﻿:root {
    --bg: #10141d;
    --bg-deep: #090b10;
    --panel: #1b1c1f;
    --panel-2: #24262c;
    --line: rgba(255, 255, 255, 0.12);
    --text: #f7f8fb;
    --muted: #aeb6c5;
    --blue: #356fea;
    --blue-dark: #2458c8;
    --danger: #ef4444;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --gold: #ffd134;
    /* header */
    --header-bg: #171717;
    --header-border: rgba(255, 255, 255, 0.08);
    /* body gradient */
    --body-bg-accent: rgba(148, 28, 44, 0.55);
    --body-bg-start: #162340;
    --body-bg-mid: #111827;
    --body-bg-end: #090b10;
    /* panel */
    --panel-tab-bg: #1a1a1a;
    --list-bg: #181818;
    --list-border: rgba(255, 255, 255, 0.24);
    --input-bg: #121316;
    --input-border: rgba(255, 255, 255, 0.2);
    --winner-box-bg: #202124;
    --winner-box-border: rgba(255, 255, 255, 0.12);
}

/* ── Light theme overrides ───────────────────────────────────────────── */
[data-theme="light"] {
    --bg: #f0f2f7;
    --bg-deep: #e4e7ef;
    --panel: #ffffff;
    --panel-2: #f3f4f8;
    --line: rgba(0, 0, 0, 0.1);
    --text: #111827;
    --muted: #5a6578;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.12);
    --gold: #c47f00;
    /* header */
    --header-bg: #ffffff;
    --header-border: rgba(0, 0, 0, 0.08);
    /* body gradient */
    --body-bg-accent: rgba(200, 60, 80, 0.08);
    --body-bg-start: #dde3f0;
    --body-bg-mid: #e8ecf5;
    --body-bg-end: #f0f2f7;
    /* panel */
    --panel-tab-bg: #f3f4f8;
    --list-bg: #f8f9fc;
    --list-border: rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
    --input-border: rgba(0, 0, 0, 0.18);
    --winner-box-bg: #f3f4f8;
    --winner-box-border: rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 76% 12%, var(--body-bg-accent), transparent 32rem),
        linear-gradient(135deg, var(--body-bg-start) 0%, var(--body-bg-mid) 45%, var(--body-bg-end) 100%);
    overflow-x: hidden;
    transition: background 300ms ease, color 300ms ease;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

/* ── Header ──────────────────────────────────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 0 24px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    flex-wrap: wrap;
    transition: background 300ms ease, border-color 300ms ease;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 800;
    white-space: nowrap;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(#e11d48 0 25%, #facc15 0 50%, #22c55e 0 75%, #2563eb 0 100%);
    border: 5px solid #203564;
    box-shadow: inset 0 0 0 6px rgba(7, 10, 18, 0.35), 0 5px 16px rgba(0, 0, 0, 0.3);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
}

.tool-btn,
.blue-btn,
.ghost-btn,
.add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 6px;
    font-weight: 700;
    color: #fff;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tool-btn {
    padding: 0 14px;
    background: transparent;
    color: var(--text);
}

.tool-btn:hover {
    background: rgba(128, 128, 128, 0.15);
}

/* Theme toggle button */
.theme-toggle-btn {
    gap: 6px;
}

/* Theme toggle icon — symbol injected via CSS ::before only */
.theme-icon {
    font-size: 1rem;
    line-height: 1;
}

[data-theme="light"] .theme-icon::before {
    content: "☀";
}

[data-theme="dark"] .theme-icon::before {
    content: "☽";
}

/* ── Display-mode tabs (header) ─────────────────────────────────────── */
.display-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 4px;
    flex-shrink: 0;
}

.display-tab {
    padding: 7px 18px;
    border-radius: 6px;
    background: transparent;
    color: #9da6b8;
    font-size: 0.88rem;
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease;
    white-space: nowrap;
    border: 0;
    cursor: pointer;
}

.display-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.display-tab.active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 10px rgba(53, 111, 234, 0.35);
}

/* ── App shell ───────────────────────────────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 455px);
    gap: 22px;
    min-height: calc(100vh - 72px);
    padding: 20px;
}

.stage {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 112px);
}

.wheel-card {
    width: min(74vh, 780px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.wheel-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    filter: drop-shadow(0 28px 26px rgba(0, 0, 0, 0.36));
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.spin-center {
    position: absolute;
    inset: 50% auto auto 50%;
    width: clamp(128px, 18%, 156px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    color: #111827;
    border: 8px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 -10px 18px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    font-weight: 800;
    line-height: 1.08;
}

.spin-center span {
    max-width: 90px;
}

.spin-center small {
    max-width: 96px;
    color: #657084;
    font-size: 0.68rem;
    font-weight: 700;
}

.spin-center:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.04);
}

.spin-center:disabled {
    cursor: wait;
    color: #6b7280;
}

.pointer {
    position: absolute;
    top: 50%;
    right: -3.5%;
    width: clamp(44px, 8%, 62px);
    height: clamp(42px, 7.5%, 58px);
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff3953, #b9112a);
    clip-path: polygon(0 50%, 100% 0, 78% 50%, 100% 100%);
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.45));
    z-index: 5;
}

/* ── Panel ───────────────────────────────────────────────────────────── */
.panel {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 560px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: background 300ms ease;
}

