/* Self-hosted Inter (variable, latin subset) — no third-party font round-trip */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* === TOKENS === */
:root {
  --bg: #111;
  --surface: #1c1c1c;
  --border: #2e2e2e;
  --text: #e8e8e8;
  --muted: #777;
  --accent: #f07220;
  --accent-red: #e85252;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --nav-h: 52px;
}
[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #fff;
  --border: #e0e0e0;
  --text: #111;
  --muted: #666;
}

/* === ICONS === */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}
.icon-solid { fill: currentColor; }

/* === BASE === */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* === NAV === */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  height: var(--nav-h);
}
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}
.nav-links a {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.12s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.theme-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s;
}
.theme-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

/* === CONTAINER === */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === PAGE HEADER === */
.page-header {
  padding: 1rem 0 0.5rem;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}
.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

/* === SEARCH === */
.search-row { margin-top: 1rem; margin-bottom: 1rem; }
.search-wrap {
  position: relative;
  max-width: 580px;
}
.search-wrap .icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240,114,32,0.12);
}
.search-wrap input::placeholder { color: var(--muted); }
.search-clear {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  display: none;
  transition: color 0.12s;
}
.search-clear:hover { color: var(--text); }
.search-wrap.has-value .search-clear { display: block; }
.search-wrap.has-value input { padding-right: 2.2rem; }

/* === FILTER CHIPS === */
.filter-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.5rem;
}
/* Series toggle button (sits in filter row) */
.series-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}
.series-caret {
  width: 13px; height: 13px;
  transition: transform 0.2s;
}
.series-toggle-btn[aria-expanded="true"] .series-caret { transform: rotate(180deg); }

/* Series expandable chip panel */
.series-panel {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}
.series-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.series-chip {
  padding: 0.2rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.series-chip:hover,
.series-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cat-btn {
  padding: 0.3rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.cat-btn:hover {
  color: var(--text);
  border-color: var(--text);
}
.cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === RESULTS COUNT === */
.results-row {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === GAMES GRID === */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  padding-bottom: 3rem;
}

/* === GAME CARD === */
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  animation: card-in 0.22s ease both;
}
.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.26), 0 2px 8px rgba(0,0,0,0.12);
}
.game-thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--border) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='8' width='20' height='8' rx='4'/><line x1='6' y1='12' x2='10' y2='12'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='15' y1='13' x2='15.01' y2='13' stroke-width='3'/><line x1='18' y1='11' x2='18.01' y2='11' stroke-width='3'/></svg>") center / 36px no-repeat;
  overflow: hidden;
}
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-new {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.fav-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(0,0,0,0.5);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.45;
  transition: opacity 0.12s, color 0.12s;
  cursor: pointer;
}
.game-card:hover .fav-btn,
.fav-btn.active { opacity: 1; }
.fav-btn.active { color: var(--accent-red); }
.fav-btn:hover { color: var(--accent-red); }

.game-info {
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.game-name {
  font-size: 0.825rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-tag {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
}

/* === EMPTY / LOADING === */
.loading-msg,
.empty-msg,
.error-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* === FOOTER === */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy { margin: 0; }
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a { transition: color 0.12s; }
.footer-links a:hover { color: var(--text); }
footer a { color: inherit; text-decoration: none; }

/* =========================================
   PLAY PAGE
   ========================================= */
.play-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  padding: 0 0 3rem;
  align-items: start;
}
.game-frame-wrap {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  contain: layout style;
}

/* ── Game loading overlay ─────────────────────────────────── */
.game-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  transition: opacity 0.45s ease;
}
.game-loading-hide { opacity: 0; pointer-events: none; }

.game-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 0 2rem;
  animation: loading-fadein 0.4s ease both;
}
@keyframes loading-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner ring */
.loading-ring-svg { width: 56px; height: 56px; }
.loading-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3;
}
.loading-ring-arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 56 95;
  transform-origin: 30px 30px;
  animation: loading-spin 0.9s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

/* "Taking longer" hint */
.loading-hint {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  animation: loading-fadein 0.5s ease both;
}

