/* ============================================================
   Game Hub — public arcade
   Minimal, store-like. Light + dark (html[data-theme]).
   ============================================================ */

:root {
  /* corner sizes: rounded squares (~5%) */
  --r-xl: 14px;            /* panels, banners, big cards */
  --r-lg: 12px;            /* game cards, game frame */
  --r-md: 8px;             /* buttons, inputs, chips, icon buttons */
  --r-sm: 6px;             /* small badges */
  --r-icon: max(4px, 5%);  /* game icons */
  /* soft light: no pure white page, gentler text and borders */
  --bg: #f3f4f6;
  --surface: #fafbfc;
  --raised: #e8eaee;
  --line: #e1e4e8;
  --line-strong: #d0d4da;
  --text: #2b2f36;
  --muted: #5f646d;
  --faint: #858a93;
  --accent: #0b7f5c;
  --accent-hover: #086a4c;
  --accent-soft: #dff0e8;
  --on-accent: #ffffff;
  --rose: #d93025;
  --rose-soft: #fce8e6;
  --live: #188038;
  --stage: #0b0c0e;
  --shadow-1: 0 1px 2px rgba(40, 44, 52, .10), 0 1px 3px 1px rgba(40, 44, 52, .05);
  --shadow-2: 0 2px 4px rgba(40, 44, 52, .12), 0 6px 12px 2px rgba(40, 44, 52, .07);
  --shadow-card: 0 1px 2px rgba(40, 44, 52, .06), 0 4px 14px rgba(40, 44, 52, .08);
  --shadow-card-hover: 0 2px 4px rgba(40, 44, 52, .08), 0 10px 24px rgba(40, 44, 52, .12);
  --shadow-stage: 0 2px 6px rgba(40, 44, 52, .08), 0 12px 32px rgba(40, 44, 52, .12);

  --font: "Google Sans", "Product Sans", Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 3vw, 56px);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #202124;
  --surface: #292a2d;
  --raised: #303134;
  --line: #3c4043;
  --line-strong: #5f6368;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --faint: #80868b;
  --accent: #5bb974;
  --accent-hover: #81c995;
  --accent-soft: rgba(91, 185, 116, .16);
  --on-accent: #10261a;
  --rose: #f28b82;
  --rose-soft: rgba(242, 139, 130, .14);
  --live: #81c995;
  --stage: #000000;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px 1px rgba(0, 0, 0, .15);
  --shadow-2: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 8px 3px rgba(0, 0, 0, .15);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 14px rgba(0, 0, 0, .22);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .32);
  --shadow-stage: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.wrap { margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */

.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar .bar { display: flex; align-items: center; gap: 28px; height: 64px; }

/* text-only logo */
.logo { flex-shrink: 0; display: flex; align-items: center; }
.logo:hover { opacity: .85; }

.topnav { display: flex; gap: 6px; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  display: flex; align-items: center; padding: 0 14px; white-space: nowrap;
  font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.topnav a:hover { color: var(--text); }
.topnav a.on { color: var(--accent); border-bottom-color: var(--accent); }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.search {
  width: 340px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  background: var(--raised); border-radius: var(--r-md); color: var(--muted); border: 1px solid transparent;
}
.search:focus-within { background: var(--bg); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--font); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search { position: relative; }
.search > svg { flex-shrink: 0; }
.search-close, .icon-btn.search-open { display: none; }
.search-close { border: 0; background: none; color: var(--muted); padding: 6px; margin-right: -8px; cursor: pointer; border-radius: var(--r-md); }
.search-close:hover { color: var(--text); background: var(--raised); }

.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; padding: 6px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card-hover); border: 1px solid var(--line);
}
.suggest-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); color: var(--text); }
.suggest-row:hover, .suggest-row.on { background: var(--raised); }
.suggest-icon { position: relative; width: 40px; height: 40px; border-radius: var(--r-icon); overflow: hidden; flex-shrink: 0; background: var(--raised); }
.suggest-icon img { width: 100%; height: 100%; object-fit: cover; }
.suggest-icon .fallback { font-size: 18px; }
.suggest-text { min-width: 0; display: flex; flex-direction: column; }
.suggest-text b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-text small { color: var(--muted); font-size: 12px; }
.suggest-all {
  display: block; width: 100%; margin-top: 4px; padding: 10px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--accent); font: 500 13px var(--font); text-align: left; cursor: pointer; border-radius: 0 0 var(--r-md) var(--r-md);
}
.suggest-all:hover { background: var(--accent-soft); }
.suggest-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }

