/* =========================================================================
   Mega Games Hub – web design system
   Light + dark themes via [data-theme] on <html>. Accent comes from Admin → App Settings.
   ========================================================================= */
:root {
  --accent: #4f46e5;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 20px;
  /* game thumbnails are 512px SVG tiles with rx=96 → 18.75%; frames must use the same proportion */
  --thumb-radius: 18.75%;
  --header-h: 64px;
  --container: 1280px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --gold: #d97706; --silver: #64748b; --bronze: #b45309;
  --success: #16a34a; --danger: #dc2626;
}
[data-theme="light"] {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #f1f3f9; --surface-3: #e9ecf5;
  --border: #e3e6ef; --border-strong: #cfd4e2;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --header-bg: rgba(255, 255, 255, .86);
  --brand-dot: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
  --accent-text: color-mix(in srgb, var(--accent) 85%, black);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0d17; --surface: #121527; --surface-2: #181c33; --surface-3: #20253f;
  --border: #23284a; --border-strong: #31375e;
  --text: #eef0fb; --text-2: #c3c7e3; --muted: #9196b9; --faint: #6b7097;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55);
  --header-bg: rgba(11, 13, 23, .82);
  --brand-dot: #121527;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, #121527);
  --accent-text: color-mix(in srgb, var(--accent) 55%, white);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 30px; font-weight: 800; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.header { position: sticky; top: 0; z-index: 60; height: var(--header-h); background: var(--header-bg); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: block; flex: none; box-shadow: 0 4px 12px rgba(124, 58, 237, .28); }
.primary-nav { display: flex; gap: 2px; }
.primary-nav a { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .15s, background .15s; }
.primary-nav a:hover { color: var(--text); background: var(--surface-2); }
.primary-nav a.on { color: var(--text); }
.primary-nav a.on::after { content: ""; display: block; height: 2px; margin: 4px 4px -6px; border-radius: 2px; background: var(--accent); }
.search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.search input { width: 100%; height: 40px; padding: 0 44px 0 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 500 14px var(--font); outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search-ic { position: absolute; left: 12px; top: 10px; color: var(--faint); width: 18px; height: 18px; }
.search kbd { position: absolute; right: 10px; top: 9px; font: 600 11px var(--font); color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.account { display: flex; align-items: center; gap: 10px; position: relative; }
.coin-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 60%, #b45309); box-shadow: inset 0 -1px 0 rgba(0,0,0,.2); flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-3); display: inline-grid; place-items: center; font-size: 18px; flex: none; border: 1px solid var(--border); }
.avatar.sm { width: 30px; height: 30px; font-size: 15px; }
.avatar.lg { width: 76px; height: 76px; font-size: 38px; }
.avatar-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.menu { position: absolute; top: 46px; right: 0; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s var(--ease); z-index: 70; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head b { display: block; font-size: 14px; } .menu-head small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--text-2); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.menu svg { width: 18px; height: 18px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; transition: filter .15s, transform .08s, background .15s, border-color .15s; box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.12); }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.warn { background: #f59e0b; color: #1f1300; }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: inline-grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--danger); }
.icon-btn.on svg { fill: currentColor; }

/* ---------- layout ---------- */
.view { flex: 1; padding-top: 28px; padding-bottom: 56px; outline: none; }
.section { margin-top: 40px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.section-head .titles { flex: 1; min-width: 0; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.section-head .link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; font-size: 14px; }
.section-head .link svg { width: 16px; height: 16px; }
.row-nav { display: flex; gap: 6px; }
.row-nav button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; }
.row-nav button:hover { background: var(--surface-2); }
.row-nav svg { width: 16px; height: 16px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head p { color: var(--muted); margin-top: 6px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; color: var(--faint); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h3 { flex: 1; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.two-col > * { min-width: 0; }

/* ---------- game cards ---------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 18px; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth; padding: 2px 2px 10px; margin: -2px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.card { display: block; position: relative; border-radius: var(--radius-lg); }
.card-media { position: relative; aspect-ratio: 1; border-radius: var(--thumb-radius); overflow: hidden; background: var(--surface-3); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.card .play { position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; opacity: 0; transform: translateY(6px); transition: .2s var(--ease); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.card .play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; margin-left: 2px; }
.card:hover .card-media { transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover .play, .card:focus-visible .play { opacity: 1; transform: none; }
.card-body { padding: 10px 2px 0; }
.card-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.card-meta svg { width: 12px; height: 12px; fill: #f59e0b; stroke: none; }
.tag { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: #fff; text-transform: uppercase; }
.tag.hot { background: #e11d48; } .tag.new { background: #059669; } .tag.premium { background: #d97706; }

/* skeletons */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--radius-lg); }
.sk-card .sk-img { aspect-ratio: 1; border-radius: var(--thumb-radius); }
.sk-card .sk-line { height: 12px; margin-top: 12px; border-radius: 6px; width: 80%; }
.sk-card .sk-line.short { width: 50%; margin-top: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- home hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 44px; border-radius: 24px; overflow: hidden; color: #fff;
  background: radial-gradient(900px 400px at 0% 0%, color-mix(in srgb, var(--accent) 85%, #000) 0%, transparent 60%), linear-gradient(135deg, #0f1230 0%, #1a1450 55%, #0e2a3d 100%); box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, #000 30%, transparent); pointer-events: none; }
.hero-copy { position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
.hero h1 { color: #fff; font-size: 44px; line-height: 1.08; margin: 18px 0 14px; letter-spacing: -.035em; }
.hero h1 span { background: linear-gradient(90deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: rgba(255,255,255,.75); font-size: 16px; max-width: 480px; }
.hero-cta { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.hero .btn.secondary { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.hero-stats { display: flex; gap: 32px; margin-top: 32px; }
.hero-stats b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: 13px; color: rgba(255,255,255,.6); }
.hero-feature { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feature-tile { position: relative; border-radius: var(--thumb-radius); overflow: hidden; aspect-ratio: 1; box-shadow: 0 18px 40px rgba(0,0,0,.35); transition: transform .25s var(--ease); }
.feature-tile:hover { transform: translateY(-4px) scale(1.01); }
.feature-tile img { width: 100%; height: 100%; object-fit: cover; }
.feature-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.75)); font-weight: 700; font-size: 13px; }
.feature-tile:nth-child(1) { transform: translateY(18px); } .feature-tile:nth-child(4) { transform: translateY(-18px); }
.feature-tile:nth-child(1):hover { transform: translateY(14px); } .feature-tile:nth-child(4):hover { transform: translateY(-22px); }

/* category chips & tiles */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .e { font-size: 15px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cat-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; flex: none; }
.cat-tile b { display: block; font-size: 15px; } .cat-tile small { color: var(--muted); font-size: 13px; }
.cat-tile svg { margin-left: auto; color: var(--faint); width: 18px; height: 18px; }

.notice { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); margin-bottom: 24px; }
.notice img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.notice .txt { flex: 1; } .notice b { display: block; color: var(--text); } .notice span { color: var(--text-2); font-size: 14px; }
.notice .bar { width: 4px; align-self: stretch; border-radius: 4px; }

/* ---------- game page ---------- */
.game-hero { display: flex; gap: 28px; align-items: flex-start; }
.game-hero .cover { width: 180px; height: 180px; border-radius: var(--thumb-radius); overflow: hidden; box-shadow: var(--shadow); flex: none; background: var(--surface-3); }
.game-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }
.stat-chips { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0 22px; }
.stat-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.stat-chip svg { width: 17px; height: 17px; color: var(--muted); }
.stat-chip b { color: var(--text); }
.game-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.prose { color: var(--text-2); font-size: 15.5px; line-height: 1.7; }
.howto { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: 14.5px; }
.howto svg { color: #f59e0b; }
.rating { display: flex; align-items: center; gap: 4px; }
.rating button { border: 0; background: none; padding: 2px; color: var(--border-strong); }
.rating button svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.rating button.on, .rating:hover button { color: #f59e0b; }
.rating button:hover ~ button { color: var(--border-strong); }

/* leaderboard rows */
.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: grid; grid-template-columns: 40px 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--border); }
.lb li:first-child { border-top: 0; }
.lb li.me { background: var(--accent-soft); }
.lb .rank { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-size: 14px; }
.lb .medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; margin: 0 auto; }
.lb .m1 { background: linear-gradient(135deg, #fbbf24, #d97706); } .lb .m2 { background: linear-gradient(135deg, #cbd5e1, #64748b); } .lb .m3 { background: linear-gradient(135deg, #f59e0b, #92400e); }
.lb .who { min-width: 0; } .lb .who b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lb .who small { color: var(--muted); font-size: 12px; }
.lb .val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.lb .val small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.me-card { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.me-card .big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }

/* segmented / tabs */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button, .seg a { border: 0; background: none; height: 34px; padding: 0 16px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs-line { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs-line button { border: 0; background: none; padding: 12px 0; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-line button.on { color: var(--text); border-color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; }
.list a, .list .li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--border); transition: background .12s; }
.list li:first-child a, .list li:first-child .li { border-top: 0; }
.list a:hover { background: var(--surface-2); }
.list img { width: 48px; height: 48px; border-radius: var(--thumb-radius); flex: none; object-fit: cover; background: var(--surface-3); }
.list .main { flex: 1; min-width: 0; } .list .main b { display: block; font-size: 14.5px; font-weight: 600; } .list .main small { color: var(--muted); font-size: 12.5px; }
.list .end { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.list .end svg { width: 16px; height: 16px; color: var(--faint); }
.field { width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 14.5px var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.field-wrap { position: relative; }
.field-wrap svg { position: absolute; left: 14px; top: 12px; color: var(--faint); width: 20px; height: 20px; }
.field-wrap .field { padding-left: 44px; }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

/* ---------- player ---------- */
body.playing .footer, body.playing .tabbar, body.playing #adFooter, body.playing #adTop { display: none !important; }
body.playing { height: 100vh; height: 100dvh; overflow: hidden; }
body.playing .view { max-width: none; padding: 0; display: flex; min-height: 0; }
.player { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; background: #07080f; }
.player-main { display: flex; flex-direction: column; min-width: 0; }
.player-bar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px; background: #0d0f1c; border-bottom: 1px solid #1d2140; color: #e7e9f7; }
.player-bar .icon-btn { background: #161a31; border-color: #262b4d; color: #c9cce6; }
.player-bar .icon-btn:hover { background: #1f2442; color: #fff; }
.player-bar img { width: 32px; height: 32px; border-radius: var(--thumb-radius); }
.player-bar .t { flex: 1; min-width: 0; } .player-bar .t b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .player-bar .t small { color: #8a8fb6; font-size: 12px; }
.stage { flex: 1; min-height: 0; display: flex; justify-content: center; background: radial-gradient(600px 400px at 50% 30%, #12152b, #07080f); }
.stage iframe { border: 0; height: 100%; width: 100%; max-width: 500px; background: #0f1020; box-shadow: 0 0 0 1px #1d2140, 0 30px 80px rgba(0,0,0,.5); }
.stage.landscape iframe { max-width: none; box-shadow: none; }
.player-main { min-height: 0; }
.player-side { min-height: 0; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--border); padding: 18px; display: grid; gap: 16px; align-content: start; }
.nudge { padding: 16px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #06b6d4)); color: #fff; }
.nudge b { display: block; margin-bottom: 4px; } .nudge p { font-size: 13.5px; opacity: .9; margin-bottom: 12px; }
.nudge .btn { background: #fff; color: #111; }
.best-box { display: flex; align-items: center; gap: 14px; padding: 16px; }
.best-box .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fef3c7; color: #b45309; }
.best-box b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.1; }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; padding: 24px; }
.profile-head .who { flex: 1; min-width: 0; } .profile-head h1 { font-size: 24px; } .profile-head .muted { overflow: hidden; text-overflow: ellipsis; }
.level { padding: 0 24px 24px; }
.level-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.level-row b { color: var(--text); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #06b6d4)); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.kpi { padding: 18px 20px; border-left: 1px solid var(--border); } .kpi:first-child { border-left: 0; }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.reward { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.reward .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.reward .txt { flex: 1; } .reward b { display: block; } .reward small { color: var(--muted); }
.settings a, .settings button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 20px; border: 0; border-top: 1px solid var(--border); background: none; text-align: left; font-size: 14.5px; font-weight: 500; color: var(--text-2); }
.settings > :first-child { border-top: 0; }
.settings a:hover, .settings button:hover { background: var(--surface-2); color: var(--text); }
.settings svg { width: 18px; height: 18px; color: var(--muted); }
.settings .danger, .settings .danger svg { color: var(--danger); }
.switch { margin-left: auto; width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s var(--ease); }
.switch.on { background: var(--accent); } .switch.on::after { transform: translateX(18px); }

/* ---------- empty / states ---------- */
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--surface-2); color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.state { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.state .box { max-width: 420px; }
.state .ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--accent-soft); color: var(--accent-text); }
.state .ic svg { width: 28px; height: 28px; }
.state h2 { font-size: 24px; margin-bottom: 8px; }
.state p { color: var(--muted); margin-bottom: 22px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ads ---------- */
.ad-band:empty { display: none; }
/* AdSense marks slots it could not fill – collapse them instead of leaving a gap */
.ad:has(ins[data-ad-status="unfilled"]), .ad-band:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-band { padding: 16px 0 0; }
#adTop { max-width: var(--container); margin: 0 auto; padding: 16px 24px 0; }
.ad { position: relative; margin: 28px auto; text-align: center; max-width: 100%; }
.ad::before { content: "Advertisement"; display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.ad ins.adsbygoogle { display: block; min-height: 90px; }
.ad iframe { border: 0; max-width: 100%; margin: 0 auto; display: block; }
.ad img { margin: 0 auto; border-radius: 8px; }
.ad.side { margin: 0; }
.ad-band .ad { margin: 0 auto; }

/* ---------- modal / toast / interstitial ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(9, 11, 22, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(440px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 24px 0; } .modal-head h2 { flex: 1; }
.modal-body { padding: 14px 24px 24px; }
.modal-body p { color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.signin-art { display: block; width: 56px; height: 56px; border-radius: 15px; margin-bottom: 16px; box-shadow: 0 8px 20px rgba(124, 58, 237, .3); }
.perks { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-2); }
.perks svg { color: var(--success); width: 18px; height: 18px; }
.emoji-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 8px; }
.emoji-pick button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 20px; }
.emoji-pick button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
#toastRoot { position: fixed; top: calc(var(--header-h) + 14px); right: 20px; z-index: 120; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 500; font-size: 14px; animation: slide .2s var(--ease); }
.toast .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--success); }
.toast.err .bar { background: var(--danger); }
.interstitial { position: fixed; inset: 0; z-index: 110; background: rgba(5, 6, 14, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; }
.interstitial iframe { border: 0; background: #fff; max-width: 92vw; max-height: 70vh; border-radius: 8px; }
.interstitial small { opacity: .6; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */
.footer { margin-top: 24px; background: var(--surface); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-top: 48px; padding-bottom: 36px; }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 14px; max-width: 340px; }
.footer h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 14px; font-weight: 700; }
.footer-grid > div > a:not(.brand):not(.store) { display: block; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.footer-grid > div > a:not(.brand):not(.store):hover { color: var(--text); }
.store-links { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.store { display: inline-flex; flex-direction: column; justify-content: center; height: 44px; padding: 0 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; line-height: 1.1; }
.store small { font-weight: 500; font-size: 10px; opacity: .8; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; flex-wrap: wrap; }

.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; padding: 36px; }
  .hero-feature { grid-template-columns: repeat(4, 1fr); }
  .feature-tile:nth-child(n) { transform: none; }
  .two-col { grid-template-columns: 1fr; }
  .player { grid-template-columns: 1fr; }
  .player-side { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .primary-nav { display: none; }
  .search kbd { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .container { padding: 0 16px; }
  .header-inner { gap: 12px; }
  .brand-name { display: none; }
  .search { max-width: none; }
  .coin-pill { display: none; }
  .view { padding-top: 18px; padding-bottom: 96px; }
  h1 { font-size: 24px; }
  .hero { padding: 26px 20px; border-radius: 18px; gap: 26px; }
  .hero h1 { font-size: 32px; }
  .hero-stats { gap: 22px; }
  .hero-feature { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .feature-tile .cap { display: none; }
  .rail { grid-auto-columns: 132px; gap: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 18px 12px; }
  .section { margin-top: 32px; }
  .row-nav { display: none; }
  .game-hero { flex-direction: column; gap: 18px; }
  .game-hero .cover { width: 120px; height: 120px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
  .footer { margin-bottom: 64px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  #toastRoot { left: 16px; right: 16px; top: auto; bottom: 84px; }
  .toast { min-width: 0; max-width: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--header-bg); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--border); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent-text); }
  .stage iframe { max-width: none; box-shadow: none; }
  .player-bar .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- static pages: legal / about / contact ---------- */
.doc-head { max-width: 860px; margin: 8px 0 32px; }
.doc-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.doc-head h1 { font-size: 40px; letter-spacing: -.035em; margin: 14px 0 10px; }
.doc-head .lead { font-size: 17px; color: var(--text-2); line-height: 1.6; }
.doc-meta { color: var(--muted); font-size: 14px; margin-top: 12px; }
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.doc-toc { position: sticky; top: calc(var(--header-h) + 24px); }
.doc-layout > * { min-width: 0; }
.doc-toc-inner { border-left: 2px solid var(--border); padding-left: 16px; }
.doc-toc summary { list-style: none; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 10px; cursor: default; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc summary svg { display: none; width: 18px; height: 18px; margin-left: auto; transition: transform .2s; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: calc(100vh - 180px); overflow: auto; }
.doc-toc a { display: block; font-size: 13.5px; color: var(--muted); padding: 4px 0; line-height: 1.35; }
.doc-toc a:hover, .doc-toc a.on { color: var(--accent-text); }
.prose-doc { max-width: 780px; color: var(--text-2); font-size: 16px; line-height: 1.75; }
.prose-doc h2 { font-size: 24px; margin: 44px 0 12px; scroll-margin-top: calc(var(--header-h) + 20px); padding-top: 4px; }
.prose-doc h2:first-child { margin-top: 0; }
.prose-doc h3 { font-size: 18px; margin: 28px 0 8px; }
.prose-doc p { margin: 0 0 16px; }
.prose-doc ul, .prose-doc ol { margin: 0 0 18px; padding-left: 22px; }
.prose-doc li { margin: 6px 0; }
.prose-doc a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose-doc strong { color: var(--text); }
.prose-doc table { width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-size: 14.5px; display: block; overflow-x: auto; }
.prose-doc th, .prose-doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose-doc th { background: var(--surface-2); color: var(--text); font-weight: 600; white-space: nowrap; }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); margin: 0 0 24px; font-size: 15px; }
.callout svg { color: var(--accent-text); margin-top: 3px; }
.company-card { padding: 20px 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); margin: 8px 0 24px; font-size: 15px; line-height: 1.7; }
.company-card b { color: var(--text); }
/* about & contact */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 8px 0 32px; }
.about-stat { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.about-stat b { display: block; font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.about-stat span { color: var(--muted); font-size: 14px; }
.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 28px; }
.feature { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.feature .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; } .feature p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.6; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.contact-cards { display: grid; gap: 12px; }
.contact-card { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.contact-card .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.contact-card small { display: block; color: var(--muted); font-size: 13px; } .contact-card b, .contact-card a { color: var(--text); font-size: 15.5px; font-weight: 600; word-break: break-word; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
textarea.field { height: auto; min-height: 160px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 19px, calc(100% - 15px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.form-note { font-size: 13px; color: var(--muted); }
.alert-box { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; font-size: 15px; }
.alert-box.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.alert-box.err { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 980px) {
  .doc-layout, .contact-layout { grid-template-columns: 1fr; gap: 20px; }
  .doc-toc { position: static; }
  .doc-toc-inner { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 0; box-shadow: var(--shadow-sm); }
  .doc-toc summary { margin: 0; padding: 14px 16px; cursor: pointer; font-size: 13px; color: var(--text-2); }
  .doc-toc summary svg { display: block; }
  .doc-toc details[open] summary svg { transform: rotate(180deg); }
  .doc-toc ol { max-height: 50vh; padding: 0 16px 12px; border-top: 1px solid var(--border); padding-top: 8px; }
  .doc-toc a { padding: 8px 0; font-size: 14.5px; }
}
@media (max-width: 640px) {
  .doc-head { margin-bottom: 22px; }
  .doc-head h1 { font-size: 28px; margin-top: 12px; }
  .doc-head .lead { font-size: 16px; }
  .prose-doc { font-size: 15.5px; line-height: 1.7; }
  .prose-doc h2 { font-size: 20px; margin-top: 34px; }
  .prose-doc h3 { font-size: 16.5px; }
  .prose-doc ul, .prose-doc ol { padding-left: 18px; }
  .prose-doc th, .prose-doc td { padding: 9px 10px; font-size: 13.5px; }
  .callout { padding: 14px; font-size: 14.5px; }
  .company-card { padding: 16px; font-size: 14.5px; word-break: break-word; }
  .form-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .about-stat { padding: 14px; } .about-stat b { font-size: 24px; } .about-stat span { font-size: 13px; }
  .contact-card { padding: 14px; }
  .panel-pad { padding: 16px; }
}
@media (max-width: 380px) {
  .doc-head h1 { font-size: 25px; }
  .about-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- responsive hardening (all pages) ---------- */
.search-btn { display: none; }
.section-head .link, .panel-head a { min-height: 36px; display: inline-flex; align-items: center; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > * { flex: none; }
.page-head > * { min-width: 0; }
.hero-feature { width: 100%; max-width: 540px; justify-self: end; }
.profile-head h1 { overflow-wrap: anywhere; }
.prose-doc, .company-card, .contact-card, .best-box, .me-card, .notice .txt { overflow-wrap: anywhere; min-width: 0; }
.best-box > div, .me-card > div { min-width: 0; }
img, svg, video, iframe { max-width: 100%; }
@media (max-width: 1100px) { .hero-feature { max-width: none; justify-self: stretch; } }
@media (max-width: 640px) {
  .search { display: none; }
  .search-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .brand-name { display: none; }
  .page-head { gap: 14px; margin-bottom: 18px; }
  .page-head .seg { width: 100%; }
  .page-head .btn { flex: none; }
  .profile-head { flex-wrap: wrap; gap: 14px; padding: 18px; }
  .profile-head .avatar.lg { width: 60px; height: 60px; font-size: 30px; }
  .profile-head .who { flex: 1 1 calc(100% - 80px); }
  .profile-head h1 { font-size: 20px; }
  .profile-head > .btn { width: 100%; }
  .level { padding: 0 18px 18px; }
  .kpi { padding: 14px 16px; } .kpi b { font-size: 19px; }
  .tabs-line { gap: 18px; }
  .hero-stats b { font-size: 21px; }
  /* full-screen game on phones: hide the site header while playing */
  body.playing .header { display: none; }
  body.playing .player { height: 100vh; height: 100dvh; }
  .player-bar { padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
}
@media (min-width: 430px) and (max-width: 640px) { .brand-name { display: inline; font-size: 16px; } }
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .header-inner { gap: 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .btn.sm { padding: 0 10px; }
  .hero { padding: 22px 16px; }
  .hero h1 { font-size: 28px; }
  .hero-cta .btn { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.panel-head { flex-wrap: wrap; row-gap: 4px; }
.panel-head > * { min-width: 0; }
.badge { min-height: 30px; }
@media (max-width: 360px) { .panel-head { padding: 14px 16px; } .panel-head .muted { font-size: 12px !important; } }

/* ---------- 404 page ---------- */
.nf { max-width: 640px; margin: 0 auto; padding: 48px 0 24px; text-align: center; }
.nf-art { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(88px, 22vw, 150px); font-weight: 800; line-height: 1; letter-spacing: -.04em; margin-bottom: 18px; }
.nf-art > span:not(.nf-pad) { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #ec4899)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf-pad { width: .82em; height: .82em; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); animation: nf-bob 3.2s ease-in-out infinite; }
.nf-pad svg { width: 62%; height: 62%; fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.nf-pad svg circle { fill: var(--accent); stroke: none; }
@keyframes nf-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .nf-pad { animation: none; } }
.nf-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; margin-bottom: 14px; }
.nf h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -.02em; margin-bottom: 10px; }
.nf-lead { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 520px; margin: 0 auto 24px; }
.nf-search { display: flex; align-items: center; gap: 8px; max-width: 480px; margin: 0 auto 18px; padding: 6px 6px 6px 14px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.nf-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.nf-search > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.nf-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; height: 40px; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nf-chips { justify-content: center; flex-wrap: wrap; }
.nf-section { margin-top: 36px; }
@media (max-width: 560px) {
  .nf { padding-top: 28px; }
  .nf-actions .btn { flex: 1 1 100%; }
  .nf-search .btn { padding: 0 14px; }
  .nf-chips { flex-wrap: nowrap; justify-content: flex-start; margin: 0 -16px; padding: 0 16px 4px; }
  .nf-section { margin-top: 28px; }
}

/* ---------- scroll arrows for chip rows ---------- */
.scroller { position: relative; }
.scroller > .chip-row { scroll-behavior: smooth; }
.scroller.can-next > .chip-row { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); }
.scroller.can-prev > .chip-row { -webkit-mask-image: linear-gradient(to right, transparent, #000 72px); mask-image: linear-gradient(to right, transparent, #000 72px); }
.scroller.can-prev.can-next > .chip-row { -webkit-mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); }
.sc-btn { position: absolute; top: calc(50% - 2px); transform: translateY(-50%) scale(.9); z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s, background .15s; }
.sc-btn.prev { left: 0; }
.sc-btn.next { right: 0; }
.sc-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sc-btn:hover { background: var(--surface-2); }
.scroller.can-prev > .sc-btn.prev, .scroller.can-next > .sc-btn.next { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
@media (hover: none) { .sc-btn { display: none; } }