/* Game name label */
.loading-game-name {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.01em;
  max-width: 300px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sliding progress bar */
.loading-bar-wrap {
  width: 160px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  width: 50%;
  background: var(--accent);
  border-radius: 1px;
  animation: loading-slide 1.6s ease-in-out infinite;
}
@keyframes loading-slide {
  0%   { transform: translateX(-200%); }
  100% { transform: translateX(400%); }
}

/* ── Buggy game banner ────────────────────────────────────── */
.buggy-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: #f5a623;
  line-height: 1.4;
}
.buggy-banner[hidden] { display: none; }
.buggy-icon { width: 15px; height: 15px; flex-shrink: 0; }
.buggy-dismiss {
  margin-left: auto;
  font-size: 1rem;
  line-height: 1;
  color: #f5a623;
  opacity: 0.7;
  flex-shrink: 0;
  padding: 0 0.2rem;
}
.buggy-dismiss:hover { opacity: 1; }

/* ── Status badges on game cards ──────────────────────────── */
.badge-buggy,
.badge-broken {
  position: absolute;
  bottom: 0.4rem;
  left: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  pointer-events: none;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-buggy  { background: rgba(0,0,0,0.6); color: #f5a623; }
.badge-broken { background: rgba(220,38,38,0.85); color: #fff; }
.game-iframe {
  width: 100%;
  /* Fill viewport height minus nav (52px) and controls bar (42px) */
  height: calc(100vh - var(--nav-h) - 42px);
  min-height: 400px;
  max-height: 900px;
  display: block;
  border: none;
  background: #000;
  will-change: transform;
}
.frame-controls {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  align-items: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.frame-controls::-webkit-scrollbar { display: none; }
.frame-controls.controls-fade {
  opacity: 0;
  visibility: hidden;
}
.ctrl-btn {
  border: 1px solid var(--border);
  color: var(--muted);
  height: 30px;
  padding: 0 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.12s, border-color 0.12s;
  background: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.ctrl-btn:hover {
  color: var(--text);
  border-color: var(--text);
}
.ctrl-btn.fav-active {
  color: var(--accent-red);
  border-color: var(--accent-red);
}
.ctrl-spacer { flex: 1; }
.shortcut-wrap { position: relative; }
.shortcut-btn { width: 30px; padding: 0; justify-content: center; font-weight: 700; }
.shortcut-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 100;
}
.shortcut-title { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.shortcut-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.shortcut-table td { padding: 0.18rem 0.4rem 0.18rem 0; color: var(--text); }
.shortcut-table td:first-child { width: 2rem; }
kbd {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text);
}
.session-time {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.session-sep {
  font-size: 0.75rem;
  color: var(--border);
  padding: 0 0.1rem;
}
.session-time-dim { opacity: 0.5; }

/* Theater mode */
.play-layout.theater {
  grid-template-columns: 1fr;
}
.play-layout.theater .game-sidebar {
  display: none;
}
.ctrl-btn.theater-active {
  color: var(--accent);
  border-color: var(--accent);
}

/* Game sidebar */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  scrollbar-width: none;
}
.game-sidebar::-webkit-scrollbar { display: none; }
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  overflow: hidden;
}
.sidebar-thumb {
  display: block;
  width: calc(100% + 2.3rem);
  max-width: calc(100% + 2.3rem);
  margin: -1.1rem -1.15rem 0.85rem;
  height: 140px;
  object-fit: cover;
}
.sidebar-back {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.5rem;
  transition: color 0.12s;
}
.sidebar-back:hover { color: var(--text); }
.rate-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.6rem 0 0.15rem;
}
.sidebar-card .game-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.sidebar-card .game-author {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.tag {
  padding: 0.2rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
}
.tag-link {
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tag-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.game-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-desc.expanded {
  display: block;
  overflow: visible;
}
.desc-toggle {
  font-size: 0.78rem;
  color: var(--accent);
  padding: 0;
  margin-top: 0.25rem;
  display: block;
  transition: opacity 0.12s;
}
.desc-toggle:hover { opacity: 0.75; }
.star-row {
  display: flex;
  gap: 0.2rem;
  margin-top: 0.6rem;
}
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--border);
  padding: 0;
  line-height: 1;
  transition: color 0.1s, transform 0.1s;
}
.star-btn.active,
.star-btn.hover { color: #f0a020; }
.star-btn:hover { transform: scale(1.15); }
.rate-aggregate {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  font-weight: 500;
}

/* Sidebar skeleton loader */
@keyframes skel-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Animation library ────────────────────────────────────── */
@keyframes fav-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
@keyframes empty-in {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes shelf-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hm-in {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: none; }
}
@keyframes info-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.skel {
  border-radius: 5px;
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease infinite;
}
.skel-title  { height: 18px; width: 60%; margin-bottom: 0.5rem; }
.skel-sub    { height: 12px; width: 35%; margin-bottom: 0.9rem; }
.skel-tag    { height: 22px; width: 55px; border-radius: 100px; display: inline-block; margin-right: 0.35rem; margin-bottom: 0.75rem; }
.skel-line   { height: 11px; width: 100%; margin-bottom: 0.4rem; }
.skel-line-s { height: 11px; width: 70%; margin-bottom: 0; }

/* Fav button pop — add/remove .pop via JS on click */
.fav-btn.pop,
.ctrl-btn.pop { animation: fav-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* Sidebar info card entrance — add .info-loaded via JS after renderInfo */
.sidebar-card.info-loaded { animation: info-in 0.22s ease both; }

/* Empty state entrance — plays automatically when element is inserted */
.empty-state { animation: empty-in 0.25s ease both; }
.stats-empty  { animation: empty-in 0.25s ease both; }

/* Shelf section entrance — add .shelf-revealed via JS when shown */
.shelf-revealed { animation: shelf-in 0.28s ease both; }

/* Stats panel entrance — add .panel-in via JS when shown */
.panel-in { animation: panel-in 0.28s ease both; }

/* Heatmap cell stagger — class + inline animation-delay set by JS */
.hm-cell.hm-anim { animation: hm-in 0.25s ease both; }

/* Recommended */
.sidebar-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.65rem;
}
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.rec-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  transition: background 0.12s;
}
.rec-item:hover { background: var(--bg); }
.rec-thumb {
  width: 42px;
  height: 42px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--border) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='8' width='20' height='8' rx='4'/><line x1='6' y1='12' x2='10' y2='12'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='15' y1='13' x2='15.01' y2='13' stroke-width='3'/><line x1='18' y1='11' x2='18.01' y2='11' stroke-width='3'/></svg>") center / 22px no-repeat;
  flex-shrink: 0;
}
.rec-info { overflow: hidden; }
.rec-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-tag {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
}

/* Game page link in sidebar */
.game-page-link {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.12s;
}
.game-page-link:hover { opacity: 0.75; }

/* Ad slots — hidden until populated by media.net */
.ad-slot {
  width: 100%;
  min-height: 0;
}
.ad-slot:empty { display: none; }
.ad-slot-below-game { margin-top: 0.75rem; }

/* =========================================
   FAVORITES PAGE
   ========================================= */
.fav-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
}
.fav-empty h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.fav-empty p {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* =========================================
   ABOUT PAGE
   ========================================= */
.about-wrap {
  max-width: 700px;
  padding: 2.5rem 0 4rem;
}
.about-wrap h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}
.about-wrap .lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}
.about-wrap h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2.25rem 0 0.65rem;
}
.about-wrap p {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 0.7rem;
}
.about-wrap code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.82rem;
  background: var(--border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}
