/* =============== TOKENS / THEME ================== */
:root {
    --white: #fff;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1f2937;
    --slate-900: #0f172a;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-900: #7c2d12;
    --yellow-50: #fefce8;
    --yellow-100: #fef9c3;
    --yellow-200: #fef08a;
    --yellow-300: #fde047;
    --yellow-400: #facc15;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-600: #dc2626;

    --shadow-md: 0 6px 14px rgba(15, 23, 42, .08);
    --shadow-lg: 0 10px 24px rgba(15, 23, 42, .12);
    --shadow-xl: 0 16px 36px rgba(15, 23, 42, .14);
    --shadow-2xl: 0 24px 56px rgba(15, 23, 42, .18);
}


/* =============== LAYOUT ================== */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: 1.2fr .8fr;
}

@media (max-width:980px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* =============== TYPO/UTILS ================== */
.muted {
    color: var(--slate-600);
    font-size: .95rem;
}

.small {
    font-size: .85rem;
}

.label {
    font-weight: 900;
    color: var(--slate-800);
    margin-bottom: .25rem;
    display: block;
}

.divider {
    height: 2px;
    background: rgba(0, 0, 0, .06);
    margin: .5rem 0;
}

/* =============== STEPS ================== */
.steps {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin: 1rem 0 2rem;
}

.step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    color: var(--slate-700);
}

.step__dot {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--yellow-400);
    color: var(--orange-900);
    box-shadow: var(--shadow-md);
}

.step--active {
    color: var(--orange-900);
}

.step--active .step__dot {
    background: var(--orange-900);
    color: var(--white);
}

/* =============== CARD ================== */
.card {
    background: var(--white);
    border-radius: 18px;
    border: 2px solid rgba(15, 23, 42, .06);
    box-shadow: var(--shadow-xl);
    padding: 1rem;
}

.card--accent {
    border-color: var(--yellow-300);
}

.card--dark {
    background: var(--slate-900);
    color: var(--white);
    border-color: rgba(255, 255, 255, .08);
}

.card h3 {
    margin: 0 0 .5rem;
    font-weight: 900;
    color: var(--orange-900);
}

/* =============== GAME LIST ================== */
.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.game {
    border-radius: 16px;
    padding: .9rem;
    cursor: pointer;
    background: linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, #fde68a, #fca5a5, #86efac) border-box;
    border: 2px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

.game:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.game.is-active {
    background: linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, #f59e0b, #ef4444, #22c55e) border-box;
    box-shadow: 0 14px 30px rgba(124, 45, 18, .15);
}

.game__name {
    font-weight: 900;
    color: var(--orange-900);
}

.game__meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .25rem;
}

.pill {
    background: rgba(15, 23, 42, .06);
    color: var(--slate-800);
    border-radius: 999px;
    padding: .25rem .5rem;
    font-size: .8rem;
}

/* =============== PICKER / PANEL ================== */
.picker {
    background: var(--orange-50);
    border: 2px dashed rgba(0, 0, 0, .08);
    border-radius: 1rem;
    padding: .75rem;
}

.panel {
    background: var(--white);
    border: 2px solid var(--orange-200);
    border-radius: 1rem;
    padding: .5rem .5rem .75rem;
    margin-bottom: .5rem;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .25rem;
}

.panel__title {
    font-weight: 900;
    color: var(--orange-900);
}

.panel__tools {
    display: flex;
    gap: .5rem;
}

.panel .small.muted {
    color: var(--slate-700);
    font-size: .92rem;
}

/* =============== NUMBER GRID & BALLS ================== */
.numbers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    gap: .6rem;
}

@media (max-width:420px) {
    .numbers {
        gap: .7rem;
        grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    }
}

.ball {
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    font-size: clamp(14px, 2.2vw, 20px);
    color: var(--slate-900);
    border: 2.5px solid rgba(15, 23, 42, .14);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .92) 0 35%, transparent 36% 100%),
        linear-gradient(180deg, #fff 0%, #fff7d6 100%);
    box-shadow: inset 0 -3px 8px rgba(124, 45, 18, .08), 0 6px 14px rgba(15, 23, 42, .10);
    cursor: pointer;
    user-select: none;
    transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}

.ball:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
}

.ball:active {
    transform: translateY(0);
}

.ball:focus-visible {
    outline: 3px solid var(--orange-600);
    outline-offset: 2px;
}

.ball.is-picked {
    color: #fff;
    border-color: var(--green-700);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85) 0 32%, transparent 33% 100%),
        linear-gradient(180deg, #34d399 0%, #16a34a 100%);
    box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .18), 0 10px 24px rgba(22, 163, 74, .25);
}

.ball--extra {
    border-color: rgba(2, 6, 23, .14);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9) 0 35%, transparent 36% 100%),
        linear-gradient(180deg, #eef2ff 0%, #dbeafe 100%);
}

.ball--extra.is-picked {
    color: #fff;
    border-color: var(--blue-700);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85) 0 32%, transparent 33% 100%),
        linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .18), 0 10px 24px rgba(37, 99, 235, .25);
}

/* =============== SUMMARY ================== */
.summary__row {
    display: flex;
    justify-content: space-between;
    margin: .25rem 0;
}

.summary__total {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--orange-900);
}

/* =============== BUTTONS ================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 0;
    border-radius: 14px;
    padding: .9rem 1.05rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.btn--accent {
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    color: var(--white);
}

.btn--primary {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: var(--white);
}

.btn--soft {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: var(--orange-900);
}

.btn--danger {
    background: var(--red-600);
    color: var(--white);
}

.btn--block {
    width: 100%;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* =============== FORMS ================== */
.select,
.input {
    width: 100%;
    padding: .75rem .9rem;
    border-radius: 12px;
    border: 2px solid var(--orange-200);
    background: #fff;
}

.notice {
    background: var(--orange-50);
    border: 2px solid var(--orange-200);
    padding: .75rem;
    border-radius: 1rem;
}

/* =============== TOAST & MODAL ================== */
.toast {
    position: fixed;
    z-index: 50;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    background: var(--slate-900);
    color: var(--white);
    padding: .75rem 1rem;
    border-radius: .75rem;
    box-shadow: var(--shadow-2xl);
    display: none;
}

/* demo checkout */
dialog[open] {
    border: 0;
    border-radius: 1rem;
    width: min(560px, 92vw);
    padding: 0;
    box-shadow: var(--shadow-2xl);
}

.modal__head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    font-weight: 900;
    color: var(--orange-900);
}

.modal__body {
    padding: 1rem 1.25rem;
}