/* ==========================================================================
   SCRITCHY SCRATCHY — "Nocturne Lottery" design system
   A dark, premium late-night lottery-kiosk aesthetic: ink backdrops, warm
   gold leaf, felt-green undertones, tactile glass panels and neon ticket
   accents. Display serif (Fraunces) paired with a warm grotesque (Hanken).
   ========================================================================== */

:root {
    /* ---- Ink / surfaces ---- */
    --ink-900: #08070c;
    --ink-850: #0c0a12;
    --ink-800: #110e18;
    --ink-700: #181421;
    --ink-600: #211c2e;

    --surface-1: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.10);
    --surface-inset: rgba(0, 0, 0, 0.35);

    --hairline: rgba(255, 255, 255, 0.09);
    --hairline-strong: rgba(255, 255, 255, 0.17);

    /* ---- Text ---- */
    --text: #f3ecdd;
    --text-muted: #a89e8c;
    --text-dim: #6f6857;
    --color-text: var(--text);
    --color-text-muted: var(--text-muted);

    /* ---- Gold leaf (primary luxury accent) ---- */
    --gold-1: #ffe7a6;
    --gold: #f2c869;
    --gold-2: #d6a23d;
    --gold-deep: #8f6a1e;
    --gold-glow: rgba(242, 200, 105, 0.30);
    --grad-gold: linear-gradient(135deg, #ffe7a6 0%, #f2c869 38%, #cf9a35 100%);

    /* ---- Felt / table green undertone ---- */
    --felt: #18553f;
    --felt-glow: rgba(30, 110, 78, 0.22);

    /* ---- States ---- */
    --success: #3ad79a;
    --success-glow: rgba(58, 215, 154, 0.25);
    --warning: #f2c869;
    --danger: #ff5b6b;
    --danger-glow: rgba(255, 91, 107, 0.28);

    /* ---- Per-ticket neon accents (set as --accent on theme classes) ---- */
    --clover-primary: #35d39a;       --clover-secondary: #facc15;
    --neon-primary: #ff2e93;         --neon-secondary: #25d6ec;
    --penalty-primary: #ff6a3d;      --penalty-secondary: #ef4444;
    --cosmic-primary: #a98bff;       --cosmic-secondary: #5b9dff;
    --banco-primary: #aee63f;        --banco-secondary: #4ade80;
    --morpion-primary: #2ad6e8;      --morpion-secondary: #38bdf8;
    --astro-primary: #8b9bff;        --astro-secondary: #c084fc;
    --solitaire-primary: #fb923c;    --solitaire-secondary: #f43f5e;
    --cash-primary: #4ade80;         --cash-secondary: #22c55e;
    --millionnaire-primary: #fbbf24; --millionnaire-secondary: #ffe7a6;

    /* default accent used when no theme set */
    --accent: var(--gold);
    --accent-2: var(--gold-2);

    /* ---- Geometry ---- */
    --r-xs: 8px;
    --r-sm: 12px;
    --r: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-pill: 999px;

    /* ---- Elevation ---- */
    --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 18px 50px -12px rgba(0, 0, 0, 0.65);
    --shadow-3: 0 40px 90px -24px rgba(0, 0, 0, 0.8);
    --ring-gold: 0 0 0 1px rgba(242, 200, 105, 0.4), 0 0 26px -6px var(--gold-glow);

    /* ---- Fonts ---- */
    --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
    --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --font-stamp: 'Special Elite', 'Courier New', monospace;
    --font-mono: 'Spline Sans Mono', ui-monospace, 'SFMono-Regular', monospace;

    /* ---- Motion ---- */
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    --transition-slow: 0.55s cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    letter-spacing: 0.005em;
    background-color: var(--ink-900);
    background-image:
        radial-gradient(900px 520px at 12% -8%, rgba(242, 200, 105, 0.10), transparent 60%),
        radial-gradient(1100px 700px at 108% 4%, var(--felt-glow), transparent 62%),
        radial-gradient(900px 900px at 50% 120%, rgba(70, 40, 110, 0.18), transparent 60%),
        linear-gradient(180deg, var(--ink-850), var(--ink-900));
    background-attachment: fixed;
    position: relative;
}

/* Fine grain + halftone overlay for atmosphere/depth */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 4px 4px;
    mix-blend-mode: overlay;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app-header, .app-main, .app-footer { position: relative; z-index: 1; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-optical-sizing: auto;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

::selection { background: var(--gold); color: #1c1305; }

button, input, select { font-family: inherit; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--r-pill);
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); background-clip: padding-box; }

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.hidden { display: none !important; }
.w-full { width: 100%; }
.font-bold { font-weight: 700; }

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.6rem;
    background: linear-gradient(180deg, rgba(20, 16, 28, 0.92), rgba(12, 10, 18, 0.82));
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 1px 0 rgba(242, 200, 105, 0.08), 0 14px 40px -18px rgba(0, 0, 0, 0.9);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container { display: flex; align-items: center; gap: 0.7rem; }

.logo-icon {
    font-size: 1.7rem;
    filter: drop-shadow(0 0 10px var(--gold-glow));
    animation: pulse 3s infinite ease-in-out;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    position: relative;
    background: var(--grad-gold);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gold-sweep 6s linear infinite;
}
.logo-text .highlight {
    font-style: italic;
    background: linear-gradient(135deg, #ff9ecb 0%, var(--neon-primary) 60%, #c81d6a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav tabs */
.app-nav {
    display: flex;
    gap: 0.2rem;
    padding: 0.3rem;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
}
.nav-tab {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0.5rem 1.05rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-normal), box-shadow var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: var(--surface-2); }
.nav-tab.active {
    color: #1c1305;
    background: var(--grad-gold);
    box-shadow: 0 4px 16px -4px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.badge-online, .badge-bot {
    min-width: 1.25rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: var(--r-pill);
    color: #08120d;
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
    animation: flash-pulse 2.4s infinite ease;
}
.badge-bot { background: var(--gold); color: #1c1305; box-shadow: 0 0 10px var(--gold-glow); }

/* Header stat readouts */
.header-stats { display: flex; gap: 0.6rem; }
.stat-card {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: var(--surface-1);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent, var(--gold));
    opacity: 0.8;
}
#ppm-container::before { background: var(--success); }
#prestige-currency-container::before { background: var(--cosmic-primary); }
#balance-container::before { background: var(--gold); }
.stat-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    font-weight: 700;
    order: -1;
    width: 100%;
    flex-basis: 100%;
    margin-bottom: -0.1rem;
}
.stat-value {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    transition: color var(--transition-fast);
}
.stat-unit { font-size: 0.85rem; opacity: 0.8; }

/* ==========================================================================
   MAIN LAYOUT, TABS & SUB-SCREENS
   ========================================================================== */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.6rem 3rem;
}

.tab-content { display: none; animation: tab-fade 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
.tab-content.active { display: block; }

.sub-screen, .multi-sub-screen {
    display: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}
.sub-screen.active, .multi-sub-screen.active { display: block; }

/* ==========================================================================
   SECTION HEADINGS
   ========================================================================== */
.section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.3rem);
    font-weight: 600;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.02em;
}
.section-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 2px;
    margin: 0.7rem auto 0;
    background: var(--grad-gold);
    border-radius: var(--r-pill);
    box-shadow: 0 0 14px -2px var(--gold-glow);
}
.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 60ch;
    margin: 0.7rem auto 2rem;
    font-size: 0.98rem;
}
.subsection-title {
    font-size: 1.3rem;
    color: var(--text);
    margin: 2.4rem 0 1.1rem;
    padding-left: 0.85rem;
    border-left: 3px solid var(--gold);
}
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    --btn-bg: var(--surface-2);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    color: var(--text);
    background: var(--btn-bg);
    border: 1px solid var(--hairline-strong);
    padding: 0.7rem 1.4rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-normal), background var(--transition-normal), filter var(--transition-fast);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.btn::after { /* sheen sweep */
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg);
    transition: left 0.6s var(--transition-normal);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { left: 130%; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.4);
}
.btn:disabled::after { display: none; }