/* category tiles: a sideways row under the top bar, all screens */
.catbar { border-top: 1px solid var(--line); }
.catbar .wrap { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 8px; }
.catbar .wrap::-webkit-scrollbar { display: none; }
.catbar a {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 3px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--muted); border: 1px solid var(--line-strong);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.catbar a:hover { color: var(--text); background: var(--surface); }
.catbar a.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.cat-icon {
  width: 22px; height: 22px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 600;
}
.cat-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-icon svg { display: block; }
.catbar a.on .cat-icon.cat-home { background: transparent; color: var(--accent); }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-md); border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn svg { display: block; }
.theme-icon { display: flex; align-items: center; justify-content: center; line-height: 0; }
.theme-dark-icon { display: none; }
html[data-theme="dark"] .theme-dark-icon { display: flex; }
html[data-theme="dark"] .theme-light-icon { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: var(--r-md); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-1); }
.btn-quiet { background: transparent; color: var(--accent); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--accent-soft); }

.btn-like { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-like:hover { background: var(--raised); }
.btn-like[aria-pressed="true"] { color: var(--rose); border-color: transparent; background: var(--rose-soft); }
.btn-like.pop svg { animation: pop .3s ease; }
@keyframes pop { 45% { transform: scale(1.3); } }

/* ---------- chips (sort + filters) ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line-strong); color: var(--muted);
  font-size: 14px; font-weight: 500;
}
.chip:hover { background: var(--raised); color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- hero: collage (left) + featured info (right) ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 80px); align-items: start;
  padding: clamp(12px, 1.4vw, 22px) 0 8px;
}

.collage {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.1vw, 18px);
  padding: clamp(14px, 1.6vw, 26px); border-radius: var(--r-xl); background: var(--surface);
}
.tile {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-icon);
  background: var(--raised); box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tile.big { grid-column: span 2; grid-row: span 2; border-radius: var(--r-icon); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .fallback { font-size: clamp(28px, 3vw, 48px); }
.tile.big .fallback { font-size: clamp(56px, 7vw, 110px); }
.collage, .spotlight { box-shadow: var(--shadow-card); }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile-tag {
  position: absolute; left: 7%; bottom: 7%; padding: 4px 12px; border-radius: var(--r-sm);
  background: var(--bg); color: var(--accent); font-size: 12px; font-weight: 500; box-shadow: var(--shadow-1);
}

/* left column: collage on top, featured banner fills the rest down to the trending list */
.hero-main { display: flex; flex-direction: column; gap: clamp(14px, 1.4vw, 22px); align-self: stretch; min-width: 0; }

.spotlight {
  position: relative; flex: 1; min-height: 180px; border-radius: var(--r-xl); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-1);
}
.spot {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  color: #fff; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s;
}
.spot.on { opacity: 1; visibility: visible; }
.spot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-bg.blur { filter: blur(30px) saturate(1.3) brightness(.85); transform: scale(1.3); }
.spot::after {                       /* keeps the text readable on any picture */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20, 22, 26, .78) 0%, rgba(20, 22, 26, .45) 45%, rgba(20, 22, 26, 0) 75%);
}
.spot-art {
  position: relative; z-index: 1; order: 2; height: 72%; max-height: 220px; aspect-ratio: 1; object-fit: cover;
  margin-right: clamp(20px, 4vw, 64px); border-radius: var(--r-icon); box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .3s ease;
}
.spot:hover .spot-art { transform: rotate(-3deg) scale(1.03); }
.spot-text {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: clamp(20px, 2.4vw, 40px); max-width: 60%;
}
.spot-label { font-size: 13px; font-weight: 500; color: #a8e6c1; }
.spot-name { font-size: clamp(22px, 2.2vw, 34px); font-weight: 500; line-height: 1.1; letter-spacing: -.01em; }
.spot-meta { font-size: 14px; color: rgba(255, 255, 255, .8); }
.spot-play {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 20px; border-radius: var(--r-md);
  background: #fff; color: #1f2329; font-size: 14px; font-weight: 500; transition: transform .2s ease;
}
.spot:hover .spot-play { transform: translateX(3px); }
.spot:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--r-xl); }
.spot-dots { position: absolute; z-index: 2; right: 22px; bottom: 18px; display: flex; gap: 6px; }
.spot-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .5); transition: width .3s ease, background .3s ease;
}
.spot-dots button.on { width: 22px; background: #fff; }
.spot-dots button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.hero-info {
  display: flex; flex-direction: column; min-width: 0; align-self: stretch;
  background: var(--surface); border-radius: var(--r-xl); padding: clamp(18px, 1.8vw, 28px); box-shadow: var(--shadow-card);
}
.hi-head { display: flex; align-items: center; gap: 14px; margin-top: 10px; min-width: 0; }
.hi-icon { position: relative; width: 68px; height: 68px; border-radius: var(--r-icon); overflow: hidden; flex-shrink: 0; background: var(--raised); box-shadow: var(--shadow-1); }
.hi-icon.small { width: 52px; height: 52px; }
.hi-icon img { width: 100%; height: 100%; object-fit: cover; }
.hi-icon .fallback { font-size: 28px; }
.hi-title { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero-like {
  width: 48px; height: 48px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.hero-like svg { display: block; }
.hero-like:hover { background: var(--raised); }
.hero-like[aria-pressed="true"] { color: var(--rose); background: var(--rose-soft); border-color: transparent; }

/* wide screens: collage as 6 x 2 (big tile + 8 small) so it stays short */
@media (min-width: 1200px) {
  .hero { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .collage { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.hero-label { color: var(--accent); font-size: 13px; font-weight: 500; }
.hero-title { margin: 0; font-size: clamp(22px, 2vw, 30px); line-height: 1.15; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-meta { font-size: 13px; flex-wrap: wrap; gap: 0; }
.hero-meta span + span::before { content: "·"; margin: 0 8px; color: var(--faint); }
.hero-desc { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.hero-actions .btn-lg { flex: 1; }
.btn-lg { height: 48px; padding: 0 28px; font-size: 15px; }

.trending { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.hero-actions + .trending { margin-top: 20px; }
.trending-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.trending h2 { margin: 0; font-size: 14px; font-weight: 500; }
.trending .see-all { font-size: 13px; }
.trend-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: var(--r-md); }
.trend-row:hover { background: var(--raised); }
.trend-row .rank { width: 16px; font-size: 14px; font-weight: 600; color: var(--accent); text-align: center; flex-shrink: 0; }
.trend-row .trend-icon { width: 46px; height: 46px; }
.trend-play { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 6px 14px; border-radius: var(--r-md); flex-shrink: 0; }
.trend-icon { position: relative; width: 52px; height: 52px; border-radius: var(--r-icon); overflow: hidden; flex-shrink: 0; background: var(--raised); box-shadow: var(--shadow-1); }
.trend-icon img { width: 100%; height: 100%; object-fit: cover; }
.trend-icon .fallback { font-size: 22px; }
.trend-text { min-width: 0; flex: 1; }
.trend-text b { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-text .meta { gap: 0; }
.trend-text .meta span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }
.trend-go { width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex-shrink: 0; }

.meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.plays { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.plays svg { opacity: .75; }

/* ---------- sections ---------- */

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 40px 0 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.01em; }

/* ---------- game tiles ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; padding-bottom: 64px; }
@media (min-width: 1800px) { .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

.card {
  display: block; padding: 10px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.card-art {
  position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-icon);
  background: var(--raised); box-shadow: var(--shadow-1);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-tag {
  position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-sm); background: var(--bg); color: var(--accent); box-shadow: var(--shadow-1);
}
.card-name {
  margin: 10px 0 2px; font-size: 14px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { font-size: 13px; gap: 0; flex-wrap: wrap; }
.card .meta span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }

/* letter icon when a game has no thumbnail (tonal colors) */
.fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 52px; font-weight: 500; }
.hue-0 { background: #e8f0fe; color: #1967d2; }
.hue-1 { background: #e6f4ea; color: #137333; }
.hue-2 { background: #f3e8fd; color: #8430ce; }
.hue-3 { background: #fef7e0; color: #b06000; }
.hue-4 { background: #e4f7fb; color: #007b83; }
html[data-theme="dark"] .hue-0 { background: #263449; color: #8ab4f8; }
html[data-theme="dark"] .hue-1 { background: #22392a; color: #81c995; }
html[data-theme="dark"] .hue-2 { background: #392c49; color: #d7aefb; }
html[data-theme="dark"] .hue-3 { background: #42381f; color: #fdd663; }
html[data-theme="dark"] .hue-4 { background: #1f3b40; color: #78d9ec; }

/* ---------- home sections: charts, shelves ---------- */

.see-all { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 14px; font-weight: 500; }
.see-all:hover { text-decoration: underline; }

.charts .chart-list {
  list-style: none; margin: 0; padding: 14px; display: grid; gap: 4px 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card);
}
.chart-row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-md); }
.chart-row:hover { background: var(--raised); }
.rank { width: 26px; flex-shrink: 0; text-align: center; font-size: 20px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.chart-list li:nth-child(-n+3) .rank { color: var(--accent); }

.shelf-tools { display: flex; align-items: center; gap: 6px; }
.shelf-tools .see-all { margin-right: 8px; }
.shelf-btn {
  width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease, opacity .15s ease;
}
.shelf-btn svg { display: block; }
.shelf-btn:hover:not(:disabled) { background: var(--raised); }
.shelf-btn:disabled { opacity: .35; cursor: default; }
.shelf-tools.no-scroll .shelf-btn { display: none; }

.shelf-row {
  display: grid; grid-auto-flow: column; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding: 6px 4px 14px; margin: -6px -4px 0;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > * { scroll-snap-align: start; }
.shelf-cards .shelf-row { grid-auto-columns: clamp(150px, 13vw, 200px); }

/* wide game picture: banner, else the icon on a blurred copy of itself */
.art { position: relative; display: block; overflow: hidden; background: var(--raised); }
.art-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-bg.blur { filter: blur(28px) saturate(1.3) brightness(.9); transform: scale(1.35); }
.art-bg.fallback { display: grid; place-items: center; font-size: 48px; }
.art-icon {
  position: absolute; top: 50%; left: 50%; height: 72%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-icon);
  transform: translate(-50%, -50%) rotate(-4deg); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); transition: transform .3s ease;
}

/* slider: popular games, sideways */
.slider .shelf-row { grid-auto-columns: clamp(150px, 11.5vw, 200px); gap: 18px; }
.slide { display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-card); transition: box-shadow .2s ease, transform .2s ease; }
.slide:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.slide:hover .art-icon { transform: translate(-50%, -50%) rotate(0deg) scale(1.04); }
.slide .art { aspect-ratio: 16 / 9; }
.slide-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.slide-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slide-text b { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-text .meta span + span::before, .fr-text .meta span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }
.slide-text .meta, .fr-text .meta { gap: 0; }

/* feature rows: one big card + smaller games beside it; the side alternates */
.fr-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-flow: dense; gap: 18px; }
.fr-big {
  grid-column: 1 / span 3; grid-row: span 2; display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-card); transition: box-shadow .2s ease, transform .2s ease;
}
.feature-row.flip .fr-big { grid-column: 5 / span 3; }
.fr-big:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.fr-big:hover .art-icon { transform: translate(-50%, -50%) rotate(0deg) scale(1.04); }
.fr-big .art { flex: 1; min-height: 220px; }
.fr-foot { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.fr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-label { font-size: 12px; font-weight: 500; color: var(--accent); }
.fr-text b { font-size: 19px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* slim banner: the newest game */
.strip { position: relative; display: flex; align-items: center; gap: 20px; margin-top: 40px; min-height: 120px; border-radius: var(--r-xl); overflow: hidden; color: #fff; box-shadow: var(--shadow-card); }
.strip .art { position: absolute; inset: 0; }
.strip .art-icon { left: auto; right: clamp(20px, 6vw, 90px); transform: translateY(-50%) rotate(-6deg); height: 80%; }
.strip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 22, 26, .78), rgba(20, 22, 26, .35) 55%, rgba(20, 22, 26, 0) 80%); }
.strip-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; padding: 22px 0 22px clamp(20px, 2.4vw, 34px); max-width: 60%; }
.strip-label { font-size: 12px; font-weight: 500; color: #ffd789; }
.strip-text b { font-size: clamp(20px, 2vw, 26px); font-weight: 500; }
.strip-desc { font-size: 13px; color: rgba(255, 255, 255, .8); }
.strip-play { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: var(--r-md); background: #fff; color: #1f2329; font-size: 14px; font-weight: 500; flex-shrink: 0; }

/* compact strips: small icons, one row */
.mini-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 14px; }
.mini { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mini-icon { position: relative; aspect-ratio: 1; border-radius: var(--r-icon); overflow: hidden; background: var(--raised); box-shadow: var(--shadow-card); transition: transform .2s ease; }
.mini:hover .mini-icon { transform: translateY(-2px); }
.mini-icon img { width: 100%; height: 100%; object-fit: cover; }
.mini-icon .fallback { font-size: 24px; }
.mini b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .mini:nth-child(n+11) { display: none; }

/* compact style: three rows of icon + name, on a soft panel */
.shelf-list .shelf-row {
  grid-template-rows: repeat(3, auto); grid-auto-columns: clamp(260px, 24vw, 360px); gap: 4px 20px;
  padding: 14px; margin: 0; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card);
}
.list-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-md); min-width: 0; }
.list-item:hover { background: var(--raised); }
.list-item .trend-go { margin-left: auto; }

.empty { padding: 72px 20px 96px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 18px; font-weight: 500; margin-bottom: 6px; }
.empty a { color: var(--accent); }

/* ---------- game page ---------- */

/* game first, at the top, sized to fit the screen; details in a thin column on the right */
.game-page { --stage-h: calc(100vh - 64px - 46px - 36px); padding-top: 16px; padding-bottom: 40px; }   /* bar + category row */
@supports (height: 100dvh) { .game-page { --stage-h: calc(100dvh - 64px - 46px - 36px); } }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 19vw, 340px); gap: clamp(20px, 2vw, 36px); align-items: start; }

.stage { position: relative; background: var(--stage); border-radius: var(--r-lg); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow-stage); }
.stage.portrait { height: max(var(--stage-h), 420px); }

.details { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; align-self: flex-start; }
.crumb:hover { color: var(--text); }

.side-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-icon { width: 72px; height: 72px; border-radius: var(--r-icon); overflow: hidden; flex-shrink: 0; position: relative; box-shadow: var(--shadow-1); background: var(--raised); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon .fallback { font-size: 34px; }
.app-title { min-width: 0; }
.app-title h1 { margin: 0; font-size: clamp(20px, 1.6vw, 26px); line-height: 1.2; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; }
.app-title .cat { display: inline-block; margin-top: 2px; color: var(--accent); font-weight: 500; font-size: 14px; }
.app-title .cat:hover { text-decoration: underline; }

.stats-row { display: flex; align-items: stretch; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-row div { flex: 1; padding: 0 10px; text-align: center; border-left: 1px solid var(--line-strong); min-width: 0; }
.stats-row div:first-child { border-left: 0; }
.stats-row b { display: block; font-size: 15px; font-weight: 500; }
.stats-row span { font-size: 12px; color: var(--muted); }

.side-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.side-actions .btn { justify-content: center; }

/* controls inside the game box */
.stage-controls {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: flex; gap: 4px; padding: 5px; border-radius: var(--r-md);
  background: rgba(20, 21, 24, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  opacity: .72; transition: opacity .2s ease;
}
.stage:hover .stage-controls, .stage-controls:focus-within, .stage:fullscreen .stage-controls { opacity: 1; }
@media (hover: none) { .stage-controls { opacity: 1; } }
.sc-btn {
  width: 38px; height: 38px; border-radius: var(--r-md); border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: #fff;
  transition: background-color .15s ease, color .15s ease;
}
.sc-btn:hover { background: rgba(255, 255, 255, .16); }
.sc-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.sc-btn .when-off { display: none; }
.sc-btn[aria-pressed="true"] .when-on { display: none; }
.sc-btn[aria-pressed="true"] .when-off { display: grid; }
.sc-btn .when-on, .sc-btn .when-off { place-items: center; }
.sc-like[aria-pressed="true"] { color: #ff6b81; }
.sc-btn.pop svg { animation: pop .3s ease; }
.stage:fullscreen .stage-controls { top: 16px; right: 16px; }
.stage iframe { display: block; border: 0; width: 100%; background: #000; }
.stage.portrait iframe { height: max(var(--stage-h), 420px); width: auto; max-width: 100%; aspect-ratio: 9 / 16; }
.stage.landscape iframe { width: min(100%, calc(var(--stage-h) * 16 / 9)); aspect-ratio: 16 / 9; }
.stage:fullscreen { border-radius: 0; width: 100vw; height: 100vh; }
.stage:fullscreen { height: 100vh; }
.stage:fullscreen iframe { width: auto; height: 100vh; max-width: 100vw; min-width: 0; }
.stage.landscape:fullscreen iframe { width: 100vw; height: auto; max-height: 100vh; }


.details h2 { margin: 6px 0 -8px; font-size: 17px; font-weight: 500; }
.details .desc { color: var(--muted); margin: 0; font-size: 14px; white-space: pre-line; }

.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }

.score {
  padding: 16px 18px; border-radius: var(--r-lg); background: var(--accent-soft);
  display: none; align-items: baseline; justify-content: space-between;
}
.score.show { display: flex; animation: fade .3s ease; }
.score span { color: var(--accent); font-size: 13px; font-weight: 500; }
.score b { font-size: 30px; font-weight: 500; color: var(--text); }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; color: var(--muted); font-size: 13px; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) { .search { width: 260px; } }

@media (max-width: 1100px) { .charts .chart-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); } }

@media (max-width: 1100px) {
  .fr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fr-big, .feature-row.flip .fr-big { grid-column: 1 / -1; grid-row: auto; }
  .fr-big .art { min-height: 0; aspect-ratio: 21 / 9; flex: none; }
  .mini-row { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .mini-row .mini:nth-child(n+9) { display: none; }
}

@media (max-width: 960px) {
  .topnav { display: none; }


  /* search becomes an icon; tapping it opens the box across the bar */
  .search { display: none; }
  .icon-btn.search-open { display: grid; }
  .topbar.searching .logo, .topbar.searching .icon-btn.search-open, .topbar.searching .theme-toggle { display: none; }
  .topbar.searching .top-tools { flex: 1; min-width: 0; margin-left: 0; }
  .topbar.searching .search { display: flex; flex: 1; width: auto; }
  .topbar.searching .search-close { display: grid; }

  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-page { --stage-h: calc(100vh - 64px - 44px - 24px); padding-top: 12px; }   /* bar + category row */
  @supports (height: 100dvh) { .game-page { --stage-h: calc(100dvh - 64px - 44px - 24px); } }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .collage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .collage .tile:nth-child(n+6) { display: none; }      /* big + 4 small on smaller screens */
}

@media (max-width: 640px) {
  .topbar .bar { gap: 10px; }
  .logo .logo-img { height: 20px !important; }
  .top-tools { gap: 2px; }
  .catbar .wrap { padding-top: 7px; padding-bottom: 7px; }
  .charts .chart-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; padding: 8px; border-radius: var(--r-xl); }
  .chart-list li:nth-child(n+6) { display: none; }
  .shelf-tools .shelf-btn { display: none; }
  .slider .shelf-row { grid-auto-columns: 36%; gap: 10px; }
  .fr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .fr-big .art { aspect-ratio: 16 / 9; }
  .fr-foot { padding: 12px 14px; gap: 10px; }
  .mini-row { display: flex; overflow-x: auto; scrollbar-width: none; gap: 10px; }
  .mini-row::-webkit-scrollbar { display: none; }
  .mini { flex: 0 0 22%; }
  .mini-row .mini:nth-child(n) { display: flex; }
  .strip { min-height: 104px; margin-top: 28px; }
  .strip-desc { display: none; }
  .strip .art-icon { display: none; }
  .strip-play { margin-right: 16px; }
  .shelf-tools .see-all { margin-right: 0; }
  .shelf-cards .shelf-row { grid-auto-columns: 34%; gap: 10px; }
  .shelf-list .shelf-row { grid-auto-columns: 86%; padding: 8px; border-radius: var(--r-xl); }
  .hero { padding-top: 16px; gap: 22px; }
  .spotlight { min-height: 190px; border-radius: var(--r-xl); }
  .spot-text { max-width: 70%; }
  .spot-art { height: 56%; margin-right: 16px; }
  .collage { padding: 10px; gap: 8px; border-radius: var(--r-xl); }
  .tile-tag { left: 8px; bottom: 8px; font-size: 11px; padding: 3px 10px; }
  .btn-lg { width: 100%; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 6px; }
  .card-name { font-size: 13px; }
  .section-head { margin-top: 28px; }
  .app-icon { width: 60px; height: 60px; }
  .stage { border-radius: var(--r-md); }
  .stage-controls { top: 8px; right: 8px; padding: 3px; gap: 2px; }
  .sc-btn { width: 34px; height: 34px; }
}

@media (max-width: 380px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* logo: dark letters in light mode, light letters in dark mode */
.logo-img { display: block; width: auto; max-width: none; }
.logo-on-dark { display: none; }
html[data-theme="dark"] .logo-on-light { display: none; }
html[data-theme="dark"] .logo-on-dark { display: block; }

/* ======================================================================
   Players: header wallet, sign-in pages, wallet page, Today card, toast
   ====================================================================== */

.btn-soft { background: var(--raised); color: var(--text); }
.btn-soft:hover { background: var(--line); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--raised); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: var(--muted); }

/* header */
.wallet-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; flex-shrink: 0;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); color: var(--text); font-size: 15px;
}
.wallet-chip svg { display: block; }
.wallet-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-chip:hover { box-shadow: var(--shadow-card-hover); }
.signin-btn { height: 38px; padding: 0 18px; flex-shrink: 0; }
.back-app {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; flex-shrink: 0;
  border-radius: var(--r-md); color: var(--muted); font-size: 14px; border: 1px solid var(--line-strong);
}
.back-app:hover { color: var(--text); background: var(--surface); }
.back-app svg { display: block; }

.flash-wrap { padding-top: 14px; }
.flash { padding: 12px 16px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.flash-error { background: var(--rose-soft); color: var(--rose); }

/* forms */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label, .convert-card label { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 8px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number],
.convert-card input[type=text], .convert-card input[type=number], .link-form input {
  height: 44px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px; width: 100%; min-width: 0;
}
.form input:focus, .convert-card input:focus, .link-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 400; margin: 8px 0 6px; }
.form button[type=submit] { margin-top: 14px; }
.field-hint { font-size: 12px; color: var(--faint); }
.form-error { padding: 10px 14px; border-radius: var(--r-md); background: var(--rose-soft); color: var(--rose); font-size: 14px; margin-bottom: 12px; }
.otp-input { letter-spacing: .4em; font-size: 22px !important; text-align: center; font-variant-numeric: tabular-nums; }

/* sign-in pages */
.auth-page { display: grid; place-items: start center; padding-top: clamp(20px, 6vh, 64px); padding-bottom: 64px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: clamp(22px, 3vw, 34px); }
.auth-card h1 { margin: 0; font-size: 26px; font-weight: 500; }
.auth-sub { margin: 6px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-foot { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--accent); font-weight: 500; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.app-buttons { display: flex; flex-direction: column; gap: 8px; }
.app-buttons .btn { justify-content: center; }

/* wallet page */
.account { padding-top: 20px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 18px; }
.wallet-hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: clamp(20px, 2.4vw, 30px); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-card);
}
.wh-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wh-label { font-size: 13px; color: var(--muted); }
.wh-balance { display: flex; align-items: center; gap: 10px; font-size: clamp(34px, 4vw, 46px); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wh-balance svg { display: block; }
.wh-sub { font-size: 13px; color: var(--muted); }
.wh-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.wh-stat { display: flex; flex-direction: column; gap: 4px; min-width: 150px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--raised); }
.wh-stat > span:first-child { font-size: 12px; color: var(--muted); }
.wh-stat b { font-size: 20px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wh-stat small { font-size: 13px; color: var(--muted); font-weight: 400; }
.streak svg { color: #f28c28; }
.progress { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.nudge { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }
.nudge svg { flex-shrink: 0; display: block; }
.nudge-muted { background: var(--raised); color: var(--muted); }

.account-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.account-main, .account-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: clamp(16px, 2vw, 24px); }
.panel-card h2 { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.panel-card > .muted { margin: -4px 0 14px; font-size: 14px; }

.convert-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.convert-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); }
.cc-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.cc-head b { font-size: 16px; font-weight: 500; }
.cc-head .muted { font-size: 13px; }
.cc-account { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); }
.cc-row { display: flex; gap: 8px; }
.cc-quote { font-size: 14px; font-weight: 500; color: var(--accent); min-height: 20px; }
.cc-quote.cc-short { color: var(--muted); font-weight: 400; }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ledger li:first-child { border-top: 0; }
.ledger-what { display: flex; flex-direction: column; min-width: 0; }
.ledger-what b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-what span { font-size: 12px; color: var(--muted); }
.ledger-amount { font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ledger-amount.plus { color: var(--accent); }
.ledger-amount.minus { color: var(--muted); }
.pill { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: var(--r-sm); flex-shrink: 0; background: var(--raised); color: var(--muted); }
.pill-completed { background: var(--accent-soft); color: var(--accent); }
.pill-failed { background: var(--rose-soft); color: var(--rose); }

.app-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 6px; border-top: 1px solid var(--line); }
.app-row:first-of-type { border-top: 0; }
.app-name { display: flex; flex-direction: column; min-width: 0; }
.app-name b { font-weight: 500; }
.app-name .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.linked { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--accent); font-weight: 500; }
.link-form { display: flex; gap: 8px; padding-bottom: 8px; }
.link-form input { height: 38px; font-size: 14px; }
.logout-form { margin-top: 14px; }

/* goals (wallet page + Today card) */
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.goal { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-top: 1px solid var(--line); }
.goal:first-child { border-top: 0; }
.goal-icon { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0; background: var(--raised); color: var(--muted); }
.goal-icon svg { display: block; }
.goal.ready .goal-icon { background: var(--accent-soft); color: var(--accent); }
.goal.done .goal-icon { background: var(--accent); color: var(--on-accent); }
.goal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.goal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-top b { font-weight: 500; font-size: 14px; }
.goal-reward { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.goal-reward svg { display: block; }
.goal-desc { font-size: 12px; color: var(--muted); }
.goal-count { font-size: 12px; color: var(--muted); }
.goal.done .progress > span { background: var(--faint); }
.goal-action { flex-shrink: 0; min-width: 72px; display: flex; justify-content: flex-end; }
.claimed { font-size: 13px; color: var(--muted); }

/* home: Today card */
.today { margin-top: 32px; padding: clamp(16px, 2vw, 24px); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-card); }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.today-title h2 { margin: 0; font-size: 20px; font-weight: 500; }
.today-nudge { margin: 2px 0 0; color: var(--accent); font-size: 14px; font-weight: 500; }
.today-stats { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.today-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.today-stat b { color: var(--text); font-size: 17px; font-weight: 600; }
.today-stat small { color: var(--muted); }
.today-stat svg { display: block; }
.today .goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.today .goal { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; }
.today-guest .goal-action .btn { white-space: nowrap; }

/* credit toast on the game page */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); opacity: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; max-width: min(92vw, 520px);
  padding: 12px 18px; border-radius: var(--r-lg); background: #1f2329; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  font-size: 14px; transition: transform .3s ease, opacity .3s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast b { font-size: 16px; font-weight: 600; color: #ffd789; }
.toast span { color: rgba(255, 255, 255, .8); }
.toast em { flex-basis: 100%; font-style: normal; color: #a8e6c1; font-size: 13px; }
.toast a { color: #a8e6c1; font-weight: 500; text-decoration: underline; }
.toast-coin { width: 18px; height: 18px; border-radius: 50%; background: #FFC83D; box-shadow: inset 0 0 0 3px #E09A00; flex-shrink: 0; }

@media (max-width: 960px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .today .goals { grid-template-columns: minmax(0, 1fr); }
  .back-app span { display: none; }
  .back-app { padding: 0 9px; }
}
@media (max-width: 640px) {
  .wallet-chip { height: 36px; padding: 0 10px 0 8px; font-size: 14px; }
  .signin-btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .wh-stat { min-width: 0; flex: 1; }
  .today-stats { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ===== an app's own arcade (ESL Arcade, ZVL Games...): colours come from partials/app-skin ===== */
:root { --highlight: var(--accent); --font-head: var(--font); }
.app-logo { height: 34px; width: auto; max-width: 200px; object-fit: contain; }
.app-logo-text { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--text); white-space: nowrap; }
.app-arcade .wallet-chip { box-shadow: none; border: 1px solid color-mix(in srgb, var(--highlight) 55%, transparent); }
.app-arcade .wallet-chip svg { color: var(--highlight); }
@media (max-width: 640px) {
  .app-logo { height: 28px; max-width: 140px; }
  .app-logo-text { font-size: 18px; }
}
.app-arcade .catbar a { background: var(--surface); }
.app-arcade .catbar a.on { background: var(--accent-soft); }