.about-wrap a { color: var(--accent); text-decoration: underline; }
.about-wrap a:hover { opacity: 0.82; }
.request-btn {
  display: inline-block;
  margin: 0.4rem 0 1.2rem;
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.15s;
}
.request-btn:hover { opacity: 0.85 !important; }
.about-list {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.about-list li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  padding-left: 1.25rem;
  position: relative;
}
.about-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}
.about-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.about-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.about-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}
.about-kpi-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}
@media (max-width: 540px) {
  .about-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .about-wrap h1 { font-size: 1.55rem; }
}

/* =========================================
   404 PAGE
   ========================================= */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  text-align: center;
  padding: 2rem;
}
.not-found .err-code {
  font-size: 7rem;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}
.not-found h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.not-found p {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
}
.btn:hover { opacity: 0.88; }

/* =========================================
   PLAYTIME CHART
   ========================================= */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-top: 1rem;
}
.chart-card .chart-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.chart-card canvas {
  width: 100% !important;
  max-height: 160px;
}
.chart-empty {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 0;
}
.total-playtime {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
.total-playtime strong {
  color: var(--text);
}

/* =========================================
   CAMO (TAB DISGUISE)
   ========================================= */
.camo-wrap {
  position: relative;
  flex-shrink: 0;
}
.camo-btn {
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: color 0.12s, border-color 0.12s;
}
.camo-btn:hover {
  color: var(--text);
  border-color: var(--text);
}
.camo-btn.camo-on {
  color: var(--accent);
  border-color: var(--accent);
}
.camo-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  min-width: 190px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 200;
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.camo-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  visibility: visible;
  transition-delay: 0s;
}
.camo-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.75rem;
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.camo-item:hover { background: var(--bg); color: var(--text); }
.camo-item.active { color: var(--accent); }
.camo-item-off { color: var(--muted); }
.camo-sep {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0.4rem;
}