.btn-primary {
    color: #1c1305;
    background: var(--grad-gold);
    border-color: rgba(255, 231, 166, 0.6);
    box-shadow: 0 8px 24px -8px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover { box-shadow: 0 14px 32px -8px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.6); }

.btn-secondary {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--hairline-strong);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--gold-deep); }

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #ff7a86, var(--danger) 55%, #c8313f);
    border-color: rgba(255, 120, 132, 0.5);
    box-shadow: 0 8px 24px -8px var(--danger-glow);
}

.btn-prestige {
    color: #fff;
    background: linear-gradient(135deg, #c084fc 0%, var(--cosmic-primary) 50%, #6d28d9 100%);
    border-color: rgba(167, 139, 250, 0.55);
    box-shadow: 0 10px 30px -10px rgba(168, 130, 255, 0.55);
    font-size: 1.02rem;
    padding: 0.85rem 1.6rem;
}

.btn-buy, .btn-buy-perm {
    font-size: 0.88rem;
    padding: 0.6rem 1.1rem;
    white-space: nowrap;
}

.button-group { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.arrow { display: inline-block; transition: transform var(--transition-fast); }
.btn-secondary:hover .arrow { transform: translateX(-3px); }

/* ==========================================================================
   TICKET SELECTION GRID
   ========================================================================== */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 1.5rem;
}

.ticket-select-card {
    --accent: var(--gold);
    --accent-2: var(--gold-2);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.35rem 1.35rem;
    background:
        radial-gradient(140% 90% at 50% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
        linear-gradient(180deg, var(--ink-700), var(--ink-800));
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    --rx: 0deg;
    --ry: 0deg;
    --lift: 0px;
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
    transition: transform 0.16s ease-out, box-shadow var(--transition-normal), border-color var(--transition-normal);
    animation: card-rise 0.6s var(--transition-normal) backwards;
}
/* staggered entrance */
.tickets-grid .ticket-select-card:nth-child(1) { animation-delay: 0.02s; }
.tickets-grid .ticket-select-card:nth-child(2) { animation-delay: 0.06s; }
.tickets-grid .ticket-select-card:nth-child(3) { animation-delay: 0.10s; }
.tickets-grid .ticket-select-card:nth-child(4) { animation-delay: 0.14s; }
.tickets-grid .ticket-select-card:nth-child(5) { animation-delay: 0.18s; }
.tickets-grid .ticket-select-card:nth-child(6) { animation-delay: 0.22s; }
.tickets-grid .ticket-select-card:nth-child(7) { animation-delay: 0.26s; }
.tickets-grid .ticket-select-card:nth-child(8) { animation-delay: 0.30s; }
.tickets-grid .ticket-select-card:nth-child(9) { animation-delay: 0.34s; }
.tickets-grid .ticket-select-card:nth-child(10) { animation-delay: 0.38s; }

/* foil top edge */
.ticket-select-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    opacity: 0.85;
}
/* hover sheen */
.ticket-select-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px 220px at var(--mx, 50%) -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    z-index: -1;
}
.ticket-select-card:hover {
    --lift: -8px;
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow: var(--shadow-3), 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 30px 60px -28px color-mix(in srgb, var(--accent) 45%, transparent);
}
.ticket-select-card:hover::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .ticket-select-card { transform: none; transition: box-shadow var(--transition-normal), border-color var(--transition-normal); }
    .ticket-select-card:hover { transform: translateY(-6px); }
}

.ticket-badge {
    align-self: flex-start;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.28rem 0.7rem;
    border-radius: var(--r-pill);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    margin-bottom: 0.9rem;
}

.ticket-icon {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 0.7rem;
    filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--accent) 40%, transparent));
    transition: transform var(--transition-normal);
}
.ticket-select-card:hover .ticket-icon { transform: scale(1.12) rotate(-6deg); }

.ticket-select-card h3 {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.ticket-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
    flex: 1;
    margin-bottom: 1.1rem;
}
.ticket-pricing {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
    margin-bottom: 1rem;
    background: var(--surface-inset);
    border: 1px dashed var(--hairline-strong);
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.ticket-pricing .cost span,
.ticket-pricing .max-win span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}
.ticket-pricing .max-win { text-align: right; }
.ticket-pricing .max-win span { color: var(--accent); }
.btn-play { width: 100%; }

/* Per-theme accent assignment (selection cards) */
.ticket-select-card.clover       { --accent: var(--clover-primary);       --accent-2: var(--clover-secondary); }
.ticket-select-card.neon         { --accent: var(--neon-primary);         --accent-2: var(--neon-secondary); }
.ticket-select-card.penalty      { --accent: var(--penalty-primary);      --accent-2: var(--penalty-secondary); }
.ticket-select-card.cosmic       { --accent: var(--cosmic-primary);       --accent-2: var(--cosmic-secondary); }
.ticket-select-card.banco        { --accent: var(--banco-primary);        --accent-2: var(--banco-secondary); }
.ticket-select-card.morpion      { --accent: var(--morpion-primary);      --accent-2: var(--morpion-secondary); }
.ticket-select-card.astro        { --accent: var(--astro-primary);        --accent-2: var(--astro-secondary); }
.ticket-select-card.solitaire    { --accent: var(--solitaire-primary);    --accent-2: var(--solitaire-secondary); }
.ticket-select-card.cash         { --accent: var(--cash-primary);         --accent-2: var(--cash-secondary); }
.ticket-select-card.millionnaire { --accent: var(--millionnaire-primary); --accent-2: var(--millionnaire-secondary); }

/* badge variant tints follow the card accent automatically; keep explicit for legacy markup */
.neon-badge, .penalty-badge, .cosmic-badge, .banco-badge,
.morpion-badge, .astro-badge, .solitaire-badge, .cash-badge, .millionnaire-badge { /* inherit accent */ }

/* ==========================================================================
   GAME SCREEN — scratch ticket
   ========================================================================== */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 640px;
    margin: 0 auto 1.4rem;
    flex-wrap: wrap;
}
.active-ticket-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}
.active-ticket-cost-badge {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    padding: 0.25rem 0.7rem;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}

