/* ===========================================================================
   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: #6b7385;
    --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); }
.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); }
.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; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 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; }
.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); }

/* ---- 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; }
.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; } }

/* 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; }

/* ---- 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: 1100px; }

/* ===========================================================================
   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);
    background: radial-gradient(circle, rgba(255,244,210,.95), rgba(255,206,110,.5) 42%, transparent 72%); }
.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; }
.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; }
@keyframes card-emerge {
    0%   { opacity: 0; transform: translateY(8px) scale(.42); filter: brightness(5) blur(9px); }
    28%  { opacity: 1; filter: brightness(3.2) blur(4px); }
    62%  { transform: translateY(0) scale(1.06); filter: brightness(1.4) blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(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; }
@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); } }

/* 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) ------------------------------- */
.reveal-particles { position: absolute; left: 50%; top: 50%; width: 300px; height: 340px; transform: translate(-50%,-50%); pointer-events: none; z-index: 3; }
.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;
    background: radial-gradient(circle at 50% 45%, rgba(255,240,200,.95), rgba(255,210,120,.5) 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; }

@media (prefers-reduced-motion: reduce) {
    .pack-scene.anticipating, .pack-scene.anticipating .foil-pack { animation: none; }
    .particle { display: 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-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; } }

/* 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
   =========================================================================== */
.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); }

/* ===========================================================================
   Pack detail page (Courtyard-style)
   =========================================================================== */
.pd { position: relative; }
.pd-ambient { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); width: 1100px; max-width: 120%; 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: 2; 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; }
.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-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; }
.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; }
.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; }

.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; }
.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); }

.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); }
    .pd-odds-panel { position: relative; top: 0; right: auto; width: 100%; margin: 14px auto 0; }
}

/* ===========================================================================
   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-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; }

/* 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; }
.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-faint); 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; }

@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-sidebar { display: none; }
    .mainnav { display: none; }
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
    .stat-row { gap: 24px; flex-wrap: wrap; }
}