/* ── Editable session title (in header, beside KACTII Wheel logo) ──── */
.header-season {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.session-title-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 5px;
    transition: background 140ms ease, color 140ms ease;
}

.session-title-text:hover {
    background: rgba(128, 128, 128, 0.14);
    color: var(--text);
}

.session-title-edit-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--muted);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 140ms ease, color 140ms ease;
    cursor: pointer;
}

.session-title-edit-btn:hover {
    background: rgba(128, 128, 128, 0.14);
    color: var(--text);
}

.session-title-input {
    width: 130px;
    height: 28px;
    padding: 0 7px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--blue);
    border-radius: 4px;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(53, 111, 234, 0.22);
}

.session-title-input[hidden] {
    display: none;
}

/* ── Panel tabs ──────────────────────────────────────────────────────── */
.panel-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--panel-tab-bg);
    border-bottom: 1px solid var(--line);
}

.tab {
    min-height: 54px;
    background: transparent;
    color: var(--muted);
    border-bottom: 3px solid transparent;
    font-weight: 800;
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--blue);
}

.tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: #6a6f7b;
    color: #fff;
    font-size: 0.8rem;
}

.panel-actions {
    display: flex;
    gap: 10px;
    padding: 18px 20px 12px;
    flex-wrap: wrap;
}

.blue-btn,
.ghost-btn {
    padding: 0 16px;
}

.blue-btn {
    background: var(--blue);
}

.blue-btn:hover,
.add-btn:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.ghost-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
}

.ghost-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.45);
}

/* Reset Wheel button — uses a distinct teal tint */
.reset-wheel-btn {
    background: #0e7c72;
}

.reset-wheel-btn:hover {
    background: #0a6660;
    transform: translateY(-1px);
}

.entry-label {
    margin: 8px 20px 8px;
    color: #c8ced9;
    font-size: 0.9rem;
    font-weight: 700;
}

.add-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 20px 18px;
}

#participantInput {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    outline: 0;
}

#participantInput:focus {
    border-color: #7aa3ff;
    box-shadow: 0 0 0 3px rgba(53, 111, 234, 0.28);
}

/* Kredit number input — fixed width, hidden in plain tab */
.kredit-input {
    flex: 0 0 80px;
    width: 80px;
    min-width: 0;
    box-sizing: border-box;
    height: 48px;
    padding: 0 8px;
    color: var(--gold);
    background: var(--input-bg);
    border: 1px solid rgba(255, 209, 52, 0.3);
    border-radius: 6px;
    outline: 0;
    font: inherit;
    font-size: 0.85rem;
    -moz-appearance: textfield;
}

.kredit-input::-webkit-outer-spin-button,
.kredit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kredit-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 209, 52, 0.2);
}

.kredit-input[hidden] {
    display: none;
}

#addBtn {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
}

.name-list {
    flex: 1;
    min-height: 240px;
    margin: 0 20px 20px;
    padding: 12px;
    list-style: none;
    background: var(--list-bg);
    border: 1px solid var(--list-border);
    border-radius: 6px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

.name-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
    padding: 4px 2px;
    color: var(--text);
}

/* Name label — takes all remaining space, truncates if too long */
.name-item .item-name {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #cfd5df;
    font-weight: 800;
}

.remove-btn:hover {
    background: var(--danger);
    color: #fff;
}

.empty-state {
    display: grid;
    place-items: center;
    height: 100%;
    color: #9299a8;
    text-align: center;
    line-height: 1.45;
    padding: 36px 18px;
}

/* ── Winner box (panel bottom) ───────────────────────────────────────── */
.winner-box {
    margin-top: auto;
    padding: 18px 20px;
    background: var(--winner-box-bg);
    border-top: 1px solid var(--winner-box-border);
    transition: background 300ms ease;
}

.winner-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* Name + kredit badge side by side */
.winner-name-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#winnerName {
    color: var(--text);
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.winner-kredits {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 209, 52, 0.14);
    border: 1px solid rgba(255, 209, 52, 0.3);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Modals — shared infrastructure ─────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 40;
    backdrop-filter: blur(3px);
    display: none;
}

.modal-overlay.is-open {
    display: block;
}

.modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-wrap.is-open {
    display: flex;
    pointer-events: auto;
}