.scratch-card-container {
    --accent: var(--gold);
    max-width: 480px;
    margin: 0 auto;
    perspective: 1400px;
}
.scratch-card-inner {
    position: relative;
    background: linear-gradient(170deg, #fbf4e4 0%, #f3e7cb 55%, #e8d6ad 100%);
    border-radius: var(--r-lg);
    padding: 1.1rem 1.1rem 1.3rem;
    box-shadow:
        var(--shadow-3),
        0 0 0 1px rgba(0, 0, 0, 0.25),
        inset 0 0 0 2px rgba(255, 255, 255, 0.5);
    color: #2a2114;
    overflow: hidden;
    animation: card-rise 0.5s var(--ease-spring);
}
.scratch-card-inner::before { /* glow ring tinted per theme */
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 50%, color-mix(in srgb, var(--accent) 40%, transparent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.ticket-header-stub {
    text-align: center;
    position: relative;
    padding-bottom: 0.6rem;
}
.vintage-stars { color: var(--gold-deep); letter-spacing: 0.3em; font-size: 0.8rem; }
.vintage-ticket-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 4.4vw, 1.45rem);
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #1f1810;
    margin: 0.2rem 0;
    /* keep clear of the absolutely-positioned price circle on the right */
    padding-inline: 56px;
    text-transform: uppercase;
    text-wrap: balance;
}
.vintage-serial-number {
    font-family: var(--font-stamp);
    font-size: 0.72rem;
    color: #6b5733;
    letter-spacing: 0.05em;
}
.vintage-price-circle {
    position: absolute;
    top: -2px;
    right: 0;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    color: #2a2114;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffe7a6, var(--gold-2));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
    transform: rotate(-12deg);
}

.ticket-perforation {
    height: 0;
    margin: 0.5rem -1.1rem 0.9rem;
    border-top: 2px dashed rgba(70, 55, 30, 0.35);
    position: relative;
}
.ticket-perforation::before,
.ticket-perforation::after {
    content: "";
    position: absolute;
    top: -11px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ink-900);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}
.ticket-perforation::before { left: -11px; }
.ticket-perforation::after { right: -11px; }

.ticket-play-area {
    position: relative;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: #efe3c6;
    box-shadow: inset 0 0 18px rgba(120, 96, 50, 0.25);
}
.scratch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.7rem;
    aspect-ratio: 1 / 0.78;
}
.scratch-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: linear-gradient(160deg, #fffaf0, #efe2c4);
    border: 1px solid rgba(120, 96, 50, 0.25);
    border-radius: var(--r-xs);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.slot-icon { font-size: 1.85rem; line-height: 1; }
.slot-value {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b5733;
}
.scratch-slot.highlight-win {
    background: linear-gradient(160deg, #fff7d6, #ffe9a3);
    border-color: var(--gold-2);
    box-shadow: 0 0 0 2px var(--gold), 0 0 22px -2px var(--gold-glow);
    animation: win-pop 0.6s var(--ease-spring) both, win-glow 1.6s ease-in-out 0.4s infinite;
    z-index: 2;
}
.slot-value.win-value { color: #9a6b00; font-size: 0.82rem; }

.scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    border-radius: var(--r-sm);
    transition: opacity var(--transition-slow);
}
.scratch-canvas.fade-out { opacity: 0; pointer-events: none; }

/* Game controls */
.game-controls { max-width: 480px; margin: 1.4rem auto 0; text-align: center; }
.scratch-instruction {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
    min-height: 1.6em;
    margin-bottom: 1rem;
}
.progress-bar-container { margin: 0 auto 0.5rem; max-width: 360px; }
.progress-bar-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.progress-bar-label span { color: var(--gold); font-family: var(--font-mono); font-weight: 700; }
.progress-bar {
    height: 10px;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: var(--r-pill);
    background: var(--grad-gold);
    box-shadow: 0 0 12px var(--gold-glow);
    transition: width 0.25s ease-out;
}

.bot-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.9rem auto 0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
    border-radius: var(--r-pill);
}
.bot-emoji { animation: bounce 1.4s infinite; }
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, var(--gold) 30%, transparent);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Per-theme accent glow on the active game screen */
#tab-solo.tab-content .sub-screen.clover-active .scratch-card-container,
.clover-active .scratch-card-container       { --accent: var(--clover-primary); }
.neon-active .scratch-card-container         { --accent: var(--neon-primary); }
.penalty-active .scratch-card-container      { --accent: var(--penalty-primary); }
.cosmic-active .scratch-card-container       { --accent: var(--cosmic-primary); }
.banco-active .scratch-card-container        { --accent: var(--banco-primary); }
.morpion-active .scratch-card-container      { --accent: var(--morpion-primary); }
.astro-active .scratch-card-container        { --accent: var(--astro-primary); }
.solitaire-active .scratch-card-container    { --accent: var(--solitaire-primary); }
.cash-active .scratch-card-container         { --accent: var(--cash-primary); }
.millionnaire-active .scratch-card-container { --accent: var(--millionnaire-primary); }

/* ==========================================================================
   UPGRADES & PRESTIGE TAB
   ========================================================================== */
.upgrades-wrapper { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.upgrades-list { display: flex; flex-direction: column; gap: 0.9rem; }

.upgrade-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    transition: border-color var(--transition-normal), transform var(--transition-normal);
}
.upgrade-card:hover { border-color: var(--gold-deep); transform: translateX(4px); }
.upgrade-details { display: flex; align-items: center; gap: 1rem; }
.upgrade-icon {
    font-size: 2rem;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--r-sm);
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    flex-shrink: 0;
}
.upgrade-details h3 { font-size: 1.1rem; color: var(--text); }
.upgrade-desc { font-size: 0.85rem; color: var(--text-muted); max-width: 46ch; margin: 0.15rem 0 0.35rem; }
.upgrade-level {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    padding: 0.1rem 0.55rem;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--gold) 12%, transparent);
}

/* Prestige */
.prestige-section { margin-top: 2.5rem; }
.prestige-dashboard {
    padding: 1.5rem;
    border-radius: var(--r-lg);
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(168, 130, 255, 0.16), transparent 60%),
        linear-gradient(180deg, var(--ink-700), var(--ink-800));
    border: 1px solid color-mix(in srgb, var(--cosmic-primary) 30%, var(--hairline));
    box-shadow: var(--shadow-2), 0 0 40px -20px rgba(168, 130, 255, 0.5);
    text-align: center;
}
.prestige-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.prestige-stat-item { display: flex; flex-direction: column; gap: 0.25rem; }
.prestige-stat-item .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.prestige-stat-item .value { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; color: var(--text); }
.prestige-stat-item .valueHighlight {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cosmic-primary);
    text-shadow: 0 0 18px rgba(168, 130, 255, 0.6);
}
.prestige-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 60ch;
    margin: 0 auto 1.2rem;
    line-height: 1.5;
}

.permanent-upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
}
.perm-upgrade-card {
    padding: 1.3rem;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color var(--transition-normal), transform var(--transition-normal);
}
.perm-upgrade-card:hover { border-color: var(--cosmic-primary); transform: translateY(-4px); }
.perm-upgrade-card h4 { font-size: 1.1rem; color: var(--text); }
.perm-upgrade-card p { font-size: 0.84rem; color: var(--text-muted); flex: 1; }
.perm-upgrade-card .level {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cosmic-primary);
    align-self: flex-start;
    padding: 0.1rem 0.55rem;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--cosmic-primary) 14%, transparent);
}

/* ==========================================================================
   STATS TAB
   ========================================================================== */
.stats-wrapper { max-width: 920px; margin: 0 auto; }
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stats-summary-card {
    padding: 1.2rem;
    text-align: center;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
}
.stats-summary-card .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.stats-summary-card .value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.4rem;
}

.stats-table-container {
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    overflow: hidden auto;
    box-shadow: var(--shadow-2);
}
.vintage-stats-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.vintage-stats-table thead {
    background: var(--surface-inset);
}
.vintage-stats-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    border-bottom: 1px solid var(--hairline-strong);
}
.vintage-stats-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--hairline);
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}
.vintage-stats-table tbody tr { transition: background var(--transition-fast); }
.vintage-stats-table tbody tr:hover { background: var(--surface-2); }
.vintage-stats-table tbody tr:last-child td { border-bottom: none; }
.ticket-name-cell { font-family: var(--font-body) !important; font-weight: 600; }

