/* =============================================================================
   PUNTER BOX  —  The Vault of Tickets
   ---------------------------------------------------------------------------
   Brass-and-obsidian vault with cinematic win FX.
   Tier visuals are layered so the same card just gains classes on a win:
       .ticket-card.jackpot    gold storm
       .ticket-card.diamond    blue lightning halo
       .ticket-card.purple     purple aurora ribbon
       .ticket-card.bronze     orange flame edge
       .ticket-card.spark      yellow halo pulse
       .ticket-card.dead       greyscale sink
   ============================================================================= */

/* ── Palette ──────────────────────────────────────────────────────────── */
:root {
    --pb-bg:           #0B1020;
    --pb-bg-2:         #131A2E;
    --pb-bg-3:         #0E1326;
    --pb-gold:         #FFD86B;
    --pb-gold-deep:    #D4AF37;
    --pb-brass:        #B8860B;
    --pb-cream:        #F8F4E6;
    --pb-text:         #C9C4B1;
    --pb-text-dim:     #8C8674;
    --pb-cyan:         #5BB3F0;
    --pb-diamond:      #00B4D8;
    --pb-purple:       #B388EB;
    --pb-purple-deep:  #9D4EDD;
    --pb-bronze:       #FF8C42;
    --pb-bronze-deep:  #E07A1F;
    --pb-spark:        #FFD60A;
    --pb-dead:         #6c757d;
    --pb-rose:         #E04A6B;
    --pb-green:        #88D8B0;
}

/* ─────────────────────────────────────────────────────────────────────────
   SHELL
   ─────────────────────────────────────────────────────────────────────── */
.page-punter {
    color: var(--pb-text);
    position: relative;
    min-height: calc(100vh - 200px);
}

.punter-shell {
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 32px 60px;
    position: relative;
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO + STATS
   ─────────────────────────────────────────────────────────────────────── */
.punter-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 20px 26px;
    background:
        radial-gradient(120% 200% at 50% 0%, rgba(255,216,107,0.10), transparent 60%),
        linear-gradient(180deg, #1a1e3e 0%, #0F142A 100%);
    border: 1px solid var(--pb-gold-deep);
    border-radius: 14px;
    box-shadow:
        0 0 32px rgba(255,216,107,0.15),
        inset 0 1px 0 rgba(255,216,107,0.30),
        inset 0 -1px 0 rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}
.punter-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,216,107,0.08), transparent);
    transform: translateX(-100%);
    animation: heroSweep 8s linear infinite;
    pointer-events: none;
}
@keyframes heroSweep {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

.punter-title {
    display: flex; align-items: center; gap: 18px;
}
.punter-glyph {
    font-size: 48px;
    filter: drop-shadow(0 0 12px var(--pb-gold));
    animation: glyphFloat 3.5s ease-in-out infinite;
}
@keyframes glyphFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-4px) rotate(2deg); }
}
.punter-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 38px; font-weight: 700;
    letter-spacing: 4px;
    margin: 0; padding: 0;
    background: linear-gradient(180deg, #FFE89E 0%, var(--pb-gold) 50%, var(--pb-gold-deep) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(255,216,107,0.4);
}
.punter-sub {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 14px; font-style: italic;
    color: var(--pb-text); margin: 2px 0 0 0;
    letter-spacing: 1.5px;
    opacity: 0.85;
}

/* Stats chips */
.punter-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
    display: flex; flex-direction: column; align-items: center;
    min-width: 78px; padding: 8px 14px;
    background: var(--pb-bg);
    border: 1px solid #2A3354;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat-chip:hover { transform: translateY(-2px); }
.stat-chip .chip-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px; font-weight: 700; line-height: 1;
    color: var(--pb-cream);
}
.stat-chip .chip-lbl {
    font-size: 10px; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--pb-text-dim);
    margin-top: 4px;
}
.stat-chip.sealed  .chip-num { color: var(--pb-gold);    }
.stat-chip.pending .chip-num { color: var(--pb-cyan);    }
.stat-chip.winner  .chip-num { color: var(--pb-diamond); }
.stat-chip.jackpot .chip-num { color: var(--pb-gold);    text-shadow: 0 0 14px var(--pb-gold);}
.stat-chip.dead    .chip-num { color: var(--pb-dead);    }

.stat-chip.jackpot { border-color: var(--pb-gold); box-shadow: 0 0 16px rgba(255,216,107,0.25); }
.stat-chip.winner  { border-color: var(--pb-diamond); }


/* ─────────────────────────────────────────────────────────────────────────
   ACTION CARDS (NEW TICKET + CHECK WINNERS)
   ─────────────────────────────────────────────────────────────────────── */
.punter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 28px;
}
@media (max-width: 980px) {
    .punter-actions { grid-template-columns: 1fr; }
}

.punter-card {
    background:
        radial-gradient(80% 120% at 0% 0%, rgba(255,216,107,0.05), transparent 60%),
        linear-gradient(180deg, var(--pb-bg-2) 0%, var(--pb-bg) 100%);
    border: 1px solid #2A3354;
    border-radius: 14px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ── 📊 Punter Analysis Report — gold-accented action card ───────────────── */
.panar-card {
    border-color: rgba(255, 200, 80, 0.32) !important;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255, 200, 80, 0.10), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(160, 123, 224, 0.06), transparent 60%),
        linear-gradient(180deg, rgba(20, 16, 8, 0.92), rgba(10, 6, 4, 0.96)) !important;
}
.panar-card .card-title {
    color: #ffd66a !important;
    text-shadow: 0 0 10px rgba(255, 200, 80, 0.4);
    padding-right: 56px;
}
.panar-desc {
    color: #d3c4a0;
    font-size: 0.84rem;
    line-height: 1.55;
    margin: 4px 0 14px;
}
.panar-desc b {
    color: #ffd66a;
    font-weight: 700;
}
.panar-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 11px 18px;
    background: linear-gradient(180deg, rgba(255, 200, 80, 0.22), rgba(200, 150, 50, 0.12));
    border: 1px solid rgba(255, 200, 80, 0.55);
    color: #fff5d4;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 0 14px rgba(255, 200, 80, 0.25);
}
.panar-btn:hover {
    background: linear-gradient(180deg, rgba(255, 200, 80, 0.34), rgba(200, 150, 50, 0.2));
    box-shadow: 0 0 24px rgba(255, 200, 80, 0.55);
    transform: translateY(-1px);
}
.panar-btn:active { transform: translateY(0); }
.panar-btn.is-busy {
    pointer-events: none;
    opacity: 0.7;
}
.panar-btn-icon { font-size: 1.05rem; }
.panar-btn-spinner {
    display: inline-block;
    animation: panarSpin 1.0s linear infinite;
}
@keyframes panarSpin {
    0%   { opacity: 0.3; }
    50%  { opacity: 1;   }
    100% { opacity: 0.3; }
}
.panar-msg {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #b09c70;
    font-style: italic;
    min-height: 1em;
}
.panar-msg.is-ok    { color: #6ee7a4; font-style: normal; }
.panar-msg.is-error { color: #ff9a9a; font-style: normal; }

/* ── Sigil — a small idle "the engine is alive" glyph, top-right ────────── */
.panar-sigil {
    position: absolute; top: 18px; right: 20px;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.panar-sigil-glyph {
    position: relative; z-index: 2;
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(255,214,106,0.55));
    animation: panarGlyphFloat 3.6s ease-in-out infinite;
}
@keyframes panarGlyphFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-3px) rotate(3deg); }
}
.panar-sigil-ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg,
        transparent, rgba(255,200,80,0.45), transparent 35%,
        transparent 65%, rgba(160,123,224,0.30), transparent);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    animation: panarRingSpin 9s linear infinite;
    opacity: 0.85;
}
.panar-sigil-ring2 {
    inset: 8px;
    animation: panarRingSpin 6s linear infinite reverse;
    opacity: 0.55;
}
@keyframes panarRingSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Window chips — 20 / 50 / 100 draws, visualised instead of just prose ── */
.panar-windows {
    display: flex; align-items: center; gap: 8px;
    margin: 2px 0 14px;
}
.panar-window-chip {
    display: flex; flex-direction: column; align-items: center;
    min-width: 54px; padding: 6px 10px;
    background: rgba(255,200,80,0.06);
    border: 1px solid rgba(255,200,80,0.28);
    border-radius: 9px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.panar-window-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 14px rgba(255,200,80,0.25);
}
.panar-window-chip b {
    font-family: 'JetBrains Mono', monospace;
    font-size: 17px; color: #ffd66a; line-height: 1;
    text-shadow: 0 0 8px rgba(255,200,80,0.35);
}
.panar-window-chip small {
    font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase;
    color: #b09c70; margin-top: 3px;
}
.panar-window-arrow {
    color: rgba(255,200,80,0.4);
    font-size: 13px;
}

