/* ===========================================================================
   Gotya design system — clean, modern, collectible. Dark-first with rarity hues.
   =========================================================================== */
:root {
    --bg: #0b0d12;
    --bg-elev: #12151d;
    --bg-card: #161a24;
    --bg-card-2: #1c2130;
    --border: #262c3a;
    --border-soft: #1e2430;
    --text: #e8ebf2;
    --text-dim: #9aa3b5;
    --text-faint: #8b93a6; /* lifted from #6b7385 to clear WCAG AA (4.5:1) on --bg */
    --primary: #6c5cff;
    --primary-d: #5546e8;
    --accent: #21d4a8;
    --danger: #ef4444;
    --warn: #f59e0b;
    --ok: #22c55e;

    --common: #9ca3af;
    --uncommon: #22c55e;
    --rare: #3b82f6;
    --epic: #a855f7;
    --legendary: #f59e0b;
    --grail: #ef4444;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
    --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: radial-gradient(1200px 600px at 50% -200px, #171a26 0%, var(--bg) 60%) fixed;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
p { color: var(--text-dim); }
small { color: var(--text-faint); }

/* ===========================================================================
   App shell — left sidebar + thin topbar (Courtyard-style)
   =========================================================================== */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 22px 28px 90px; }
.app-content .page { max-width: none; margin: 0; padding: 0 0 20px; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--bg-elev); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; padding: 16px 14px; z-index: 60; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 14px; }
.sb-brand { display: flex; align-items: center; }
.sb-logo-full { height: 32px; width: auto; max-width: 160px; display: block; }
.sb-logo-icon { height: 30px; width: 30px; object-fit: contain; display: none; }
.app-shell.collapsed .sb-logo-full { display: none; }
.app-shell.collapsed .sb-logo-icon { display: block; }
.sb-collapse { background: none; border: none; color: var(--text-faint); font-size: 1.1rem; cursor: pointer; border-radius: 6px; width: 26px; height: 26px; }
.sb-collapse:hover { background: var(--bg-card-2); color: var(--text); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-dim); font-weight: 500; font-size: .94rem; position: relative; transition: background .14s, color .14s; }
.sb-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sb-link:hover { background: var(--bg-card-2); color: var(--text); }
.sb-link.active { background: linear-gradient(100deg, rgba(108,92,255,.22), rgba(108,92,255,.08)); color: #fff; }
.sb-link.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.sb-link.sb-admin { color: #b9adff; }
.sb-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; font-style: normal; padding: 1px 7px; border-radius: 100px; min-width: 18px; text-align: center; }
.sb-sep { height: 1px; background: var(--border-soft); margin: 10px 8px; }
.sb-bottom { padding: 12px 6px 4px; }
.sb-wallet { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.sb-wallet-label { color: var(--text-faint); font-size: .8rem; }
.sb-wallet-amt { font-weight: 800; color: var(--accent); }
.sb-cta { }

/* Collapsed sidebar (icons only) */
.app-shell.collapsed { grid-template-columns: 76px 1fr; }
.app-shell.collapsed .sb-brand span,
.app-shell.collapsed .sb-link span,
.app-shell.collapsed .sb-badge,
.app-shell.collapsed .sb-wallet-label,
.app-shell.collapsed .sb-bottom .btn { display: none; }
.app-shell.collapsed .sb-brand { font-size: 1.1rem; }
.app-shell.collapsed .sb-link { justify-content: center; padding: 11px 0; }
.app-shell.collapsed .sb-wallet { justify-content: center; padding: 10px 0; }

/* Thin topbar inside the main column */
.app-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(11,13,18,.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-soft); }
.topbar-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-dim); border: 1px solid var(--border-soft); }
.topbar-icon:hover { color: var(--text); border-color: var(--text-faint); }
.topbar-dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 100px; background: var(--danger); color: #fff; font-size: .64rem; font-weight: 800; font-style: normal; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.sb-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.sb-overlay { display: none; }

/* ---- Top bar (admin keeps the classic bar) ------------------------------ */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(11,13,18,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-soft); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 12px 20px; }
.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; }
.brand span { color: var(--primary); }
.mainnav { display: flex; gap: 22px; flex: 1; }
.mainnav a { color: var(--text-dim); font-weight: 500; font-size: .94rem; transition: color .15s; }
.mainnav a:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.wallet-pill, .points-pill { background: var(--bg-card); border: 1px solid var(--border); border-radius: 100px; padding: 7px 14px; font-weight: 600; font-size: .86rem; }
.wallet-pill { color: var(--accent); }
.wallet-pill-bonus { color: #2ec27e; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--border); font-size: .82rem; }
.points-pill { color: var(--legendary); }
.usermenu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); border: none; color: #fff; font-weight: 700; cursor: pointer; }
.usermenu-drop { position: absolute; right: 0; top: 100%; margin-top: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; min-width: 190px; box-shadow: var(--shadow); display: none; flex-direction: column; z-index: 60; }
/* Invisible bridge spanning the gap so hover isn't lost moving avatar -> menu. */
.usermenu::after { content: ''; position: absolute; right: 0; top: 100%; width: 200px; height: 14px; display: none; }
.usermenu:hover::after { display: block; }
.usermenu:hover .usermenu-drop, .usermenu:focus-within .usermenu-drop { display: flex; }
.usermenu-drop a, .usermenu-drop button { text-align: left; padding: 9px 12px; border-radius: 7px; color: var(--text-dim); background: none; border: none; font: inherit; cursor: pointer; }
.usermenu-drop a:hover, .usermenu-drop button:hover { background: var(--bg-card-2); color: var(--text); }
.usermenu-drop .admin-link { color: var(--primary); font-weight: 600; }

/* ---- Buttons ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem; cursor: pointer; border: 1px solid transparent; transition: transform .08s, background .15s, border .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn-accent { background: var(--accent); color: #06231c; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Layout primitives --------------------------------------------------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 32px 20px 80px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.muted { color: var(--text-dim); }
.grid { display: grid; gap: 18px; }
/* min-width:0 lets children SHRINK below their content width — without it a
   wide table inside any grid card stretches the whole page past the viewport
   on mobile (everything right of the screen edge gets cut off). */
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px; }
.card-pad-lg { padding: 28px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.flex1 { flex: 1; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 32px; }
.hr { height: 1px; background: var(--border-soft); border: none; margin: 18px 0; }

/* ---- Flash --------------------------------------------------------------- */
.flash-stack { max-width: var(--maxw); margin: 14px auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; border: 1px solid; }
.flash-success { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.35); color: #7ff0b0; }
.flash-error { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.35); color: #ffb4b4; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { text-align: center; padding: 64px 20px 40px; }
.hero h1 { font-size: 3.1rem; letter-spacing: -.04em; background: linear-gradient(120deg, #fff 20%, #b9b2ff 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.18rem; max-width: 620px; margin: 14px auto 26px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.stat-row { display: flex; gap: 40px; justify-content: center; margin-top: 44px; }
.stat-row .num { font-size: 1.8rem; font-weight: 800; }
.stat-row .lbl { color: var(--text-faint); font-size: .85rem; }

/* ---- Legal / info / support pages --------------------------------------- */
.legal { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; }
.legal h1 { font-size: 2rem; margin: 14px 0 6px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal h3 { font-size: 1.02rem; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--text-dim); line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--primary); }
.legal-meta { color: var(--text-faint); font-size: .88rem; }
.legal-company { margin-top: 32px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px 20px; }
.legal-company dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 10px 0 0; }
.legal-company dt { color: var(--text-faint); font-size: .9rem; }
.legal-company dd { margin: 0; color: var(--text); font-size: .9rem; }
.legal-links { color: var(--text-faint); }
.legal-links a { color: var(--text-dim); }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '⌄'; color: var(--text-faint); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { margin: 12px 0 0; }

.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.support-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 22px; text-align: center; }
.support-ic { font-size: 2rem; }
.support-card h3 { margin: 8px 0 6px; }
.support-card .btn { margin-top: 10px; }
@media (max-width: 620px) { .support-grid { grid-template-columns: 1fr; } .legal-company dl { grid-template-columns: 1fr; } }

/* ---- App footer --------------------------------------------------------- */
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 28px; border-top: 1px solid var(--border-soft); color: var(--text-faint); font-size: .85rem; margin-top: auto; }
.app-footer nav { display: flex; gap: 18px; }
.app-footer a { color: var(--text-dim); }
.app-footer a:hover { color: var(--text); }
.app-footer .footer-social { display: flex; align-items: center; gap: 14px; }
.app-footer .footer-social a { display: inline-flex; color: var(--text-dim); transition: color .15s ease, transform .15s ease; }
.app-footer .footer-social a:hover { color: var(--text); transform: translateY(-1px); }
.app-footer .footer-social svg { display: block; }

/* ---- Signed-in home dashboard ------------------------------------------- */
.home-welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 8px 0 18px; }
.home-welcome h1 { font-size: 1.9rem; margin-bottom: 4px; }
.home-welcome p { margin: 0; }
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.hs-tile { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 18px; transition: transform .12s, border-color .14s; }
.hs-tile:hover { transform: translateY(-2px); border-color: var(--text-faint); }
.hs-label { color: var(--text-faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.hs-val { font-size: 1.5rem; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
@media (max-width: 720px) { .home-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- Shout box / activity ----------------------------------------------- */
.shoutbox { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px 18px; overflow: hidden; }
.shout-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .9rem; border-bottom: 1px solid var(--border-soft); }
.shout-item:last-child { border-bottom: none; }
a.shout-link { text-decoration: none; color: inherit; border-radius: 8px; padding: 10px 12px; margin: 0 -12px; transition: background .12s; }
a.shout-link:hover { background: rgba(255,255,255,.04); }
.shout-go { margin-left: 8px; color: var(--text-faint); font-size: 1.2rem; line-height: 1; }
a.shout-link:hover .shout-go { color: var(--text); }
.shout-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grail); box-shadow: 0 0 10px var(--grail); }

/* ---- Machine / pack cards ----------------------------------------------- */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.machine-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; transition: transform .12s, border-color .15s; display: flex; flex-direction: column; }
.machine-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.machine-art { aspect-ratio: 4/3; background: linear-gradient(135deg, #1b2030, #262c3e); display: flex; align-items: center; justify-content: center; position: relative; }
.machine-art .price-tag { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); padding: 5px 11px; border-radius: 100px; font-weight: 700; font-size: .9rem; }
.machine-art .tier-emoji { font-size: 3rem; opacity: .9; }
.machine-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.machine-body h3 { font-size: 1.02rem; margin: 0; }
.machine-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--text-faint); margin-top: auto; padding-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .73rem; font-weight: 600; padding: 3px 9px; border-radius: 100px; background: var(--bg-card-2); color: var(--text-dim); }
.badge-low { background: rgba(245,158,11,.14); color: var(--warn); }
.badge-restock { background: rgba(108,92,255,.14); color: #b3a8ff; }
.badge-grail { background: rgba(239,68,68,.14); color: #ff9a9a; }
.badge-live { background: rgba(34,197,94,.14); color: var(--ok); }
.badge-paused { background: rgba(154,163,181,.14); color: var(--text-dim); }

/* category tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tab { padding: 8px 16px; border-radius: 100px; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); font-weight: 500; font-size: .88rem; cursor: pointer; }
.tab.active, .tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Odds table ---------------------------------------------------------- */
.odds-table { width: 100%; border-collapse: collapse; }
.odds-table th, .odds-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: .9rem; }
.odds-table th { color: var(--text-faint); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.rarity-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.prob-bar { height: 6px; border-radius: 4px; background: var(--bg-card-2); overflow: hidden; margin-top: 5px; }
.prob-bar > span { display: block; height: 100%; border-radius: 4px; }

/* ---- Detail pages -------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 32px; align-items: start; }
.card-image { width: 100%; aspect-ratio: 3/4; border-radius: var(--radius); background: linear-gradient(160deg, #20283a, #161b28); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: .92rem; }
.kv .k { color: var(--text-faint); }
.big-price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }

/* ---- Forms --------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-dim); }
.input, select, textarea { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; color: var(--text); font: inherit; width: 100%; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,255,.18); }
.file-input { padding: 8px; cursor: pointer; }
.file-input::file-selector-button { background: var(--bg-card-2); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 7px 12px; margin-right: 12px; cursor: pointer; font: inherit; font-weight: 600; }
.file-input::file-selector-button:hover { border-color: var(--primary); color: #fff; }
.thumb { width: 38px; height: 52px; border-radius: 5px; object-fit: cover; border: 1px solid var(--border-soft); background: var(--bg-card-2); vertical-align: middle; }

/* Drag & drop image picker */
.dropzone { position: relative; border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.dropzone:hover { border-color: var(--primary); }
.dropzone.dragging { border-color: var(--primary); background: rgba(108,92,255,.1); }
.dz-input { display: none; }
.dz-preview { display: none; }
.dropzone.has-file .dz-preview { display: block; }
.dropzone.has-file .dz-prompt { display: none; }
.dz-preview img { max-height: 190px; max-width: 100%; border-radius: 9px; border: 1px solid var(--border-soft); }
.dz-prompt { color: var(--text-dim); font-size: .9rem; }
.dz-icon { font-size: 1.9rem; }
.dz-link { color: var(--primary); text-decoration: underline; }
.dz-clear { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; display: none; font-size: .8rem; line-height: 1; }
.dropzone.has-file .dz-clear { display: block; }

/* AI intake scan card */
.ai-scan { border: 1px solid rgba(108,92,255,.35); background: linear-gradient(180deg, rgba(108,92,255,.06), transparent); }
.ai-drops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.ai-drops .field label { font-size: .78rem; }
.ai-scan [data-ai-status] { font-size: .85rem; }
@media (max-width: 640px) { .ai-drops { grid-template-columns: 1fr; } }

/* P&L revenue/day chart */
.pnl-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; margin-top: 14px; }
.pnl-col { flex: 1; min-width: 3px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.pnl-col:hover { background: rgba(255,255,255,.04); }
.pnl-bar-rev { background: var(--ok); border-radius: 3px 3px 0 0; min-height: 2px; }
.pnl-bar-bb { background: var(--danger); border-radius: 0 0 3px 3px; min-height: 0; }

/* Inline thumbnail replace/remove in lists */
.thumb-cell { display: flex; align-items: center; gap: 5px; }
.thumb-cell form { margin: 0; }
.thumb-label { cursor: pointer; display: inline-block; }
.thumb-label:hover .thumb { border-color: var(--primary); }
.thumb-file { display: none; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 1.3rem; }
.thumb-remove { width: 20px; height: 20px; border-radius: 50%; background: transparent; border: 1px solid var(--border); color: var(--text-faint); cursor: pointer; font-size: .68rem; line-height: 1; padding: 0; }
.thumb-remove:hover { border-color: var(--danger); color: var(--danger); }
.row-preselected { background: rgba(108,92,255,.07); }
.row-preselected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--text-dim); }
.checkbox input { width: 18px; height: 18px; margin-top: 1px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; background: #fff; color: #1f1f1f; font-weight: 600; font-size: 1rem; padding: 13px 16px; border-radius: 11px; border: 1px solid #dadce0; margin-top: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: background .15s, box-shadow .15s, transform .08s; }
.btn-google:hover { background: #f6f8fb; box-shadow: 0 3px 10px -2px rgba(0,0,0,.35); }
.btn-google:active { transform: translateY(1px); }
.btn-google svg { width: 20px; height: 20px; flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--text-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }
.auth-wrap { max-width: 420px; margin: 48px auto; }
.auth-wrap .card { padding: 32px; }
.field-row { display: flex; gap: 12px; } .field-row > * { flex: 1; }

/* ---- Redemption (ship cards) -------------------------------------------- */
.rd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-top: 12px; }
.rd-card { position: relative; cursor: pointer; }
.rd-card input { position: absolute; opacity: 0; pointer-events: none; }
.rd-card-body { display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--border); border-radius: 12px; padding: 8px; transition: border-color .12s, box-shadow .12s; }
.rd-card input:checked + .rd-card-body { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.rd-card input:disabled + .rd-card-body { opacity: .4; }
.rd-card-img { aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 8px; overflow: hidden; font-size: 1.6rem; }
.rd-card-img img { width: 100%; height: 100%; object-fit: cover; }
.rd-card-name { font-size: .8rem; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-card-fmv { font-size: .78rem; color: var(--muted); }
.rd-summary { position: sticky; top: 16px; }
.rd-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: .9rem; border-bottom: 1px solid var(--border); }
.rd-total { display: flex; justify-content: space-between; padding: 12px 0 2px; font-weight: 700; font-size: 1.1rem; }

/* ---- Tables -------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.table th { color: var(--text-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--bg-elev); }
.pill { font-size: .74rem; padding: 3px 9px; border-radius: 100px; font-weight: 600; }
.pill-green { background: rgba(34,197,94,.14); color: var(--ok); }
.pill-blue { background: rgba(59,130,246,.14); color: #93c5fd; }
.pill-amber { background: rgba(245,158,11,.14); color: var(--warn); }
.pill-gray { background: rgba(154,163,181,.14); color: var(--text-dim); }
.pill-red { background: rgba(239,68,68,.14); color: #fca5a5; }

/* ---- KPI tiles ----------------------------------------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; }
.kpi .kpi-label { color: var(--text-faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }

/* ---- Admin shell --------------------------------------------------------- */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 61px); }
.admin-sidebar { background: var(--bg-elev); border-right: 1px solid var(--border-soft); padding: 20px 12px; }
.admin-sidebar .side-group { color: var(--text-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin: 18px 10px 6px; }
.admin-sidebar a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-dim); font-weight: 500; font-size: .9rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--bg-card-2); color: var(--text); }
.admin-main { padding: 28px 32px 80px; max-width: 1500px; }
/* Admin topbar spans full width so the logo sits top-left, above the sidebar. */
body.is-admin .topbar-inner { max-width: none; }
.admin-sb-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.admin-sb-overlay { display: none; }