.positive { color: var(--success) !important; }
.negative { color: var(--danger) !important; }
.neutral { color: var(--text-muted) !important; }

/* ==========================================================================
   GRATTE-BOT TAB
   ========================================================================== */
.bot-locked-container {
    max-width: 540px;
    margin: 3rem auto;
    padding: 2.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px dashed var(--hairline-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}
.lock-icon { font-size: 3.5rem; display: block; margin-bottom: 1rem; filter: grayscale(0.3) drop-shadow(0 0 16px rgba(0,0,0,0.5)); }
.bot-locked-container h2 { font-size: 1.6rem; color: var(--text); margin-bottom: 0.8rem; }
.bot-locked-container p { color: var(--text-muted); margin-bottom: 0.8rem; font-size: 0.92rem; }
.bot-locked-container strong { color: var(--gold); }
.lock-sub { font-size: 0.84rem !important; opacity: 0.85; }

.bot-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.5rem; align-items: start; }

.bot-config-card, .bot-log-card,
.bot-standby-inner, .bot-running-inner, .bot-report-inner {
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}
.bot-config-card { padding: 1.5rem; }
.bot-config-card h2 { font-size: 1.35rem; color: var(--text); margin-bottom: 0.3rem; }

.bot-ticket-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 1.1rem 0; max-height: 360px; overflow-y: auto; padding-right: 0.3rem; }
.bot-ticket-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    transition: border-color var(--transition-fast);
}
.bot-ticket-row:hover { border-color: var(--gold-deep); }
.bot-row-icon { font-size: 1.5rem; flex-shrink: 0; }
.bot-row-info { flex: 1; min-width: 0; }
.bot-row-info h4 { font-size: 0.95rem; color: var(--text); }
.bot-row-price { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); }

.bot-qty-control {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--ink-800);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    padding: 0.15rem;
}
.btn-qty-minus, .btn-qty-plus {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn-qty-minus:hover, .btn-qty-plus:hover { background: var(--gold); color: #1c1305; }
.btn-qty-plus:active, .btn-qty-minus:active { transform: scale(0.9); }
.qty-input {
    width: 34px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.92rem;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input { cursor: text; transition: background var(--transition-fast); }
.qty-input:focus { outline: none; background: var(--surface-2); border-radius: 6px; }

/* Boutons d'action du configurateur bot (Reset + Lancer) */
.bot-action-buttons { display: flex; gap: 0.6rem; align-items: stretch; }
.bot-action-buttons #btn-bot-start { flex: 1; }
.bot-action-buttons #btn-bot-reset { flex: 0 0 auto; white-space: nowrap; }

.bot-summary-box {
    padding: 0.9rem 1rem;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    margin-bottom: 1rem;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted);
    padding: 0.2rem 0;
}
.summary-line.font-bold { color: var(--text); font-size: 1.05rem; padding-top: 0.5rem; border-top: 1px solid var(--hairline); margin-top: 0.3rem; }
.summary-line span:last-child { font-family: var(--font-mono); color: var(--gold); font-weight: 700; }

/* Bot status sub-screens */
.bot-status-wrapper { display: flex; flex-direction: column; gap: 1.2rem; }
.bot-sub-screen { display: none; }
.bot-sub-screen.active { display: block; animation: tab-fade 0.4s cubic-bezier(0.32, 0.72, 0, 1); }

.bot-standby-inner, .bot-running-inner, .bot-report-inner { padding: 1.6rem; }
.bot-standby-inner { text-align: center; }
.bot-avatar-pulse { font-size: 3.5rem; animation: avatar-float 3s ease-in-out infinite; }
.bot-standby-inner h3 { font-size: 1.3rem; color: var(--text); margin: 0.6rem 0 0.4rem; }
.bot-standby-inner p { color: var(--text-muted); font-size: 0.9rem; }

.running-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.2rem; }
.running-header h3 { font-size: 1.25rem; color: var(--text); }
.status-dot-pulse {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 var(--success-glow);
    animation: status-pulse-glow 1.5s infinite;
}
.running-ticket-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    margin-bottom: 1.2rem;
}
.ticket-icon-anim { font-size: 2.5rem; animation: ticket-wiggle 1.2s ease-in-out infinite; }
.running-ticket-details h4 { color: var(--text); }
.running-ticket-details span { font-size: 0.82rem; color: var(--text-muted); font-family: var(--font-mono); }

.bot-progress-container { margin-bottom: 1.2rem; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.progress-labels span:last-child { font-family: var(--font-mono); color: var(--gold); }
.bot-progress-bar {
    height: 12px;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.bot-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #7ef0c0);
    box-shadow: 0 0 12px var(--success-glow);
    border-radius: var(--r-pill);
    transition: width 0.1s linear;
}
.bot-queue-preview {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.7rem 0.9rem;
    background: var(--surface-inset);
    border-radius: var(--r-sm);
    margin-bottom: 1.2rem;
}
.bot-queue-preview span:last-child { color: var(--text); font-weight: 600; }

/* Bot report */
.report-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem; }
.report-icon { font-size: 1.8rem; }
.report-header h3 { font-size: 1.3rem; color: var(--text); }
.report-net-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-radius: var(--r-sm);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    border: 1px solid var(--hairline);
}
.report-net-banner.profit { background: color-mix(in srgb, var(--success) 14%, transparent); border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); }
.report-net-banner.loss { background: color-mix(in srgb, var(--danger) 14%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.report-net-banner.neutral { background: var(--surface-inset); color: var(--text-muted); }
.report-net-banner span:first-child { font-family: var(--font-mono); }

.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin-bottom: 1.2rem; }
.report-stat-card {
    padding: 0.9rem;
    text-align: center;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
}
.report-stat-card .label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.report-stat-card .value { display: block; font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; color: var(--text); margin-top: 0.3rem; }

.report-breakdown { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.2rem; }
.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    background: var(--surface-inset);
    border-radius: var(--r-xs);
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.breakdown-row .type-label { color: var(--text); font-weight: 600; }
.breakdown-row .stats-val { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.78rem; }
.report-actions { display: flex; gap: 0.7rem; }

/* Bot activity log */
.bot-log-card { padding: 1.3rem 1.4rem; }
.bot-log-card h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 0.8rem; }
.bot-log-console {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    height: 200px;
    overflow-y: auto;
    padding: 0.9rem;
    background: #07060b;
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.6);
}
.log-line { padding: 0.05rem 0; color: var(--text-muted); border-left: 2px solid transparent; padding-left: 0.5rem; }
.log-line.system { color: var(--gold); }
.log-line.win { color: var(--success); }
.log-line.loss { color: var(--text-dim); }
.log-line.penalty-text { color: var(--danger); }
.log-line.info { color: var(--text-muted); }

/* ==========================================================================
   MULTIPLAYER TAB
   ========================================================================== */
.connect-card {
    max-width: 520px;
    margin: 3rem auto;
    padding: 2.6rem;
    text-align: center;
    background:
        radial-gradient(120% 90% at 50% -20%, var(--felt-glow), transparent 60%),
        linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}
.connect-emoji { font-size: 3.5rem; display: block; margin-bottom: 1rem; animation: bounce 2.5s infinite; }
.connect-card h2 { font-size: 1.7rem; color: var(--text); margin-bottom: 0.8rem; }
.connect-card p { color: var(--text-muted); margin-bottom: 1.4rem; line-height: 1.55; }
.connection-status-msg { margin-top: 1rem; font-size: 0.9rem; font-weight: 600; min-height: 1.4em; }

