html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

        /* ---------- Notion-like design tokens ---------- */
        :root {
            --bg: #f7f6f3;
            --paper: #fff;
            --ink: #1f2937;
            --muted: #6b7280;
            --line: #e6e5e2;
            --accent: #0ea5e9;
            --accent-2: #7dd3fc;
            --radius: 16px;
            --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05);
            --tile: 68px;
        }

        @@media (prefers-color-scheme: dark) {
            :root {
                --bg: #0f1115;
                --paper: #14171f;
                --ink: #e5e7eb;
                --muted: #9aa2b1;
                --line: #202634;
                --accent: #38bdf8;
                --accent-2: #0ea5e9;
                --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35)
            }

            body {
                color-scheme: dark
            }
        }

        /* ---------- Global ---------- */
        * {
            box-sizing: border-box
        }

        body {
            background: var(--bg);
            color: var(--ink);
            font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif
        }

        .paper {
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            box-shadow: var(--shadow)
        }

        .pill {
            display: inline-block;
            padding: .25rem .6rem;
            border-radius: 999px;
            background: #eef2ff10;
            border: 1px solid var(--line);
            font-size: .75rem
        }

        .muted {
            color: var(--muted)
        }

        .toolbar {
            position: sticky;
            top: 0;
            z-index: 30;
            backdrop-filter: saturate(180%) blur(8px);
            background: color-mix(in hsl, var(--bg) 85%, transparent);
            border-bottom: 1px solid var(--line)
        }

        .btn-accent {
            background: var(--accent);
            border: none;
            color: #001018;
            font-weight: 600
        }

            .btn-accent:hover {
                background: var(--accent-2)
            }

        .section {
            padding: 12px
        }

        @@media (min-width:992px) {
            .section {
                padding: 20px
            }
        }

        .card-n {
            padding: 16px;
            border-radius: var(--radius);
            background: var(--paper);
            border: 1px solid var(--line);
            box-shadow: var(--shadow)
        }

        /* ---------- Tournament list ---------- */
        .t-card {
            transition: transform .15s ease;
            cursor: pointer
        }

            .t-card:hover {
                transform: translateY(-2px)
            }

        .capbar {
            height: 8px;
            background: #e5e7eb;
            border-radius: 999px;
            overflow: hidden
        }

            .capbar > span {
                display: block;
                height: 100%;
                background: var(--accent)
            }

        /* ---------- Matchmaking ---------- */
        .mm-bubble {
            font-variant-numeric: tabular-nums
        }

        /* ---------- Game grid ---------- */
        #grid {
            display: grid;
            gap: 10px;
            justify-content: center;
            align-content: center
        }

        .tile {
            touch-action: manipulation;
            width: var(--tile);
            aspect-ratio: 1/1;
            border-radius: 12px;
            background: #e5e7eb;
            border: 1px solid var(--line);
            display: grid;
            place-items: center;
            font-size: clamp(22px,4.5vw,36px);
            user-select: none;
            -webkit-tap-highlight-color: transparent;
            cursor: pointer;
            transition: transform .05s ease;
        }

            .tile:active {
                transform: translateY(1px)
            }

            .tile.revealed {
                background: var(--paper)
            }

            .tile.matched {
                background: #dcfce7;
                border-color: #86efac
            }

            /* Pending flip feedback: shows instantly while waiting for server ack */
            .tile.pending {
                outline: 2px dashed var(--accent);
                opacity: .85;
            }

            .tile:focus {
                outline: none;
            }


        .hud {
            display: flex;
            gap: 12px;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap
        }

        /* ---------- Leaderboard / Finale ---------- */
        .lb-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px dashed var(--line);
            font-variant-numeric: tabular-nums
        }

        .ticker {
            white-space: nowrap;
            overflow: hidden
        }

            .ticker > span {
                display: inline-block;
                padding-right: 2rem;
                animation: roll 30s linear infinite
            }

        @@keyframes roll {
            from {
                transform: translateX(0)
            }

            to {
                transform: translateX(-100%)
            }
        }

        /* ---------- Admin drawer ---------- */
        .drawer {
            position: fixed;
            right: 0;
            top: 0;
            bottom: 0;
            width: min(520px, 100%);
            transform: translateX(100%);
            transition: transform .25s ease;
            background: var(--paper);
            border-left: 1px solid var(--line);
            z-index: 40;
            overflow: auto
        }

            .drawer.open {
                transform: translateX(0)
            }

        .field {
            margin-bottom: 12px
        }

            .field label {
                font-size: .85rem;
                color: var(--muted)
            }

        /* ---------- Mobile helpers ---------- */
        .sticky-cta {
            position: sticky;
            bottom: 0;
            background: var(--paper);
            border-top: 1px solid var(--line);
            padding: 12px
        }
        /* Add this to your CSS */
.turn-indicator {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    animation: pulse 1.2s infinite;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.6);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.turn-indicator.other {
    background: var(--line);
    color: var(--muted);
    animation: none;
    box-shadow: none;
}