/* ============================================================
   responsive.css — Adaptations multi-supports (GSM / tablette / PC)
   Complète style.css. Chargé après lui dans head.php.
   Stratégie : "mobile-first overrides" + composants nouveaux
   (barre de navigation basse, toasts, cartes-tableaux, modales
   plein écran, zones tactiles, encoches iOS).
   ============================================================ */

/* ----------------------------------------------------------
   1. BARRE DE NAVIGATION BASSE (mobile uniquement)
   Générée par buildNav() dans core.js (#bottomNav).
   Cachée par défaut (desktop), affichée < 768px.
   ---------------------------------------------------------- */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    background: var(--white, #fff);
    border-top: 1px solid var(--border, #e5e7eb);
    /* encoche iOS / barre gestuelle Android */
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.bottom-nav-inner,
.bottom-nav {
    grid-auto-flow: column;
}
.bottom-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 2px;
    background: none;
    border: none;
    color: var(--text-light, #64748b);
    font-size: 0.66rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color .15s;
}
.bottom-item.active { color: var(--primary, #2563eb); }
.bottom-icon { font-size: 1.25rem; line-height: 1; }
.bottom-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bottom-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 0.6rem;
    line-height: 16px;
    text-align: center;
}

/* ----------------------------------------------------------
   2. TOASTS (feedback non bloquant) — remplace alert()
   core.js : .toast-host > .toast.toast-<type>.show
   ---------------------------------------------------------- */
.toast-host {
    position: fixed;
    z-index: 1200;
    left: 50%;
    bottom: calc(80px + env(safe-area-inset-bottom, 0));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    max-width: 92vw;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info    { background: #334155; }
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-warning { background: #d97706; }

/* Sur grand écran, toasts en bas à droite */
@media (min-width: 768px) {
    .toast-host {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
        transform: none;
        align-items: flex-end;
    }
}

/* ----------------------------------------------------------
   3. ZONES TACTILES & SAISIE (mobile)
   - cibles ≥ 44px (recommandation Apple/Google)
   - inputs ≥ 16px pour éviter le zoom auto iOS
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .btn, .nav-item, .bottom-item, .form-select, .form-input,
    button, [role="button"] {
        min-height: 44px;
    }
    .btn-sm { min-height: 38px; }
    .form-input, .form-select, .form-textarea {
        font-size: 16px; /* anti-zoom iOS */
    }
}

/* ----------------------------------------------------------
   4. TÉLÉPHONE (< 768px)
   - barre basse visible, sidebar en tiroir (gérée par style.css)
   - padding bas du contenu pour ne pas masquer derrière la barre
   - en-tête plus compact
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .bottom-nav { display: flex; }
    .page-body {
        padding: 1rem;
        padding-bottom: calc(156px + env(safe-area-inset-bottom, 0));
        overscroll-behavior-y: contain;
    }
    .page-header { padding: 0.75rem 1rem; }
    .page-title { font-size: 1.05rem; }
    .page-header .actions .btn span.label-long { display: none; }

    .sub-tabs { display: none !important; }
    .bottom-nav {
        display: flex;
        gap: 0.25rem;
        padding: 0.45rem 0.45rem calc(0.45rem + env(safe-area-inset-bottom, 0));
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }
    .bottom-nav::-webkit-scrollbar { display: none; }
    .sub-tab {
        min-width: 0;
        min-height: 44px;
        padding: 0.45rem 0.55rem;
        border-radius: 14px;
        border: 1px solid transparent;
        background: transparent;
        color: var(--text-light, #64748b);
        display: flex;
        align-items: center;
        gap: 0.45rem;
        justify-content: center;
        overflow: hidden;
    }
    .sub-tab.active { background: var(--primary-bg, #ecfeff); color: var(--primary-dark, #115e59); border-color: rgba(15,118,110,.18); }
    .sub-tab-label { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sub-tab-icon { width: 1.2rem; text-align: center; }
    .bottom-nav .bottom-item {
        min-width: 84px;
        flex: 0 0 auto;
    }

    /* Grilles de stats : 2 colonnes sur mobile */
    .stat-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ----------------------------------------------------------
   5. TABLEAUX → CARTES (< 640px)
   Les <table class="data-table"> deviennent des cartes empilées.
   Chaque <td> affiche son libellé via data-label.
   ---------------------------------------------------------- */
@media (max-width: 640px) {
    table.data-table,
    table.data-table tbody,
    table.data-table tr,
    table.data-table td {
        display: block;
        width: 100%;
    }
    table.data-table thead { display: none; }
    table.data-table tr {
        margin-bottom: 0.75rem;
        border: 1px solid var(--border, #e5e7eb);
        border-radius: 10px;
        padding: 0.5rem 0.75rem;
        background: var(--white, #fff);
    }
    table.data-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.35rem 0;
        border: none;
        text-align: right;
    }
    table.data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-light, #64748b);
        text-align: left;
    }
}

/* ----------------------------------------------------------
   6. MODALES PLEIN ÉCRAN sur mobile
   ---------------------------------------------------------- */
@media (max-width: 640px) {
    .modal, .modal-box, #globalModalBox, .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        max-height: 100%;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 1rem !important;
        display: flex;
        flex-direction: column;
    }
    .modal-body, #modalBody {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-footer, #modalFooter {
        gap: 0.65rem;
        margin-top: 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
    }
    #modalBody .form-group { margin-bottom: 0.9rem; }
    #modalBody .form-input,
    #modalBody .form-select,
    #modalBody .form-textarea,
    #modalBody input:not([type="checkbox"]):not([type="radio"]),
    #modalBody select,
    #modalBody textarea {
        min-height: 48px;
        font-size: 16px;
    }
    .form-row { grid-template-columns: 1fr !important; }
}

/* ----------------------------------------------------------
   7. TABLETTE (768px – 1023px)
   Sidebar en tiroir conservée, mais contenu plus aéré ;
   barre basse masquée (assez de place pour le tiroir).
   ---------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
    .bottom-nav { display: none; }
    .page-body { padding: 1.25rem; }
    .stat-row { grid-template-columns: repeat(3, 1fr); }
}

/* ----------------------------------------------------------
   8. ORDINATEUR (≥ 1024px)
   Sidebar fixe et toujours visible (overrides du mode tiroir),
   bouton menu masqué, barre basse masquée.
   ---------------------------------------------------------- */
@media (min-width: 1024px) {
    .sidebar {
        position: relative !important;
        left: 0 !important;
    }
    .sidebar-overlay { display: none !important; }
    .mobile-menu-btn { display: none !important; }
    .bottom-nav { display: none !important; }
}

/* ----------------------------------------------------------
   9. GRAND ÉCRAN (≥ 1440px) : contenu centré, lisibilité
   ---------------------------------------------------------- */
@media (min-width: 1440px) {
    .page-body > .card,
    .page-body > .stat-row,
    .page-body > .alert {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ----------------------------------------------------------
   10. PRÉFÉRENCES UTILISATEUR
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* Élément sélectionné (compo, sondages, listes cliquables) */
.is-selected { background: #eff6ff; }
.list-item.is-selected { border-left: 3px solid var(--primary, #2563eb); }

.presence-view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.3rem;
    border: 1px solid var(--border, #dbe4ef);
    border-radius: 8px;
    background: #e2e8f0;
}
.presence-view-tab {
    min-width: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}
.presence-view-tab.active {
    border-color: rgba(15, 118, 110, .24);
    background: #ffffff;
    color: var(--primary-dark, #115e59);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

@media (max-width: 420px) {
    .presence-view-tab {
        flex-direction: column;
        gap: 0.15rem;
        padding: 0.45rem 0.2rem;
        font-size: 0.7rem;
    }
}

/* ----------------------------------------------------------
   11. DIVERS (jeux)
   ---------------------------------------------------------- */
:root {
    --divers-accent: #0ea5e9;
    --divers-accent-2: #22c55e;
    --divers-ink: #0f172a;
    --divers-shell: #f8fafc;
}

.divers-summary-card {
    background: linear-gradient(120deg, #0f172a 0%, #164e63 58%, #14532d 100%);
    color: #e2e8f0;
    border: none;
    position: relative;
    overflow: hidden;
}
.divers-summary-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}
.divers-summary-head .card-title { color: #f8fafc; }
.divers-summary-strip {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
}
.divers-summary-strip::-webkit-scrollbar { display: none; }
.divers-pill {
    min-width: 96px;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.36);
    display: grid;
    gap: 0.12rem;
    flex: 0 0 auto;
}
.divers-pill-label {
    font-size: 0.64rem;
    color: #cbd5e1;
    line-height: 1.15;
}
.divers-pill-value {
    font-size: 0.82rem;
    color: #f8fafc;
    line-height: 1.12;
}
.divers-pill.is-money .divers-pill-value { color: #38bdf8; }
.divers-pill.is-yellow .divers-pill-value { color: #fde047; }
.divers-pill.is-red .divers-pill-value { color: #f87171; }

.divers-games-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
    gap: 0.85rem;
}
.divers-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.7rem;
    margin-bottom: 0.2rem;
    padding: 0.3rem;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #e2e8f0;
}
.divers-view-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
}
.divers-view-tab.active {
    border-color: rgba(15, 118, 110, .24);
    background: #fff;
    color: #115e59;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.divers-game-tile {
    position: relative;
    min-width: 0;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.divers-game-tile::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #0f766e, #22c55e);
}
.divers-game-tile:hover {
    transform: translateY(-2px);
    border-color: #4ade80;
    box-shadow: 0 13px 28px rgba(15, 23, 42, .11);
}
.divers-game-tile.is-locked {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.divers-game-tile.is-locked::before { background: #94a3b8; }
.divers-game-tile.is-locked:hover { border-color: #94a3b8; }
.divers-game-tile-head {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
}
.divers-game-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    font-size: 1.45rem;
}
.divers-game-tile.is-locked .divers-game-icon {
    border-color: #cbd5e1;
    background: #e2e8f0;
    filter: grayscale(.65);
}
.divers-game-title-wrap { min-width: 0; }
.divers-game-title-wrap h3 {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.96rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.divers-game-title-wrap > span {
    display: block;
    margin-top: 0.15rem;
    overflow: hidden;
    color: #64748b;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.divers-game-status {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
}
.divers-game-status.is-open { color: #15803d; }
.divers-game-status.is-open > span { color: #22c55e; font-size: 0.58rem; }
.divers-condition-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.divers-condition {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.68rem;
    font-weight: 700;
}
.divers-condition.is-met {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.divers-score-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: auto;
    padding: 0.65rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.divers-score-strip > div {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
    padding: 0 0.45rem;
    text-align: center;
}
.divers-score-strip > div + div { border-left: 1px solid #e2e8f0; }
.divers-score-strip span {
    overflow: hidden;
    color: #64748b;
    font-size: 0.64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.divers-score-strip strong { color: #0f172a; font-size: 1rem; }
.divers-game-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}
.divers-game-actions .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

body.divers-game-open { overflow: hidden; }
body.divers-game-open .page-body { overflow: hidden; overscroll-behavior: none; }
body.divers-game-open .sub-tabs,
body.divers-game-open .bottom-nav {
    pointer-events: none;
}
.divers-game-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.52), rgba(2, 6, 23, 0.94));
    padding: clamp(0.5rem, 2vw, 1.2rem);
    overscroll-behavior: contain;
    touch-action: pan-y;
    animation: diversOverlayIn .28s ease;
}
.divers-game-shell {
    position: relative;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.divers-game-card {
    margin-top: 0 !important;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at 10% -20%, rgba(34, 197, 94, .12), transparent 50%),
        radial-gradient(circle at 90% -20%, rgba(14, 165, 233, .12), transparent 55%),
        var(--divers-shell);
    border: 1px solid rgba(148, 163, 184, .42);
    box-shadow: 0 14px 40px rgba(2, 6, 23, .18);
    animation: diversCardIn .32s ease;
}
.divers-game-card > .card-header {
    min-height: 42px;
    padding-right: 3.1rem;
}
.divers-game-card > .muted {
    max-width: 720px;
    margin-bottom: 0.8rem;
    line-height: 1.45;
}
.divers-game-card .card-title {
    color: var(--divers-ink);
    letter-spacing: .01em;
}
.divers-game-card .badge {
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .25);
}
.divers-game-card canvas {
    background: #0b1220;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 10px 24px rgba(2, 6, 23, .3);
}
.divers-test-unlock {
    display: flex;
    justify-content: center;
    padding: 1rem 0 0.25rem;
}
.divers-drag-surface,
.divers-tap-surface {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.divers-drag-surface { cursor: grab; }
.divers-drag-surface:active { cursor: grabbing; }
.divers-tap-surface { cursor: pointer; }
.divers-canvas-stage {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    width: 100%;
}
.divers-canvas-stage canvas {
    width: min(100%, 560px);
    height: auto;
    border: 1px solid #334155;
    border-radius: 8px;
}
.divers-game-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}
.game-control-panel {
    width: min(100%, 560px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
}
.game-control-panel label {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
}
.game-control-panel input[type="range"] {
    grid-column: 1 / -1;
    width: 100%;
    accent-color: #0284c7;
}

.mines-wrap,
.memory-wrap {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
}
.mines-grid {
    width: min(100%, 360px);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 7px;
    border-radius: 8px;
    background: #0f172a;
}
.mines-cell {
    min-width: 0;
    aspect-ratio: 1;
    border: 1px solid #94a3b8;
    border-radius: 5px;
    background: #16a34a;
    color: #0f172a;
    font-size: clamp(0.8rem, 4vw, 1.2rem);
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}
.mines-cell.is-open { background: #e2e8f0; }
.mines-cell.is-mine { background: #fecaca; }

.guess-player-layout {
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1rem, 4vw, 2.5rem);
    width: min(100%, 760px);
    margin: 1rem auto 0;
}
.guess-player-silhouette {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(180deg, #dbeafe 0 54%, #86efac 54% 100%);
}
.guess-player-silhouette::before {
    content: '';
    position: absolute;
    z-index: 2;
    top: 30px;
    left: 50%;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #111827;
    transform: translateX(-50%);
}
.guess-player-silhouette::after {
    content: '';
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 0;
    width: 150px;
    height: 180px;
    background: var(--player-shirt, #1d4ed8);
    clip-path: polygon(22% 4%, 78% 4%, 100% 26%, 80% 40%, 72% 100%, 28% 100%, 20% 40%, 0 26%);
    transform: translateX(-50%);
    filter: brightness(.35) saturate(.75);
}
.guess-player-silhouette span {
    position: absolute;
    z-index: 3;
    top: 123px;
    left: 50%;
    color: rgba(255, 255, 255, .68);
    font-size: 2.25rem;
    font-weight: 900;
    transform: translateX(-50%);
}
.guess-player-content { min-width: 0; }
.guess-player-clues {
    min-height: 84px;
    margin: 0.85rem 0;
    padding-left: 1.2rem;
    color: #334155;
}
.guess-player-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.guess-player-option {
    width: 100%;
    min-height: 44px;
    white-space: normal;
}
.guess-player-option.is-correct { border-color: #16a34a; background: #dcfce7; color: #14532d; }
.guess-player-option.is-wrong { border-color: #dc2626; background: #fee2e2; color: #7f1d1d; }
.guess-player-feedback,
.guess-player-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    color: #334155;
    font-weight: 700;
}
.guess-player-feedback.is-correct { color: #166534; }
.guess-player-feedback.is-wrong { color: #991b1b; }
.guess-player-result {
    min-height: 260px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.guess-player-result strong { color: #166534; font-size: 2.4rem; }

.quick-math-stage {
    width: min(100%, 560px);
    min-height: 300px;
    display: grid;
    align-content: center;
    gap: 1rem;
    margin: 1rem auto 0;
    padding: clamp(1rem, 4vw, 2rem);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: linear-gradient(145deg, #ecfeff, #f0fdf4);
}
.quick-math-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.quick-math-clock { color: #c2410c; font-size: 1.35rem; font-weight: 900; }
.quick-math-question {
    min-height: 90px;
    display: grid;
    place-items: center;
    color: #0f172a;
    font-size: clamp(2rem, 9vw, 4rem);
    font-weight: 900;
}
.quick-math-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}
.quick-math-options button {
    min-height: 56px;
    border: 1px solid #0284c7;
    border-radius: 7px;
    background: #fff;
    color: #0c4a6e;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
}
.quick-math-result {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    color: #334155;
    text-align: center;
}
.quick-math-result strong { color: #166534; font-size: 3.5rem; }

.memory-grid {
    width: min(100%, 430px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    perspective: 900px;
}
.memory-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid #64748b;
    border-radius: 7px;
    background: #0f766e;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform .28s ease, border-color .2s ease;
}
.memory-card.is-open { transform: rotateY(180deg); }
.memory-card.is-matched { border-color: #16a34a; }
.memory-card span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    backface-visibility: hidden;
}
.memory-card-back { color: #fff; font-size: clamp(0.75rem, 3vw, 1.15rem); font-weight: 900; }
.memory-card-front {
    border-radius: 6px;
    background: #f8fafc;
    font-size: clamp(1.25rem, 7vw, 2.2rem);
    transform: rotateY(180deg);
}
.memory-state {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: #166534;
}
.g2048-stage {
    display: grid;
    justify-items: center;
    gap: 0.8rem;
    margin-top: 0.9rem;
}
.g2048-grid {
    width: min(100%, 380px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(5px, 1.5vw, 9px);
    padding: clamp(6px, 1.8vw, 10px);
    border: 1px solid #64748b;
    border-radius: 8px;
    background: #334155;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.g2048-tile {
    min-width: 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 7px;
    background: var(--g2048-bg);
    color: var(--g2048-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 7px rgba(15, 23, 42, .2);
    font-size: clamp(1rem, 5.5vw, 1.65rem);
    font-weight: 900;
}
.g2048-controls {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(2, 44px);
    gap: 0.35rem;
}
.g2048-controls button:nth-child(1) { grid-column: 2; }
.g2048-controls button:nth-child(2) { grid-column: 1; grid-row: 2; }
.g2048-controls button:nth-child(3) { grid-column: 2; grid-row: 2; }
.g2048-controls button:nth-child(4) { grid-column: 3; grid-row: 2; }

.casino-wrap {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.8rem;
}
.football-casino {
    padding: 0.2rem 0 0.4rem;
}
.casino-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.6rem;
}
.casino-balance,
.casino-kpis {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.65rem;
}
.casino-balance span,
.casino-kpis span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
}
.casino-balance strong {
    display: block;
    margin-top: 0.2rem;
    color: #0f172a;
    font-size: 1.4rem;
    line-height: 1;
}
.casino-balance small {
    display: block;
    margin-top: 0.25rem;
    color: #475569;
    font-size: 0.72rem;
}
.casino-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}
.casino-kpis strong {
    display: block;
    margin-top: 0.15rem;
    color: #0f172a;
    font-size: 1.05rem;
}
.casino-games {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
}
.casino-games .btn {
    min-width: 0;
    min-height: 42px;
    white-space: normal;
}
.casino-bet {
    display: grid;
    grid-template-columns: auto minmax(0, 130px);
    align-items: center;
    gap: 0.55rem;
}
.casino-bet label {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}
.casino-panel {
    display: grid;
    gap: 0.6rem;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.7rem;
}
.casino-rule-box {
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.45;
    padding: 0.55rem 0.65rem;
}
.casino-stake-block {
    display: grid;
    gap: 0.45rem;
}
.casino-stake-block label {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}
.casino-stake-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.casino-stake-custom {
    max-width: 180px;
}
.casino-ratio-line {
    width: 100%;
    display: grid;
    gap: 0.18rem;
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #f8fafc;
}
.casino-ratio-line span {
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 700;
}
.casino-ratio-line strong {
    font-size: 0.86rem;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.3;
}
.casino-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.casino-superadmin-toggle {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
}
.casino-superadmin-toggle label {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    cursor: pointer;
}
.casino-status {
    padding: 0.55rem 0.65rem;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 0.84rem;
}
.casino-status.is-win {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.casino-status.is-loss {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}
.casino-history {
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.65rem;
}
.casino-history-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.33rem 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.82rem;
}
.casino-history-row:last-child { border-bottom: 0; }
.casino-history-row strong.is-win { color: #15803d; }
.casino-history-row strong.is-loss { color: #b45309; }
.casino-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.casino-chip-bet {
    padding: 0.4rem 0.6rem;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.roulette-layout {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}
.roulette-wheel-wrap {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
}
.roulette-wheel-orbit {
    position: relative;
    width: 260px;
    height: 260px;
}
.roulette-wheel {
    position: relative;
    width: 260px;
    height: 260px;
    border: 12px solid #854d0e;
    border-radius: 50%;
    background: radial-gradient(circle at center, #14532d 0 32%, #166534 32% 100%);
    transition: transform 2s cubic-bezier(.18,.84,.22,1);
}
.roulette-wheel-center,
.roulette-ball {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 50%;
}
.roulette-wheel-center {
    inset: 90px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 2rem;
    border: 4px solid #e2e8f0;
}
.roulette-player-center {
    overflow: hidden;
}
.roulette-player-center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.roulette-player-center span {
    font-size: 1rem;
    font-weight: 900;
}
.roulette-ball {
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    background: #fff;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(15,23,42,.25);
}
.roulette-cell,
.roulette-outside-bet {
    position: relative;
    overflow: hidden;
}
.roulette-chip {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 0.66rem;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
}
.roulette-slot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    margin-left: -14px;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 800;
    color: #fff;
}
.roulette-slot.green { color: #bbf7d0; }
.roulette-slot.red { color: #fecaca; }
.roulette-slot.black { color: #e2e8f0; }
.roulette-last {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}
.roulette-board,
.sicbo-board {
    display: grid;
    gap: 0.7rem;
}
.roulette-numbers {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.32rem;
}
.roulette-cell,
.roulette-outside-bet,
.sicbo-total {
    min-height: 42px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
}
.roulette-cell.red,
.roulette-outside-bet.red { background: #7f1d1d; color: #fff; }
.roulette-cell.black,
.roulette-outside-bet.black { background: #111827; color: #fff; }
.roulette-cell.green { background: #14532d; color: #fff; }
.roulette-outside {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}
.casino-board-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}
.casino-blackjack,
.casino-slots,
.casino-dice,
.casino-sicbo {
    display: grid;
    gap: 0.8rem;
}
.casino-slots-machine-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 0.55rem;
    align-items: center;
}
.slot-lever-btn {
    position: relative;
    width: 62px;
    height: 182px;
    border-radius: 16px;
    border: 1px solid #6b7280;
    background: linear-gradient(165deg, #111827, #0b1220);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 -24px 28px rgba(0,0,0,.35), 0 10px 20px rgba(2,6,23,.35);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}
.slot-lever-btn::before {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, #94a3b8, #475569);
}
.slot-lever-btn::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 999px;
    background: #0f172a;
    box-shadow: 0 0 0 2px #cbd5e1;
}
.slot-lever-btn .lever-stick {
    position: absolute;
    left: 50%;
    top: 22px;
    width: 8px;
    height: 122px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: linear-gradient(180deg, #e2e8f0, #64748b);
    transform-origin: top center;
}
.slot-lever-btn .lever-knob {
    position: absolute;
    left: 50%;
    top: 10px;
    width: 28px;
    height: 28px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #fde68a, #dc2626 62%);
    box-shadow: 0 5px 12px rgba(0,0,0,.38), inset 0 -4px 6px rgba(0,0,0,.22);
}
.casino-slot-machine.is-rolling + .slot-lever-btn {
    animation: slotLeverBuzz .42s steps(5) infinite;
}
.casino-slot-machine.is-rolling + .slot-lever-btn .lever-stick {
    animation: slotLeverStick .46s cubic-bezier(.22,.88,.24,1.02) 1;
}
.casino-slot-machine.is-rolling + .slot-lever-btn .lever-knob {
    animation: slotLeverKnob .46s cubic-bezier(.22,.88,.24,1.02) 1;
}
.slot-lever-btn:active .lever-knob {
    top: 36px;
}
.slot-lever-btn.is-clack-1 {
    filter: brightness(1.08) contrast(1.08);
}
.slot-lever-btn.is-clack-2 {
    filter: brightness(1.14) contrast(1.12);
}
.slot-lever-btn.is-clack-1 .lever-stick {
    animation: leverClackStick1 .11s steps(2) 1;
}
.slot-lever-btn.is-clack-2 .lever-stick {
    animation: leverClackStick2 .14s steps(2) 1;
}
.slot-lever-btn.is-clack-1 .lever-knob {
    animation: leverClackKnob1 .11s steps(2) 1;
}
.slot-lever-btn.is-clack-2 .lever-knob {
    animation: leverClackKnob2 .14s steps(2) 1;
}
@keyframes slotLeverBuzz {
    0% { transform: translate(0, 0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 0); }
    100% { transform: translate(0, 0); }
}
@keyframes leverClackStick1 {
    0% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(12deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}
@keyframes leverClackStick2 {
    0% { transform: translateX(-50%) rotate(0deg); }
    45% { transform: translateX(-50%) rotate(16deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}
@keyframes leverClackKnob1 {
    0% { top: 10px; }
    50% { top: 22px; }
    100% { top: 10px; }
}
@keyframes leverClackKnob2 {
    0% { top: 10px; }
    40% { top: 28px; }
    100% { top: 10px; }
}
@keyframes slotLeverStick {
    0% { transform: translateX(-50%) rotate(0deg); }
    40% { transform: translateX(-50%) rotate(20deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}
@keyframes slotLeverKnob {
    0% { top: 10px; }
    38% { top: 48px; }
    70% { top: 16px; }
    100% { top: 10px; }
}
.casino-blackjack-head,
.casino-slots-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: end;
}
.casino-blackjack-table {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(160deg, #0f766e, #14532d);
}
.casino-zone-title {
    color: #dcfce7;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.casino-card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.45rem 0;
}
.casino-foot-card {
    width: 72px;
    height: 98px;
    display: grid;
    align-content: space-between;
    padding: 0.45rem;
    border-radius: 12px;
    background: linear-gradient(150deg, #ffffff, #e0f2fe);
    border: 1px solid #bae6fd;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(2,6,23,.16);
}
.casino-foot-card.is-hidden {
    place-items: center;
    align-content: center;
    background: linear-gradient(150deg, #0f172a, #14532d);
    color: #f8fafc;
}
.card-rank {
    color: #ffffff;
    text-shadow:
        -2px -2px 0 #000000,
        2px -2px 0 #000000,
        -2px 2px 0 #000000,
        2px 2px 0 #000000,
        0 0 6px rgba(0,0,0,.35);
    font-weight: 900;
}
.card-rank.corner {
    font-size: 0.82rem;
    line-height: 1;
}
.card-rank.corner.bottom {
    justify-self: end;
    align-self: end;
}
.card-rank.center {
    align-self: center;
    justify-self: center;
    max-width: 100%;
    padding: 0 0.15rem;
    font-size: 1.02rem;
    line-height: 1.02;
    text-align: center;
    word-break: break-word;
}
.card-suit {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}
.casino-blackjack-actions,
.casino-dice-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
}
.casino-table-note,
.casino-payouts {
    color: #475569;
    font-size: 0.82rem;
}
.casino-slot-machine {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    padding: 0.85rem;
    border-radius: 14px;
    background: linear-gradient(160deg, #0f172a, #7c2d12);
}
.slot-reel {
    position: relative;
    height: 168px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255,255,255,.92);
    box-shadow: inset 0 8px 14px -8px rgba(0,0,0,.45), inset 0 -8px 14px -8px rgba(0,0,0,.45);
}
.slot-reel::before,
.slot-reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 42px;
    pointer-events: none;
    z-index: 2;
}
.slot-reel::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,.85), rgba(255,255,255,0));
}
.slot-reel::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,.85), rgba(255,255,255,0));
}
.slot-reel-track {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.slot-symbol {
    height: 84px;
    width: 100%;
    flex: 0 0 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}
.slot-symbol small {
    font-size: 0.62rem;
    font-weight: 700;
    color: #334155;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.casino-jackpot-logo {
    justify-self: center;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    border: 2px solid #facc15;
    background: radial-gradient(circle at 30% 30%, #fef08a, #f59e0b);
    color: #7c2d12;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.slot-symbol img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #dc2626;
}
.slot-symbol span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #0f766e;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
}
.casino-dice-cubes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.casino-dice-cubes.is-rolling .casino-die {
    animation: diceShake .22s linear infinite;
}
@keyframes diceShake {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-3deg); }
    50% { transform: translateY(1px) rotate(2deg); }
    75% { transform: translateY(-1px) rotate(-2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}
.casino-die {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8fafc, #dbeafe);
    border: 1px solid #93c5fd;
    color: #0f172a;
    font-size: 1.8rem;
    font-weight: 900;
}
.casino-die.large {
    width: 74px;
    height: 74px;
}
.casino-die-face {
    position: relative;
    width: 44px;
    height: 44px;
}
.casino-die-face .pip {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #0f172a;
}
.casino-die-face .c { left: 18px; top: 18px; }
.casino-die-face .tl { left: 4px; top: 4px; }
.casino-die-face .tr { right: 4px; top: 4px; }
.casino-die-face .ml { left: 4px; top: 18px; }
.casino-die-face .mr { right: 4px; top: 18px; }
.casino-die-face .bl { left: 4px; bottom: 4px; }
.casino-die-face .br { right: 4px; bottom: 4px; }
.sicbo-totals {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}
.casino-race {
    display: grid;
    gap: 0.7rem;
}
.race-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
}
.race-track {
    display: grid;
    gap: 0.45rem;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.2) 0 1px, rgba(255,255,255,0) 1px 44px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 2px, rgba(255,255,255,0) 2px 24px),
        linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.02)),
        linear-gradient(135deg, #15803d, #14532d);
    padding: 0.6rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.race-lane {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 42px;
    gap: 0.45rem;
    align-items: center;
    min-height: 58px;
}
.race-name {
    font-size: 0.75rem;
    font-weight: 800;
}
.race-bar {
    position: relative;
    height: 38px;
    border-radius: 999px;
    background: rgba(226,232,240,.35);
    overflow: hidden;
}
.race-finish {
    position: absolute;
    top: -8px;
    right: 10px;
    width: 3px;
    height: 54px;
    background: repeating-linear-gradient(180deg, #111827 0 4px, #f8fafc 4px 8px);
    z-index: 2;
}
.race-progress {
    height: 100%;
    border-radius: 999px;
    transition: width .08s linear;
}
.race-distance {
    font-size: 0.74rem;
    color: #475569;
    text-align: right;
    font-weight: 700;
}
.race-avatar {
    position: absolute;
    top: 0;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,23,42,.35);
    z-index: 4;
}
.race-avatar.is-winner {
    animation: raceWinnerHalo .55s ease-out 1, raceWinnerPulse 1s ease-in-out 2;
}
.race-outcome {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-weight: 800;
    animation: raceOutcomeIn .36s cubic-bezier(.16,.84,.24,1);
}
.race-outcome.is-win {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}
.race-outcome.is-loss {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412;
}
@keyframes raceWinnerHalo {
    0% { box-shadow: 0 0 0 0 rgba(250,204,21,.0), 0 2px 8px rgba(15,23,42,.35); }
    40% { box-shadow: 0 0 0 10px rgba(250,204,21,.45), 0 0 18px rgba(250,204,21,.9); }
    100% { box-shadow: 0 0 0 0 rgba(250,204,21,.0), 0 2px 8px rgba(15,23,42,.35); }
}
@keyframes raceWinnerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes raceOutcomeIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.race-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-tutorial-card {
    border: 1px solid #bae6fd;
    background: linear-gradient(145deg, #f0f9ff, #ecfeff);
}
.dashboard-tutorial-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.tutorial-sheet {
    display: grid;
    gap: 0.75rem;
}
.tutorial-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.tutorial-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.1rem;
}
.tutorial-desc {
    margin: 0;
    color: #334155;
    line-height: 1.5;
}
.tutorial-progress {
    width: 100%;
    height: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}
.tutorial-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #22c55e);
}
.tutorial-pages {
    color: #64748b;
    font-size: 0.8rem;
}
.divers-close-btn {
    position: absolute;
    z-index: 4;
    top: 0.6rem;
    right: 0.6rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 6px 16px rgba(2, 6, 23, .25);
}

@keyframes diversOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes diversCardIn {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .divers-summary-head .item-sub { display: none; }
    .divers-pill { min-width: 0; flex: 1 1 auto; }
    .divers-summary-strip {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow-x: hidden;
    }
    .divers-games-grid { grid-template-columns: 1fr; }
    .divers-view-tab {
        flex-direction: column;
        gap: 0.15rem;
        font-size: 0.72rem;
    }
    .game-control-panel { grid-template-columns: 1fr; }
    .guess-player-layout { grid-template-columns: 1fr; }
    .guess-player-silhouette {
        width: min(100%, 190px);
        height: 210px;
        margin: 0 auto;
    }
    .guess-player-silhouette::before { top: 17px; }
    .guess-player-silhouette::after { height: 145px; }
    .guess-player-silhouette span { top: 100px; }
    .guess-player-clues { min-height: 0; }
    .casino-top { grid-template-columns: 1fr; }
    .casino-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .casino-bet { grid-template-columns: 1fr; }
    .roulette-layout { grid-template-columns: 1fr; }
    .roulette-numbers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .roulette-outside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sicbo-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .race-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    .guess-player-options { grid-template-columns: 1fr; }
    .quick-math-stage { min-height: 260px; }
    .memory-grid { gap: 5px; }
    .casino-games { grid-template-columns: 1fr; }
    .roulette-numbers,
    .sicbo-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (orientation: landscape) and (max-height: 520px) {
    .divers-game-overlay { padding: 0.35rem; }
    .divers-close-btn {
        width: 36px;
        height: 36px;
        margin-bottom: 0.25rem;
    }
    .divers-game-card { padding: 0.75rem !important; }
}