.multiplayer-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }

.multi-play-area {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}
.coop-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.coop-card-header h3 { font-size: 1.25rem; color: var(--text); }
.coop-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.25rem 0.7rem;
    border-radius: var(--r-pill);
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
}
.scratch-card-container.coop-inactive { opacity: 0.55; filter: grayscale(0.5); pointer-events: none; }

.coop-controls { display: flex; flex-direction: column; gap: 0.9rem; }
.coop-btns { margin-top: 0; }

.betting-board {
    padding: 1.2rem;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r);
}
.betting-board h4 { font-size: 1.05rem; color: var(--text); margin-bottom: 0.3rem; }
.bet-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.9rem; }
.bet-input-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.bet-input, .gift-input {
    width: 90px;
    padding: 0.6rem 0.8rem;
    background: var(--ink-800);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 700;
}
.bet-input:focus, .gift-input:focus, .gift-select:focus, #chat-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.bet-input-row .btn { flex: 1; min-width: 130px; }

.bets-list { display: flex; flex-direction: column; gap: 0.4rem; }
.no-bets { font-size: 0.82rem; color: var(--text-dim); text-align: center; padding: 0.8rem; font-style: italic; }
.bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.8rem;
    border-radius: var(--r-xs);
    font-size: 0.84rem;
    border-left: 3px solid var(--text-dim);
    background: var(--surface-1);
}
.bet-item.bet-win { border-left-color: var(--success); }
.bet-item.bet-loss { border-left-color: var(--danger); }
.bet-item-amount { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }

/* Sidebar */
.multi-sidebar { display: flex; flex-direction: column; gap: 1.2rem; }
.sidebar-section {
    padding: 1.2rem;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
}
.sidebar-section h4 { font-size: 1rem; color: var(--text); margin-bottom: 0.8rem; }

.players-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 220px; overflow-y: auto; }
.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.7rem;
    background: var(--surface-inset);
    border-radius: var(--r-xs);
    font-size: 0.85rem;
}
.name-indicator, .player-name-indicator { font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.name-indicator::before, .player-name-indicator::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    flex-shrink: 0;
}
.player-coins { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }

.gift-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gift-select {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 0.8rem;
    background: var(--ink-800);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 0.85rem;
}
.gift-row .btn { flex-shrink: 0; }

/* Chat */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
    background: var(--surface-inset);
    border-radius: var(--r-sm);
}
.chat-bubble {
    padding: 0.5rem 0.75rem;
    background: var(--surface-2);
    border-radius: 4px 12px 12px 12px;
    max-width: 92%;
    animation: bubble-in 0.3s var(--ease-spring);
}
.chat-bubble.system-msg {
    align-self: center;
    background: transparent;
    border: 1px dashed var(--hairline-strong);
    text-align: center;
    font-size: 0.78rem;
    color: var(--gold);
    font-style: italic;
    max-width: 100%;
}
.chat-bubble-header { display: flex; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.2rem; }
.chat-bubble-header span:first-child { font-weight: 700; font-size: 0.82rem; }
.chat-time { font-size: 0.68rem; color: var(--text-dim); font-family: var(--font-mono); }
.chat-bubble-content { font-size: 0.88rem; color: var(--text); word-wrap: break-word; line-height: 1.4; }

.chat-form-row { display: flex; gap: 0.5rem; }
#chat-input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.9rem;
    background: var(--ink-800);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-pill);
    color: var(--text);
    font-size: 0.88rem;
}
.chat-form-row .btn { flex-shrink: 0; }

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(5, 4, 9, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    width: min(420px, 100%);
    padding: 2.4rem 2rem;
    text-align: center;
    border-radius: var(--r-xl);
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(242, 200, 105, 0.2), transparent 60%),
        linear-gradient(180deg, var(--ink-700), var(--ink-800));
    border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--hairline));
    box-shadow: var(--shadow-3), 0 0 60px -20px var(--gold-glow);
    transform: scale(0.85) translateY(20px);
    transition: transform var(--transition-slow);
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.modal-emoji { font-size: 4rem; line-height: 1; margin-bottom: 0.8rem; animation: bounce 1.4s ease-in-out infinite; filter: drop-shadow(0 0 20px var(--gold-glow)); }
.modal-title { font-size: 2rem; font-weight: 900; color: var(--text); margin-bottom: 0.5rem; }
.modal-desc { color: var(--text-muted); margin-bottom: 1.4rem; }
.modal-prize {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.6rem;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px var(--gold-glow));
}
.prize-unit { -webkit-text-fill-color: initial; }
.modal-content .btn { min-width: 160px; }

/* ==========================================================================
   SOUND TOGGLE, FOOTER, PARTICLES
   ========================================================================== */
.sound-toggle {
    position: fixed;
    bottom: 1.4rem;
    right: 1.4rem;
    z-index: 200;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--hairline-strong);
    background: var(--surface-2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-2);
    transition: transform var(--transition-fast), background var(--transition-normal), border-color var(--transition-normal);
}
.sound-toggle:hover { transform: scale(1.1); border-color: var(--gold); background: var(--surface-3); }
.sound-toggle:active { transform: scale(0.95); }

.app-footer {
    text-align: center;
    padding: 1.6rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--hairline);
    margin-top: auto;
}

.particle-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes flash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gold-sweep { to { background-position: 220% 0; } }
@keyframes tab-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-rise { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes win-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes win-glow {
    0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 16px -2px var(--gold-glow); }
    50% { box-shadow: 0 0 0 2px var(--gold), 0 0 30px 2px var(--gold-glow); }
}
@keyframes avatar-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@keyframes status-pulse-glow {
    0% { box-shadow: 0 0 0 0 var(--success-glow); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes ticket-wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    .bot-layout, .multiplayer-layout { grid-template-columns: 1fr; }
    .app-header { justify-content: center; }
    .app-nav { order: 3; width: 100%; justify-content: center; }
}

@media (max-width: 768px) {
    .app-main { padding: 1.4rem 1rem 2.5rem; }
    .header-stats { width: 100%; justify-content: center; }
    .nav-tab { font-size: 0.82rem; padding: 0.45rem 0.8rem; }
    .logo-text { font-size: 1.4rem; }
    .tickets-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
    .report-actions { flex-direction: column; }
    .prestige-stats { gap: 1.5rem; }
}

@media (max-width: 480px) {
    .stat-label { display: none; }
    .header-stats { gap: 0.4rem; }
    .stat-card { padding: 0.45rem 0.6rem; }
    .modal-content { padding: 1.8rem 1.3rem; }
    .modal-prize { font-size: 2.2rem; }
}

/* ==========================================================================
   MÉCANIQUES DE TICKET — bannière, layouts, badges (refonte FDJ)
   ========================================================================== */
/* Pastille de mécanique sur les cartes de sélection */
.mech-pill {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.22rem 0.55rem;
    border-radius: var(--r-pill);
    color: var(--ink-900);
    background: var(--accent, var(--gold));
    box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--accent) 60%, transparent);
}
.how-to-win {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: -0.4rem 0 1rem;
    padding: 0.5rem 0.7rem;
    background: var(--surface-inset);
    border-left: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
    border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
.how-to-win .how-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent, var(--gold));
    margin-bottom: 0.15rem;
}