/* ── Feature pills — what the report actually contains, at a glance ──────── */
.panar-features {
    display: flex; flex-wrap: wrap; gap: 7px;
    margin-bottom: 18px;
}
.panar-feature {
    font-size: 0.72rem;
    padding: 5px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,200,80,0.18);
    border-radius: 999px;
    color: #cbbf9a;
    white-space: nowrap;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.panar-feature:hover {
    border-color: rgba(255,200,80,0.5);
    color: #ffd66a;
    transform: translateY(-1px);
}

/* ── Generating state — the card itself breathes while the PDF compiles ─── */
.panar-card.is-generating {
    animation: panarBreathe 1.6s ease-in-out infinite;
}
@keyframes panarBreathe {
    0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04), 0 0 0 rgba(255,200,80,0); }
    50%      { box-shadow: 0 8px 24px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04), 0 0 28px rgba(255,200,80,0.35); }
}
.panar-card.is-generating .card-shimmer { animation-duration: 1.4s; }
.panar-card.is-generating .panar-sigil-ring  { animation-duration: 2.2s; }
.panar-card.is-generating .panar-sigil-ring2 { animation-duration: 1.5s; }
.panar-card.is-generating .panar-sigil-glyph { animation-duration: 0.9s; }

.card-shimmer {
    position: absolute; top: 0; left: -150%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,216,107,0.07), transparent);
    transform: skewX(-12deg);
    pointer-events: none;
    animation: cardShimmer 6s ease-in-out infinite;
}
@keyframes cardShimmer {
    0%, 70%  { left: -150%; }
    100%     { left: 200%; }
}
.card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--pb-gold);
    margin: 0 0 18px 0;
    text-shadow: 0 0 10px rgba(255,216,107,0.30);
}

/* Form rows */
.form-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.form-label {
    font-size: 12px; letter-spacing: 2px;
    text-transform: uppercase; color: var(--pb-text-dim);
    min-width: 86px;
}
.source-row { gap: 16px; }
.src-opt {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--pb-bg);
    border: 1px solid #2A3354;
    cursor: pointer; user-select: none;
    transition: all .2s ease;
    color: var(--pb-text);
    font-size: 13px;
}
.src-opt:hover { border-color: var(--pb-gold); color: var(--pb-cream); }
.src-opt input { accent-color: var(--pb-gold); }
.src-opt input:checked + span { color: var(--pb-gold); font-weight: 600; }

.draw-input {
    width: 160px;
    background: var(--pb-bg);
    border: 1px solid #2A3354; border-radius: 8px;
    padding: 10px 14px;
    color: var(--pb-cream);
    font-family: 'JetBrains Mono', monospace; font-size: 16px;
    transition: border .2s ease, box-shadow .2s ease;
}
.draw-input:focus {
    outline: none;
    border-color: var(--pb-gold);
    box-shadow: 0 0 0 3px rgba(255,216,107,0.15);
}

/* Stack groups the box row + set-nav so they share a column */
.num-box-stack {
    display: flex; flex-direction: column; gap: 8px;
    min-width: 0;            /* allow shrinking inside flex parent */
    flex: 1 1 auto;
    max-width: 100%;
}

.num-boxes {
    display: flex; gap: 8px;
    flex-wrap: nowrap;        /* keep one row → scroll if overflow */
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px;     /* breathing room above + below for scrollbar */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    /* Custom slim gold scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--pb-gold-deep) transparent;
}
.num-boxes::-webkit-scrollbar         { height: 6px; }
.num-boxes::-webkit-scrollbar-track   { background: transparent; }
.num-boxes::-webkit-scrollbar-thumb   { background: var(--pb-gold-deep); border-radius: 3px; }
.num-boxes::-webkit-scrollbar-thumb:hover { background: var(--pb-gold); box-shadow: 0 0 8px rgba(255,216,107,0.4); }

/* Soft gold edge-fade hint when the row scrolls — tells the eye "more this way" */
.num-boxes {
    -webkit-mask-image: linear-gradient(90deg,
        transparent 0,
        #000 14px,
        #000 calc(100% - 14px),
        transparent 100%);
            mask-image: linear-gradient(90deg,
        transparent 0,
        #000 14px,
        #000 calc(100% - 14px),
        transparent 100%);
}

.num-box {
    flex: 0 0 auto;           /* don't shrink — scroll instead */
    scroll-snap-align: start;
}

/* Hide System-8 boxes when card is in System-6 / Mix mode.
   data-count="6" → only show first 6 boxes (S6 + MIX)
   data-count="7" → show 7 boxes (System 7 — future)
   data-count="8" → show all 8 (System 8) */
.num-boxes[data-count="6"] .num-box-x,
.num-boxes[data-count="7"] .num-box[data-idx="7"] { display: none; }

/* ── SET NAVIGATOR — browse imported picks ─────────────────────────────
   Appears after the user clicks IMPORT. Each engine run returns N sets
   (System 8 typically gives 6). The punter can scroll through them with
   ◀ / ▶ or the keyboard arrows before locking. */
.set-nav {
    display: inline-flex; align-items: center; gap: 10px;
    align-self: flex-start;
    padding: 6px 12px 6px 6px;
    background: linear-gradient(180deg, rgba(255,216,107,0.10), rgba(255,216,107,0.02));
    border: 1px solid var(--pb-gold-deep);
    border-radius: 999px;
    font-size: 11px; letter-spacing: 1.5px;
    color: var(--pb-text-dim);
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(255,216,107,0.10);
    animation: setNavAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes setNavAppear {
    0%   { transform: translateY(-4px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0)    scale(1);    opacity: 1; }
}
.set-nav .nav-pos { color: var(--pb-text); font-weight: 600; padding: 0 4px; }
.set-nav b        { color: var(--pb-gold); font-family: 'JetBrains Mono', monospace;
                    font-size: 13px; margin: 0 1px; }

.nav-arrow {
    background: var(--pb-bg);
    border: 1px solid var(--pb-gold-deep);
    color: var(--pb-gold);
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    padding: 0;
}
.nav-arrow:hover {
    background: linear-gradient(180deg, var(--pb-gold), var(--pb-gold-deep));
    color: var(--pb-bg);
    box-shadow: 0 0 14px rgba(255,216,107,0.50);
    transform: scale(1.08);
}
.nav-arrow:active { transform: scale(0.92); }
.nav-arrow:disabled {
    opacity: 0.35; cursor: not-allowed;
    background: var(--pb-bg); color: var(--pb-text-dim);
    border-color: #2A3354;
    box-shadow: none; transform: none;
}

.nav-tip {
    font-size: 9px; letter-spacing: 1.5px;
    color: var(--pb-text-dim); opacity: 0.6;
    margin-left: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,216,107,0.20);
}

/* When a set is freshly loaded, boxes do a brief gold flash so the user
   sees that this row of numbers is "the imported set". */
.num-boxes.set-loaded .num-box {
    animation: setLoadPulse 0.55s ease;
}
@keyframes setLoadPulse {
    0%   { box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4),
                       inset 0 1px 0 rgba(255,255,255,0.05),
                       0 0 0 0 rgba(255,216,107,0); }
    50%  { box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4),
                       inset 0 1px 0 rgba(255,255,255,0.10),
                       0 0 12px 2px rgba(255,216,107,0.45); }
    100% { box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4),
                       inset 0 1px 0 rgba(255,255,255,0.05); }
}

/* Subtle hint chip next to "Numbers (1–45)" — count indicator */
.numbox-hint {
    color: var(--pb-gold);
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.85;
}

/* Number-7 and 8 boxes get a slightly different border tint so the eye
   knows "these are bonus / System 8 territory" */
.num-box-x {
    border-color: rgba(255, 216, 107, 0.45);
    background:
        radial-gradient(60% 100% at 50% 0%, #2a2440, var(--pb-bg));
}
.num-box-x:focus { border-color: var(--pb-gold); }
.num-box {
    width: 56px; height: 56px;
    border: 1.5px solid #2A3354; border-radius: 10px;
    background: radial-gradient(60% 100% at 50% 0%, #1a2040, var(--pb-bg));
    color: var(--pb-cream);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px; font-weight: 700;
    transition: all .2s ease;
    box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
.num-box:focus {
    outline: none;
    border-color: var(--pb-gold);
    box-shadow:
        inset 0 -2px 6px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 0 0 3px rgba(255,216,107,0.20);
    transform: translateY(-1px);
}
.num-box.shake {
    animation: numShake 0.4s ease;
    border-color: var(--pb-rose) !important;
}
@keyframes numShake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-5px); }
    40%     { transform: translateX(5px); }
    60%     { transform: translateX(-3px); }
    80%     { transform: translateX(3px); }
}
.win-box  { border-color: rgba(255,216,107,0.45); }
.supp-box { border-color: rgba(91,179,240,0.45); }