.modal-card {
    width: min(400px, 100%);
    padding: 36px 28px 32px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: modal-pop 280ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Shared modal elements */
.modal-trophy {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(255, 209, 52, 0.4));
}

.modal-subtitle {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-winner-name {
    margin: 0 0 20px;
    color: var(--text);
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.modal-kredits-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 7px 18px;
    background: rgba(255, 209, 52, 0.1);
    border: 1px solid rgba(255, 209, 52, 0.28);
    border-radius: 999px;
}

.modal-kredits-label {
    color: #9da6b8;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.modal-kredits-value {
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 800;
}

/* Full-width button used in both modals */
.modal-full-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
}

/* Two-button row in congrats modal */
.modal-btn-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

/* ── Step 2 — Deduct from Pool modal ─────────────────────────────────── */
.deduct-card {
    text-align: left;
}

.deduct-title {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 800;
}

.deduct-winner-label {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.deduct-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.deduct-label {
    color: #c8ced9;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.deduct-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    box-sizing: border-box;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font: inherit;
    font-size: 1rem;
    outline: 0;
    -moz-appearance: textfield;
}

.deduct-input::-webkit-outer-spin-button,
.deduct-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.deduct-input:focus {
    border-color: #7aa3ff;
    box-shadow: 0 0 0 3px rgba(53, 111, 234, 0.28);
}

.deduct-error {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 6px;
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Pool display row */
.deduct-pool-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 12px;
    padding: 12px 16px;
    background: rgba(255, 209, 52, 0.07);
    border: 1px solid rgba(255, 209, 52, 0.22);
    border-radius: 8px;
}

.deduct-pool-label {
    color: #9da6b8;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.deduct-pool-value {
    color: var(--gold);
    font-size: 1.3rem;
    font-weight: 800;
}

.deduct-close-gap {
    margin-top: 4px;
}

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    max-width: min(360px, calc(100vw - 44px));
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    font-weight: 700;
    z-index: 60;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Scrollbars ──────────────────────────────────────────────────────── */
.name-list::-webkit-scrollbar {
    width: 10px;
}

.name-list::-webkit-scrollbar-track {
    background: #111;
}

.name-list::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 999px;
}

/* ── Budget Bar (below wheel) ─────────────────────────────────────── */
.budget-bar {
    width: 100%;
    margin-top: 16px;
    padding: 14px 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    flex-shrink: 0;
    transition: opacity 200ms ease;
}

.budget-bar[hidden] {
    display: none;
}

.budget-label {
    display: block;
    margin-bottom: 8px;
    color: #c8ced9;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.budget-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.budget-input {
    width: 120px;
    height: 42px;
    padding: 0 12px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font: inherit;
    outline: 0;
    -moz-appearance: textfield;
}

.budget-input::-webkit-outer-spin-button,
.budget-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.budget-input:focus {
    border-color: #7aa3ff;
    box-shadow: 0 0 0 3px rgba(53, 111, 234, 0.28);
}

.budget-preview {
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    flex: 1;
}

.budget-add-btn {
    height: 42px;
    padding: 0 22px;
    font-size: 0.9rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* ── Budget Credits Bar (top of panel) ───────────────────────────── */
.budget-credits-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--line);
}

.budget-credits-bar[hidden] {
    display: none;
}

.bc-label {
    color: #aeb6c5;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bc-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.02em;
}

.bc-value.depleted {
    color: #ef4444;
}

/* ── Results list ───────────────────────────────────────────────────── */
.results-list .name-item {
    gap: 8px;
}

.result-num {
    flex-shrink: 0;
    width: 24px;
    color: #6a6f7b;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
}

/* ── Accessibility ──────────────────────────────────────────────────── */
.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.side-drawer,
.modal-wrap,
.history-panel {
    color: var(--text);
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tog {
    accent-color: var(--blue);
}

.spin-btn {
    user-select: none;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .stage {
        min-height: auto;
    }

    .wheel-card {
        width: min(86vw, 680px);
    }

    .panel {
        min-height: 420px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
        min-height: auto;
    }

    /* Keep season title compact; cap max-width tighter */
    .session-title-text {
        max-width: 100px;
    }

    .display-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .display-tab {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 16px;
    }

    /* Hide separator and constrain season title on very small screens */

    .session-title-text {
        max-width: 140px;
    }

    .toolbar {
        width: 100%;
    }

    .tool-btn {
        flex: 1;
    }

    .app-shell {
        padding: 14px;
    }

    .wheel-card {
        width: min(94vw, 520px);
    }

    .spin-center {
        width: 118px;
        border-width: 6px;
    }

    .spin-center small {
        display: none;
    }

    .panel-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ghost-btn {
        grid-column: 1 / -1;
    }

    .modal-card {
        padding: 32px 20px 28px;
    }
}