/* ===========================================================================
   Unbox experience — gold foil pack → rip → flash → card on a pedestal.
   Modelled on the Courtyard.io reveal flow.
   =========================================================================== */
.unbox-page { max-width: 560px; margin: 0 auto; padding: 14px 16px 60px; }
.unbox-top { display: flex; align-items: center; gap: 12px; padding: 8px 2px 16px; }
.unbox-back { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); font-size: 1.1rem; }
.unbox-title { flex: 1; line-height: 1.25; }
.unbox-title strong { display: block; font-size: 1.05rem; }
.unbox-title span { color: var(--text-faint); font-size: .8rem; }
.points-badge { background: rgba(245,158,11,.14); color: var(--legendary); border: 1px solid rgba(245,158,11,.3); padding: 5px 11px; border-radius: 100px; font-size: .78rem; font-weight: 700; white-space: nowrap; }

/* The dark studio stage that holds both the pack and the reveal. */
.unbox-stage {
    position: relative; border-radius: 22px; overflow: hidden;
    min-height: 540px; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(120% 90% at 50% 38%, #2a2f3c 0%, #14171f 55%, #0c0e14 100%);
    box-shadow: inset 0 0 80px rgba(0,0,0,.55), var(--shadow);
}

/* ---- Gold foil pack ------------------------------------------------------ */
.pack-scene { position: relative; display: flex; flex-direction: column; align-items: center; transition: opacity .35s, transform 1.2s ease; }
.pack-scene.gone { opacity: 0; pointer-events: none; }
.foil-pack {
    position: relative; width: 250px; height: 344px; border-radius: 14px;
    transform-style: preserve-3d; animation: pack-float 4s ease-in-out infinite;
    filter: drop-shadow(0 30px 40px rgba(0,0,0,.5));
}
@keyframes pack-float { 0%,100%{ transform: translateY(0) rotate(-1deg);} 50%{ transform: translateY(-12px) rotate(1deg);} }

/* two foil halves that tear apart on rip */
.foil-half {
    position: absolute; left: 0; right: 0; height: 50%; overflow: hidden;
    background:
        repeating-linear-gradient(118deg, rgba(255,255,255,.0) 0 14px, rgba(255,255,255,.16) 16px, rgba(255,255,255,0) 22px),
        linear-gradient(125deg, #9a7416 0%, #f6dd8a 22%, #c79a26 44%, #fff1bd 60%, #b88a1c 80%, #8a6710 100%);
    background-blend-mode: screen, normal;
    transition: transform .85s cubic-bezier(.5,-0.2,.4,1), opacity .85s;
}
/* Reveal pack with uploaded artwork: contain it within the pack frame. */
.foil-pack.has-img { background: none; box-shadow: none; filter: drop-shadow(0 18px 26px rgba(0,0,0,.55)); }
.foil-pack.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }

.foil-top { top: 0; border-radius: 14px 14px 0 0;
    box-shadow: inset 0 12px 26px rgba(255,255,255,.25); }
.foil-bottom { bottom: 0; border-radius: 0 0 14px 14px;
    box-shadow: inset 0 -12px 26px rgba(0,0,0,.18); }
/* concentric emboss that lines up across the seam */
.foil-top::after, .foil-bottom::after {
    content: ''; position: absolute; left: 50%; width: 190px; height: 190px; margin-left: -95px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 38%, rgba(120,90,15,.45) 39%, transparent 41%,
        transparent 56%, rgba(120,90,15,.4) 57%, transparent 59%,
        transparent 74%, rgba(120,90,15,.35) 75%, transparent 77%);
}
.foil-top::after { bottom: -95px; }
.foil-bottom::after { top: -95px; }
/* crimped heat-seal edges */
.foil-top::before, .foil-bottom::before {
    content: ''; position: absolute; left: 0; right: 0; height: 16px;
    background: repeating-linear-gradient(90deg, #7e5d0d 0 3px, #e7c463 3px 6px);
    opacity: .85;
}
.foil-top::before { top: 0; }
.foil-bottom::before { bottom: 0; }

.foil-label {
    position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    background: #14161d; color: #fff; padding: 7px 14px; border-radius: 9px;
    font-weight: 800; font-size: .9rem; letter-spacing: .02em; z-index: 3;
    display: flex; align-items: center; gap: 7px; box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.foil-logo { color: var(--accent); }
.foil-badge {
    position: absolute; bottom: 30px; right: 22px; z-index: 3;
    background: #14161d; color: #c9cee0; font-size: .58rem; font-weight: 700; letter-spacing: .08em;
    padding: 5px 8px; border-radius: 6px; transform: rotate(-4deg);
    border-left: 3px solid; border-image: linear-gradient(var(--accent), var(--primary)) 1;
}
.open-pack-btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 4;
    background: #fff; color: #11131a; border: none; cursor: pointer;
    padding: 13px 30px; border-radius: 100px; font-weight: 700; font-size: 1rem;
    box-shadow: 0 8px 22px rgba(0,0,0,.35); transition: transform .12s, box-shadow .12s;
}
.open-pack-btn:hover { transform: translate(-50%,-50%) scale(1.05); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
.open-pack-btn:active { transform: translate(-50%,-50%) scale(.97); }
.open-pack-btn:disabled { opacity: .7; cursor: default; }
.pack-shadow { width: 180px; height: 26px; margin-top: 26px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0,0,0,.5), transparent 70%); filter: blur(3px); }

/* ---- Charging glow behind the pack (builds before the burst) ------------- */
.pack-aura { position: absolute; left: 50%; top: 46%; width: 300px; height: 400px; transform: translate(-50%,-50%) scale(.5);
    border-radius: 50%; z-index: 0; opacity: 0; pointer-events: none; filter: blur(26px);
    /* --tease is set by JS to the hit-tier colour, so the glow "leaks" the
       rarity before the card is shown (the anticipation trick). */
    background: radial-gradient(circle, rgba(255,244,210,.95), var(--tease, rgba(255,206,110,.5)) 42%, transparent 72%); }
/* Faint colour flickers while the pack shakes — a tease, not the full glow. */
.pack-scene.anticipating .pack-aura { animation: tease-flicker 1.3s ease-in forwards; }
.pack-scene.big-hit.anticipating .pack-aura { animation-duration: 2.05s; }
@keyframes tease-flicker {
    0% { opacity: 0; } 30% { opacity: .16; } 45% { opacity: .05; }
    65% { opacity: .3; } 80% { opacity: .14; } 100% { opacity: .32; }
}
.pack-scene.charging .pack-aura { animation: aura-grow .75s ease-in forwards; }
@keyframes aura-grow {
    0% { opacity: 0; transform: translate(-50%,-50%) scale(.5); }
    100% { opacity: 1; transform: translate(-50%,-50%) scale(1.8); filter: blur(40px) brightness(1.7); }
}
.pack-scene.charging .foil-pack { animation: pack-charge .78s cubic-bezier(.5,0,.4,1) forwards; position: relative; z-index: 1; }
@keyframes pack-charge {
    0% { transform: scale(1) rotate(0); filter: brightness(1); }
    22% { transform: scale(1.04) rotate(-2deg); }
    44% { transform: scale(1.03) rotate(2deg); }
    66% { transform: scale(1.12) rotate(-1deg); filter: brightness(1.5); }
    100% { transform: scale(1.34) rotate(2.5deg); filter: brightness(2.6) saturate(1.4); opacity: .1; }
}

/* rip state (foil halves split during the flash, for non-image packs) */
.foil-pack.ripping .foil-top { transform: translateY(-160px) rotate(-14deg) scale(.92); opacity: 0; }
.foil-pack.ripping .foil-bottom { transform: translateY(160px) rotate(11deg) scale(.92); opacity: 0; }
.foil-pack.ripping .foil-label,
.foil-pack.ripping .foil-badge,
.foil-pack.ripping .open-pack-btn { opacity: 0; transition: opacity .25s; }

/* ---- White flash (full white-out, holds, then reveals) ------------------- */
.rip-flash {
    position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: 0;
    background: radial-gradient(circle at 50% 46%, #fff 0%, #fff 58%, rgba(255,255,255,.85) 78%, transparent 100%);
}
.rip-flash.fire { animation: flash-burst 1.05s ease-out forwards; }
@keyframes flash-burst {
    0% { opacity: 0; transform: scale(.3); }
    26% { opacity: 1; transform: scale(1.05); }
    52% { opacity: 1; transform: scale(1.12); }   /* hold the white-out */
    100% { opacity: 0; transform: scale(1.45); }   /* fade away, revealing the card */
}

/* ---- Pedestal reveal ----------------------------------------------------- */
.reveal-result { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; z-index: 2; }
.reveal-result.show { display: flex; }
.pedestal-card-wrap { position: relative; opacity: 0; transform: translateY(46px) scale(.86); animation: rise .8s cubic-bezier(.2,.8,.25,1) .08s forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0) scale(1); } }
/* Dopamine reveal: card materialises out of the white flash, then the rarity
   aura flares big and settles. */
/* Reveal card: no frame/pedestal, just the card image floating. */
.unbox-stage .pedestal-card { background: none; border: none; overflow: visible; }
.unbox-stage .pedestal-card img { filter: drop-shadow(0 16px 26px rgba(0,0,0,.55)); }
.reveal-result.show .pedestal-card-wrap { animation: card-emerge 1s cubic-bezier(.2,.7,.2,1) forwards; }
/* Crisp emergence — scale/opacity only, no white wash or blur over the card:
   the card itself must always be clearly readable. */