/* =========================================
   SHELVES — recently played + recommended
   ========================================= */
.shelves {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}
.shelf { flex: 1; min-width: 0; }
.shelf-hd {
  display: flex;
  align-items: center;
  margin-bottom: 0.45rem;
}
.shelf-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex: 1;
}
.shelf-clear {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0;
  transition: color 0.12s;
}
.shelf-clear:hover { color: var(--accent-red); }
.shelf-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-card {
  flex: 0 0 80px;
  color: var(--text);
  text-decoration: none;
}
.shelf-thumb-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color 0.12s, transform 0.15s;
}
.shelf-card:hover .shelf-thumb-wrap {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.shelf-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
}
.shelf-name {
  font-size: 0.64rem;
  font-weight: 500;
  margin-top: 0.28rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  transition: color 0.12s;
}
.shelf-card:hover .shelf-name { color: var(--text); }
.shelf-card.shelf-resume .shelf-thumb-wrap::after {
  content: '\25B6 Continue';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  text-align: center;
  padding: 0.18rem 0;
  letter-spacing: 0.04em;
}
@media (max-width: 600px) {
  .shelves { flex-direction: column; gap: 0.75rem; }
}

/* =========================================
   STATS PAGE — PREMIUM
   ========================================= */
.stats-wrap { padding: 2rem 0 4rem; }
.stats-hd { margin-bottom: 1.5rem; }
.stats-hd h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

/* KPI row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.25rem;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  animation: panel-in 0.32s ease both;
}
.kpi-card:nth-child(1) { animation-delay: 0ms; }
.kpi-card:nth-child(2) { animation-delay: 55ms; }
.kpi-card:nth-child(3) { animation-delay: 110ms; }
.kpi-card:nth-child(4) { animation-delay: 165ms; }
.kpi-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.kpi-card.kpi-featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(240,114,32,0.1) 0%, var(--surface) 65%);
}
.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(240,114,32,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 0.9rem;
  font-size: 1rem;
}
.kpi-val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.kpi-featured .kpi-val { color: var(--accent); }
.kpi-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

/* Shared panel */
.stats-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
}
.stats-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stats-panel-title { font-size: 0.85rem; font-weight: 600; }
.stats-panel-sub { font-size: 0.75rem; color: var(--muted); }

/* Charts row */
.stats-charts-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
  margin-bottom: 1rem;
}
.activity-canvas-wrap {
  position: relative;
  height: 180px;
}

/* Donut */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 0.4rem; }
.donut-leg-item { display: flex; align-items: center; gap: 0.55rem; font-size: 0.78rem; }
.donut-leg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-leg-name {
  flex: 1;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}