/* Slot-machine reveal: a special class added briefly during a check */
.num-box.slot-rolling {
    color: var(--pb-gold);
    text-shadow: 0 0 8px var(--pb-gold);
}

/* Hide spinner arrows on number inputs (cleaner look) */
.num-box::-webkit-outer-spin-button,
.num-box::-webkit-inner-spin-button,
.draw-input::-webkit-outer-spin-button,
.draw-input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
.num-box, .draw-input { -moz-appearance: textfield; }

/* ─────────────────────────────────────────────────────────────────────────
   BUTTONS
   ─────────────────────────────────────────────────────────────────────── */
.button-row {
    display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap;
}
.btn-import, .btn-fetch, .btn-lock, .btn-check {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px;
    border-radius: 10px; cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12px; font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all .2s ease;
    border: 1px solid #2A3354;
    background: var(--pb-bg);
    color: var(--pb-cream);
    position: relative; overflow: hidden;
}
.btn-import:hover, .btn-fetch:hover {
    border-color: var(--pb-cyan);
    color: var(--pb-cyan);
    box-shadow: 0 0 18px rgba(91,179,240,0.25);
    transform: translateY(-1px);
}
.btn-lock, .btn-check {
    background: linear-gradient(180deg, #1f2547 0%, #141936 100%);
    border-color: var(--pb-gold-deep);
    color: var(--pb-gold);
}
.btn-lock::after, .btn-check::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,216,107,0.25), transparent);
    transition: left .6s ease;
}
.btn-lock:hover, .btn-check:hover {
    border-color: var(--pb-gold);
    box-shadow: 0 0 24px rgba(255,216,107,0.35), inset 0 0 18px rgba(255,216,107,0.10);
    color: #FFE89E;
}
.btn-lock:hover::after, .btn-check:hover::after { left: 100%; }
.btn-lock:active, .btn-check:active { transform: scale(0.98); }

.btn-glyph { font-size: 14px; }

.punter-msg {
    margin-top: 12px; font-size: 12px;
    color: var(--pb-text-dim); min-height: 16px;
    letter-spacing: 0.6px;
}
.punter-msg.ok   { color: var(--pb-green); }
.punter-msg.warn { color: var(--pb-bronze); }
.punter-msg.err  { color: var(--pb-rose); }


/* ─────────────────────────────────────────────────────────────────────────
   THE VAULT
   ─────────────────────────────────────────────────────────────────────── */
.punter-vault {
    position: relative;
    border-radius: 18px;
    padding: 0;
    background:
        radial-gradient(80% 140% at 50% 0%, rgba(255,216,107,0.07), transparent 60%),
        linear-gradient(180deg, #1A1F3E 0%, #0E1326 60%, #0B1020 100%);
    /* Layered brass-and-obsidian frame: outer gold + inner brass */
    box-shadow:
        0 0 0 1px var(--pb-gold-deep),
        0 0 0 3px var(--pb-bg-3),
        0 0 0 4px var(--pb-brass),
        0 0 0 5px var(--pb-bg-3),
        0 0 0 6px var(--pb-gold-deep),
        0 0 40px rgba(255,216,107,0.18),
        inset 0 1px 0 rgba(255,216,107,0.25);
    overflow: hidden;
    margin-bottom: 24px;
    animation: vaultBreathe 5s ease-in-out infinite;
}
@keyframes vaultBreathe {
    0%, 100% {
        box-shadow:
            0 0 0 1px var(--pb-gold-deep), 0 0 0 3px var(--pb-bg-3),
            0 0 0 4px var(--pb-brass),   0 0 0 5px var(--pb-bg-3),
            0 0 0 6px var(--pb-gold-deep),
            0 0 32px rgba(255,216,107,0.16),
            inset 0 1px 0 rgba(255,216,107,0.25);
    }
    50% {
        box-shadow:
            0 0 0 1px var(--pb-gold), 0 0 0 3px var(--pb-bg-3),
            0 0 0 4px var(--pb-brass), 0 0 0 5px var(--pb-bg-3),
            0 0 0 6px var(--pb-gold),
            0 0 56px rgba(91,179,240,0.22),
            inset 0 1px 0 rgba(255,216,107,0.40);
    }
}

.vault-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 18px; flex-wrap: wrap;
    padding: 18px 26px;
    background: linear-gradient(180deg, rgba(255,216,107,0.08), transparent);
    border-bottom: 1px solid rgba(255,216,107,0.25);
}
.vault-title-wrap { display: flex; align-items: center; gap: 12px; }
.vault-padlock {
    font-size: 28px; filter: drop-shadow(0 0 10px var(--pb-gold));
    transition: transform .5s ease;
    cursor: default;
}
.vault-padlock.unsealing { animation: padlockSwing 0.9s ease forwards; }
@keyframes padlockSwing {
    0%   { transform: rotate(0deg) scale(1); }
    40%  { transform: rotate(-25deg) scale(1.1); }
    70%  { transform: rotate(15deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}
.vault-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 26px; font-weight: 700; letter-spacing: 4px;
    color: var(--pb-gold);
    text-shadow: 0 0 14px rgba(255,216,107,0.40);
}

.vault-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
    padding: 6px 14px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    background: var(--pb-bg);
    border: 1px solid #2A3354; border-radius: 999px;
    color: var(--pb-text); cursor: pointer;
    transition: all .2s ease;
}
.filter-chip:hover { color: var(--pb-cream); border-color: var(--pb-gold-deep); }
.filter-chip.active {
    background: linear-gradient(180deg, rgba(255,216,107,0.20), rgba(255,216,107,0.05));
    border-color: var(--pb-gold);
    color: var(--pb-gold);
    box-shadow: 0 0 12px rgba(255,216,107,0.30);
}

.vault-clear {
    padding: 7px 14px;
    background: rgba(224,74,107,0.08);
    border: 1px solid rgba(224,74,107,0.4); border-radius: 999px;
    color: var(--pb-rose);
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
    cursor: pointer; transition: all .2s ease;
}
.vault-clear:hover {
    background: rgba(224,74,107,0.18);
    border-color: var(--pb-rose);
    box-shadow: 0 0 12px rgba(224,74,107,0.30);
}

.vault-body {
    padding: 22px 26px 30px;
    min-height: 200px;
    position: relative;
    z-index: 2;
}
.vault-empty {
    display: flex; flex-direction: column; align-items: center;
    padding: 50px 0; gap: 10px;
    color: var(--pb-text-dim); opacity: 0.7;
}
.empty-glyph { font-size: 48px; opacity: 0.5; }
.empty-text  { font-style: italic; letter-spacing: 1px; }

/* Drifting dust particles inside the vault */
.vault-dust {
    position: absolute; inset: 0;
    pointer-events: none; overflow: hidden;
    z-index: 1; opacity: 0.7;
}
.dust-mote {
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--pb-gold);
    box-shadow: 0 0 6px var(--pb-gold);
    opacity: 0.4;
    animation: dustDrift linear infinite;
}
@keyframes dustDrift {
    0%   { transform: translate3d(0, 100%, 0) scale(0.6); opacity: 0; }
    10%  { opacity: 0.5; }
    90%  { opacity: 0.5; }
    100% { transform: translate3d(40px, -100%, 0) scale(0.9); opacity: 0; }
}


/* ─────────────────────────────────────────────────────────────────────────
   TICKET CARDS (scrolls in the vault)
   ─────────────────────────────────────────────────────────────────────── */
.ticket-card {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(91,179,240,0.06), transparent 60%),
        linear-gradient(180deg, #1a1f3e 0%, #11162e 100%);
    border: 1px solid #2A3354;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 14px;
    position: relative;
    transition:
        transform .35s cubic-bezier(0.16, 1, 0.3, 1),
        border-color .35s ease,
        box-shadow .35s ease,
        opacity .35s ease,
        filter .8s ease;
    transform-style: preserve-3d;
    will-change: transform;
}
.ticket-card:hover {
    border-color: var(--pb-cyan);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 24px rgba(91,179,240,0.15);
    transform: translateY(-2px);
}