@keyframes card-emerge {
    0%   { opacity: 0; transform: translateY(8px) scale(.42); }
    28%  { opacity: 1; }
    62%  { transform: translateY(0) scale(1.06); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.reveal-result.show .rarity-aura { animation: aura-reveal 1.3s ease-out; }
@keyframes aura-reveal {
    0%   { opacity: 0; transform: translate(-50%,-50%) scale(2.4); }
    35%  { opacity: 1; }
    100% { opacity: .9; transform: translate(-50%,-50%) scale(1); }
}
.pedestal-card {
    width: 200px; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden;
    background: linear-gradient(160deg, #20283a, #11151f); border: 1px solid rgba(255,255,255,.14);
    display: flex; align-items: center; justify-content: center; position: relative; z-index: 2;
    animation: card-bob 4s ease-in-out infinite .9s;
}
.pedestal-card img { width: 100%; height: 100%; object-fit: contain; }
@keyframes card-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }
.rarity-aura { position: absolute; left: 50%; top: 44%; width: 280px; height: 280px; transform: translate(-50%,-50%); border-radius: 50%; z-index: 1; opacity: .9; filter: blur(8px); }
.aura-common{background:radial-gradient(circle,rgba(156,163,175,.5),transparent 65%)}
.aura-uncommon{background:radial-gradient(circle,rgba(34,197,94,.5),transparent 65%)}
.aura-rare{background:radial-gradient(circle,rgba(59,130,246,.55),transparent 65%)}
.aura-epic{background:radial-gradient(circle,rgba(168,85,247,.6),transparent 65%)}
.aura-legendary{background:radial-gradient(circle,rgba(245,158,11,.65),transparent 66%)}
.aura-grail{background:radial-gradient(circle,rgba(239,68,68,.7),transparent 68%); animation: aura-pulse 1.8s ease-in-out infinite}
@keyframes aura-pulse { 0%,100%{opacity:.6;transform:translate(-50%,-50%) scale(1)} 50%{opacity:1;transform:translate(-50%,-50%) scale(1.12)} }
.pedestal {
    width: 200px; height: 40px; margin-top: -8px; border-radius: 50%;
    background: radial-gradient(ellipse at 50% 30%, #cfd4dd, #8b909c 60%, #5c606b);
    box-shadow: 0 16px 30px -8px rgba(0,0,0,.6); position: relative; z-index: 2;
    display: flex; align-items: flex-start; justify-content: center;
}
.pedestal::before { content:''; position:absolute; top:7px; left:50%; transform:translateX(-50%); width:120px; height:18px; border-radius:50%; border:1px solid rgba(0,0,0,.12); }
.pedestal span { font-size: .5rem; letter-spacing: .12em; color: #4b4f59; margin-top: 5px; font-weight: 700; }
.meta-pill {
    margin-top: 22px; max-width: 320px; text-align: center; background: rgba(10,12,18,.72);
    border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 16px;
    color: var(--text-dim); font-size: .84rem; backdrop-filter: blur(6px);
}
.meta-pill .rar { text-transform: capitalize; font-weight: 700; }

/* ---- Anticipation: pack shakes while the camera pushes in --------------- */
/* Zoom is a transition (not an animation) so it holds smoothly into the charge
   phase instead of snapping back when the .anticipating class is removed. */
.pack-scene.is-zoom { transform: scale(1.12); }
.pack-scene.anticipating .foil-pack { animation: pack-shake .42s ease-in-out 3; }
/* Big hits build longer and shake harder — you can feel it coming. */
.pack-scene.big-hit.anticipating .foil-pack { animation: pack-shake .34s ease-in-out 6; }
@keyframes pack-shake {
    0%,100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-7px) rotate(-2deg); }
    40% { transform: translateX(7px) rotate(2deg); }
    60% { transform: translateX(-5px) rotate(-1.4deg); }
    80% { transform: translateX(5px) rotate(1.4deg); }
}

/* ---- Staged reveal: card back flips to its face ------------------------- */
.reveal-fx { display: flex; flex-direction: column; align-items: center; }
.card-back, .card-face {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; backface-visibility: hidden;
}
.card-back {
    background: linear-gradient(160deg, #232c40, #0f131c);
    border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.32); font-size: 2.6rem;
    transition: opacity .35s ease, transform .45s ease;
}
.card-back.out { opacity: 0; transform: rotateY(90deg) scale(.9); }
.card-face { opacity: 0; transform: rotateY(-90deg) scale(.94); transition: opacity .45s, transform .5s cubic-bezier(.2,.8,.25,1); }
.card-face img { width: 100%; height: 100%; object-fit: contain; }
.card-face.in { opacity: 1; transform: none; }

/* identity text rises in sequence under the card */
.reveal-id { margin-top: 18px; text-align: center; }
.reveal-rarity, .reveal-name, .reveal-grade { opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s; }
.reveal-rarity.in, .reveal-name.in, .reveal-grade.in { opacity: 1; transform: none; }
.reveal-rarity { text-transform: capitalize; font-weight: 800; letter-spacing: .08em; font-size: .8rem; text-shadow: 0 0 16px currentColor; }
.reveal-name { font-size: 1.2rem; font-weight: 800; margin-top: 3px; }
.reveal-grade { color: var(--text-faint); font-size: .82rem; margin-top: 2px; }

/* ---- Value reward: "Market Value" + count-up + multiple + verdict ------- */
.value-reward { opacity: 0; transform: translateY(12px); transition: opacity .45s, transform .45s; margin-top: 16px; text-align: center; }
.value-reward.in { opacity: 1; transform: none; }
.vr-label { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }
.vr-amount { font-size: 2.5rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; margin-top: 2px; font-variant-numeric: tabular-nums; }
.vr-mult { opacity: 0; transform: scale(.7); transition: opacity .3s, transform .35s cubic-bezier(.2,1.6,.4,1); font-weight: 800; font-size: .95rem; color: var(--text-dim); margin-top: 5px; }
.vr-mult.in { opacity: 1; transform: none; }
.vr-badge { opacity: 0; transform: scale(.6); transition: opacity .25s, transform .4s cubic-bezier(.2,1.8,.4,1); display: inline-block; margin-top: 12px; font-weight: 900; font-size: 1.05rem; letter-spacing: .04em; padding: 8px 18px; border-radius: 100px; }
.vr-badge.in { opacity: 1; transform: none; }

/* value-tier glow on the card (lights up the instant the value lands) */
.pedestal-card { transition: box-shadow .6s ease; }
.hit-green.charged  { box-shadow: 0 0 38px 4px rgba(34,197,94,.55); }
.hit-blue.charged   { box-shadow: 0 0 44px 6px rgba(59,130,246,.6); }
.hit-purple.charged { box-shadow: 0 0 52px 8px rgba(168,85,247,.65); }
.hit-gold.charged   { box-shadow: 0 0 62px 10px rgba(245,200,80,.72); }
.hit-grail.charged  { animation: card-bob 4s ease-in-out infinite .9s, grail-pulse 1.6s ease-in-out infinite; }
@keyframes grail-pulse { 0%,100% { box-shadow: 0 0 60px 10px rgba(255,206,90,.7); } 50% { box-shadow: 0 0 100px 22px rgba(255,170,40,.95); } }
/* On the reveal stage the card stays completely clean — no halo/glow bleeding
   over its edges. Rarity is carried by the text, value colour and badge. */
.unbox-stage .pedestal-card.charged { box-shadow: none; }
.unbox-stage .hit-grail.charged { animation: card-bob 4s ease-in-out infinite .9s; }

/* tier colours for the value text + badge */
.fx-green  .vr-amount { color: #34d399; } .fx-green  .vr-badge { background: rgba(34,197,94,.16); color: #34d399; border: 1px solid rgba(34,197,94,.5); }
.fx-blue   .vr-amount { color: #5b9bff; } .fx-blue   .vr-badge { background: rgba(59,130,246,.16); color: #5b9bff; border: 1px solid rgba(59,130,246,.5); }
.fx-purple .vr-amount { color: #c084fc; } .fx-purple .vr-badge { background: rgba(168,85,247,.18); color: #c084fc; border: 1px solid rgba(168,85,247,.55); }
.fx-gold   .vr-amount { color: #ffce5a; } .fx-gold   .vr-badge { background: rgba(245,200,80,.18); color: #ffd873; border: 1px solid rgba(245,200,80,.6); }
.fx-grail  .vr-amount { color: #ffd873; text-shadow: 0 0 26px rgba(255,200,80,.7); }
.fx-grail  .vr-badge { background: linear-gradient(120deg, #f59e0b, #fde68a, #f59e0b); color: #3a2600; border: none; box-shadow: 0 6px 24px rgba(245,158,11,.6); }

/* ---- Celebration particles (gold / grail) ------------------------------- */
/* Particles rise BEHIND the card (z 1 < card z 2) — never over its face. */
.reveal-particles { position: absolute; left: 50%; top: 50%; width: 300px; height: 340px; transform: translate(-50%,-50%); pointer-events: none; z-index: 1; }
.particle { position: absolute; top: 62%; border-radius: 50%; opacity: 0;
    background: radial-gradient(circle, #fff, #ffce5a 60%, transparent);
    animation-name: particle-fly; animation-timing-function: cubic-bezier(.2,.7,.3,1); animation-fill-mode: forwards; }
@keyframes particle-fly {
    0% { opacity: 0; transform: translateY(20px) scale(.4); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-230px) scale(1); }
}

/* ---- Grail jackpot: screen flash + shake -------------------------------- */
.grail-flash { position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: 0;
    /* Soft golden pulse — never a full white-out, so the card stays readable. */
    background: radial-gradient(circle at 50% 45%, rgba(255,240,200,.5), rgba(255,210,120,.25) 45%, transparent 75%); }
.grail-flash.go { animation: grail-flash-anim .85s ease-out forwards; }
@keyframes grail-flash-anim { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.unbox-stage.shake { animation: screen-shake .6s cubic-bezier(.36,.07,.19,.97); }
@keyframes screen-shake {
    10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(4px); }
    30%,50%,70% { transform: translateX(-7px); } 40%,60% { transform: translateX(7px); }
}

/* buyback panel fades in after the value moment */
.buyback-panel.panel-enter { opacity: 0; transform: translateY(14px); }
.buyback-panel.panel-enter.show { opacity: 1; transform: none; transition: opacity .5s, transform .5s; }

/* ---- Reveal juice: vignette, shockwave, holo tilt, sweep, sfx ------------ */
/* Edges dim during the build-up so all focus lands on the pack. */
.unbox-stage::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: radial-gradient(ellipse at 50% 44%, transparent 38%, rgba(0,0,0,.62) 100%);
    opacity: 0; transition: opacity .9s ease;
}
.unbox-stage.vignetted::before { opacity: 1; }

/* Expanding ring at the moment of the flash (big hits). */
.shockwave {
    position: absolute; left: 50%; top: 45%; width: 12px; height: 12px; z-index: 6;
    border: 3px solid rgba(255,255,255,.9); border-radius: 50%;
    transform: translate(-50%,-50%); pointer-events: none;
    animation: shock-ring .7s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes shock-ring {
    to { width: 620px; height: 620px; opacity: 0; border-width: 1px; }
}

/* Pointer-tracking 3D tilt on the revealed card. */
.tilt-rig { transform-style: preserve-3d; will-change: transform; transition: transform .16s ease-out; }

/* Count-up punch the instant the value crosses the pack price. */
.vr-amount.past-price { animation: price-pop .38s cubic-bezier(.2,1.8,.4,1); }
@keyframes price-pop {
    0% { transform: scale(1); } 45% { transform: scale(1.18); filter: brightness(1.6); }
    100% { transform: scale(1); }
}

/* Canvas layer for confetti / coin rain — BEHIND the reveal content (z 1 <
   .reveal-result z 2) so falling pieces never cover the card or the value. */
.fx-canvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

/* Filmed pack opening — covers the stage, first frame matches the artwork,
   ends on white, then fades out to uncover the card reveal beneath it. */
.open-video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    z-index: 4; opacity: 0; pointer-events: none; background: #0c0e14;
}
.open-video.show { opacity: 1; }
.open-video.fade-out { opacity: 0; transition: opacity .65s ease; }

/* ---- Post-rip referral modal (free packs) — "×2 FREE" designer handoff ---- */
.refmodal-overlay {
    position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
    background: rgba(5,6,10,.72); backdrop-filter: blur(5px); padding: 18px;
    opacity: 0; transition: opacity .25s;
}
.refmodal-overlay.show { opacity: 1; }
.refmodal {
    --rg: #FFC629; --rg2: #F5A623; --rg3: #E8990A;
    --rgrad: linear-gradient(135deg, #FFC629, #F5A623, #E8990A);
    position: relative; overflow: hidden; max-width: 410px; width: 100%; text-align: center;
    background: linear-gradient(180deg, #17181d, #101116);
    border: 1px solid #2a2c31; border-radius: 24px; padding: 30px 24px 22px;
    box-shadow: 0 40px 90px -20px rgba(0,0,0,.85), 0 0 0 1px rgba(255,198,41,.05), 0 0 60px -20px rgba(255,198,41,.25);
    transform: translateY(14px) scale(.94); transition: transform .35s cubic-bezier(.2,1.1,.3,1);
}
.refmodal-overlay.show .refmodal { transform: none; }
.refmodal::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--rgrad); opacity: .9; }
.refmodal::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(240px 150px at 50% -6%, rgba(255,198,41,.14), transparent 70%);
}
.refmodal-x {
    position: absolute; top: 13px; right: 14px; width: 28px; height: 28px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.04); color: #6a6c72; font-size: 17px; line-height: 1; cursor: pointer;
    transition: .15s; z-index: 5;
}
.refmodal-x:hover { background: rgba(255,255,255,.09); color: #fff; }
/* reward visual: halo + rays + floating pack + ×2 tag + sparks */
.ref-stage { position: relative; height: 132px; margin: 2px auto 4px; width: 100%; }
.ref-halo {
    position: absolute; left: 50%; top: 52%; width: 220px; height: 220px; transform: translate(-50%,-50%);
    background: radial-gradient(circle, rgba(255,198,41,.30), rgba(255,198,41,.06) 45%, transparent 68%);
    filter: blur(2px); animation: ref-breathe 3.2s ease-in-out infinite;
}
@keyframes ref-breathe { 0%,100%{opacity:.7;transform:translate(-50%,-50%) scale(.94)} 50%{opacity:1;transform:translate(-50%,-50%) scale(1.06)} }
.ref-rays {
    position: absolute; left: 50%; top: 52%; width: 210px; height: 210px; transform: translate(-50%,-50%);
    background: conic-gradient(from 0deg, transparent 0 8deg, rgba(255,198,41,.16) 9deg 11deg, transparent 12deg 30deg);
    border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 32%, #000 34%); mask: radial-gradient(circle, transparent 32%, #000 34%);
    animation: ref-raysturn 22s linear infinite; opacity: .6;
}
@keyframes ref-raysturn { to { transform: translate(-50%,-50%) rotate(360deg); } }
.ref-pack {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); height: 120px; width: auto;
    filter: drop-shadow(0 14px 22px rgba(0,0,0,.6)) drop-shadow(0 0 18px rgba(255,198,41,.25));
    animation: ref-float 3.4s ease-in-out infinite; z-index: 2;
}
.ref-pack-emoji { font-size: 4rem; line-height: 132px; position: relative; z-index: 2; display: inline-block; animation: ref-float 3.4s ease-in-out infinite; }
@keyframes ref-float { 0%,100%{transform:translate(-50%,-50%) translateY(0) rotate(-1.5deg)} 50%{transform:translate(-50%,-50%) translateY(-7px) rotate(1.5deg)} }
.ref-pack-emoji { transform: none; }
@keyframes ref-float-emoji { 0%,100%{transform:translateY(0) rotate(-1.5deg)} 50%{transform:translateY(-7px) rotate(1.5deg)} }
.ref-pack-emoji { animation-name: ref-float-emoji; }
.ref-x2 {
    position: absolute; left: calc(50% + 42px); top: 20px; z-index: 3;
    font-weight: 800; font-size: 14px; letter-spacing: .5px; color: #0A0A0A;
    background: var(--rgrad); border-radius: 100px; padding: 3px 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,.5), 0 0 0 3px rgba(255,198,41,.14);
    animation: ref-tag .5s .35s cubic-bezier(.2,1.4,.3,1) both;
}
@keyframes ref-tag { from{opacity:0;transform:scale(.4) rotate(-12deg)} to{opacity:1;transform:none} }
.ref-spark {
    position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--rg); opacity: 0; z-index: 1;
    box-shadow: 0 0 8px 1px rgba(255,198,41,.8); animation: ref-tw 2.6s ease-in-out infinite;
}
.ref-spark.s1 { left: 24%; top: 24%; animation-delay: .1s; }
.ref-spark.s2 { left: 78%; top: 38%; animation-delay: .7s; }
.ref-spark.s3 { left: 30%; top: 70%; animation-delay: 1.3s; width: 4px; height: 4px; }
.ref-spark.s4 { left: 70%; top: 74%; animation-delay: 1.9s; width: 5px; height: 5px; }
.ref-spark.s5 { left: 50%; top: 12%; animation-delay: 1s; width: 4px; height: 4px; }
@keyframes ref-tw { 0%,100%{opacity:0;transform:scale(.4)} 45%,55%{opacity:1;transform:scale(1)} }
.refmodal h3 { margin: 6px 0 0; font-size: 1.65rem; line-height: 1.05; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; }
.refmodal h3 .g { background: var(--rgrad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.refmodal .ref-sub { color: #9a9ca2; font-size: .92rem; line-height: 1.5; margin: 9px auto 0; max-width: 320px; }
.refmodal .ref-sub b { color: #e9e9ec; }
.ref-chips { display: flex; justify-content: center; gap: 9px; margin: 15px 0 4px; flex-wrap: wrap; }
.ref-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: #e6e7ea;
    background: rgba(255,255,255,.035); border: 1px solid #2a2c31; border-radius: 100px; padding: 6px 12px;
}
.ref-chip.volts { color: #d9c9ff; border-color: rgba(166,120,255,.34); background: rgba(166,120,255,.09); }
.ref-linkbox {
    display: flex; align-items: center; gap: 8px; margin: 16px 0 14px; padding: 12px 12px 12px 15px;
    background: #0b0c10; border: 1.5px dashed rgba(255,198,41,.4); border-radius: 13px; position: relative; overflow: hidden;
}
.ref-linkbox .lk { flex: 1; min-width: 0; text-align: left; font-size: .82rem; color: #cfd0d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-linkbox .lk .ref { color: var(--rg); font-weight: 700; }
.ref-cpico {
    flex: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid #34363c; background: rgba(255,255,255,.04);
    color: #9a9ca2; display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.ref-cpico:hover { color: var(--rg); border-color: rgba(255,198,41,.4); }
.ref-cpico svg { width: 16px; height: 16px; }
.ref-btns { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; margin-top: 4px; }
.ref-btn {
    position: relative; overflow: hidden; border: 0; border-radius: 13px; cursor: pointer;
    font-weight: 700; font-size: .9rem; padding: 14px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .12s ease, box-shadow .2s ease; text-decoration: none; font-family: inherit;
}
.ref-btn:active { transform: translateY(1px) scale(.99); }
.ref-btn.primary { color: #0A0A0A; background: var(--rgrad); box-shadow: 0 10px 26px -8px rgba(255,198,41,.6); }
.ref-btn.primary:hover { box-shadow: 0 14px 32px -8px rgba(255,198,41,.75); }
.ref-btn.primary .shine {
    position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg);
    animation: ref-sweep 3.2s ease-in-out infinite;
}
@keyframes ref-sweep { 0%{left:-60%} 55%{left:130%} 100%{left:130%} }
.ref-btn.primary.done { background: #1c7a44; color: #fff; box-shadow: 0 10px 26px -8px rgba(37,211,102,.5); }
.ref-btn.primary.done .shine { display: none; }
.ref-btn.wa { color: #fff; background: rgba(37,211,102,.12); border: 1px solid rgba(37,211,102,.45); }
.ref-btn.wa:hover { background: rgba(37,211,102,.2); }
.ref-btn.wa svg { width: 18px; height: 18px; flex: none; }
.refmodal-later {
    display: inline-block; background: none; border: none; margin-top: 15px; color: #6a6c72; font-size: .85rem;
    text-decoration: none; border-bottom: 1px solid transparent; transition: .15s; cursor: pointer;
}
.refmodal-later:hover { color: #9a9ca2; border-bottom-color: #34363c; }
.ref-fair { margin-top: 12px; color: #6a6c72; font-size: .72rem; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
    .ref-halo, .ref-rays, .ref-pack, .ref-pack-emoji, .ref-spark, .ref-x2, .ref-btn.primary .shine { animation: none; }
}

/* Sound on/off toggle in the stage corner. */
.sfx-toggle {
    position: absolute; top: 12px; right: 12px; z-index: 8;
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    background: rgba(10,12,18,.6); border: 1px solid var(--border-soft);
    font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); transition: transform .12s, background .2s;
}
.sfx-toggle:hover { transform: scale(1.08); background: rgba(20,24,34,.8); }

@media (prefers-reduced-motion: reduce) {
    .pack-scene.anticipating, .pack-scene.anticipating .foil-pack { animation: none; }
    .particle { display: none; }
    .shockwave, .fx-canvas { display: none; }
    .tilt-rig { transition: none; }
    .vr-amount.past-price { animation: none; }
}

/* ---- Buyback panel (after reveal) --------------------------------------- */
.buyback-panel { max-width: 560px; margin: 18px auto 0; }
.buyback-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 14px; }
.buyback-row .bb-label { font-weight: 700; font-size: 1.02rem; }
.buyback-row .bb-pill { font-size: .68rem; font-weight: 700; color: var(--ok); border: 1px solid rgba(34,197,94,.35); background: rgba(34,197,94,.12); padding: 2px 8px; border-radius: 100px; margin-left: 8px; }
.buyback-row .bb-sub { color: var(--text-faint); font-size: .8rem; }
.buyback-row .bb-amt { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; text-align: right; }
.buyback-row .bb-mv { color: var(--text-faint); font-size: .8rem; text-align: right; }
.accept-offer-btn {
    width: 100%; border: none; cursor: pointer; color: #fff; font-weight: 700; font-size: .98rem;
    padding: 14px; border-radius: 13px; letter-spacing: .01em;
    background: linear-gradient(180deg, #7b69ff, var(--primary) 55%, var(--primary-d));
    box-shadow: 0 8px 20px -10px var(--primary), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .1s, box-shadow .15s, filter .15s;
}
.accept-offer-btn:hover { box-shadow: 0 12px 26px -10px var(--primary), inset 0 1px 0 rgba(255,255,255,.3); transform: translateY(-1px); }
.accept-offer-btn:active { transform: translateY(0); }
.accept-offer-btn:disabled { opacity: .6; cursor: default; transform: none; }

/* Secondary "keep & open next" — clean neutral button, clearly below Accept */
.reveal-keep-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    margin-top: 10px; padding: 13px; border-radius: 13px; font-weight: 600; font-size: .95rem;
    background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text);
    transition: border-color .15s, background .15s, transform .1s; }
.reveal-keep-btn:hover { border-color: var(--primary); background: rgba(108,92,255,.1); }
.reveal-keep-btn:active { transform: translateY(1px); }
.reveal-keep-btn span { color: var(--primary); font-weight: 800; }
.reveal-final { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reveal-final .reveal-keep-btn { background: linear-gradient(180deg, #7b69ff, var(--primary) 55%, var(--primary-d)); border: none; color: #fff; box-shadow: 0 8px 20px -10px var(--primary); }
.reveal-final .reveal-keep-btn span { color: #fff; }
.reveal-back { color: var(--text-faint); font-size: .85rem; font-weight: 600; padding: 8px; }
.reveal-back:hover { color: var(--text-dim); }
.fairness-toggle { margin: 16px auto 0; max-width: 560px; }
.fairness-toggle summary { cursor: pointer; color: var(--text-faint); font-size: .82rem; }
.reveal-cta { max-width: 560px; margin: 0 auto; }
.reveal-left { text-align: center; color: var(--text-faint); font-size: .85rem; margin-top: 10px; }

/* "Completed ✓" confirmation overlay (multi-pack flow) */
.complete-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
    background: rgba(8,10,15,.82); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.complete-overlay.show { opacity: 1; }
.complete-card { text-align: center; transform: scale(.85); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); }
.complete-overlay.show .complete-card { transform: scale(1); }
.complete-check { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%; background: linear-gradient(135deg, var(--ok), #16a34a); color: #fff; font-size: 3rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 60px -6px var(--ok); }
.complete-title { font-size: 1.8rem; font-weight: 800; }
.complete-msg { color: var(--text-dim); margin-top: 8px; max-width: 340px; }

/* Pack checkout modal */
.checkout-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.checkout-modal[hidden] { display: none; }
.co-overlay { position: absolute; inset: 0; background: rgba(6,8,12,.72); backdrop-filter: blur(4px); }
.co-card { position: relative; width: 100%; max-width: 720px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.co-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.co-head h3 { margin: 0; font-size: 1.2rem; }
.co-x { background: none; border: none; color: var(--text-faint); font-size: 1.1rem; cursor: pointer; }
.co-x:hover { color: var(--text); }
.co-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 20px 24px 24px; }
.co-label { color: var(--text-faint); font-size: .82rem; font-weight: 600; margin-bottom: 10px; }
.co-method { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 12px; cursor: pointer; margin-bottom: 10px; transition: border-color .14s, background .14s; }
.co-method:hover { border-color: var(--text-faint); }
.co-method:has(input:checked) { border-color: var(--primary); background: rgba(108,92,255,.08); }
.co-method input { accent-color: var(--primary); width: 16px; height: 16px; }
.co-method .co-ic { font-size: 1.2rem; }
.co-method .co-mtext { flex: 1; font-weight: 600; }
.co-method .co-mtext small { display: block; color: var(--text-faint); font-weight: 400; font-size: .76rem; }
.co-method .co-bal { font-weight: 700; color: var(--accent); }
.co-method.disabled { opacity: .45; cursor: not-allowed; }
.co-method.disabled .co-bal { color: var(--danger); }
.co-summary { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px; }
.co-pack { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.co-thumb { width: 40px; height: 52px; border-radius: 7px; background: linear-gradient(150deg,#2b3146,#161b27); display: flex; align-items: center; justify-content: center; }
.co-pmeta { flex: 1; font-size: .9rem; }
.co-pmeta small { color: var(--text-faint); }
.co-pprice { font-weight: 700; }
.co-line { display: flex; justify-content: space-between; padding: 9px 0; font-size: .9rem; color: var(--text-dim); }
.co-pts { color: var(--legendary); font-weight: 700; }
.co-discount { color: var(--ok); font-weight: 600; }
/* Coupon input (checkout modal + wallet top-up) */
.co-coupon { display: flex; gap: 8px; margin: 6px 0 2px; }
.co-coupon-input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg-card); color: var(--text); font-size: .9rem; text-transform: uppercase; }
.co-coupon-input::placeholder { text-transform: none; }
.co-coupon-btn { flex: 0 0 auto; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg-card); color: var(--text); font-weight: 700; cursor: pointer; transition: background .14s; }
.co-coupon-btn:hover { background: var(--bg-elev); }
.co-coupon-msg { font-size: .8rem; min-height: 1em; margin: 4px 0 2px; color: var(--text-faint); }
.co-coupon-msg.ok { color: var(--ok); }
.co-coupon-msg.err { color: var(--danger); }
.co-total { display: flex; justify-content: space-between; padding: 12px 0 4px; border-top: 1px solid var(--border-soft); font-weight: 800; font-size: 1.05rem; }
.co-buy { width: 100%; margin-top: 14px; background: var(--primary); color: #fff; border: none; font-weight: 700; font-size: 1rem; padding: 14px; border-radius: 12px; cursor: pointer; box-shadow: 0 10px 24px -10px var(--primary); transition: background .14s, transform .1s; }
.co-buy:hover { background: var(--primary-d); }
.co-buy:active { transform: translateY(1px); }
.co-terms { font-size: .74rem; color: var(--text-faint); text-align: center; margin: 12px 0 0; }
.co-terms a { color: var(--text-dim); text-decoration: underline; }
@media (max-width: 640px) { .co-grid { grid-template-columns: 1fr; gap: 16px; } }

/* Admin withdrawals — inline process actions */
.wd-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wd-actions .input { width: 130px; }

/* Reusable confirm modal */
.confirm-overlay { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(8,10,15,.7); backdrop-filter: blur(5px); opacity: 0; transition: opacity .18s; }
.confirm-overlay.show { opacity: 1; }
.confirm-card { width: 100%; max-width: 400px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: 24px; box-shadow: var(--shadow); transform: scale(.94); transition: transform .2s cubic-bezier(.2,.9,.3,1.2); }
.confirm-overlay.show .confirm-card { transform: scale(1); }
.confirm-card h3 { font-size: 1.15rem; margin: 0 0 8px; }
.confirm-card p { color: var(--text-dim); margin: 0; line-height: 1.55; }
.confirm-card p strong { color: var(--accent); }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-cancel, .confirm-ok { flex: 1; padding: 12px; border-radius: 11px; font-weight: 600; cursor: pointer; font-size: .95rem; border: 1px solid transparent; }
.confirm-cancel { background: var(--bg-card-2); border-color: var(--border); color: var(--text-dim); }
.confirm-cancel:hover { color: var(--text); }
.confirm-ok { background: var(--accent); color: #06231c; }
.confirm-ok:hover { filter: brightness(1.06); }
.confirm-ok.danger { background: var(--danger); color: #fff; }

/* Unopened-packs banner on the collection page */
.pending-banner { display: flex; align-items: center; gap: 16px; background: linear-gradient(100deg, rgba(108,92,255,.16), var(--bg-card)); border: 1px solid rgba(108,92,255,.35); border-radius: 16px; padding: 16px 20px; margin-bottom: 22px; }
.pending-banner .pb-emoji { font-size: 1.8rem; }
.pending-banner .pb-text { flex: 1; color: var(--text-dim); }
.sb-badge-open { background: var(--accent); color: #06231c; }

/* ---- Misc ---------------------------------------------------------------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }
.note { background: var(--bg-elev); border: 1px solid var(--border-soft); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); padding: 12px 16px; font-size: .88rem; color: var(--text-dim); }
.note-warn { border-left-color: var(--warn); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-all; color: var(--text-faint); }
.guard-green { color: var(--ok); } .guard-orange { color: var(--warn); } .guard-red { color: var(--danger); }

/* ===========================================================================
   Packs page — hero carousel, category tabs, foil pack thumbnails
   =========================================================================== */
/* Home promo banner carousel (admin-managed) — responsive, image-based. */
.home-banner { position: relative; border-radius: 16px; overflow: hidden; margin: 0 0 22px; }
.home-banner-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.home-banner-track::-webkit-scrollbar { display: none; }
.home-banner-slide { flex: 0 0 100%; scroll-snap-align: start; }
.home-banner-slide a, .home-banner-slide img { display: block; width: 100%; }
.home-banner-slide img { height: auto; }
.home-banner-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; z-index: 3; }
.home-banner-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; transition: width .2s, background .2s; }
.home-banner-dots button.on { background: #fff; width: 22px; border-radius: 5px; }

.packs-hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 22px; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: 280px; display: flex; align-items: center; padding: 36px 48px; overflow: hidden; }
.hero-slide .hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-slide .hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,9,13,.78) 0%, rgba(8,9,13,.45) 45%, transparent 75%); }
.hero-copy { position: relative; z-index: 2; max-width: 460px; }
.hero-copy .eyebrow { color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.hero-copy h1 { font-size: 2.6rem; letter-spacing: -.03em; margin: 6px 0 8px; }
.hero-copy p { font-size: 1.05rem; color: #cdd3e0; margin-bottom: 20px; }
.hero-pack { position: absolute; right: 6%; top: 50%; transform: translateY(-50%) rotate(8deg); width: 190px; z-index: 1; filter: drop-shadow(0 30px 50px rgba(0,0,0,.6)); }
.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; z-index: 3; }
.hero-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.35); cursor: pointer; padding: 0; }
.hero-dots button.on { background: #fff; width: 22px; border-radius: 5px; }

/* Category tabs */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: background .14s, color .14s, border .14s; }
.cat-tab:hover { color: var(--text); border-color: var(--text-faint); }
.cat-tab.active { background: linear-gradient(120deg, var(--primary), var(--primary-d)); color: #fff; border-color: transparent; }
.cat-tab .ic { font-size: 1.05rem; }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; margin: 26px 0 16px; }

/* Pack grid */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 22px 18px; }
.pack-cell { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pack-cell .pack-name { font-weight: 600; font-size: .96rem; margin: 14px 0 8px; display: flex; align-items: center; gap: 4px; }
.pack-cell .pack-name .chev { color: var(--text-faint); }
.price-btn { background: #fff; color: #11131a; border: none; font-weight: 700; font-size: .92rem; padding: 9px 22px; border-radius: 100px; cursor: pointer; transition: transform .1s, box-shadow .12s; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.price-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.35); }
.price-btn.sold { background: var(--bg-card-2); color: var(--text-faint); cursor: default; box-shadow: none; }

/* Foil pack thumbnail (mini version of the reveal pack) */
.pack-foil { position: relative; width: 100%; max-width: 200px; aspect-ratio: 5/7; border-radius: 13px; overflow: hidden; transition: transform .16s ease, box-shadow .16s; cursor: pointer;
    box-shadow: 0 16px 30px -14px rgba(0,0,0,.6);
    background:
        repeating-linear-gradient(118deg, rgba(255,255,255,0) 0 12px, rgba(255,255,255,.14) 14px, rgba(255,255,255,0) 20px),
        linear-gradient(150deg, var(--c1) 0%, var(--c2) 28%, var(--c1) 52%, var(--c2) 76%, var(--c1) 100%);
    background-blend-mode: screen, normal; }
.pack-cell:hover .pack-foil { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 26px 40px -16px rgba(0,0,0,.7); }
.pack-foil.holo { background:
        repeating-linear-gradient(118deg, rgba(255,255,255,0) 0 12px, rgba(255,255,255,.18) 14px, rgba(255,255,255,0) 20px),
        linear-gradient(135deg,#ff5f6d,#ffc371,#7afcff,#a18cd1,#ff5f6d); }
.pack-foil img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Uploaded pack artwork: show it whole on a transparent background (no foil). */
.pack-foil.has-img { background: none !important; box-shadow: none; overflow: visible; }
.pack-foil.has-img img { object-fit: contain; filter: drop-shadow(0 14px 22px rgba(0,0,0,.5)); }
.pack-cell:hover .pack-foil.has-img { box-shadow: none; }
.pack-foil .pf-crimp { position: absolute; left: 0; right: 0; height: 11px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 3px, rgba(255,255,255,.18) 3px 6px); }
.pack-foil .pf-crimp.top { top: 0; } .pack-foil .pf-crimp.bot { bottom: 0; }
.pack-foil .pf-label { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: #14161d; color: #fff; font-weight: 800; font-size: .62rem; letter-spacing: .03em; padding: 4px 9px; border-radius: 6px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.pack-foil .pf-label b { color: var(--accent); }
.pack-foil .pf-emboss { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); width: 60%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.16) 0 33%, rgba(0,0,0,.12) 34% 37%, transparent 38% 49%, rgba(0,0,0,.1) 50% 52%, transparent 53%);
    box-shadow: inset 0 0 18px rgba(0,0,0,.2); }
.pack-foil .pf-badge { position: absolute; bottom: 12px; right: 10px; background: #14161d; color: #cfd4e2; font-size: .48rem; font-weight: 700; letter-spacing: .06em; padding: 3px 6px; border-radius: 5px; transform: rotate(-4deg); }
.pack-foil .pf-soldout { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,10,15,.45); backdrop-filter: blur(1px); }
.pack-foil .pf-soldout span { background: rgba(20,22,29,.92); color: #fff; font-weight: 700; font-size: .82rem; padding: 8px 16px; border-radius: 100px; }
.pack-foil.is-sold { filter: saturate(.5); }

/* Mobile: compact Courtyard-style list — thumbnail · name · price row */
@media (max-width: 640px) {
    .pack-grid { grid-template-columns: 1fr; gap: 0; }
    .pack-cell { flex-direction: row; align-items: center; text-align: left; gap: 14px;
        padding: 13px 2px; border-bottom: 1px solid var(--border-soft); }
    .pack-cell:last-child { border-bottom: none; }
    .pack-foil { flex: 0 0 46px; width: 46px; max-width: 46px; aspect-ratio: 5/7; border-radius: 8px; }
    .pack-cell:hover .pack-foil { transform: none; box-shadow: none; }
    .pack-foil .pf-soldout { display: none; }            /* the grey price pill already says "Sold Out" */
    .pack-cell .pack-name { flex: 1; min-width: 0; margin: 0; font-size: 1rem; line-height: 1.3;
        overflow: hidden; text-overflow: ellipsis; }
    .pack-cell .pack-name .chev { margin-left: 2px; }
    .price-btn { flex: 0 0 auto; padding: 9px 18px; font-size: .9rem; box-shadow: none; }
}

/* ===========================================================================
   Pack detail page (Courtyard-style)
   =========================================================================== */
/* overflow-x:clip contains the decorative ambient glow so it can never push the
   page wider than the viewport on mobile (it's a purely visual radial gradient). */
.pd { position: relative; overflow-x: clip; }
.pd-ambient { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); width: 1100px; max-width: 100%; height: 520px; z-index: 0; pointer-events: none;
    background: radial-gradient(60% 70% at 50% 0%, color-mix(in srgb, var(--c2) 40%, transparent) 0%, transparent 70%); opacity: .5; }
.pd-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 10px; }
.pd-back { color: var(--text-dim); font-weight: 600; font-size: .95rem; }
.pd-back:hover { color: var(--text); }
.pd-odds-btn { background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); font-weight: 600; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.pd-odds-btn:hover { color: var(--text); border-color: var(--text-faint); }
.pd-odds-btn .chev { transition: transform .2s; display: inline-block; }
.pd-odds-btn.open .chev { transform: rotate(180deg); }

.pd-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 8px; }
.pd-title { font-size: 1.8rem; letter-spacing: -.02em; margin-bottom: 22px; }
.pd-pack { width: 230px; margin-bottom: 30px; animation: pack-float 4.5s ease-in-out infinite; }
.pd-pack .pack-foil { max-width: none; width: 100%; aspect-ratio: 5/7; box-shadow: 0 36px 60px -20px rgba(0,0,0,.7); }

.pd-buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.qty-select { display: inline-flex; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 5px; gap: 3px; }
.qty-opt { background: none; border: none; color: var(--text-dim); font-weight: 700; font-size: .95rem; padding: 9px 15px; border-radius: 9px; cursor: pointer; transition: background .12s, color .12s; }
.qty-opt:hover:not(:disabled) { color: var(--text); }
.qty-opt.active { background: var(--primary); color: #fff; }
.qty-opt:disabled { opacity: .3; cursor: not-allowed; }
.buy-btn { background: var(--primary); color: #fff; border: none; font-weight: 700; font-size: 1rem; padding: 14px 30px; border-radius: 12px; cursor: pointer; transition: background .14s, transform .1s; box-shadow: 0 10px 24px -10px var(--primary); }
.buy-btn:hover:not(:disabled) { background: var(--primary-d); }
.buy-btn:active:not(:disabled) { transform: translateY(1px); }
.buy-btn:disabled { background: var(--bg-card-2); color: var(--text-faint); cursor: not-allowed; box-shadow: none; }
.pd-cap { font-size: .82rem; margin-top: 12px; }
.wallet-bonus { background: rgba(46,194,126,.10); border: 1px solid rgba(46,194,126,.4); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.wallet-bonus > strong { display: block; color: #2ec27e; font-size: .95rem; }
.wallet-bonus-msg { margin-top: 5px; font-size: .85rem; color: #8fd9b6; }
.pd-desc { max-width: 480px; margin: 22px auto 0; background: rgba(20,24,33,.7); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 20px; color: var(--text-dim); font-size: .92rem; line-height: 1.55; }

/* Odds panel */
.pd-odds-panel { position: absolute; top: 44px; right: 0; width: 380px; max-width: 92vw; z-index: 5;
    background: rgba(18,21,29,.97); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); text-align: left; }
.pd-odds-backdrop { display: none; } /* desktop uses the anchored dropdown; backdrop only on mobile */
.pd-odds-ev { font-weight: 600; margin-bottom: 12px; }
.pd-odds-ev strong { color: var(--accent); }
.pd-odds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.odds-tile { background: color-mix(in srgb, var(--oc) 14%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--oc) 35%, transparent); border-radius: 10px; padding: 10px; }
.odds-tile .ot-range { font-size: .82rem; font-weight: 600; }
.odds-tile .ot-pct { color: var(--oc); font-weight: 800; font-size: 1.05rem; margin-top: 2px; }
.pd-odds-note { font-size: .76rem; color: var(--text-faint); margin: 12px 0 0; line-height: 1.5; }
.pd-odds-note a { color: var(--text-dim); text-decoration: underline; }

/* Sections */
.pd-section { margin-top: 40px; }
.jp-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.jp-row::-webkit-scrollbar { display: none; }
.jp-card { flex: 0 0 auto; width: 132px; text-align: center; display: block; text-decoration: none; color: inherit; }
.jp-slab { width: 132px; aspect-ratio: 3/4.1; border-radius: 10px; background: linear-gradient(160deg,#1b2130,#11151d); border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 6px; transition: transform .14s, border-color .14s, box-shadow .14s; }
.jp-card:hover .jp-slab { transform: translateY(-3px); border-color: var(--text-faint); box-shadow: 0 14px 28px -16px rgba(0,0,0,.7); }
.jp-card:hover .jp-time { color: var(--text-dim); }
.jp-slab img { width: 100%; height: 100%; object-fit: contain; }
.jp-ph { font-size: 2.2rem; }
.jp-time { color: var(--text-faint); font-size: .76rem; margin-top: 8px; }

/* Courtyard-style "Just Pulled" card: card link on top, pack link below */
.jp2-card { flex: 0 0 auto; width: 170px; }
.jp2-card-top { display: block; text-decoration: none; color: inherit; }
.jp2-card-top .jp-slab { width: 170px; }
.jp2-card-top:hover .jp-slab { transform: translateY(-3px); border-color: var(--text-faint); box-shadow: 0 14px 28px -16px rgba(0,0,0,.7); }
.jp2-name { font-weight: 600; font-size: .82rem; margin: 9px 0 7px; line-height: 1.25; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.1em; }
.jp2-pack { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-dim); padding: 5px 6px; border-radius: 9px; transition: background .12s, color .12s; }
.jp2-pack:hover { background: var(--bg-card-2); color: var(--text); }
.jp2-pack-img { flex: 0 0 auto; width: 28px; height: 36px; border-radius: 5px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg-elev); font-size: .9rem; }
.jp2-pack-img img { width: 100%; height: 100%; object-fit: contain; }
.jp2-pack-meta { display: flex; flex-direction: column; min-width: 0; }
.jp2-pack-name { font-size: .76rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp2-time { font-size: .7rem; color: var(--text-faint); }

.hh-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.hh-cell { position: relative; background: radial-gradient(120% 90% at 50% 18%, #2b2f38 0%, #14171d 70%); border-radius: 14px; padding: 18px 12px 16px; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.hh-cell:hover { transform: translateY(-3px); box-shadow: 0 12px 26px -10px rgba(0,0,0,.6); }
.hh-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hh-cell.hh-hidden { display: none; }
.hh-card { width: 78%; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; }
.hh-card img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 12px rgba(0,0,0,.5)); }
.hh-ph { font-size: 2.4rem; }
.show-more { width: 100%; margin-top: 14px; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); padding: 13px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.show-more:hover { color: var(--text); }

/* Heavy Hitter lightbox */
.hh-modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; }
.hh-modal.show { display: flex; }
.hh-modal-overlay { position: absolute; inset: 0; background: rgba(6,8,12,.82); backdrop-filter: blur(6px); }
.hh-modal-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; max-width: 460px; width: 100%; animation: hh-pop .28s cubic-bezier(.2,.8,.25,1); }
@keyframes hh-pop { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
.hh-modal-figure { width: 100%; display: flex; justify-content: center; }
.hh-modal-figure img { width: min(78vw, 360px); max-height: 68vh; object-fit: contain; border-radius: 10px; filter: drop-shadow(0 26px 44px rgba(0,0,0,.65)); }
.hh-modal-ph { font-size: 5rem; }
.hh-modal-cap { text-align: center; margin-top: 20px; }
.hh-modal-name { font-size: 1.05rem; font-weight: 700; line-height: 1.35; max-width: 420px; }
.hh-modal-grade { margin-top: 10px; display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .04em; color: var(--legendary); border: 1px solid rgba(245,158,11,.4); background: rgba(245,158,11,.12); padding: 4px 12px; border-radius: 100px; }
.hh-modal-x { position: absolute; top: 18px; right: 20px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-soft); background: rgba(20,22,30,.72); color: #fff; font-size: 1.05rem; cursor: pointer; }
.hh-modal-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-soft); background: rgba(20,22,30,.72); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hh-modal-nav:hover, .hh-modal-x:hover { background: rgba(42,46,60,.95); }
.hh-modal-nav.prev { left: 22px; }
.hh-modal-nav.next { right: 22px; }
@media (max-width: 560px) { .hh-modal-nav.prev { left: 6px; } .hh-modal-nav.next { right: 6px; } }

.morepacks-row { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 18px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.morepacks-row::-webkit-scrollbar { display: none; }

@media (max-width: 1100px) { .hh-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
    .hh-grid { grid-template-columns: repeat(3, 1fr); }
    /* Odds: bottom sheet anchored to the viewport so it's always visible on tap */
    .pd-odds-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: 100%;
        margin: 0; max-height: 82vh; overflow-y: auto; border-radius: 18px 18px 0 0; z-index: 130;
        padding-bottom: max(18px, env(safe-area-inset-bottom)); }
    .pd-odds-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 129;
        background: rgba(6,8,12,.7); backdrop-filter: blur(3px); }
}

/* Checkout / top-up modal — mobile: full-screen sheet, top-aligned, scrollable */
@media (max-width: 640px) {
    .checkout-modal { align-items: flex-start; justify-content: center; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .co-card { width: 100%; max-width: 100%; min-height: 100%; border-radius: 0; }
    .co-head { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
    .co-grid { grid-template-columns: 1fr; gap: 14px; padding: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ===========================================================================
   Marketplace — toolbar, grid, filters panel, pagination
   =========================================================================== */
.mk-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.mk-view { display: inline-flex; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 10px; padding: 3px; }
.mk-view .vt { background: none; border: none; color: var(--text-faint); width: 34px; height: 32px; border-radius: 7px; cursor: pointer; font-size: 1rem; }
.mk-view .vt.active { background: var(--bg-card-2); color: var(--text); }
.mk-count { color: var(--text-dim); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.mk-search { flex: 1; display: flex; align-items: center; gap: 9px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 11px; padding: 0 14px; color: var(--text-faint); }
.mk-search input { flex: 1; background: none; border: none; color: var(--text); font: inherit; padding: 11px 0; outline: none; }
.mk-sort select, .mk-filter-btn { background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); border-radius: 11px; padding: 11px 14px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.mk-filter-btn { display: inline-flex; align-items: center; gap: 8px; }
.mk-filter-btn:hover, .mk-sort select:hover { color: var(--text); border-color: var(--text-faint); }

.mk-body { display: block; }

/* Grid + cards */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.mk-grid.dense { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.mk-card { position: relative; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; transition: transform .14s, border-color .14s; }
.mk-card:hover { transform: translateY(-3px); border-color: var(--text-faint); }
.mk-off { position: absolute; top: 12px; left: 12px; z-index: 3; background: rgba(34,197,94,.16); color: #6ee7a8; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 100px; border: 1px solid rgba(34,197,94,.3); }
.mk-heart { position: absolute; top: 12px; right: 12px; z-index: 3; background: rgba(0,0,0,.35); border: none; width: 30px; height: 30px; border-radius: 50%; color: #cdd3e0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mk-heart:hover { color: #fff; }
.mk-heart.liked { color: #ff5d6c; }
.mk-heart.liked svg { fill: #ff5d6c; }
.mk-img { aspect-ratio: 3/3.6; border-radius: 12px; background: radial-gradient(120% 90% at 50% 20%, #2a2f38 0%, #14171d 72%); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; padding: 10px; }
.mk-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0,0,0,.45)); }
.mk-ph { font-size: 2.6rem; }
.mk-auction { position: absolute; bottom: 8px; left: 8px; background: rgba(108,92,255,.85); color: #fff; font-size: .66rem; font-weight: 700; padding: 3px 8px; border-radius: 100px; }
.mk-status { position: absolute; top: 8px; left: 8px; z-index: 3; font-size: .62rem; text-transform: capitalize; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.mk-name { font-weight: 600; font-size: .9rem; margin: 12px 0 10px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; }
.mk-prices { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.mk-price { font-weight: 800; }
.mk-fmv { background: var(--bg-card-2); color: var(--text-faint); font-size: .74rem; font-weight: 600; padding: 4px 9px; border-radius: 8px; }

/* Marketplace + profile collection — mobile (2-up grid, wrapping toolbar) */
@media (max-width: 640px) {
    .mk-toolbar { flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
    .mk-search { order: 5; flex: 1 1 100%; min-width: 0; }
    .mk-search input { min-width: 0; padding: 10px 0; }
    .mk-count { font-size: .82rem; }
    .mk-sort select, .mk-filter-btn { padding: 9px 12px; font-size: .82rem; }
    .mk-grid, .mk-grid.dense { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .mk-card { padding: 10px; border-radius: 13px; }
    .mk-name { font-size: .82rem; margin: 9px 0 8px; }
    .mk-fmv { font-size: .68rem; padding: 3px 7px; }
    .mk-price { font-size: .9rem; }
}

/* Marketplace Buy Now / Auction tabs */
.mk-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.mk-tab { padding: 9px 18px; border-radius: 100px; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); font-weight: 700; font-size: .9rem; }
.mk-tab:hover { color: var(--text); }
.mk-tab.active { background: linear-gradient(120deg, var(--primary), var(--primary-d)); color: #fff; border-color: transparent; }

/* Auction countdown urgency */
.mk-auction.urgent { background: rgba(239,68,68,.9); }
.auction-timer { margin-top: 12px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.auction-timer.urgent { color: var(--danger); }

/* List-your-collectible modal */
.lm { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 18px; }
.lm[hidden] { display: none; }
.lm-overlay { position: absolute; inset: 0; background: rgba(6,8,12,.7); backdrop-filter: blur(4px); }
.lm-card { position: relative; z-index: 1; width: 420px; max-width: 100%; max-height: 92vh; overflow-y: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; padding: 20px; animation: hh-pop .26s cubic-bezier(.2,.8,.25,1); }
.lm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lm-head h3 { margin: 0; }
.lm-x { background: none; border: none; color: var(--text-faint); font-size: 1.1rem; cursor: pointer; }
.lm-asset { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px; margin-bottom: 16px; }
.lm-thumb { width: 44px; height: 56px; border-radius: 6px; background: #14171d; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.lm-thumb img { width: 100%; height: 100%; object-fit: contain; }
.lm-toggle { display: flex; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.lm-tab { flex: 1; padding: 9px; border: none; background: none; color: var(--text-dim); font-weight: 700; border-radius: 9px; cursor: pointer; }
.lm-tab.active { background: var(--primary); color: #fff; }
.lm-priceinput { display: flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 11px; padding: 0 14px; }
.lm-priceinput span { color: var(--text-faint); font-weight: 700; }
.lm-priceinput input { flex: 1; min-width: 0; background: none; border: none; color: var(--text); font: inherit; font-size: 1.05rem; padding: 13px 0; outline: none; }
.lm [data-list-min] { display: block; margin-top: 6px; }
.lm [data-list-min].err { color: var(--danger); }
.lm-summary { margin: 16px 0; padding: 14px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; }
.lm-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; color: var(--text-dim); }
.lm-total { display: flex; justify-content: space-between; padding: 10px 0 2px; border-top: 1px solid var(--border-soft); margin-top: 6px; font-weight: 800; font-size: 1.05rem; }
.lm-submit { width: 100%; background: var(--primary); color: #fff; border: none; font-weight: 700; font-size: 1rem; padding: 14px; border-radius: 12px; cursor: pointer; }
.lm-submit:hover { background: var(--primary-d); }
.lm-submit:disabled { opacity: .5; cursor: not-allowed; }
.lm-terms { font-size: .76rem; text-align: center; margin-top: 12px; }

/* ---- Fanatics-style listing / auction page ------------------------------ */
.fc-crumb { color: var(--text-faint); font-size: .85rem; margin-bottom: 16px; }
.fc-crumb a { color: var(--text-dim); }
.fc-crumb span { margin: 0 6px; }
.fc-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.fc-media { position: sticky; top: 20px; }
.fc-img { aspect-ratio: 4/5; border-radius: 16px; background: radial-gradient(120% 90% at 50% 25%, #1c2027, #0d0f14 75%); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 28px; }
.fc-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 24px 36px rgba(0,0,0,.6)); }
.fc-thumbs { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.fc-thumb { width: 54px; height: 68px; border-radius: 8px; overflow: hidden; background: #14171d; border: 1px solid var(--border-soft); cursor: pointer; padding: 4px; }
.fc-thumb.active { border-color: var(--primary); }
.fc-thumb img { width: 100%; height: 100%; object-fit: contain; }

.fc-lot { color: var(--text-faint); font-size: .8rem; letter-spacing: .02em; margin-bottom: 8px; }
.fc-title { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; }
.fc-subtitle { color: var(--text-dim); margin: 0 0 22px; }
.fc-bidhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 6px; }
.fc-label { color: var(--text-faint); font-size: .72rem; font-weight: 700; letter-spacing: .08em; }
.fc-bigprice { font-size: 3rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; margin-top: 4px; }
.fc-bidsbox { text-align: right; }
.fc-taxes { color: var(--primary); font-size: .82rem; margin-top: 6px; }
.fc-timerow { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--border-soft); margin-top: 14px; }
.fc-timeval { font-weight: 800; font-size: 1.05rem; }
.fc-timeval.urgent { color: var(--danger); }
.fc-leader { font-size: .9rem; margin: 6px 0 14px; }
.fc-userlink { color: var(--text); font-weight: 600; }
.fc-userlink:hover { color: var(--primary); text-decoration: underline; }
.fc-youlead { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ok);
    background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
    padding: 6px 12px; border-radius: 100px; }
.fc-bidactions { display: flex; gap: 12px; margin-top: 8px; }
.fc-bidselect { flex: 1; min-width: 0; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text); border-radius: 12px; padding: 14px; font: inherit; font-weight: 600; cursor: pointer; }
.fc-bidbtn { flex: 0 0 auto; min-width: 150px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; border: none; border-radius: 100px; padding: 14px 28px; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; }
.fc-bidbtn:hover { background: var(--primary-d); }
.fc-bidbtn-ghost { background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text); width: 100%; margin-top: 10px; }
.fc-finehint, .fc-ownernote { font-size: .82rem; margin-top: 12px; }
.fc-ended { font-size: 1.05rem; margin: 8px 0 4px; }
.fc-section { margin-top: 28px; }
.fc-section h3 { margin: 0 0 8px; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.fc-fulfil { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 14px; margin-top: 24px; }
.fc-fulfil-ic { font-size: 1.5rem; }
.fc-offer { margin-top: 12px; }
.fc-offer summary { color: var(--text-dim); cursor: pointer; font-size: .9rem; }

/* Wallet: available vs reserved/held */
.wallet-held { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); color: var(--legendary); font-weight: 600; font-size: .92rem; }
.wallet-total { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-dim); font-size: .92rem; }

/* Bonus balance row (non-cashable promo credit) */
.wallet-bonus-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.wallet-bonus-row .wbr-label { display: flex; align-items: center; gap: 6px; color: #8fd9b6; font-weight: 600; font-size: .92rem; }
.wallet-bonus-row .wbr-amt { color: #2ec27e; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* "?" help bubble */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; background: var(--border-soft, #2a3140);
    color: var(--text-dim, #9aa3b5); font-size: 11px; font-weight: 700; cursor: help;
    line-height: 1; vertical-align: middle; user-select: none; }
.tip:hover, .tip:focus-visible { background: var(--accent, #f5c518); color: #11131a; outline: none; }
.tip .tip-body { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: 240px; background: #0d0f16; color: #cdd3e0; border: 1px solid var(--border-soft, #2a3140);
    border-radius: 8px; padding: 8px 11px; font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left;
    box-shadow: 0 8px 24px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 40; pointer-events: none; }
.tip:hover .tip-body, .tip:focus-visible .tip-body { opacity: 1; visibility: visible; }
.tip .tip-body::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: #0d0f16; }
.bb-myoffer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); border-radius: 10px; font-size: .88rem; }
.bb-myoffer form { margin: 0; }

/* ---- Giveaways — Hellcase-style listing --------------------------------- */
.gw2-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 14px; flex-wrap: wrap; }
.gw2-tabs { display: flex; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 4px; }
.gw2-tabs a { padding: 9px 18px; border-radius: 9px; font-weight: 700; font-size: .92rem; color: var(--text-dim); display: inline-flex; align-items: center; gap: 7px; }
.gw2-tabs a:hover { color: var(--text); }
.gw2-tabs a.on { background: var(--bg-card-2); color: var(--text); }
.gw2-create { white-space: nowrap; }
.gw2-filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; font-size: .9rem; }
.gw2-scope { display: inline-flex; align-items: center; gap: 4px; }
.gw2-scope a { padding: 7px 14px; border-radius: 100px; color: var(--text-dim); font-weight: 600; }
.gw2-scope a:hover { color: var(--text); }
.gw2-scope a.on { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--text); }

.gw2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.gw2-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 14px; display: flex; flex-direction: column;
    border-top: 2px solid color-mix(in srgb, var(--legendary) 60%, var(--border)); transition: transform .14s, border-color .14s, box-shadow .14s; }
.gw2-card:hover { transform: translateY(-3px); border-color: var(--text-faint); box-shadow: 0 14px 30px -18px rgba(0,0,0,.7); }

.gw2-head { display: flex; align-items: center; gap: 10px; }
.gw2-ava { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: .95rem; }
.gw2-who { flex: 1; min-width: 0; }
.gw2-name { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw2-verif { color: var(--legendary); font-size: .8rem; }
.gw2-role { font-size: .76rem; color: var(--legendary); font-weight: 600; }
.gw2-hot { background: rgba(244,63,94,.16); color: #ff6b7d; border: 1px solid rgba(244,63,94,.35); font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 100px; }
.gw2-part { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 700; color: var(--text-dim); }

.gw2-stage { position: relative; display: block; margin: 14px 0; height: 248px; border-radius: 12px; overflow: hidden;
    background: radial-gradient(120% 90% at 50% 12%, rgba(255,255,255,.05), transparent 62%), var(--bg-elev); }
.gw2-slides { position: absolute; inset: 0; }
.gw2-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; pointer-events: none; }
.gw2-slide.on { opacity: 1; pointer-events: auto; }
.gw2-img { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; }
.gw2-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(0,0,0,.55)); }
.gw2-ph { font-size: 3rem; opacity: .6; }
.gw2-prize { position: absolute; left: 12px; bottom: 10px; right: 12px; }
.gw2-pname { font-size: .82rem; font-weight: 700; color: var(--text); text-shadow: 0 1px 4px rgba(0,0,0,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw2-pprice { display: inline-block; margin-top: 5px; background: var(--legendary); color: #1a1404; font-weight: 800; font-size: .82rem; padding: 2px 9px; border-radius: 6px; }
.gw2-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 30px; height: 30px; border-radius: 50%;
    background: rgba(10,12,18,.6); border: 1px solid var(--border-soft); color: var(--text); font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .14s; }
.gw2-stage:hover .gw2-nav { opacity: 1; }
.gw2-nav.prev { left: 6px; } .gw2-nav.next { right: 6px; }
.gw2-nav:hover { background: rgba(10,12,18,.85); }
.gw2-dots { position: absolute; left: 12px; bottom: -2px; display: flex; gap: 4px; z-index: 2; }
.gw2-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); opacity: .5; }
.gw2-dots span.on { opacity: 1; background: var(--legendary); width: 14px; border-radius: 100px; transition: width .2s; }

.gw2-total { display: flex; align-items: center; justify-content: space-between; background: var(--bg-elev); border: 1px solid var(--border-soft);
    border-radius: 10px; padding: 9px 12px; font-size: .9rem; }
.gw2-total small { color: var(--text-faint); font-weight: 600; }
.gw2-total strong { color: var(--ok); font-size: 1.12rem; }

.gw2-timer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.gw2-timer > div { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 9px; padding: 11px 0; text-align: center; }
.gw2-timer b { display: block; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gw2-timer span { font-size: .6rem; letter-spacing: .06em; color: var(--text-faint); font-weight: 700; }
.gw2-when { margin-top: 8px; text-align: center; font-size: .82rem; color: var(--text-dim); font-weight: 600; }

.gw2-cta { margin-top: 14px; display: block; text-align: center; padding: 13px; border-radius: 10px; font-weight: 800; font-size: .86rem;
    letter-spacing: .04em; text-transform: uppercase; color: var(--legendary); border: 1px solid color-mix(in srgb, var(--legendary) 45%, transparent); transition: background .14s; }
.gw2-cta:hover { background: color-mix(in srgb, var(--legendary) 14%, transparent); }

/* Mobile: one big, clear card per row (Hellcase-style) */
@media (max-width: 640px) {
    .gw2-grid { grid-template-columns: 1fr; gap: 14px; }
    .gw2-card { padding: 16px; border-radius: 16px; }
    .gw2-stage { height: 300px; margin: 14px 0; }
    .gw2-ava { width: 42px; height: 42px; font-size: 1.1rem; }
    .gw2-name { font-size: 1.05rem; }
    .gw2-role { font-size: .84rem; }
    .gw2-part { font-size: .95rem; }
    .gw2-pname { font-size: 1rem; }
    .gw2-pprice { font-size: 1rem; padding: 4px 12px; }
    .gw2-total { padding: 13px 16px; font-size: 1rem; }
    .gw2-total strong { font-size: 1.3rem; }
    .gw2-timer { gap: 8px; }
    .gw2-timer > div { padding: 14px 0; }
    .gw2-timer b { font-size: 1.55rem; }
    .gw2-timer span { font-size: .68rem; }
    .gw2-cta { padding: 16px; font-size: .95rem; }
    /* No hover on touch — keep the carousel arrows visible. */
    .gw2-nav { opacity: 1; width: 36px; height: 36px; font-size: 1.25rem; }
}

/* ---- Giveaway detail (Hellcase-style) ---------------------------------- */
.gwd-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gwd-title { margin: 10px 0 2px; font-size: 1.7rem; }
.gwd-timer-wrap { text-align: right; }
.gwd-timer-wrap .fc-label { margin-bottom: 6px; }
.gwd-timer-wrap .gw2-timer { margin-top: 0; min-width: 230px; }
.gwd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.gwd-stat { display: flex; align-items: center; gap: 11px; }
.gwd-stat-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; background: var(--bg-elev); border: 1px solid var(--border-soft); }
.gwd-stat-label { font-size: .78rem; color: var(--text-faint); font-weight: 600; }
.gwd-stat-val { font-size: 1.15rem; font-weight: 800; }
.gwd-money { color: var(--ok); }

.gwd-pre-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.gwd-ring { --p: 0; flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; position: relative;
    background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--border) 0); }
.gwd-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg-card); }
.gwd-ring span { position: relative; font-size: .8rem; font-weight: 800; }

.gwd-reqs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gwd-req { display: flex; align-items: center; gap: 12px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; }
.gwd-req.met { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: color-mix(in srgb, var(--ok) 7%, var(--bg-elev)); }
.gwd-req-ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; background: var(--bg-card); border: 1px solid var(--border-soft); }
.gwd-req-body { flex: 1; min-width: 0; }
.gwd-req-title { font-weight: 700; font-size: .92rem; }
.gwd-req-sub { font-size: .8rem; color: var(--text-faint); margin-top: 3px; }
.gwd-req-action { flex: 0 0 auto; }
.gwd-done { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 700; color: var(--ok); }

.gwd-prizes-h { text-align: center; margin: 4px 0 18px; }
.gwd-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.gwd-prize { position: relative; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px; display: flex; flex-direction: column;
    transition: transform .14s, border-color .14s; overflow: hidden; }
.gwd-prize::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 90px; background: radial-gradient(120% 130% at 50% 0%, rgba(255,255,255,.06), transparent 70%); pointer-events: none; }
.gwd-prize:hover { transform: translateY(-3px); border-color: var(--text-faint); }
.gwd-prize-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.gwd-prize-price { background: rgba(34,197,94,.16); color: #6ee7a8; border: 1px solid rgba(34,197,94,.3); font-size: .78rem; font-weight: 800; padding: 2px 8px; border-radius: 7px; }
.gwd-prize-grade { font-size: .72rem; font-weight: 700; color: var(--text-faint); }
.gwd-prize-img { aspect-ratio: 3/3.7; display: flex; align-items: center; justify-content: center; padding: 8px; }
.gwd-prize-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0,0,0,.5)); }
.gwd-prize-img .gw2-ph { font-size: 2.4rem; opacity: .6; }
.gwd-prize-name { font-weight: 700; font-size: .86rem; text-align: center; line-height: 1.25; }
.gwd-prize-winner { margin-top: 6px; text-align: center; font-size: .78rem; color: var(--legendary); font-weight: 700; }

@media (max-width: 760px) {
    .gwd-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .gwd-timer-wrap { text-align: left; }
    .gwd-reqs { grid-template-columns: 1fr; }
    .gwd-prizes { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Giveaways (legacy detail-page cards) ------------------------------- */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.gw-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; transition: transform .14s, border-color .14s; }
.gw-card:hover { transform: translateY(-3px); border-color: var(--text-faint); }
.gw-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gw-title { margin: 2px 0; font-size: 1.12rem; }
.gw-stats { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.gw-time { font-size: .8rem; color: var(--legendary); font-weight: 700; }
.gw-time.urgent, .gw-bigtime.urgent { color: var(--danger); }
.gw-badge { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 100px; }
.gw-active { background: rgba(34,197,94,.16); color: #6ee7a8; border: 1px solid rgba(34,197,94,.35); }
.gw-upcoming { background: rgba(108,92,255,.16); color: #b9adff; border: 1px solid rgba(108,92,255,.35); }
.gw-ended, .gw-cancelled, .gw-drawing { background: rgba(255,255,255,.06); color: var(--text-faint); border: 1px solid var(--border-soft); }
.gw-bigtime { font-size: 1.4rem; font-weight: 800; }

.gw-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 8px; }
.gw-prize { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px; text-align: center; text-decoration: none; color: var(--text); }
.gw-prize:hover { border-color: var(--text-faint); }
.gw-prize-img { aspect-ratio: 3/3.6; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 20%, #2b2f38, #14171d 72%); border-radius: 8px; padding: 8px; font-size: 2rem; }
.gw-prize-img img { width: 100%; height: 100%; object-fit: contain; }
.gw-prize-name { font-size: .82rem; font-weight: 600; margin-top: 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gw-prize-fmv { font-size: .8rem; color: var(--text-faint); margin-top: 2px; }
.gw-prize-winner { margin-top: 6px; font-size: .76rem; font-weight: 700; color: var(--legendary); }

.gw-reqs { list-style: none; padding: 0; margin: 0 0 4px; display: flex; flex-direction: column; gap: 8px; }
.gw-reqs li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gw-reqs li.met { color: var(--text-dim); }
.gw-req-mark { flex: 0 0 auto; }
.gw-req-cta { margin-left: auto; color: var(--primary); font-weight: 600; font-size: .85rem; }
.gw-joined { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #6ee7a8; padding: 12px 14px; border-radius: 10px; font-weight: 600; }

.gw-prizepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px; }
.gw-pick { cursor: pointer; }
.gw-pick input { position: absolute; opacity: 0; pointer-events: none; }
.gw-pick-card { display: block; background: var(--bg-elev); border: 2px solid var(--border-soft); border-radius: 12px; padding: 8px; text-align: center; transition: border-color .12s; }
.gw-pick input:checked + .gw-pick-card { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.gw-pick input:disabled + .gw-pick-card { opacity: .4; }
.gw-pick-img { aspect-ratio: 3/3.6; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 20%, #2b2f38, #14171d 72%); border-radius: 8px; padding: 6px; font-size: 1.8rem; }
.gw-pick-img img { width: 100%; height: 100%; object-fit: contain; }
.gw-pick-name { font-size: .78rem; font-weight: 600; margin-top: 6px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gw-pick-fmv { font-size: .76rem; color: var(--text-faint); }

/* Requirement tiles (create form) */
.gw-reqgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.gw-req-tile { display: block; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; transition: border-color .12s; }
.gw-req-tile.on { border-color: var(--ok); }
.gw-req-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; padding: 0; text-align: left; }
.gw-req-ic { font-size: 1.05rem; }
.gw-req-label { flex: 1; }
.gw-req-tick { color: var(--ok); font-weight: 800; opacity: 0; margin-left: auto; }
.gw-req-tile.on .gw-req-tick { opacity: 1; }
.gw-req-cfg { display: none; flex-direction: column; gap: 8px; margin-top: 12px; }
.gw-req-tile.on .gw-req-cfg { display: flex; }
.gw-req-or { margin-top: 4px; font-size: .8rem; font-weight: 700; color: var(--text-dim); border-top: 1px dashed var(--border-soft); padding-top: 10px; }
.gw-req-or small { font-weight: 400; }
@media (max-width: 760px) { .gw-reqgrid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
    .fc-detail { grid-template-columns: 1fr; gap: 22px; }
    .fc-media { position: static; }
    .fc-bigprice { font-size: 2.4rem; }
    .fc-bidactions { flex-direction: column; }
    .fc-bidbtn { width: 100%; }
}

/* Pagination */
.mk-pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.mk-pager .pg { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); font-weight: 600; padding: 0 10px; }
.mk-pager .pg:hover { color: var(--text); border-color: var(--text-faint); }
.mk-pager .pg.on { background: var(--primary); color: #fff; border-color: transparent; }
.mk-pager .pg-dots { color: var(--text-faint); padding: 0 4px; }

/* Filters panel (slide-in) */
.mk-filters { position: fixed; top: 0; right: 0; height: 100vh; width: 320px; max-width: 88vw; background: var(--bg-elev); border-left: 1px solid var(--border); z-index: 80; padding: 18px; overflow-y: auto; transform: translateX(100%); transition: transform .24s ease; }
.mk-page.filters-open .mk-filters { transform: translateX(0); }
.mk-filters-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 75; }
.mk-page.filters-open .mk-filters-overlay { display: block; }
.mk-filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mk-filters-head h3 { margin: 0; }
.mk-filters-close { background: none; border: none; color: var(--text-faint); font-size: 1.1rem; cursor: pointer; }
.filt { border-bottom: 1px solid var(--border-soft); padding: 12px 2px; }
.filt summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.filt summary::-webkit-details-marker { display: none; }
.filt summary::after { content: '⌄'; color: var(--text-faint); transition: transform .2s; }
.filt[open] summary::after { transform: rotate(180deg); }
.filt > *:not(summary) { margin-top: 12px; }
.filt-row { display: flex; gap: 8px; }
.mk-filters-actions { display: flex; gap: 10px; margin-top: 18px; position: sticky; bottom: 0; background: var(--bg-elev); padding: 12px 0 4px; }

/* ===========================================================================
   Asset / card detail page
   =========================================================================== */
.asset-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.asset-stage { position: sticky; top: 80px; border-radius: 20px; min-height: 620px; display: flex; align-items: center; justify-content: center; padding: 28px;
    background: radial-gradient(120% 90% at 50% 25%, #2b2f38 0%, #14171d 65%, #0e1015 100%); border: 1px solid var(--border-soft); }
.asset-stage .pedestal-card-wrap { width: 100%; display: flex; justify-content: center; }
.asset-stage .pedestal-card { width: min(84%, 420px); aspect-ratio: 5/7; background: none; border: none; overflow: visible; }
.asset-stage .pedestal-card img { filter: drop-shadow(0 18px 30px rgba(0,0,0,.6)); }
.asset-stage .rarity-aura { width: 460px; height: 460px; }
.asset-thumbs { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.asset-thumb { width: 56px; height: 74px; border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: var(--bg-card-2); border: 2px solid var(--border-soft); transition: border-color .14s; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-thumb:hover { border-color: var(--text-faint); }
.asset-thumb.active { border-color: var(--primary); }

.asset-wrap { max-width: 1280px; margin: 0 auto; }
.asset-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.vaulted-pill { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 100px; padding: 8px 16px; font-size: .85rem; font-weight: 600; color: var(--text-dim); }
.asset-top-actions { display: flex; gap: 10px; }
.like-count, .share-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-soft); color: var(--text-dim); border-radius: 100px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.like-count:hover, .share-btn:hover { color: var(--text); }
.like-count.liked { color: #ff5d6c; } .like-count.liked svg { fill: #ff5d6c; }

.asset-title { font-size: 1.7rem; line-height: 1.25; margin-bottom: 10px; }
.owned-by { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: .9rem; margin-bottom: 14px; }
.ob-avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; font-size: .7rem; display: inline-flex; align-items: center; justify-content: center; }
.ob-name { color: #b9adff; font-weight: 600; }
.ob-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ob-link:hover .ob-name { text-decoration: underline; }
.asset-cert { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cert-badge { background: var(--bg-card-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 5px 11px; font-size: .82rem; font-weight: 600; }
.cert-verify { color: var(--primary); font-size: .85rem; font-weight: 600; }
.trust-row { display: flex; flex-wrap: wrap; gap: 16px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 14px 18px; font-size: .85rem; color: var(--text-dim); margin-bottom: 16px; }

/* Buy box */
.buy-box { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; }
.bb-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bb-label { color: var(--text); font-weight: 700; font-size: .85rem; }
.bb-price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.bb-buy { min-width: 150px; }
.bb-head form { margin: 0; }
.bb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bb-row2 .bb-detail, .bb-row2 > a { min-width: 0; }
.bb-detail summary { list-style: none; }
.bb-detail summary::-webkit-details-marker { display: none; }
.bb-topoffer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); color: var(--text-dim); font-size: .9rem; }
.bb-topoffer strong { color: var(--ok); }
.bb-unavailable { color: var(--warn); font-size: .92rem; }

.pb-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; }
.pb-row + .pb-row { border-top: 1px solid var(--border-soft); }
.pb-row strong { font-size: 1.15rem; }
.conf { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.conf i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: inline-block; }
.conf-high { color: var(--ok); } .conf-high i.on { background: var(--ok); }
.conf-medium { color: var(--warn); } .conf-medium i.on { background: var(--warn); }
.conf-low { color: var(--danger); } .conf-low i.on { background: var(--danger); }

.asset-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.asset-actions form { margin: 0; }
.sell-toggle summary { list-style: none; }
.sell-toggle summary::-webkit-details-marker { display: none; }

.info-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.info-card h3 { font-size: 1rem; margin-bottom: 12px; }
.hist-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: .9rem; }
.hist-row:last-child { border-bottom: none; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--bg-card-2); border: 1px solid var(--border-soft); border-radius: 100px; padding: 5px 12px; font-size: .8rem; color: var(--text-dim); }
.act-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.act-row:last-child { border-bottom: none; }
.act-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-card-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-type { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.act-price { color: var(--accent); }
.act-sub { font-size: .8rem; margin-top: 2px; }

@media (max-width: 900px) { .asset-page { grid-template-columns: 1fr; } .asset-stage { position: static; min-height: 400px; } }

/* ===========================================================================
   Leaderboard
   =========================================================================== */
.lb { max-width: 900px; margin: 0 auto; }
.lb-hero { text-align: center; margin-bottom: 28px; }
.lb-hero h1 { font-size: 2rem; }
.lb-reset { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 100px; padding: 8px 16px; color: var(--text-dim); font-size: .88rem; margin-top: 10px; }

/* Podium */
.lb-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; max-width: 680px; margin: 0 auto 8px; }
.pod { display: flex; flex-direction: column; align-items: center; position: relative; }
.pod-avatar { width: 78px; height: 78px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.7rem; position: relative; box-shadow: 0 0 40px -6px currentColor; }
.pod-1 .pod-avatar { width: 92px; height: 92px; font-size: 2rem; box-shadow: 0 0 60px -4px var(--legendary); }
.pod-crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 1.4rem; }
.pod-name { font-weight: 700; margin-top: 12px; }
.pod-rank { color: var(--text-faint); font-size: .85rem; margin-bottom: 12px; }
.pod-plat { width: 100%; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--bg-card-2), var(--bg-card)); border: 1px solid var(--border-soft); border-bottom: none; display: flex; align-items: flex-start; justify-content: center; padding: 16px 8px; }
.pod-1 .pod-plat { min-height: 130px; background: linear-gradient(180deg, rgba(245,158,11,.16), var(--bg-card)); border-color: rgba(245,158,11,.3); }
.pod-2 .pod-plat { min-height: 96px; }
.pod-3 .pod-plat { min-height: 72px; }
.pod-pts { font-weight: 800; }

/* Status / promo box */
.lb-status { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 24px; text-align: center; margin: 18px 0; }
.lb-you-rank { font-size: 1.05rem; margin-bottom: 14px; }
.lb-promo > strong { font-size: 1.05rem; }
.lb-promo p { max-width: 560px; margin: 8px auto 14px; }
.lb-prizes { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; font-size: .85rem; color: var(--text-dim); }
.lb-prizes span { white-space: nowrap; }

/* Month toggle */
.lb-toggle { display: flex; justify-content: flex-end; gap: 4px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 4px; width: max-content; margin: 0 0 16px auto; }
.lb-toggle a { padding: 9px 16px; border-radius: 9px; color: var(--text-dim); font-weight: 600; font-size: .88rem; }
.lb-toggle a.on { background: var(--bg-card-2); color: var(--text); }

/* Ranked list */
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 13px 18px; }
.lb-row.is-me { border-color: var(--primary); background: linear-gradient(100deg, rgba(108,92,255,.12), var(--bg-card)); }
.lb-pos { color: var(--text-faint); font-weight: 700; min-width: 42px; }
.lb-avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.lb-user { font-weight: 600; flex: 1; }
.lb-pts { font-weight: 700; color: var(--text-dim); }

@media (max-width: 560px) {
    .lb-podium { max-width: none; }
    .pod-avatar { width: 60px; height: 60px; font-size: 1.3rem; }
    .pod-1 .pod-avatar { width: 70px; height: 70px; }
    .lb-toggle { width: 100%; }
}

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
    .app-shell.nav-open .sidebar { transform: translateX(0); }
    .app-shell.nav-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
    .sb-toggle { display: block; }
    .sb-collapse { display: none; }
    .app-content { padding: 18px 16px 80px; }
    .app-topbar { padding: 12px 16px; }
    .hero-copy h1 { font-size: 1.9rem; }
    .hero-pack { width: 130px; right: 2%; opacity: .85; }
    .hero-slide { padding: 26px; }
}

@media (max-width: 860px) {
    .detail-grid { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sb-toggle { display: inline-flex; align-items: center; }
    .admin-sidebar { position: fixed; left: 0; top: 0; width: 260px; height: 100vh; overflow-y: auto;
        transform: translateX(-100%); transition: transform .22s ease; z-index: 60; box-shadow: 0 0 40px rgba(0,0,0,.5); }
    .admin-shell.nav-open .admin-sidebar { transform: translateX(0); }
    .admin-shell.nav-open .admin-sb-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
    .mainnav { display: none; }
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
    .stat-row { gap: 24px; flex-wrap: wrap; }
}

/* ---- Public collector profile ------------------------------------------- */
.pf-page { max-width: 1100px; margin: 0 auto; }
.pf-head { display: flex; align-items: center; gap: 18px; padding: 12px 0 28px; }
.pf-avatar { width: 76px; height: 76px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.pf-id { flex: 1; min-width: 0; }
.pf-id h1 { margin: 0; font-size: 1.6rem; line-height: 1.1; word-break: break-word; }
.pf-addr { color: var(--text-faint); font-size: .85rem; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, monospace; }
.pf-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.pf-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-soft); margin: 6px 0 24px; }
.pf-tab { padding: 12px 20px; color: var(--text-dim); font-weight: 700; font-size: 1rem; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 9px 9px 0 0; transition: color .15s, background .15s; }
.pf-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.pf-tab.active { color: var(--text); border-bottom-color: var(--primary); }
.pf-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-size: .95rem; }

.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.pf-card { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.pf-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(0,0,0,.6); }
.pf-card-img { aspect-ratio: 3/3.6; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 20%, #2b2f38, #14171d 72%); padding: 14px; }
.pf-card-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); }
.pf-card-ph { font-size: 2.6rem; }
.pf-card-name { padding: 10px 12px 2px; font-weight: 600; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-card-meta { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 12px; font-size: .78rem; }
.pf-fmv { background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); padding: 2px 8px; border-radius: 100px; color: var(--text-dim); font-weight: 600; }

.pf-act-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.pf-act-filter { width: auto; min-width: 160px; }
.pf-activity { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; }
.pf-act-row { display: grid; grid-template-columns: 96px 84px 52px 1fr auto auto 26px; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--text); transition: background .12s; }
.pf-act-row:last-child { border-bottom: none; }
.pf-act-row:hover { background: rgba(255,255,255,.035); }
.pf-act-badge { font-size: .72rem; font-weight: 700; border: 1px solid; border-radius: 100px; padding: 4px 12px; text-align: center; justify-self: start; }
.pf-act-price { font-weight: 700; }
.pf-act-thumb { width: 40px; height: 52px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #14171d; border: 1px solid var(--border-soft); }
.pf-act-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pf-act-name { font-weight: 600; font-size: .92rem; }
.pf-act-flow { font-size: .82rem; white-space: nowrap; }
.pf-flow-from, .pf-flow-to { color: var(--text-dim); font-weight: 600; }
.pf-flow-arrow { margin: 0 6px; color: var(--text-faint); }
.pf-act-time { font-size: .8rem; white-space: nowrap; }
.pf-act-link { color: var(--text-faint); display: flex; align-items: center; justify-content: center; }
.pf-act-row:hover .pf-act-link { color: var(--text); }
@media (max-width: 720px) {
    .pf-act-row { grid-template-columns: 78px 1fr auto; padding: 12px 14px; }
    .pf-act-price, .pf-act-thumb, .pf-act-flow, .pf-act-link { display: none; }
}

/* ---- Toasts (non-blocking error/notice, replaces alert()) ---------------- */
.toast-wrap {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    z-index: 1200; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none; width: min(92vw, 420px);
}
.toast {
    width: 100%; box-sizing: border-box; pointer-events: auto;
    background: var(--bg-card-2); color: var(--text);
    border: 1px solid var(--border); border-left: 3px solid var(--text-faint);
    border-radius: 10px; padding: 12px 14px; font-size: .92rem; line-height: 1.35;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-ok { border-left-color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s ease; transform: none; } }

/* ---- Invite hero (Rewards page, free-pack promo) -------------------------- */
.invite-hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(600px 280px at 88% 20%, rgba(108, 92, 255, .22), transparent 65%),
        linear-gradient(135deg, rgba(108, 92, 255, .14), rgba(33, 212, 168, .07) 55%, transparent),
        var(--bg-card);
    border: 1px solid rgba(108, 92, 255, .35);
    border-radius: var(--radius);
    padding: 26px 28px;
    box-shadow: var(--shadow);
}
.invite-hero-grid {
    display: grid; grid-template-columns: 1.5fr .9fr;
    gap: 24px; align-items: center;
}
.invite-hero-copy h2 {
    margin: 10px 0 8px; font-size: 1.75rem; line-height: 1.15;
    background: linear-gradient(90deg, var(--text), var(--primary) 85%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.invite-hero-copy p { color: var(--text-dim); max-width: 52ch; }
.invite-hero-link { display: flex; gap: 8px; margin-top: 14px; }
.invite-hero-link .input { flex: 1; min-width: 0; font-size: .88rem; }
.invite-hero-link .btn { white-space: nowrap; }
.invite-hero-art { display: flex; justify-content: center; }
.invite-hero-art img {
    max-width: 100%; max-height: 230px;
    transform: rotate(4deg);
    filter: drop-shadow(0 18px 34px rgba(108, 92, 255, .45));
    transition: transform .25s ease;
}
.invite-hero:hover .invite-hero-art img { transform: rotate(2deg) scale(1.04); }
@media (max-width: 720px) {
    .invite-hero { padding: 20px 18px; }
    .invite-hero-grid { grid-template-columns: 1fr; }
    .invite-hero-art { order: -1; }
    .invite-hero-art img { max-height: 150px; }
    .invite-hero-copy h2 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .invite-hero-art img, .invite-hero:hover .invite-hero-art img { transition: none; transform: none; }
}

/* ---- Mobile-proofing (wallet + site-wide) --------------------------------- */
.big-price-xl { font-size: 3rem; }
.deposit-presets { display: flex; gap: 6px; margin-bottom: 8px; }
.deposit-presets .btn { flex: 1 1 64px; }
@media (max-width: 720px) {
    /* Wide tables scroll inside their own card instead of stretching the page
       past the viewport (the cause of the cut-off right edge on phones). The
       admin odds editor uses .odds-table (fixed-width inputs), so it needs the
       same scroll wrapper — otherwise it forces a ~700px page width on mobile. */
    .table, .odds-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .card-pad-lg { padding: 20px 16px; }
    .big-price-xl { font-size: 2.3rem; }
    .wallet-held, .wallet-total, .wallet-bonus-row { gap: 10px; }
    .wallet-bonus-row .wbr-label { font-size: .85rem; }
}
/* Marketing hero CTA: the two large buttons can't shrink (white-space:nowrap),
   so stack them full-width on phones instead of overflowing the viewport. */
@media (max-width: 480px) {
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; }
}