.donut-leg-pct { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Heatmap */
.stats-heatmap-panel { margin-bottom: 1rem; overflow-x: auto; }
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  gap: 3px;
  margin-bottom: 0.6rem;
  width: max-content;
}
.hm-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--border);
  cursor: default;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.hm-cell:hover {
  transform: scale(1.35);
  filter: brightness(1.2);
  z-index: 1;
}
.hm-cell[data-level="1"] { background: rgba(240,114,32,0.2); }
.hm-cell[data-level="2"] { background: rgba(240,114,32,0.4); }
.hm-cell[data-level="3"] { background: rgba(240,114,32,0.6); }
.hm-cell[data-level="4"] { background: rgba(240,114,32,0.82); }
.hm-cell[data-level="5"] { background: #f07220; }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}
.heatmap-leg-label { font-size: 0.72rem; color: var(--muted); }
.heatmap-leg-cells { display: flex; gap: 3px; }

/* Top games list */
.stats-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 1.25rem 0 0.65rem;
}
.stats-list { display: flex; flex-direction: column; gap: 0.4rem; }
.stats-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s;
}
.stats-row:hover { border-color: var(--accent); }
.stats-rank {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.stats-rank.gold   { color: #f5c842; }
.stats-rank.silver { color: #a8b8cc; }
.stats-rank.bronze { color: #c87941; }
.stats-thumb {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--border) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='8' width='20' height='8' rx='4'/><line x1='6' y1='12' x2='10' y2='12'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='15' y1='13' x2='15.01' y2='13' stroke-width='3'/><line x1='18' y1='11' x2='18.01' y2='11' stroke-width='3'/></svg>") center / 20px no-repeat;
  flex-shrink: 0;
}
.stats-info { flex: 1; overflow: hidden; }
.stats-game-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  max-width: 200px;
}
.stats-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stats-pct {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}
.stats-time {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 52px;
  text-align: right;
  flex-shrink: 0;
}
.stats-empty { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.stats-empty p { margin-bottom: 1rem; font-size: 0.9rem; }

@media (max-width: 860px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-val { font-size: 1.65rem; }
}

/* =========================================
   SAVES PAGE
   ========================================= */
.saves-wrap { padding: 2rem 0 4rem; }
.saves-hd { margin-bottom: 1.5rem; }
.saves-hd h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.saves-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}

/* Sidebar */
.saves-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.saves-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}
.saves-count {
  background: var(--border);
  border-radius: 100px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}
.saves-list {
  overflow-y: auto;
  max-height: 460px;
  padding: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.saves-list::-webkit-scrollbar { width: 4px; }
.saves-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.saves-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.saves-item:hover { background: var(--bg); }
.saves-item.active { background: rgba(240,114,32,0.1); color: var(--accent); }
.saves-item-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}
.saves-item-meta { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }
.saves-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  margin-left: 0.35rem;
  background: rgba(240,114,32,0.15);
  color: var(--accent);
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: inherit;
}
.saves-badge-json { background: rgba(124,107,255,0.15); color: #7c6bff; }
.saves-sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
}
.saves-empty-hint {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

/* Editor pane */
.saves-editor-pane { display: flex; flex-direction: column; gap: 1rem; }
.saves-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.saves-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.saves-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.saves-key-name {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: var(--accent);
  margin: 0;
}
.saves-key-meta { font-size: 0.72rem; color: var(--muted); margin: 0.15rem 0 0; }
.saves-editor-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* Action buttons */
.saves-action-btn {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, opacity 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
}
.saves-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.saves-action-save { background: var(--accent); border-color: var(--accent); color: #fff; }
.saves-action-save:hover { opacity: 0.88; color: #fff; border-color: var(--accent); }
.saves-action-delete { color: var(--accent-red); border-color: var(--accent-red); background: transparent; }
.saves-action-delete:hover { background: rgba(232,82,82,0.08); }
.saves-action-import { cursor: pointer; }

/* Decode tabs */
.saves-decode-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 1.15rem;
}
.saves-tab {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s;
  margin-bottom: -1px;
  font-family: inherit;
}
.saves-tab:hover { color: var(--text); }
.saves-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Textarea */
.saves-textarea {
  width: 100%;
  min-height: 340px;
  background: var(--bg);
  border: none;
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  padding: 1rem 1.15rem;
  resize: vertical;
  outline: none;
  display: block;
}
.saves-status {
  font-size: 0.75rem;
  color: var(--accent);
  padding: 0.4rem 1.15rem 0.6rem;
  min-height: 1.5rem;
}

/* Cookie Clicker structured editor */
.saves-cc-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
}
.saves-cc-heading {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.saves-cc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.saves-cc-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.saves-cc-input {
  width: 100%;
  padding: 0.35rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.saves-cc-input:focus {
  outline: none;
  border-color: var(--accent);
}
.saves-cc-footer {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.saves-cc-warn {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  min-width: 160px;
}

/* Backup panel */
.saves-backup-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}
.saves-backup-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Search */
.saves-search-wrap {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.saves-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.32rem 0.55rem;
  outline: none;
  transition: border-color 0.12s;
}
.saves-search:focus { border-color: var(--accent); }
.saves-search::placeholder { color: var(--muted); }

/* Groups */
.saves-group-hd {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.3rem 0.65rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.1s, color 0.1s;
  margin-top: 0.2rem;
}
.saves-group-hd:hover { background: var(--bg); color: var(--text); }
.saves-group-chevron {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.saves-group.collapsed .saves-group-chevron { transform: rotate(-90deg); }
.saves-group.collapsed .saves-group-body { display: none; }
.saves-group-name { flex: 1; text-align: left; }
.saves-group-count {
  background: var(--border);
  border-radius: 100px;
  padding: 0.05rem 0.4rem;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 500;
}

/* Extra format badges */
.saves-badge-hash { background: rgba(255,80,100,0.12); color: #f55; }
.saves-badge-url  { background: rgba(0,200,140,0.12);  color: #0ca; }
.saves-badge-num  { background: rgba(80,160,255,0.12); color: #5af; }

/* Info bar (hash notice, binary notice) */
.saves-info-bar {
  padding: 0.5rem 1.15rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
[data-theme="light"] .saves-info-bar { background: rgba(0,0,0,0.025); }


@media (max-width: 700px) {
  .saves-layout { grid-template-columns: 1fr; }
  .saves-list { max-height: 200px; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1060px) {
  .play-layout {
    grid-template-columns: 1fr;
  }
  .game-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}
@media (max-width: 700px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.85rem; }
  .game-sidebar { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .game-iframe { height: 60vw; min-height: 260px; max-height: 500px; }
}
@media (max-width: 500px) {
  nav { padding: 0 1rem; gap: 0.5rem; }
  .container { padding: 0 1rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
}

/* =========================================
   HAMBURGER NAV (mobile)
   ========================================= */
.nav-hamburger {
  display: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s;
}
.nav-hamburger:hover { color: var(--text); border-color: var(--text); }

@media (max-width: 540px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 1.25rem 0.75rem;
    gap: 0;
    overflow: visible;
    flex: unset;
    flex-shrink: unset;
    min-width: unset;
    scrollbar-width: auto;
    display: flex;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 99;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }
  .nav-links a {
    padding: 0.6rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .nav-links a:last-child { border-bottom: none; }
  .theme-btn { margin-left: 0; }
  .camo-wrap { margin-left: auto; }
}

/* =========================================
   SKELETON GRID CARDS
   ========================================= */
.game-card-skel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.skel-card-thumb {
  aspect-ratio: 1;
  width: 100%;
  display: block;
}
.skel-card-info {
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.skel-card-name { height: 12px; width: 75%; }
.skel-card-tag  { height: 10px; width: 42%; }

/* =========================================
   SORT ROW
   ========================================= */
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sort-label {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.sort-btn {
  padding: 0.25rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.sort-btn:hover  { color: var(--text); border-color: var(--text); }
.sort-btn.active { border-color: var(--text); color: var(--text); }

/* =========================================
   CAMO TOOLTIP (first use)
   ========================================= */
.camo-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--text);
  color: var(--bg);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s, transform 0.25s;
  line-height: 1.4;
}
.camo-tooltip::before {
  content: '';
  position: absolute;
  top: -4px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--text);
  transform: rotate(45deg);
  border-radius: 1px;
}
.camo-tooltip.visible { opacity: 1; transform: translateY(0); }


/* =========================================
   404 IMPROVEMENTS
   ========================================= */
.not-found-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 360px;
}
.not-found-search input {
  flex: 1;
  padding: 0.55rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.not-found-search input:focus { border-color: var(--accent); }
.not-found-search input::placeholder { color: var(--muted); }
.not-found-suggestion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  color: var(--muted);
  transition: border-color 0.12s, color 0.12s;
  max-width: 280px;
}
.not-found-suggestion:hover { border-color: var(--accent); color: var(--text); }
.not-found-suggestion img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}
.not-found-suggestion strong { color: var(--text); font-weight: 600; }


/* ── Game landing pages (/games/*.html) ───────────────────── */
.game-landing {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2.5rem 0 2rem;
  max-width: 700px;
  margin: 0 auto;
}
.game-landing-thumb img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
  flex-shrink: 0;
}
.game-landing-info { flex: 1; }
.game-landing-info h1 { font-size: 1.7rem; margin-bottom: 0.5rem; }
.play-now-btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: opacity 0.15s;
}
.play-now-btn:hover { opacity: 0.85; }
@media (max-width: 500px) {
  .game-landing { flex-direction: column; align-items: center; text-align: center; }
  .game-landing-thumb img { width: 120px; height: 120px; }
  .tags-row { justify-content: center; }
}

/* =========================================
   GAME PAGE (generated /games/ pages)
   ========================================= */
.game-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.game-breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.12s; }
.game-breadcrumb a:hover { color: var(--accent); }
.game-page-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.game-about {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.game-about h2 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.game-about p { font-size: 0.85rem; color: var(--muted); line-height: 1.65; margin-bottom: 0.5rem; }
.game-about p:last-child { margin-bottom: 0; }
.game-about-byline { opacity: 0.7; }

/* FAQ block (game pages, category pages, landing pages) */
.game-faq {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.game-faq h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }
.game-faq-item {
  border-top: 1px solid var(--border);
  padding: 0.65rem 0;
}
.game-faq-item:first-of-type { border-top: 0; padding-top: 0; }
.game-faq-item summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
  transition: color 0.12s;
}
.game-faq-item summary:hover { color: var(--accent); }
.game-faq-item summary::-webkit-details-marker { display: none; }
.game-faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-weight: 600;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.game-faq-item[open] summary::after { content: '−'; }
.game-faq-item p {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}
.game-faq-item[open] p { animation: info-in 0.18s ease both; }

/* Landing page hero copy */
.landing-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.landing-intro p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.landing-intro p:last-child { margin-bottom: 0; }
.landing-intro a { color: var(--accent); text-decoration: none; }
.landing-intro a:hover { text-decoration: underline; }

/* =========================================
   REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Empty State */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); grid-column: 1 / -1; }
.empty-state .empty-icon { color: var(--accent); margin-bottom: 1rem; }
.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }


/* =====================================================
   Ad units on /games/ player pages
   (self-contained — game pages load only style.css)
   ===================================================== */
.ad-aads { margin: 1rem auto; text-align: center; line-height: 0; }
.ad-aads iframe { display: block; margin: 0 auto; border: 0; overflow: hidden; }
.ad-aads-label {
  display: block; font-size: .56rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); opacity: .55; margin-bottom: 5px; line-height: 1;
}
/* 120x600 tower in the sidebar — desktop only (sidebar stacks on mobile) */
.game-ad-tower { display: none; }
@media (min-width: 900px) { .game-ad-tower { display: block; margin-top: .9rem; } }
.game-ad-tower .ad-aads { margin: 0; }
.game-ad-tower .ad-aads iframe { width: 120px; height: 600px; max-width: 100%; }
/* Adaptive strip below the game (all screens) */
.game-ad-below { margin: 1.1rem 0; }
.game-ad-below .ad-aads iframe { width: 100%; height: 90px; max-width: 728px; }
/* Pro tier hides ads */
html.ubg-pro .ad-aads, html.ubg-pro .game-ad-tower, html.ubg-pro .game-ad-below { display: none !important; }

/* G2A affiliate card (ad-block-proof, first-party link) */
.game-sponsor {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: .85rem .9rem; margin-top: .9rem; transition: border-color .15s ease, transform .15s ease;
}
.game-sponsor:hover { border-color: var(--accent); transform: translateY(-2px); }
.game-sponsor-label { display: block; font-size: .56rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); opacity: .7; margin-bottom: .35rem; }
.game-sponsor-brand { display: block; font-weight: 700; font-size: .95rem; color: var(--accent); }
.game-sponsor-head { display: block; font-weight: 600; font-size: .9rem; margin-top: .2rem; }
.game-sponsor-sub { display: block; font-size: .78rem; color: var(--muted); margin-top: .25rem; line-height: 1.4; }
.game-sponsor-cta { display: inline-block; font-size: .82rem; font-weight: 600; color: var(--accent); margin-top: .5rem; }
