:root {
  color-scheme: dark;
  --bg: #111315;
  --sidebar: #151719;
  --panel: #1b1e21;
  --line: #303438;
  --muted: #a6adb5;
  --text: #f0f2f4;
  --accent: #ed8ba6;
  font-family: var(--t-font, ui-sans-serif, system-ui, sans-serif);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 19px; height: 19px; stroke-width: 1.8; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: calc(100dvh - var(--site-credit-height, 0px)); padding: 24px 16px 18px; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--line); z-index: 30; overflow-y: auto; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 32px; font-size: 19px; font-weight: 700; letter-spacing: -.5px; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.side-group-label { color: var(--muted); font-size: 12px; padding: 0 11px; margin-bottom: 10px; }
.side-nav, .side-categories { display: grid; gap: 3px; }
.side-link, .side-category { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px; border: 0; border-radius: 7px; background: transparent; color: #c3c8cf; text-align: left; font-size: 13px; }
.side-link svg { width: 17px; height: 17px; flex: none; }
.side-link:hover, .side-category:hover, .sidebar-recent-game:hover { background: #24282b; color: var(--text); }
.side-link[aria-pressed=true], .side-category[aria-pressed=true] { background: #30252b; color: #f2a9be; }
.categories-label { margin-top: 28px; }
.side-category { padding: 8px 11px; font-size: 12px; }
.side-category span { min-width: 0; flex: 1; }
.side-category-count { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.sidebar-recent { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.sidebar-recent-list { display: grid; gap: 5px; }
.sidebar-recent-game { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; }
.sidebar-recent-art { position: relative; display: grid; place-items: center; flex: none; width: 34px; height: 34px; overflow: hidden; border-radius: 5px; background: #303438; font-weight: 600; }
.sidebar-recent-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sidebar-recent-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.school-shortcut { margin-top: auto; padding: 25px 8px 18px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.school-shortcut img { width: 32px; height: 32px; object-fit: contain; background: white; border-radius: 6px; padding: 3px; }
.school-shortcut small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.sidebar-foot { padding: 17px 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot a, .browse-link, .footer a { text-decoration: underline; text-underline-offset: 4px; }
.content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px clamp(20px, 3vw, 44px); background: var(--bg); }
.topbar-navigation, .topbar-location { display: flex; align-items: center; gap: 12px; }
.topbar-location { font-size: 13px; white-space: nowrap; }
.topbar-location span { color: #69717a; }
.topbar-location strong { font-weight: 500; color: var(--muted); }
.topbar-location a { padding: 8px 0; }
.topbar a:hover, .footer a:hover, .sidebar-foot a:hover, .browse-link:hover { color: var(--accent); }
.topbar-actions { min-width: 0; display: flex; align-items: center; gap: 9px; }
.search-box { width: clamp(200px, 25vw, 360px); height: 42px; display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 16px; height: 16px; flex: none; }
.search-box input { min-width: 0; flex: 1; padding: 10px 0; border: 0; background: transparent; color: var(--text); font-size: 13px; outline: none; }
.search-box input::placeholder { color: var(--muted); }
.search-box kbd { font: inherit; font-size: 11px; border: 1px solid #505557; border-radius: 3px; padding: 1px 5px; }
.icon-button { min-width: 42px; height: 42px; flex: none; display: grid; place-items: center; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.icon-button:hover { border-color: var(--muted); }
.shuffle-button { padding: 0 13px; font-size: 12px; }
.mobile-menu { display: none; }
.wallet-link { height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; white-space: nowrap; }
.wallet-link img { width: 22px; height: 22px; }
.main { max-width: 1600px; margin: auto; padding: 30px clamp(20px, 3vw, 44px) 56px; }
.page-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
h1 { font-size: clamp(30px, 3vw, 40px); font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
.page-intro p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.coin-summary { display: flex; align-items: center; gap: 10px; max-width: 250px; }
.coin-summary > img { width: 28px; height: 28px; }
.coin-summary-copy { display: grid; gap: 4px; min-width: 0; }
.coin-summary strong { font-size: 12px; font-weight: 500; }
.coin-summary small { color: var(--muted); font-size: 11px; }
.reward-meter { height: 3px; margin-top: 3px; background: #35342e; border-radius: 3px; overflow: hidden; }
.reward-meter i { display: block; width: 0; height: 100%; background: #d1b776; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 17px; }
.section-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.browse-link { font-size: 12px; color: var(--muted); white-space: nowrap; }
.quick-grid, .game-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.quick-card, .game-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); transition: border-color .15s; }
.quick-card:hover, .game-card:hover { border-color: #838b94; }
.thumb { position: relative; aspect-ratio: 1.4; background: #272c30; overflow: hidden; }
.thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 28px; font-weight: 600; }
.card-info { display: grid; gap: 5px; padding: 12px 36px 13px 11px; }
.card-info strong { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-open { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; background: transparent; border: 0; border-radius: 8px; }
.card-open:focus-visible { outline-offset: -3px; }
.favorite-button { position: absolute; bottom: 12px; right: 3px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.favorite-button:hover { color: var(--text); background: #ffffff0a; }
.favorite-button svg { width: 16px; height: 16px; }
.favorite-button.is-saved { color: var(--accent); }
.favorite-button.is-saved svg { fill: currentColor; }
.catalog-section { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.catalog-controls { display: flex; align-items: center; gap: 18px; }
.result-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sort-control { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sort-control select { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 9px; font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.filter-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #b3bac2; font-size: 12px; }
.filter-button:hover { color: var(--text); border-color: var(--muted); }
.filter-button.is-active { border-color: #b36b80; background: #30252b; color: #f4bfd0; }
.empty-state { border: 1px solid var(--line); border-radius: 9px; padding: 40px 20px; text-align: center; }
.empty-state svg { color: var(--muted); margin-bottom: 13px; }
.empty-state h3 { font-size: 20px; font-weight: 600; }
.empty-state p { font-size: 13px; color: var(--muted); margin: 9px 0 20px; }
.empty-state button, .load-more { border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 12px 20px; border-radius: 7px; font-size: 13px; }
.load-more { display: block; margin: 26px auto 0; }
.load-more:hover, .empty-state button:hover { border-color: var(--accent); }
.footer { border-top: 1px solid var(--line); padding: 22px clamp(20px, 3vw, 44px); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.player { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.player-bar { min-height: 64px; flex: none; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--sidebar); }
.player-bar button, .player-bar a { color: var(--text); background: transparent; border: 0; padding: 10px 0; font-size: 12px; white-space: nowrap; }
.player-bar button:hover, .player-bar a:hover { color: var(--accent); }
.player-bar strong { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar .player-home { padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; }
.player-actions { display: flex; align-items: center; gap: 16px; }
.player-actions span { font-size: 10px; color: var(--muted); }
.player-actions .player-reward { color: #dfc588; white-space: nowrap; }
.player iframe { border: 0; width: 100%; flex: 1; min-height: 0; background: #111; }
.menu-scrim { display: none; }
.coin-toast { position: fixed; z-index: 70; right: 24px; bottom: 24px; padding: 12px 17px; border: 1px solid #bfa66a; border-radius: 8px; background: #2d291d; color: #f1d99f; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.coin-toast.is-visible { opacity: 1; }
@media (max-width: 1250px) {
  .quick-grid, .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .topbar, .main { padding-left: 24px; padding-right: 24px; }
  .topbar { gap: 12px; }
  .search-box { width: clamp(180px, 23vw, 280px); }
}
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-actions { flex: 1; }
  .search-box { flex: 1; min-width: 0; }
  .quick-grid, .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-heading-row { align-items: flex-start; }
  .catalog-controls { gap: 10px; }
  .result-count { display: none; }
  .player-actions #open-source-credit { display: none; }
}
@media(max-width:680px) {
  html { scroll-padding-top: 150px; }
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 240px; transform: translateX(-100%); transition: transform .18s; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 29; width: 100%; height: 100%; background: #0009; border: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .topbar-navigation { width: 100%; }
  .topbar-actions { width: 100%; gap: 8px; }
  .topbar-location { gap: 12px; }
  .search-box { width: auto; }
  .search-box kbd { display: none; }
  .wallet-link { width: 42px; flex: none; padding: 0; justify-content: center; }
  .wallet-link span { display: none; }
  .main { padding: 24px 16px 40px; }
  .page-intro { align-items: flex-start; margin-bottom: 25px; }
  .coin-summary { max-width: 180px; }
  .coin-summary > img { display: none; }
  .quick-grid, .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section-heading h2 { font-size: 19px; }
  .catalog-section { margin-top: 30px; padding-top: 24px; }
  .sort-control { font-size: 0; }
  .footer { padding: 20px 16px; flex-direction: column; gap: 8px; }
  .player-bar { flex-wrap: wrap; gap: 3px 12px; padding: 8px 12px; }
  .player-actions { width: 100%; justify-content: flex-end; gap: 15px; }
  .player-actions .player-reward { margin-right: auto; font-size: 10px; }
  .favorite-button { width: 40px; height: 40px; right: 0; bottom: 8px; }
}
@media (max-width: 380px) {
  .page-intro { flex-direction: column; gap: 12px; }
  .coin-summary { max-width: none; }
  .coin-summary-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .reward-meter { display: none; }
  .catalog-heading-row { gap: 8px; }
  .catalog-heading-row h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