/* Bannière de mécanique (au-dessus de la zone grattée) */
#mech-banner.mech-banner {
    margin: 0 0 0.7rem;
    padding: 0.6rem 0.8rem;
    background: rgba(20, 16, 10, 0.06);
    border: 1px dashed rgba(70, 55, 30, 0.3);
    border-radius: var(--r-sm);
    color: #2a2114;
    text-align: center;
}
.mech-banner-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #6b5733;
    margin-bottom: 0.3rem;
}
.instant-rule { font-family: var(--font-stamp); font-size: 0.75rem; color: #6b5733; }
.lotto-nums { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.lotto-num {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f1810;
    background: radial-gradient(circle at 35% 30%, #ffe7a6, var(--gold-2));
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5), 0 2px 5px rgba(0,0,0,0.25);
}
.cumul-target { font-family: var(--font-mono); font-weight: 800; font-size: 1.15rem; color: #1f1810; }
.cumul-bar {
    height: 9px;
    margin-top: 0.4rem;
    background: rgba(0,0,0,0.12);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.cumul-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c89b3a, #6b5733);
    border-radius: var(--r-pill);
    transition: width 0.6s var(--transition-normal);
}
.cumul-fill.reached { background: linear-gradient(90deg, var(--success), #7ef0c0); }

/* Slots spéciaux */
.scratch-slot.slot-number .slot-icon { font-size: 1.5rem; font-family: var(--font-mono); font-weight: 700; }
.scratch-slot.slot-bonus { background: linear-gradient(160deg, #fff7d6, #ffe9a3); }
.scratch-slot.slot-mult .slot-icon { filter: drop-shadow(0 0 6px rgba(169,139,255,0.6)); }
.scratch-slot.win-line {
    box-shadow: 0 0 0 2px var(--gold), 0 0 18px -2px var(--gold-glow);
}

/* Near-miss : les 2 cases « presque » pulsent en ambre */
.scratch-slot.near-hit {
    animation: near-pulse 0.7s var(--ease-spring) both, near-breathe 1.3s ease-in-out 0.7s infinite;
    border-color: var(--warning);
    box-shadow: 0 0 0 2px var(--warning), 0 0 22px -4px rgba(242, 200, 105, 0.5);
    z-index: 2;
}
@keyframes near-pulse { 0% { transform: scale(0.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes near-breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }

/* ==========================================================================
   FEEDBACK & JUICE — combo, delta flottant, secousse, célébration
   ========================================================================== */
.combo-meter {
    margin: 0 auto 0.8rem;
    display: inline-block;
    padding: 0.35rem 1rem;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: #1c1305;
    background: linear-gradient(135deg, #ff9d3d, #ff5b6b);
    border-radius: var(--r-pill);
    box-shadow: 0 6px 18px -6px rgba(255, 120, 60, 0.6);
}
.combo-meter .combo-count { font-family: var(--font-mono); }
.combo-meter.bump { animation: combo-bump 0.4s var(--ease-spring); }
@keyframes combo-bump { 0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); } }

.float-delta {
    position: absolute;
    right: 8px;
    top: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 5;
    animation: float-up 1s ease-out forwards;
}
.float-delta.gain { color: var(--success); text-shadow: 0 0 10px var(--success-glow); }
.float-delta.loss { color: var(--danger); }
@keyframes float-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-28px); } }

.stat-value.flash-gain { animation: val-gain 0.6s ease; }
.stat-value.flash-loss { animation: val-loss 0.6s ease; }
@keyframes val-gain { 50% { color: var(--success); text-shadow: 0 0 12px var(--success-glow); } }
@keyframes val-loss { 50% { color: var(--danger); text-shadow: 0 0 12px var(--danger-glow); } }

/* Secousse de carte (amplitude pilotée par --shake) */
.scratch-card-container.shake { animation: screen-shake 0.5s cubic-bezier(.36,.07,.19,.97); }
@keyframes screen-shake {
    10%, 90% { transform: translateX(calc(var(--shake, 4px) * -0.4)); }
    20%, 80% { transform: translateX(calc(var(--shake, 4px) * 0.6)); }
    30%, 50%, 70% { transform: translateX(calc(var(--shake, 4px) * -1)); }
    40%, 60% { transform: translateX(var(--shake, 4px)); }
}

/* Flash plein écran (gros gains) */
body.celebrate-flash::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 950;
    pointer-events: none;
    background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.85), transparent 60%);
    animation: flash-out 0.5s ease-out forwards;
}
@keyframes flash-out { from { opacity: 0.9; } to { opacity: 0; } }

/* Cadre foil sur le jackpot */
.scratch-card-inner.jackpot-frame {
    box-shadow: var(--shadow-3), 0 0 0 3px var(--gold-1), 0 0 80px -10px var(--gold-glow);
    animation: jackpot-pulse 1.3s ease-in-out infinite;
}
@keyframes jackpot-pulse {
    0%, 100% { box-shadow: var(--shadow-3), 0 0 0 3px var(--gold-1), 0 0 60px -10px var(--gold-glow); }
    50% { box-shadow: var(--shadow-3), 0 0 0 3px var(--gold-1), 0 0 110px 0 var(--gold-glow); }
}
.modal-content#win-modal.jackpot .modal-title {
    background: var(--grad-gold);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gold-sweep 3s linear infinite;
}

/* ==========================================================================
   MODALES — récompense quotidienne, confirmation, toast
   ========================================================================== */
.daily-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.35rem;
    margin: 0.4rem 0 1.4rem;
}
.daily-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.2rem;
    border-radius: var(--r-xs);
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    font-size: 0.62rem;
    color: var(--text-muted);
}
.daily-day-num { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.daily-day-val { font-family: var(--font-mono); font-weight: 700; color: var(--text); }
.daily-day.claimed { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.daily-day.claimed .daily-day-val { color: var(--gold); }
.daily-day.today {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 16px -4px var(--gold-glow);
    transform: translateY(-2px);
}

.confirm-actions { display: flex; gap: 0.8rem; justify-content: center; }
.confirm-actions .btn { min-width: 130px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translate(-50%, 20px);
    z-index: 1100;
    max-width: min(90vw, 420px);
    padding: 0.8rem 1.3rem;
    border-radius: var(--r-pill);
    background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
    border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--hairline));
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: var(--shadow-2);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   ROSTER « L'EMPIRE DE JACK » — séries, gating, rang, nouveaux thèmes
   ========================================================================== */
/* Accents des 4 nouveaux tickets */
.ticket-select-card.mots     { --accent: #e2b94a; --accent-2: #b3892b; }
.ticket-select-card.bingo    { --accent: #c084fc; --accent-2: #ec4899; }
.ticket-select-card.tacotac  { --accent: #22d3ee; --accent-2: #f97316; }
.ticket-select-card.pactole  { --accent: #34d399; --accent-2: #fbbf24; }
.mots-active .scratch-card-container     { --accent: #e2b94a; }
.bingo-active .scratch-card-container    { --accent: #c084fc; }
.tacotac-active .scratch-card-container  { --accent: #22d3ee; }
.pactole-active .scratch-card-container  { --accent: #34d399; }

/* Séparateurs de série (la grille englobe les séparateurs sur toute la largeur) */
.series-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hairline);
}
.series-separator:first-child { margin-top: 0; }
.series-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}
.series-lock { font-size: 0.78rem; color: var(--gold); font-weight: 600; }
.series-separator.locked .series-name { color: var(--text-dim); }

/* Cartes verrouillées */
.ticket-select-card.locked {
    filter: grayscale(0.85) brightness(0.6);
    cursor: not-allowed;
}
.ticket-select-card.locked:hover { transform: none; box-shadow: var(--shadow-2); }
.ticket-select-card.locked::after { display: none; }
.ticket-select-card.locked .btn-play {
    background: var(--surface-3);
    color: var(--text-muted);
    border-color: var(--hairline);
    box-shadow: none;
}

/* Puce de rang joueur (header) */
.rank-chip { min-width: 150px; }
.rank-chip .rank-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--gold-1);
    white-space: nowrap;
}
.rank-bar {
    display: block;
    width: 100%;
    height: 4px;
    margin-top: 0.3rem;
    background: var(--surface-inset);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.rank-fill {
    display: block;
    height: 100%;
    background: var(--grad-gold);
    border-radius: var(--r-pill);
    transition: width 0.6s var(--transition-normal);
}

/* ==========================================================================
   PRESTIGE MULTI-COUCHES — Diamants 💎 & Ascension ✨
   ========================================================================== */
#prestige-lab { margin-top: 1rem; }
.lab-balance {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 0.5rem;
}
.subsection-title.diamond { border-left-color: #67e8f9; }
.subsection-title.diamond .lab-balance { color: #67e8f9; }
.subsection-title.relic { border-left-color: #fbbf24; }
.subsection-title.relic .lab-balance { color: #fbbf24; }

.diamond-dash {
    border-color: color-mix(in srgb, #22d3ee 30%, var(--hairline)) !important;
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(34, 211, 238, 0.14), transparent 60%),
        linear-gradient(180deg, var(--ink-700), var(--ink-800)) !important;
    box-shadow: var(--shadow-2), 0 0 40px -20px rgba(34, 211, 238, 0.5) !important;
    margin-bottom: 1.1rem;
}
.relic-dash {
    border-color: color-mix(in srgb, #fbbf24 30%, var(--hairline)) !important;
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(251, 191, 36, 0.14), transparent 60%),
        linear-gradient(180deg, var(--ink-700), var(--ink-800)) !important;
    box-shadow: var(--shadow-2), 0 0 40px -20px rgba(251, 191, 36, 0.5) !important;
    margin-bottom: 1.1rem;
}
.diamond-dash .btn-prestige { background: linear-gradient(135deg, #67e8f9, #22d3ee 55%, #0e7490); box-shadow: 0 10px 30px -10px rgba(34,211,238,0.55); }
.relic-btn { background: linear-gradient(135deg, #fde68a, #fbbf24 55%, #b45309) !important; color: #2a1d05 !important; box-shadow: 0 10px 30px -10px rgba(251,191,36,0.55) !important; }
.lab-card .btn { width: 100%; margin-top: 0.5rem; }

/* ==========================================================================
   RISK / REWARD — Quitte ou Double & Ticket Maudit
   ========================================================================== */
.don-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.don-actions .btn { min-width: 150px; }
#btn-double-or-nothing { animation: don-pulse 1.4s ease-in-out infinite; }
@keyframes don-pulse {
    0%, 100% { box-shadow: 0 8px 24px -8px var(--danger-glow); }
    50% { box-shadow: 0 8px 30px -4px var(--danger-glow), 0 0 0 3px color-mix(in srgb, var(--danger) 30%, transparent); }
}
.ticket-select-card.cursed-card { --accent: #ff5b6b; --accent-2: #7f1d1d; }
.mech-pill-cursed { background: var(--danger); color: #fff; }
.cursed-card .ticket-icon { animation: pulse 1.6s ease-in-out infinite; }

/* ==========================================================================
   MULTIJOUEUR — pot communautaire
   ========================================================================== */
.stat-card--pot::before { background: var(--gold); }
#community-pot .stat-value { font-family: var(--font-mono); color: var(--gold-1); text-shadow: 0 0 10px var(--gold-glow); }
#community-pot .stat-label { color: var(--gold-2); }
@keyframes pot-bump { 0% { transform: scale(1); } 40% { transform: scale(1.10); } 100% { transform: scale(1); } }
.pot-bump .stat-value { display: inline-block; animation: pot-bump 0.35s ease-out; }
@keyframes pot-jackpot-flash {
    0%, 100% { box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.04); }
    50% { box-shadow: 0 0 24px 4px var(--gold-glow), inset 0 0 12px var(--gold-glow); border-color: var(--gold); }
}
.pot-jackpot-flash { animation: pot-jackpot-flash 0.6s ease-in-out 2; }

/* ==========================================================================
   MÉCANIQUES ÉTENDUES — path / bingo / crossword / blackjack / wheel / pick
   ========================================================================== */
/* PATH 4×4 */
.scratch-grid.mech-path { grid-template-columns: repeat(4, 1fr); aspect-ratio: 1 / 1; gap: 0.35rem; }
.scratch-grid.mech-path .scratch-slot { gap: 0; }
.scratch-grid.mech-path .slot-value { display: none; }
.scratch-slot.tile-empty { opacity: 0.45; background: linear-gradient(160deg, #f3e8cc, #e4d4ad); }
.scratch-slot.tile-path { background: radial-gradient(circle at 50% 40%, rgba(126,224,176,0.35), #eef7ec); }
.scratch-slot.tile-rocket { background: radial-gradient(circle at 50% 40%, rgba(169,139,255,0.4), #efe7ff); }
.scratch-slot.tile-planet { background: radial-gradient(circle at 50% 40%, rgba(242,200,105,0.4), #fff5db); }
.scratch-slot.tile-asteroid { background: radial-gradient(circle at 50% 40%, rgba(242,166,90,0.4), #fdeede); }

/* BINGO 5×5 */
.scratch-grid.mech-bingo { grid-template-columns: repeat(5, 1fr); aspect-ratio: 1 / 1; gap: 0.3rem; padding: 0.5rem; }
.scratch-grid.mech-bingo .scratch-slot { gap: 0; }
.scratch-grid.mech-bingo .slot-icon { font-size: 1.05rem; font-family: var(--font-mono); font-weight: 700; }
.scratch-grid.mech-bingo .slot-value { display: none; }
.scratch-slot.bingo-cell.marked { position: relative; }
.scratch-slot.bingo-cell.marked::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 78%; height: 78%;
    transform: translate(-50%, -50%); border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255,91,107,0.55), rgba(255,91,107,0.22));
    box-shadow: 0 0 0 2px rgba(255,91,107,0.5);
}
.scratch-slot.bingo-cell.marked .slot-icon { color: #7a1820 !important; font-weight: 800; position: relative; z-index: 1; }
.scratch-slot.bingo-free .slot-icon { color: var(--gold-2); font-size: 1.4rem; }
.bingo-draws { max-height: 64px; overflow: auto; }
.bingo-draws .lotto-num { width: 26px; height: 26px; font-size: 0.72rem; }

/* CROSSWORD */
.scratch-grid.mech-crossword { aspect-ratio: 1 / 1; gap: 0.3rem; padding: 0.5rem; }
.scratch-grid.mech-crossword .scratch-slot { gap: 0; }
.scratch-grid.mech-crossword .slot-icon { font-family: var(--font-stamp); font-size: 1.25rem; font-weight: 700; color: #5b4a2a; }
.scratch-grid.mech-crossword .slot-value { display: none; }
.cw-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.cw-word {
    font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
    padding: 0.18rem 0.5rem; border-radius: var(--r-pill);
    background: rgba(70,55,30,0.1); color: #5b4a2a; border: 1px solid rgba(70,55,30,0.2);
    transition: background var(--transition-normal);
}
.cw-word.found { background: linear-gradient(135deg, #ffe7a6, var(--gold-2)); color: #3a2c0a; border-color: var(--gold-2); }
.cw-word.found::before { content: "✓ "; font-weight: 800; }

/* BLACKJACK */
.scratch-grid.mech-blackjack { display: flex; flex-direction: column; aspect-ratio: 1 / 0.78; padding: 0.6rem; }
.bj-table { display: flex; flex-direction: column; gap: 0.3rem; height: 100%; justify-content: center; }
.bj-side { display: flex; flex-direction: column; gap: 0.25rem; align-items: center; }
.bj-label { font-family: var(--font-stamp); font-size: 0.7rem; letter-spacing: 0.08em; color: #5b4a2a; text-transform: uppercase; }
.bj-total {
    display: inline-grid; place-items: center; min-width: 1.6em; padding: 0 0.3em; margin-left: 0.3em;
    font-family: var(--font-mono); font-weight: 800; color: #1f1810;
    background: rgba(70,55,30,0.12); border-radius: var(--r-pill);
}
.bj-total.bj-win { background: linear-gradient(135deg, #ffe7a6, var(--gold-2)); color: #3a2c0a; }
.bj-row { display: flex; gap: 0.35rem; justify-content: center; }
.bj-vs { font-family: var(--font-display); font-style: italic; font-size: 0.8rem; color: #8a7a54; text-align: center; }
.scratch-slot.bj-card { width: 44px; min-width: 44px; height: 60px; gap: 0.1rem; background: linear-gradient(160deg, #fffdf7, #f1e6cc); }
.scratch-slot.bj-card .slot-icon { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 800; }
.scratch-slot.bj-card .slot-value { font-size: 1rem; }

/* WHEEL */
.scratch-grid.mech-wheel { display: grid; place-items: center; aspect-ratio: 1 / 0.78; padding: 0.5rem; }
.wheel-stage { position: relative; width: min(78%, 220px); aspect-ratio: 1 / 1; display: grid; place-items: center; }
.wheel-dial {
    width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
    box-shadow: inset 0 0 0 6px rgba(20,16,10,0.5), 0 8px 24px -8px rgba(0,0,0,0.6), var(--ring-gold);
}
.wheel-hub {
    width: 34%; height: 34%; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fff7df, var(--gold-2));
    box-shadow: 0 0 0 3px rgba(20,16,10,0.5), inset 0 0 8px rgba(0,0,0,0.25);
}
.wheel-pointer {
    position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 3;
    width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent;
    border-top: 18px solid var(--gold); filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}
.wheel-result {
    position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
    padding: 0.3rem 0.8rem; border-radius: var(--r-pill); white-space: nowrap;
    font-family: var(--font-mono); font-weight: 800; font-size: 0.95rem;
    background: rgba(20,16,10,0.85); color: var(--gold-1); box-shadow: var(--shadow-1);
}
.wheel-result.win { background: linear-gradient(135deg, #ffe7a6, var(--gold-2)); color: #2a2008; }
.wheel-result.replay { background: linear-gradient(135deg, #b9a3ff, var(--cosmic-primary)); color: #15102e; }
.wheel-result.lose { color: #d9cdb4; }

/* PICK */
.scratch-grid.mech-pick { grid-template-columns: repeat(3, 1fr); aspect-ratio: 1 / 0.92; gap: 0.5rem; padding: 0.7rem; }
.scratch-slot.slot-pick {
    cursor: pointer; background: linear-gradient(160deg, #2a2114, #43331c);
    border-color: rgba(242,200,105,0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.scratch-slot.slot-pick .slot-icon, .scratch-slot.slot-pick .slot-value { color: var(--gold-1); }
.scratch-slot.slot-pick:not(.revealed):hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--ring-gold); }
.scratch-slot.slot-pick.revealed { cursor: default; }
.scratch-slot.slot-pick.safe { background: linear-gradient(160deg, #fffaf0, #efe2c4); }
.scratch-slot.slot-pick.safe .slot-icon, .scratch-slot.slot-pick.safe .slot-value { color: #6b5733; }
.scratch-slot.slot-pick.skull {
    background: radial-gradient(circle at 50% 35%, rgba(255,91,107,0.5), #3a0d10);
    animation: near-pulse 0.5s var(--ease-spring) both;
}
.scratch-slot.slot-pick.skull .slot-icon { color: #fff; }
.scratch-slot.slot-pick.spent { opacity: 0.6; }

/* ==========================================================================
   🏅 TROPHÉES (Missions / Succès / Album)
   ========================================================================== */
.trophies-wrapper { max-width: 980px; margin: 0 auto; }
.trophies-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.trophies-hint {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: -0.4rem 0 1.1rem;
    padding-left: 0.85rem;
}
.missions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.mission-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.2rem;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.mission-card.is-ready {
    border-color: color-mix(in srgb, var(--success) 55%, transparent);
    box-shadow: 0 0 22px -8px var(--success-glow);
}
.mission-card.is-claimed { opacity: 0.62; }
.mission-head { display: flex; align-items: center; gap: 0.85rem; }
.mission-icon {
    font-size: 1.7rem;
    width: 48px; height: 48px;
    display: grid; place-items: center;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    flex-shrink: 0;
}
.mission-info h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; line-height: 1.25; }
.mission-reward { font-size: 0.8rem; color: var(--gold); font-family: var(--font-mono); }
.mission-bar { max-width: none; margin: 0; }
.btn-claim-mission { width: 100%; }

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.achievement-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: var(--r);
    border: 1px solid var(--hairline);
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    box-shadow: var(--shadow-1);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.achievement-card.unlocked {
    border-color: color-mix(in srgb, var(--gold) 45%, transparent);
    box-shadow: var(--ring-gold);
}
.achievement-card.locked { opacity: 0.55; filter: grayscale(0.5); }
.achievement-icon {
    font-size: 1.9rem;
    width: 54px; height: 54px;
    display: grid; place-items: center;
    background: var(--surface-inset);
    border: 1px solid var(--hairline);
    border-radius: var(--r-sm);
    flex-shrink: 0;
}
.achievement-body h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 0.2rem; }
.achievement-body p { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 0.35rem; line-height: 1.35; }
.achievement-reward { font-size: 0.78rem; color: var(--gold); font-family: var(--font-mono); font-weight: 700; }
.achievement-badge {
    position: absolute;
    top: 0.7rem; right: 0.7rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1c1305;
    background: var(--grad-gold);
    padding: 0.18rem 0.55rem;
    border-radius: var(--r-pill);
    box-shadow: 0 0 12px -2px var(--gold-glow);
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.85rem;
    padding-bottom: 1.5rem;
}
.album-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.6rem;
    text-align: center;
    border-radius: var(--r-sm);
    border: 1px solid var(--hairline);
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    box-shadow: var(--shadow-1);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.album-cell.discovered:hover { transform: translateY(-3px); }
.album-cell.undiscovered { opacity: 0.5; filter: grayscale(1); }
.album-cell.jackpot {
    border-color: color-mix(in srgb, var(--cosmic-primary) 55%, transparent);
    box-shadow: 0 0 22px -6px rgba(169, 139, 255, 0.5);
    background: linear-gradient(180deg, color-mix(in srgb, var(--cosmic-primary) 14%, var(--surface-2)), var(--surface-1));
}
.album-icon { font-size: 2rem; line-height: 1; }
.album-name { font-size: 0.78rem; font-weight: 700; color: var(--text); font-family: var(--font-display); }
.album-state {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.album-cell.jackpot .album-state { color: var(--cosmic-primary); }

.badge-troph { background: var(--success); color: #04261a; box-shadow: 0 0 10px var(--success-glow); }

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