/* Spawn animation when a new ticket lands in the vault */
.ticket-card.fresh {
    animation: ticketFlipIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes ticketFlipIn {
    0%   { transform: perspective(800px) rotateX(-65deg) translateY(-40px); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: perspective(800px) rotateX(0)     translateY(0);     opacity: 1; }
}

/* Spawn ring pulse */
.ticket-ring {
    position: absolute; inset: -4px;
    border: 2px solid var(--pb-gold);
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    animation: ringPulse 1.6s ease-out forwards;
}
@keyframes ringPulse {
    0%   { transform: scale(0.92); opacity: 0.95; }
    100% { transform: scale(1.15); opacity: 0;    }
}

/* Hover tilt (set by JS) */
.ticket-card.tilting {
    transition: transform 0.08s ease-out, box-shadow .35s ease, border-color .35s ease;
}

/* Card header */
.ticket-hdr {
    display: flex; align-items: center;
    gap: 14px; flex-wrap: wrap;
    font-size: 12px; letter-spacing: 1.5px;
    color: var(--pb-text-dim);
    margin-bottom: 12px;
}
.ticket-id   { font-family: 'JetBrains Mono', monospace; color: var(--pb-gold); font-weight: 700; }
.ticket-draw { color: var(--pb-cyan); font-weight: 600; }
.ticket-source {
    padding: 2px 9px; border-radius: 999px;
    font-size: 10px; font-weight: 700;
    border: 1px solid #2A3354; background: var(--pb-bg);
}
.ticket-source.S6  { color: #FFB266; border-color: #FFB266; }
.ticket-source.S8  { color: #8FD7FF; border-color: #8FD7FF; }
.ticket-source.MIX { color: #C8B0FF; border-color: #C8B0FF; }

.ticket-del {
    margin-left: auto;
    background: transparent; border: 1px solid transparent;
    color: var(--pb-text-dim); cursor: pointer;
    border-radius: 8px; padding: 4px 8px;
    font-size: 14px;
    transition: all .2s ease;
}
.ticket-del:hover {
    color: var(--pb-rose); border-color: rgba(224,74,107,0.4);
    background: rgba(224,74,107,0.08);
}

/* Orbs (the six numbers) */
.ticket-orbs {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.orb {
    width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: radial-gradient(60% 100% at 50% 0%, #1f2547, #0F1431);
    border: 1.5px solid #2A3354;
    color: var(--pb-cream);
    font-family: 'JetBrains Mono', monospace;
    font-size: 17px; font-weight: 700;
    box-shadow:
        inset 0 -3px 6px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 2px 6px rgba(0,0,0,0.35);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
/* Slot-machine roll while a check is animating in */
.orb.rolling {
    color: var(--pb-gold);
    text-shadow: 0 0 6px var(--pb-gold);
}
/* Match highlights — applied once results land */
.orb.matched-main {
    color: var(--pb-cream);
    border-color: var(--pb-gold);
    background: radial-gradient(60% 100% at 50% 0%, #FFE89E, #B8860B);
    box-shadow:
        inset 0 -3px 6px rgba(0,0,0,0.4),
        0 0 18px rgba(255,216,107,0.6),
        0 0 32px rgba(255,216,107,0.3);
    transform: scale(1.08);
    animation: orbPop .5s ease;
}
.orb.matched-supp {
    color: var(--pb-bg);
    border-color: var(--pb-cyan);
    background: radial-gradient(60% 100% at 50% 0%, #BDE8FF, #5BB3F0);
    box-shadow: 0 0 14px rgba(91,179,240,0.6);
}
.orb.dimmed { opacity: 0.4; filter: grayscale(0.6); }

@keyframes orbPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.20); }
    100% { transform: scale(1.08); }
}

/* Status row */
.ticket-status {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,0.06);
}
.status-icon { font-size: 16px; }
.status-text { letter-spacing: 0.5px; }

.ticket-card.pending .status-text { color: var(--pb-cyan); }
.ticket-card.pending .status-icon { animation: pendingPulse 2s ease-in-out infinite; }
@keyframes pendingPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1.0; }
}

/* ── TIER variants ───────────────────────────────────────────────────── */

/* JACKPOT */
.ticket-card.jackpot {
    border-color: var(--pb-gold);
    background:
        radial-gradient(70% 130% at 50% 0%, rgba(255,216,107,0.20), transparent 60%),
        linear-gradient(180deg, #2a1f3e 0%, #1A1326 100%);
    box-shadow:
        0 12px 36px rgba(0,0,0,0.6),
        0 0 48px rgba(255,216,107,0.5),
        inset 0 0 20px rgba(255,216,107,0.10);
    animation: jackpotLevitate 3s ease-in-out infinite;
    transform-origin: center bottom;
}
@keyframes jackpotLevitate {
    0%, 100% { transform: translateY(0)     rotate(0); }
    50%      { transform: translateY(-6px)  rotate(0.4deg); }
}
.ticket-card.jackpot .status-text { color: var(--pb-gold); font-weight: 700; letter-spacing: 1.5px; }
.ticket-card.jackpot .status-icon { animation: trophyShake 1.4s ease-in-out infinite; }
@keyframes trophyShake {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    25%      { transform: rotate(15deg) scale(1.15); }
    75%      { transform: rotate(-15deg) scale(1.15); }
}

/* DIAMOND (5/6) */
.ticket-card.diamond {
    border-color: var(--pb-diamond);
    background:
        radial-gradient(70% 130% at 50% 0%, rgba(0,180,216,0.18), transparent 60%),
        linear-gradient(180deg, #1a263e 0%, #0E1A2E 100%);
    box-shadow:
        0 12px 32px rgba(0,0,0,0.55),
        0 0 36px rgba(0,180,216,0.45);
}
.ticket-card.diamond .status-text { color: var(--pb-diamond); font-weight: 700; }
/* Mini-lightning lines */
.ticket-card.diamond::before {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(170deg, transparent 40%, rgba(0,180,216,0.30) 50%, transparent 60%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: lightFlick 2.2s ease-in-out infinite;
}
@keyframes lightFlick {
    0%, 90%, 100% { opacity: 0; }
    5%, 8%        { opacity: 1; }
    20%, 22%      { opacity: 0.8; }
    50%, 52%      { opacity: 0.6; }
}

/* PURPLE (4/6) */
.ticket-card.purple {
    border-color: var(--pb-purple);
    background:
        radial-gradient(70% 130% at 50% 0%, rgba(179,136,235,0.18), transparent 60%),
        linear-gradient(180deg, #261e3e 0%, #18112E 100%);
    box-shadow:
        0 12px 28px rgba(0,0,0,0.55),
        0 0 32px rgba(179,136,235,0.40);
}
.ticket-card.purple::after {
    content: '';
    position: absolute; inset: 0; border-radius: 14px;
    background: conic-gradient(from 0deg, transparent, rgba(179,136,235,0.20), transparent, rgba(91,179,240,0.18), transparent);
    pointer-events: none;
    mix-blend-mode: screen;
    animation: auroraRibbon 6s linear infinite;
}
@keyframes auroraRibbon {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ticket-card.purple .status-text { color: var(--pb-purple); font-weight: 700; }

/* BRONZE (3+supp) */
.ticket-card.bronze {
    border-color: var(--pb-bronze);
    background:
        radial-gradient(70% 130% at 50% 0%, rgba(255,140,66,0.16), transparent 60%),
        linear-gradient(180deg, #3a261e 0%, #2E1A12 100%);
    box-shadow:
        0 10px 24px rgba(0,0,0,0.55),
        0 0 26px rgba(255,140,66,0.40);
}
.ticket-card.bronze::before {
    content: '';
    position: absolute; inset: -2px; border-radius: 14px;
    background: linear-gradient(90deg, transparent, var(--pb-bronze) 50%, transparent);
    background-size: 200% 100%;
    -webkit-mask:
        linear-gradient(#000, #000) content-box,
        linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 2px;
    animation: bronzeFlame 2.2s linear infinite;
    pointer-events: none;
}
@keyframes bronzeFlame {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.ticket-card.bronze .status-text { color: var(--pb-bronze); font-weight: 700; }

/* SPARK (3/6 only) */
.ticket-card.spark {
    border-color: var(--pb-spark);
    background:
        radial-gradient(70% 130% at 50% 0%, rgba(255,214,10,0.10), transparent 60%),
        linear-gradient(180deg, #2A2410 0%, #1E1A08 100%);
    box-shadow:
        0 10px 20px rgba(0,0,0,0.5),
        0 0 20px rgba(255,214,10,0.32);
}
.ticket-card.spark .status-text { color: var(--pb-spark); font-weight: 600; }

/* DEAD (<3) */
.ticket-card.dead {
    border-color: #3a3a3a;
    background: linear-gradient(180deg, #1A1A1A 0%, #0E0E0E 100%);
    filter: grayscale(0.85) brightness(0.78);
    opacity: 0.78;
    transform: translateY(2px);
}
.ticket-card.dead .status-text { color: var(--pb-dead); font-style: italic; }
.ticket-card.dead .orb { filter: grayscale(0.8); }

/* Stamp that lands on the ticket */
.ticket-stamp {
    position: absolute;
    top: 50%; right: 20px;
    transform: translateY(-50%) rotate(-12deg) scale(2);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px; font-weight: 700;
    letter-spacing: 4px;
    padding: 4px 14px;
    border: 3px solid currentColor;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    animation: stampLand 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes stampLand {
    0%   { transform: translateY(-50%) rotate(-12deg) scale(3); opacity: 0; }
    60%  { transform: translateY(-50%) rotate(-12deg) scale(0.9); opacity: 1; }
    100% { transform: translateY(-50%) rotate(-12deg) scale(1);  opacity: 0.85; }
}
.ticket-stamp.jackpot { color: var(--pb-gold);    border-color: var(--pb-gold);   text-shadow: 0 0 12px var(--pb-gold);   }
.ticket-stamp.diamond { color: var(--pb-diamond); border-color: var(--pb-diamond);}
.ticket-stamp.purple  { color: var(--pb-purple);  border-color: var(--pb-purple); }
.ticket-stamp.bronze  { color: var(--pb-bronze);  border-color: var(--pb-bronze); }
.ticket-stamp.spark   { color: var(--pb-spark);   border-color: var(--pb-spark);  }
.ticket-stamp.dead    { color: var(--pb-dead);    border-color: var(--pb-dead); opacity: 0.6; }


/* ─────────────────────────────────────────────────────────────────────────
   CINEMATIC OVERLAY (winning reveal)
   ─────────────────────────────────────────────────────────────────────── */
.vault-overlay {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 1000;
}

/* Scan beam — cyan laser sweeping top to bottom of the vault */
.vault-scanbeam {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg,
        transparent, var(--pb-cyan), #BDE8FF, var(--pb-cyan), transparent);
    box-shadow: 0 0 20px var(--pb-cyan), 0 0 60px var(--pb-cyan);
    opacity: 0;
}
.vault-scanbeam.active {
    animation: scanSweep 1.4s linear forwards;
}
@keyframes scanSweep {
    0%   { top: -10px; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Screen-wide gold flash (jackpot) */
.vault-screen-flash {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,216,107,0.55), transparent 60%);
    opacity: 0;
    mix-blend-mode: screen;
}
.vault-screen-flash.active {
    animation: screenFlash 1.4s ease-out forwards;
}
@keyframes screenFlash {
    0%   { opacity: 0; }
    10%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Vault doors that burst open (just edge glows that fly outward) */
.vault-doors-l, .vault-doors-r {
    position: absolute; top: 0; bottom: 0;
    width: 50vw;
    background: linear-gradient(90deg,
        rgba(255,216,107,0.0) 0%,
        rgba(255,216,107,0.0) 75%,
        var(--pb-gold-deep) 92%,
        var(--pb-gold) 100%);
    opacity: 0;
    pointer-events: none;
}
.vault-doors-r {
    right: 0;
    background: linear-gradient(270deg,
        rgba(255,216,107,0.0) 0%,
        rgba(255,216,107,0.0) 75%,
        var(--pb-gold-deep) 92%,
        var(--pb-gold) 100%);
}
.vault-doors-l.bursting { animation: doorL 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.vault-doors-r.bursting { animation: doorR 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes doorL {
    0%   { transform: translateX(0);     opacity: 0; }
    20%  { transform: translateX(0);     opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}
@keyframes doorR {
    0%   { transform: translateX(0);    opacity: 0; }
    20%  { transform: translateX(0);    opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* Confetti & fireworks containers */
.vault-confetti, .vault-fireworks {
    position: absolute; inset: 0;
    pointer-events: none;
}
.confetti-piece {
    position: absolute;
    width: 10px; height: 14px;
    border-radius: 2px;
    opacity: 0;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0%   { transform: translateY(-10vh) rotate(0); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 1; }
}

.firework-burst {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--pb-gold), transparent 70%);
    animation: fireworkBurst 1.1s ease-out forwards;
}
@keyframes fireworkBurst {
    0%   { transform: scale(0);  opacity: 1; }
    100% { transform: scale(32); opacity: 0; }
}

/* Lightning (DIAMOND tier) */
.vault-lightning {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
}
.vault-lightning.active { animation: lightningFlash 1.6s ease-out forwards; }
@keyframes lightningFlash {
    0%   { opacity: 0; }
    5%   { opacity: 1; }
    15%  { opacity: 0.2; }
    25%  { opacity: 1; }
    40%  { opacity: 0.4; }
    60%  { opacity: 0.9; }
    100% { opacity: 0; }
}
.vault-lightning path {
    stroke: var(--pb-diamond);
    stroke-width: 0.5;
    fill: none;
    filter: drop-shadow(0 0 6px var(--pb-cyan));
}

/* Aurora ribbon (PURPLE tier) */
.vault-aurora {
    position: absolute; inset: 0;
    background: conic-gradient(from 0deg at 50% 50%,
        transparent, rgba(179,136,235,0.4), transparent,
        rgba(91,179,240,0.3), transparent);
    opacity: 0; mix-blend-mode: screen;
    pointer-events: none;
}
.vault-aurora.active { animation: auroraBurst 2.5s ease-out forwards; }
@keyframes auroraBurst {
    0%   { opacity: 0; transform: scale(0.4) rotate(0); }
    40%  { opacity: 0.7; }
    100% { opacity: 0; transform: scale(2) rotate(360deg); }
}

/* JACKPOT central stamp */
.vault-stamp {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(3) rotate(-8deg);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 80px; font-weight: 700;
    letter-spacing: 8px;
    color: var(--pb-gold);
    text-shadow:
        0 0 24px var(--pb-gold),
        0 0 48px var(--pb-gold-deep),
        0 4px 0  rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
}
.vault-stamp.active { animation: stampSlam 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes stampSlam {
    0%   { transform: translate(-50%, -50%) scale(8)  rotate(-8deg); opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(0.9) rotate(-8deg); opacity: 1; }
    50%  { transform: translate(-50%, -50%) scale(1)   rotate(-8deg); opacity: 1; }
    80%  { transform: translate(-50%, -50%) scale(1)   rotate(-8deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2) rotate(-8deg); opacity: 0; }
}


/* ─────────────────────────────────────────────────────────────────────────
   Page enter / leave (subtle slide so the page transition feels alive)
   ─────────────────────────────────────────────────────────────────────── */
.page-punter.page-enter {
    animation: punterEnter 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes punterEnter {
    0%   { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(6px); }
    100% { opacity: 1; transform: translateY(0)    scale(1);     filter: blur(0);   }
}


/* =============================================================================
   🎫 Punter Data Range Strip
   First + Latest draw on file. Sits between the punter-hero and the action
   panels, giving the user an at-a-glance "what does the engine know about?"
   ============================================================================= */

.punter-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: center;
    margin: 14px 0 22px 0;
    padding: 16px 22px;
    background: linear-gradient(135deg,
        rgba(20, 16, 45, 0.65),
        rgba(8, 6, 24, 0.75));
    border-radius: 14px;
    box-shadow:
        0 0 24px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(176, 149, 245, 0.12);
}

.punter-range-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.punter-range-cell.prng-latest {
    text-align: right;
    align-items: flex-end;
}

.prng-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: rgba(220, 220, 240, 0.55);
}

.prng-value {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.prng-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 600;
    color: #ffd86b;
    text-shadow: 0 0 16px rgba(255, 216, 107, 0.4);
    line-height: 1;
}
.prng-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: rgba(220, 220, 240, 0.75);
}

.punter-range-spacer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.punter-range-arrow {
    font-size: 24px;
    color: rgba(176, 149, 245, 0.7);
    text-shadow: 0 0 14px rgba(176, 149, 245, 0.45);
    animation: prngArrow 3s ease-in-out infinite;
}
@keyframes prngArrow {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50%      { transform: translateX(4px); opacity: 1.0; }
}
.punter-range-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.6);
    padding: 3px 10px;
    background: rgba(176, 149, 245, 0.12);
    border-radius: 12px;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .punter-range { grid-template-columns: 1fr; gap: 12px; }
    .punter-range-cell.prng-latest { text-align: left; align-items: flex-start; }
    .punter-range-spacer { flex-direction: row; }
}


/* =============================================================================
   📤  UPLOAD CARD + RESULT MODAL
   ============================================================================= */

.upload-desc {
    color: rgba(220, 220, 240, 0.65);
    font-size: 12px;
    line-height: 1.5;
    margin: 4px 0 12px 0;
}

.upload-drop {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 2px dashed rgba(176, 149, 245, 0.35);
    border-radius: 14px;
    background: rgba(20, 16, 45, 0.45);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.upload-drop:hover, .upload-drop.dragover {
    background: rgba(40, 32, 80, 0.6);
    border-color: rgba(255, 216, 107, 0.55);
    transform: translateY(-1px);
}
.upload-drop-glyph {
    font-size: 32px;
    filter: drop-shadow(0 0 8px rgba(255, 216, 107, 0.4));
}
.upload-drop-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: rgba(240, 240, 255, 0.85);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}
.upload-drop-text strong { color: #ffd86b; }
.upload-drop-text small {
    color: rgba(180, 180, 220, 0.55);
    font-size: 11px;
}

.upload-actions { display: flex; gap: 10px; margin-top: 12px; }
.upload-run-btn {
    background: linear-gradient(135deg, #ffd86b, #d99e4b);
    color: #2a1a08;
    border: none;
    border-radius: 22px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 0 22px rgba(255, 216, 107, 0.4);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
}
.upload-run-btn:hover { transform: translateY(-1px); box-shadow: 0 0 32px rgba(255, 216, 107, 0.6); }
.upload-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.upload-clear-btn {
    background: rgba(60, 50, 100, 0.6);
    color: rgba(240, 240, 255, 0.85);
    border: 1px solid rgba(120, 110, 220, 0.25);
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
}

.upload-preview {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(10, 8, 24, 0.55);
    border-left: 3px solid #ffd86b;
    border-radius: 0 8px 8px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.85);
    max-height: 140px;
    overflow: auto;
}
.upload-prev-line { padding: 2px 0; }
.upload-msg {
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 100, 100, 0.85);
    min-height: 14px;
}
.upload-msg.ok { color: rgba(120, 220, 130, 0.95); }

.upload-modal { position: fixed; inset: 0; z-index: 9200; display: none; align-items: center; justify-content: center; }
.upload-modal.show { display: flex; }
.upload-modal[hidden] { display: none !important; }
.upload-modal-backdrop {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(10, 5, 25, 0.85), rgba(2, 2, 8, 0.96));
    backdrop-filter: blur(6px);
}
.upload-modal-shell {
    position: relative;
    width: min(960px, 95vw);
    max-height: 90vh;
    background: linear-gradient(180deg, rgba(20, 16, 50, 0.97), rgba(8, 6, 22, 0.99));
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(176, 149, 245, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.upload-modal-head {
    padding: 22px 28px 14px 28px;
    border-bottom: 1px solid rgba(176, 149, 245, 0.15);
    position: sticky; top: 0; z-index: 5;
    background: linear-gradient(180deg, rgba(28, 22, 55, 0.95), rgba(20, 16, 50, 0.98));
    flex-shrink: 0;
}
.upload-modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    color: #ffd86b;
    text-shadow: 0 0 12px rgba(255, 216, 107, 0.4);
}
.upload-modal-sub {
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.55);
}
.upload-modal-close {
    position: absolute; top: 18px; right: 20px;
    width: 32px; height: 32px;
    background: rgba(255, 100, 100, 0.18);
    color: #ff8aa6;
    border: 1px solid rgba(255, 138, 166, 0.4);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
}
.upmod-pdf-btn {
    position: absolute; top: 18px; right: 64px;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(255,216,107,0.24), rgba(200,150,50,0.14));
    border: 1px solid rgba(255,216,107,0.5);
    border-radius: 999px;
    color: #fff5d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s ease;
}
.upmod-pdf-btn:hover { box-shadow: 0 0 16px rgba(255,216,107,0.4); transform: translateY(-1px); }
.upmod-pdf-btn:disabled { opacity: 0.5; cursor: wait; }
.upmod-pdf-icon { font-size: 13px; }
.upmod-msg {
    padding: 0 28px;
    font-size: 11px; color: rgba(220,220,240,0.6);
    min-height: 0;
    transition: min-height 0.2s ease;
}
.upmod-msg:not(:empty) { min-height: 20px; padding-bottom: 6px; }
.upmod-msg.is-ok    { color: #6ee7a4; }
.upmod-msg.is-error { color: #ff9a9a; }
.upmod-msg.is-busy  { color: #ffd66a; font-style: italic; }

@media (max-width: 640px) {
    .upmod-pdf-btn { position: static; margin-top: 10px; }
    .upload-modal-close { top: 22px; }
}
.upload-modal-body {
    flex: 1; overflow-y: auto;
    padding: 18px 28px 28px 28px;
    color: rgba(220, 220, 240, 0.92);
}

.upmod-verdict {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(28, 22, 55, 0.6), rgba(10, 8, 24, 0.75));
    border-radius: 10px;
    border-left: 4px solid #ffd86b;
    margin-bottom: 18px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 18px;
    color: rgba(245, 240, 255, 0.92);
    line-height: 1.5;
}
.upmod-verdict[data-tone="amber"] { border-left-color: #ffaa33; }
.upmod-verdict[data-tone="blue"]  { border-left-color: #6bbcff; }

.upmod-section { margin-bottom: 22px; }
.upmod-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(220, 220, 240, 0.6);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(176, 149, 245, 0.15);
}
.upmod-overall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.upmod-stat {
    background: rgba(28, 22, 55, 0.45);
    border-radius: 10px;
    padding: 10px 14px;
}
.upmod-stat .stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(220, 220, 240, 0.55);
}
.upmod-stat .stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    color: #ffd86b;
    margin-top: 4px;
}
.upmod-stat .stat-sub {
    font-size: 10px;
    color: rgba(180, 180, 220, 0.5);
    margin-top: 2px;
}

.upmod-set-card {
    background: rgba(18, 14, 40, 0.6);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-left: 3px solid rgba(176, 149, 245, 0.4);
}
.upmod-set-head {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.upmod-set-idx {
    font-family: 'JetBrains Mono', monospace;
    color: rgba(180, 180, 220, 0.6);
    font-size: 11px;
}
.upmod-set-balls { display: flex; gap: 5px; }
.upmod-set-ball {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #c8a8ff, #7a5fd0);
    color: #1a1428;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 11px;
}
.upmod-set-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.75);
}
.upmod-set-style {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(176, 149, 245, 0.12);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: #ffd86b;
}

.upmod-empty {
    text-align: center;
    color: rgba(180, 180, 220, 0.4);
    font-style: italic;
    padding: 30px;
}

.upmod-pair-list { display: flex; flex-wrap: wrap; gap: 6px; }
.upmod-pair {
    background: rgba(30, 24, 58, 0.55);
    border: 1px solid rgba(176, 149, 245, 0.18);
    border-radius: 16px;
    padding: 4px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.85);
}
.upmod-pair strong { color: #ffd86b; }


/* ════════════════════════════════════════════════════════════════════════
   🎴 TELL-TALE TABLE  ·  the headline 5-set fusion / FinalScore panel
   Sits at the very top of the upload-analysis modal.
   ════════════════════════════════════════════════════════════════════════ */

.tt-wrap {
    background: linear-gradient(180deg, rgba(28, 22, 55, 0.55), rgba(10, 8, 24, 0.35));
    border: 1px solid rgba(255, 216, 107, 0.20);
    border-radius: 14px;
    padding: 18px 20px 22px;
    margin-bottom: 26px;
    box-shadow:
        0 0 24px rgba(255, 216, 107, 0.06),
        inset 0 1px 0 rgba(255, 216, 107, 0.10);
}
.tt-title {
    display: flex; align-items: baseline; gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.tt-glyph { font-size: 22px; }
.tt-title-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: #ffd86b;
    letter-spacing: 0.02em;
    font-weight: 600;
}
.tt-title-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(220, 220, 240, 0.5);
}
.tt-caption {
    font-size: 12px;
    color: rgba(220, 220, 240, 0.65);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 216, 107, 0.15);
    font-style: italic;
}

/* ── Per-set rows ──────────────────────────────────────────────────── */
.tt-rows { display: flex; flex-direction: column; gap: 12px; }

.tt-row {
    background: rgba(18, 14, 40, 0.55);
    border-radius: 12px;
    border-left: 3px solid rgba(255, 216, 107, 0.4);
    padding: 14px 16px 12px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tt-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 22px rgba(255, 216, 107, 0.10);
}
.tt-row.rank-1 {
    border-left-color: #ffd86b;
    background:
        linear-gradient(135deg, rgba(255, 216, 107, 0.06), transparent 60%),
        rgba(18, 14, 40, 0.65);
}
.tt-row.rank-1::before {
    content: "★";
    position: absolute;
    top: 8px; right: 12px;
    color: #ffd86b;
    font-size: 14px;
    opacity: 0.7;
}

/* Role accent stripes (left border tint) */
.tt-row[data-role="stabiliser"]      { border-left-color: #6bbcff; }
.tt-row[data-role="precision_blade"] { border-left-color: #ff9560; }
.tt-row[data-role="classic_balance"] { border-left-color: #c8a8ff; }
.tt-row[data-role="whisper"]         { border-left-color: #88e0c0; }
.tt-row[data-role="wildcard"]        { border-left-color: #ff6f8e; }
.tt-row.rank-1                       { border-left-color: #ffd86b; }

/* Row head: rank + balls + FinalScore */
.tt-row-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 10px;
}
.tt-rank-block {
    display: flex; flex-direction: column;
    align-items: center;
    min-width: 56px;
}
.tt-rank {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    color: #ffd86b;
    line-height: 1;
}
.tt-set-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(180, 180, 220, 0.5);
    margin-top: 2px;
    letter-spacing: 0.06em;
}
.tt-balls {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.tt-ball {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ffd86b, #c89a2b);
    color: #1a1428;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.tt-score-block {
    min-width: 110px;
    text-align: right;
}
.tt-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 26px;
    color: #ffd86b;
    line-height: 1;
}
.tt-score-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(220, 220, 240, 0.5);
    margin-top: 3px;
}
.tt-score-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.tt-score-fill {
    height: 100%;
    background: linear-gradient(90deg, #c89a2b, #ffd86b);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* Chips: role / stability / volatility / momentum / sum */
.tt-row-meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 6px;
}
.tt-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(30, 24, 58, 0.6);
    border: 1px solid rgba(176, 149, 245, 0.18);
    color: rgba(220, 220, 240, 0.85);
    letter-spacing: 0.02em;
}
.tt-chip.role {
    background: rgba(255, 216, 107, 0.12);
    border-color: rgba(255, 216, 107, 0.35);
    color: #ffd86b;
}
.tt-chip.stab[data-level="high"]   { color: #88e0c0; border-color: rgba(136, 224, 192, 0.30); }
.tt-chip.stab[data-level="medium"] { color: #c8a8ff; border-color: rgba(200, 168, 255, 0.25); }
.tt-chip.stab[data-level="low"]    { color: #ff9560; border-color: rgba(255, 149, 96, 0.25); }
.tt-chip.vol[data-level="low"]        { color: #88e0c0; border-color: rgba(136, 224, 192, 0.30); }
.tt-chip.vol[data-level="controlled"] { color: #c8a8ff; }
.tt-chip.vol[data-level="moderate"]   { color: #ffaa55; }
.tt-chip.vol[data-level="high"]       { color: #ff6f8e; border-color: rgba(255, 111, 142, 0.30); }
.tt-chip.mom.mom-up   { color: #88e0c0; border-color: rgba(136, 224, 192, 0.30); }
.tt-chip.mom.mom-down { color: #ff6f8e; border-color: rgba(255, 111, 142, 0.30); }
.tt-chip.mom.mom-flat { color: rgba(220, 220, 240, 0.7); }
.tt-chip.sum {
    color: rgba(180, 180, 220, 0.85);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 12px;
}

.tt-row-blurb {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13.5px;
    color: rgba(220, 220, 240, 0.75);
    margin: 6px 0 10px;
    padding-left: 4px;
    opacity: 0.85;
}

/* ── Prize-tier matrix per row ─────────────────────────────────────── */
.tt-matrix {
    background: rgba(10, 8, 24, 0.45);
    border-radius: 8px;
    padding: 8px 10px 10px;
    margin-top: 6px;
}
.tt-tier-header, .tt-tier-row {
    display: grid;
    grid-template-columns: 80px repeat(4, 1fr) 130px;
    gap: 6px;
    align-items: center;
    padding: 3px 0;
}
.tt-tier-header {
    border-bottom: 1px solid rgba(255, 216, 107, 0.12);
    margin-bottom: 4px;
}
.tt-tier-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(220, 220, 240, 0.55);
}
.tt-tier-cell {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    text-align: center;
    padding: 4px 0;
    border-radius: 4px;
    color: rgba(220, 220, 240, 0.85);
    background: rgba(30, 24, 58, 0.35);
}
.tt-tier-cell.head {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(220, 220, 240, 0.55);
    background: transparent;
    padding: 2px 0;
}
.tt-tier-cell.head.gold,
.tt-tier-cell.gold {
    color: #ffd86b;
}
.tt-tier-cell.zero {
    color: rgba(180, 180, 220, 0.3);
    background: transparent;
}
.tt-tier-cell.hit {
    background: rgba(200, 168, 255, 0.15);
    color: #c8a8ff;
    font-weight: 700;
}
.tt-tier-cell.gold:not(.zero):not(.head) {
    background: linear-gradient(135deg, rgba(255, 216, 107, 0.30), rgba(200, 154, 43, 0.20));
    color: #ffd86b;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(255, 216, 107, 0.30);
    animation: tt-gold-pulse 2.4s ease-in-out infinite;
}
@keyframes tt-gold-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 216, 107, 0.30); }
    50%      { box-shadow: 0 0 18px rgba(255, 216, 107, 0.55); }
}
.tt-tier-totals {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-align: right;
    color: rgba(220, 220, 240, 0.75);
    display: flex; gap: 8px; justify-content: flex-end;
    flex-wrap: wrap;
}
.tt-tier-totals.head { font-size: 9px; opacity: 0.5; }
.tt-wins {
    color: #ffd86b;
    font-weight: 700;
}
.tt-nearmiss {
    color: rgba(255, 170, 85, 0.85);
    font-size: 10px;
    font-style: italic;
}
.tt-best {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 216, 107, 0.10);
    font-size: 11px;
    color: rgba(220, 220, 240, 0.6);
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}
.tt-best strong { color: #ffd86b; }


/* ════════════════════════════════════════════════════════════════════════
   🪬 HARMONICS & CANCELLATIONS MATRIX
   ════════════════════════════════════════════════════════════════════════ */

.hm-wrap {
    background: linear-gradient(180deg, rgba(18, 14, 40, 0.50), rgba(10, 8, 24, 0.35));
    border-radius: 12px;
    padding: 14px 18px 18px;
    margin-top: 18px;
    border: 1px solid rgba(176, 149, 245, 0.18);
}
.hm-caption {
    font-size: 11px;
    color: rgba(220, 220, 240, 0.55);
    margin-bottom: 12px;
    font-style: italic;
}
.hm-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}
.hm-matrix th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #ffd86b;
    padding: 6px;
    text-align: center;
    font-weight: 600;
}
.hm-matrix th.hm-row-head {
    text-align: right;
    color: #ffd86b;
    padding-right: 10px;
}
.hm-cell {
    text-align: center;
    padding: 8px 6px;
    border-radius: 6px;
    min-width: 70px;
    background: rgba(30, 24, 58, 0.45);
    transition: transform 0.15s ease;
}
.hm-cell:hover { transform: scale(1.05); }
.hm-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: rgba(220, 220, 240, 0.95);
}
.hm-lbl {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    opacity: 0.75;
    margin-top: 2px;
}
.hm-perfect {
    background: linear-gradient(135deg, rgba(136, 224, 192, 0.35), rgba(136, 224, 192, 0.10));
    box-shadow: 0 0 10px rgba(136, 224, 192, 0.25);
}
.hm-perfect .hm-val, .hm-perfect .hm-lbl { color: #88e0c0; }
.hm-strong  { background: rgba(136, 224, 192, 0.18); }
.hm-strong .hm-val, .hm-strong .hm-lbl   { color: #a4ecd0; }
.hm-medium  { background: rgba(200, 168, 255, 0.16); }
.hm-medium .hm-val, .hm-medium .hm-lbl   { color: #c8a8ff; }
.hm-weak    { background: rgba(255, 170, 85, 0.18); }
.hm-weak .hm-val, .hm-weak .hm-lbl       { color: #ffaa55; }
.hm-cancel  { background: rgba(255, 111, 142, 0.18); }
.hm-cancel .hm-val, .hm-cancel .hm-lbl   { color: #ff6f8e; }
.hm-diag {
    color: rgba(180, 180, 220, 0.25);
    font-size: 18px;
}


/* ════════════════════════════════════════════════════════════════════════
   ⭐ FINAL INTERPRETATION  ·  fusion recommendations
   ════════════════════════════════════════════════════════════════════════ */

.rec-wrap {
    background: linear-gradient(180deg, rgba(255, 216, 107, 0.04), rgba(10, 8, 24, 0.45));
    border-radius: 12px;
    padding: 14px 18px 18px;
    margin-top: 18px;
    border: 1px solid rgba(255, 216, 107, 0.22);
}
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}
.rec-card {
    background: rgba(18, 14, 40, 0.55);
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid rgba(255, 216, 107, 0.6);
}
.rec-head {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    color: #ffd86b;
    margin-bottom: 8px;
    display: flex; align-items: baseline; gap: 8px;
}
.rec-icon { font-size: 18px; }
.rec-body {
    font-size: 12px;
    color: rgba(220, 220, 240, 0.78);
    line-height: 1.55;
    margin-bottom: 10px;
}
.rec-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 216, 107, 0.12);
    color: #ffd86b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    margin-right: 4px;
    margin-bottom: 2px;
}
.rec-pill.syn-perfect { background: rgba(136, 224, 192, 0.18); color: #88e0c0; }
.rec-pill.syn-strong  { background: rgba(136, 224, 192, 0.14); color: #a4ecd0; }
.rec-pill.syn-medium  { background: rgba(200, 168, 255, 0.16); color: #c8a8ff; }
.rec-pill.syn-weak    { background: rgba(255, 170, 85, 0.14); color: #ffaa55; }
.rec-pill.syn-cancels { background: rgba(255, 111, 142, 0.16); color: #ff6f8e; }

.rec-sets {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 216, 107, 0.12);
}
.rec-set {
    display: flex; flex-direction: column; gap: 4px;
    padding: 4px 8px;
    background: rgba(30, 24, 58, 0.5);
    border-radius: 6px;
}
.rec-set-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(180, 180, 220, 0.55);
}
.rec-set-balls { display: flex; gap: 3px; flex-wrap: wrap; }
.rec-ball {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd86b, #c89a2b);
    color: #1a1428;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
}
.rec-plus {
    font-size: 18px;
    color: rgba(255, 216, 107, 0.6);
    font-family: 'Cormorant Garamond', serif;
}

/* Error state */
.tt-error {
    color: rgba(255, 111, 142, 0.85);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    padding: 12px;
    background: rgba(255, 111, 142, 0.08);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 111, 142, 0.5);
}

/* Mobile narrow */
@media (max-width: 640px) {
    .tt-row-head {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .tt-score-block { text-align: left; }
    .tt-tier-header, .tt-tier-row {
        grid-template-columns: 70px repeat(4, 1fr);
        gap: 4px;
    }
    .tt-tier-totals { display: none; }
}


/* =============================================================================
   ✍️ MANUAL ENTRY MODAL — type up to 5 sets, no Excel needed
   ============================================================================= */
.manual-entry-card { border-color: rgba(176, 149, 245, 0.28) !important; }
.manual-entry-shell { width: min(720px, 95vw); }

.manual-entry-toggle {
    display: flex; gap: 10px; margin-bottom: 18px;
}

.manual-entry-rows {
    display: flex; flex-direction: column; gap: 14px;
    margin-bottom: 18px;
}
.manual-entry-row {
    display: flex; align-items: center; gap: 14px;
}
.manual-entry-row-label {
    flex: 0 0 52px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 1px;
    color: var(--pb-text-dim);
    text-transform: uppercase;
}
.manual-num-boxes .num-box { width: 44px; height: 44px; font-size: 16px; }

/* ── O-mikuji checkbox — shared, deliberately eye-catching so it's never
   missed (manual entry AND spreadsheet-upload panels both use this) ──── */
.omikuji-check {
    position: relative;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(176, 149, 245, 0.16), transparent 60%),
        linear-gradient(135deg, rgba(255,216,107,0.10), rgba(176,149,245,0.10));
    border: 1.5px solid rgba(200, 170, 255, 0.45);
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 0 0 rgba(200,170,255,0);
    animation: omikujiGlow 3.2s ease-in-out infinite;
    overflow: hidden;
}
.omikuji-check::before {
    content: '';
    position: absolute; top: 0; left: -150%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
    transform: skewX(-12deg);
    animation: cardShimmer 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes omikujiGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(176,149,245,0.15), inset 0 1px 0 rgba(255,255,255,0.04); border-color: rgba(200,170,255,0.4); }
    50%      { box-shadow: 0 0 26px rgba(200,170,255,0.4),  inset 0 1px 0 rgba(255,255,255,0.08); border-color: rgba(230,200,255,0.7); }
}
.omikuji-check-glyph {
    font-size: 30px; line-height: 1; flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(200,170,255,0.55));
    animation: glyphFloat 3.5s ease-in-out infinite;
}
.omikuji-check-text { flex: 1; }
.omikuji-check-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px; font-weight: 700;
    color: #fff5ff;
    letter-spacing: 0.3px;
}
.omikuji-check-sub {
    font-size: 12px; color: var(--pb-text-dim); font-style: italic;
    margin-top: 2px;
}
.omikuji-check input {
    width: 22px; height: 22px; flex-shrink: 0;
    accent-color: var(--pb-purple); cursor: pointer;
}

.manual-entry-actions { display: flex; gap: 12px; margin-bottom: 4px; }


/* =============================================================================
   🎡 WHEEL OF FORTUNE — the o-mikuji spin
   ============================================================================= */
.wheel-overlay {
    position: fixed; inset: 0; z-index: 9400;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
}
.wheel-overlay.show { opacity: 1; pointer-events: all; }
.wheel-overlay[hidden] { display: none !important; }
.wheel-backdrop {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(20, 10, 35, 0.92), rgba(2, 2, 8, 0.97));
    backdrop-filter: blur(6px);
}

.wheel-stage {
    position: relative; z-index: 1;
    width: 320px; height: 320px;
    display: flex; align-items: center; justify-content: center;
}
.wheel-pointer {
    position: absolute; top: -14px; left: 50%;
    transform: translateX(-50%);
    font-size: 28px; color: var(--pb-gold);
    text-shadow: 0 0 12px rgba(255, 216, 107, 0.7);
    z-index: 3;
}
.wheel-svg { width: 300px; height: 300px; filter: drop-shadow(0 8px 30px rgba(0,0,0,0.6)); }
.wheel-hub {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 46px; height: 46px; border-radius: 50%;
    background: radial-gradient(circle, #2a1f3e, #14101f);
    border: 2px solid var(--pb-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 20px rgba(255, 216, 107, 0.4);
    z-index: 2;
}

.wheel-spark {
    position: absolute; top: 50%; left: 50%;
    width: 6px; height: 6px; border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: wheelSparkFly 1.3s ease-out forwards;
    pointer-events: none;
    z-index: 4;
}
@keyframes wheelSparkFly {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); opacity: 0; }
}

.wheel-result {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(10, 6, 20, 0.92), rgba(4, 2, 10, 0.98));
    border-radius: 50%;
    opacity: 0; transform: scale(0.85);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
    padding: 20px;
}
.wheel-result.reveal { opacity: 1; transform: scale(1); }
.wheel-result[hidden] { display: none !important; }
.wheel-result-kanji {
    font-family: 'Cormorant Garamond', serif;
    font-size: 56px; font-weight: 700;
    color: var(--pb-gold-deep);
    text-shadow: 0 0 24px rgba(255, 216, 107, 0.6);
}
.wheel-result-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--pb-cream);
}
.wheel-result-verse {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 14px; line-height: 1.5;
    color: var(--pb-text);
    max-width: 220px;
    margin: 4px 0 8px;
}
.wheel-continue-btn {
    padding: 8px 18px;
    background: linear-gradient(180deg, rgba(255,216,107,0.28), rgba(200,150,50,0.16));
    border: 1px solid rgba(255,216,107,0.55);
    border-radius: 999px;
    color: #fff5d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s ease;
}
.wheel-continue-btn:hover { box-shadow: 0 0 18px rgba(255,216,107,0.4); }

@media (max-width: 480px) {
    .wheel-stage { width: 280px; height: 280px; }
    .wheel-svg { width: 260px; height: 260px; }
    .manual-entry-row { flex-wrap: wrap; }
}
