/* bingle styles */

:root {
  /* the three things that define the look */
  --bg: #0a0a0a;
  --text: #ffffff;
  --accent: #ffffff;            /* user-overridable from settings (bingle-accent) */

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --dim: #6b6b6b;               /* secondary / muted text */
  --line: #1c1c1c;              /* structural hairlines */
  --surface: #101010;           /* panels / cards */
  --surface2: #161616;          /* hover surface */

  /* legacy aliases — static pages + server-rendered HTML reference these.
     Mapping --lime -> --accent is what turns every old lime touch into the
     user's accent automatically. */
  --ink: var(--text);
  --ink-dim: var(--dim);
  --lime: var(--accent);
  --lime-dark: var(--accent);
  --line-2: var(--line);
  --border: var(--line);
  --bg-2: var(--surface);
  --bg2: var(--surface);
  --panel: var(--surface);
  --text2: var(--dim);
  --warn: #f5a623;
  --danger: #ff3333;
  --info: #4fc3f7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a, button, summary, [role="button"], .card, .entry, .pill, .source-tab,
.mini-card, .bs-accent, label.bs-switch, .swatch { cursor: crosshair; }

::selection { background: var(--accent); color: #000; }

/* ---------- subtle living background: soft centre pulse + grain ------------ */
body::before {                 /* grain */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {                  /* very soft radial pulse from centre-top */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 38%,
    color-mix(in srgb, var(--accent) 7%, transparent) 0%, transparent 70%);
  opacity: 0.5; animation: bg-pulse 9s ease-in-out infinite;
}
@keyframes bg-pulse { 0%, 100% { opacity: 0.32; } 50% { opacity: 0.6; } }

/* floating particles (effects.js builds them; density slider in settings) */
#fx-particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#fx-particles i { position: absolute; bottom: -10px; border-radius: 50%;
  background: var(--accent); opacity: 0.12;
  animation-name: fx-float; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes fx-float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.18; } 90% { opacity: 0.18; }
  100% { transform: translateY(-104vh) translateX(20px); opacity: 0; }
}

body.fx-ready { animation: fx-pagein 0.45s ease; }
@keyframes fx-pagein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after, #fx-particles { animation: none; }
  #fx-particles { display: none; }
  body.fx-ready { animation: none; }
}

/* keep real content above the background layers */
.topbar, .hub, .gx, .foot, #recent-row, .wrap, .game-modal { position: relative; z-index: 1; }

/* ---------- shared top bar (hub + games) ---------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1100px; margin: 0 auto; padding: 20px 26px;
}
.topbar-logo { font-size: 15px; font-weight: 700; letter-spacing: -0.04em; color: var(--dim);
  transition: color 0.1s; }
.topbar-logo .dot { color: var(--accent); }
.topbar-logo:hover { color: var(--text); }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  transition: color 0.1s; }
.topnav a:hover { color: var(--accent); }

/* the account button (accounts.js renders into #account-area) */
.acct-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--dim);
  border: 1px solid var(--line); padding: 6px 11px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; transition: color 0.1s, border-color 0.1s; }
.acct-btn:hover { color: var(--accent); border-color: var(--accent); }
.acct-btn .acct-ico { font-size: 12px; }
@media (max-width: 560px) { .acct-btn .acct-label { display: none; } }

/* ===========================================================================
   HUB
   =========================================================================== */
.hub {
  max-width: 640px; margin: 0 auto; padding: 7vh 26px 8vh;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.brand {
  margin: 0; font-weight: 800; letter-spacing: -0.06em; line-height: 0.86;
  font-size: clamp(76px, 19vw, 224px); color: var(--text);
}
.brand .dot { color: var(--accent); animation: caret-blink 1.2s steps(1) infinite; }
@keyframes caret-blink { 0%, 55% { opacity: 1; } 55.01%, 100% { opacity: 0.18; } }

.tagline { margin: 20px 0 0; color: var(--dim); font-size: 12px; letter-spacing: 0.04em;
  min-height: 1.3em; transition: opacity 0.28s ease; }
.tagline.fx-tag-out { opacity: 0; }

.stat { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; flex-wrap: wrap; }
.stat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: bg-pulse 2.4s ease-in-out infinite; }
.stat-sep { color: var(--line); }
.stat #live-count, .stat #play-count { color: var(--text); }

/* the four destinations — a quiet centered menu, not a card grid */
.menu { width: 100%; max-width: 460px; margin: 8vh auto 0; text-align: left; }
.entry {
  display: flex; align-items: baseline; gap: 16px; padding: 20px 6px;
  border-top: 1px solid var(--line); transition: padding-left 0.12s ease;
}
.menu .entry:last-child { border-bottom: 1px solid var(--line); }
.entry .e-idx { font-size: 11px; color: var(--dim); letter-spacing: 0.1em; }
.entry .e-name { flex: 1 1 auto; font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); transition: color 0.1s; }
.entry .e-desc { font-size: 10px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.entry .e-arrow { font-size: 15px; color: var(--dim); transition: color 0.1s, transform 0.12s; }
.entry:hover { padding-left: 12px; }
.entry:hover .e-name, .entry:hover .e-idx { color: var(--accent); }
.entry:hover .e-arrow { color: var(--accent); transform: translateX(4px); }
@media (max-width: 480px) { .entry .e-desc { display: none; } }

/* ===========================================================================
   FOOTER (single dead-minimal line, used by hub + games)
   =========================================================================== */
.foot { border-top: 1px solid var(--line); margin-top: 6vh; padding: 22px 26px 40px;
  max-width: 1100px; margin-left: auto; margin-right: auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px;
  color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.foot a { color: var(--dim); transition: color 0.1s; }
.foot a:hover { color: var(--accent); }
.foot .sep { color: var(--line); }

/* ===========================================================================
   GAMES BROWSER (/games)
   =========================================================================== */
.gx { max-width: 1100px; margin: 0 auto; padding: 24px 26px 60px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 26px; }

.gx-head { margin: 10px 0 22px; }
.gx-kicker { color: var(--dim); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 8px; }
.gx-title { margin: 0; font-weight: 800; letter-spacing: -0.05em; line-height: 0.9;
  font-size: clamp(42px, 9vw, 96px); color: var(--text); }
.gx-title .dot { color: var(--accent); }

/* terminal search: > prompt + blinking block caret */
.term { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  border-left: 2px solid var(--accent); background: var(--surface); padding: 0 16px; margin: 0 0 18px;
  transition: border-color 0.1s; }
.term:focus-within { border-color: var(--accent); }
.term .term-prompt { color: var(--accent); font-size: 16px; }
.search { flex: 1 1 auto; background: transparent; border: none; outline: none; border-radius: 0;
  color: var(--text); font-family: var(--mono); font-size: 14px; padding: 15px 0; }
.search::placeholder { color: var(--dim); }
.term-caret { flex: 0 0 auto; width: 8px; height: 16px; background: var(--accent);
  animation: caret-blink 1.05s steps(1) infinite; }
.term:focus-within .term-caret { opacity: 0; }

/* category filters: slash-separated command line, accent underline on active */
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin: 0 0 6px; }
.pill { position: relative; background: transparent; border: none; border-radius: 0; cursor: crosshair;
  color: var(--dim); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 6px 8px; transition: color 0.1s; }
.pill::after { content: "/"; position: absolute; right: -4px; color: var(--line); }
.pill:last-child::after { content: ""; }
.pill:hover { color: var(--text); }
.pill.active { color: var(--accent); }
.pill.active::before { content: ""; position: absolute; left: 8px; right: 12px; bottom: 0; height: 2px; background: var(--accent); }

.count-line { color: var(--dim); font-size: 11px; letter-spacing: 0.06em; margin: 12px 2px 16px; }

/* source tabs */
.source-tabs { display: flex; gap: 2px; overflow-x: auto; margin: 2px 0 20px;
  border-bottom: 1px solid var(--line); scrollbar-width: none; }
.source-tabs::-webkit-scrollbar { display: none; }
.source-tab { flex: 0 0 auto; background: transparent; border: none; position: relative; white-space: nowrap;
  color: var(--dim); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  padding: 11px 14px; transition: color 0.1s; }
.source-tab:hover, .source-tab.active { color: var(--text); }
.source-tab.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--accent); }

/* the grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding-bottom: 40px;
  transition: opacity 0.15s ease; }
.grid.fading { opacity: 0; }

.card { position: relative; display: block; background: var(--surface); border: 1px solid var(--line);
  padding: 16px 15px 15px; min-height: 120px; overflow: hidden;
  transition: background 0.1s, border-color 0.1s, transform 0.1s; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent);
  transition: width 0.1s ease; }
.card:hover { background: var(--surface2); border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px); }
.card:hover::before { width: 3px; }
.card .cat { display: inline-block; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--line); padding: 2px 6px; margin-bottom: 12px; }
.card .name { font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--text); word-break: break-word; }
.card .play { position: absolute; right: 13px; bottom: 11px; width: 26px; height: 26px;
  display: grid; place-items: center; color: var(--dim); transition: color 0.1s, transform 0.1s; }
.card:hover .play { color: var(--accent); transform: translateX(2px); }
.card .star { position: absolute; top: 12px; right: 34px; color: var(--accent); font-size: 12px; }

/* featured pin */
.card.featured { border-color: var(--accent); order: -1; }
.card.featured::before { width: 3px; }
.card .pin-badge { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--accent); color: #000;
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 6px; text-transform: uppercase; }

/* card thumbnail (effects.js) */
.card-thumb { display: block; height: 76px; margin-bottom: 12px; border-radius: 0;
  background: #0c0c0c center / cover no-repeat; position: relative; overflow: hidden; border: 1px solid var(--line);
  transition: transform 0.15s ease; }
.card-thumb::after { content: attr(data-letter); position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; font-size: 30px; color: var(--accent); opacity: 0.5; }
.card-thumb.has-img::after { content: ""; }
.card-thumb.has-img::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 45%, rgba(10,10,10,0.6) 100%); }
.card:hover .card-thumb.has-img { transform: scale(1.04); }
.fx-card { opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease; }
.fx-card.fx-in { opacity: 1; transform: none; }

/* HOT / NEW badges — rectangular, uppercase, tight */
.fx-badge { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em; padding: 3px 6px; text-transform: uppercase; }
.fx-badge-hot { background: var(--accent); color: #000; animation: hot-pulse 1.8s ease-in-out infinite; }
.fx-badge-new { background: transparent; color: var(--accent); border: 1px solid var(--accent); left: auto; right: 10px; }
.card.fx-hot { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
@keyframes hot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.playing-badge { position: absolute; bottom: 10px; left: 12px; z-index: 2; font-size: 9px; font-weight: 800;
  letter-spacing: 0.04em; color: var(--accent); text-transform: uppercase; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 70px 20px; font-size: 13px; }
.empty b { color: var(--text); }

.loading { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 40px; }
.skel { height: 120px; flex: 1 1 190px; max-width: 240px; background: var(--surface);
  border: 1px solid var(--line); animation: skel-pulse 1.1s ease-in-out infinite; }
@keyframes skel-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

/* horizontal rows: recently played + trending */
.hscroll-row { margin: 6px 0 22px; }
.hscroll-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 12px; }
.hscroll-head h2 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.hscroll-clear { background: transparent; border: 1px solid var(--line); color: var(--dim); font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 11px; }
.hscroll-clear:hover { color: var(--accent); border-color: var(--accent); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.hscroll::-webkit-scrollbar { height: 5px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line); }
.mini-card { position: relative; flex: 0 0 170px; display: flex; flex-direction: column; gap: 5px;
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent);
  padding: 13px 13px 12px; transition: background 0.1s; }
.mini-card:hover { background: var(--surface2); }
.mini-cat { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.mini-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.25; }
.mini-sub { font-size: 10px; color: var(--dim); }
.mini-x { position: absolute; top: 6px; right: 7px; background: rgba(0,0,0,0.5); border: none; color: #fff;
  width: 18px; height: 18px; font-size: 12px; line-height: 1; opacity: 0; transition: opacity 0.1s; }
.mini-card:hover .mini-x { opacity: 0.8; }
.mini-x:hover { background: var(--danger); opacity: 1; }

/* favourite heart */
.card-fav { position: absolute; top: 9px; right: 11px; z-index: 3; background: transparent; border: none;
  color: var(--dim); font-size: 15px; line-height: 1; padding: 2px; opacity: 0.5; transition: transform 0.1s, color 0.1s, opacity 0.1s; }
.card:hover .card-fav { opacity: 0.85; }
.card-fav:hover { transform: scale(1.2); color: var(--accent); opacity: 1; }
.card-fav.on { color: var(--accent); opacity: 1; }

/* ===========================================================================
   ALERT BANNER
   =========================================================================== */
#alert-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: none; align-items: center; gap: 14px;
  padding: 11px 20px; font-weight: 700; color: #000; }
#alert-banner.show { display: flex; }
#alert-banner.info { background: var(--info); }
#alert-banner.warning { background: var(--warn); }
#alert-banner.danger { background: var(--danger); color: #fff; }
#alert-banner .msg { flex: 1; }
#alert-banner .countdown { font-variant-numeric: tabular-nums; opacity: 0.8; }
#alert-banner .dismiss { background: rgba(0,0,0,0.2); border: none; color: inherit; width: 24px; height: 24px; font-size: 15px; line-height: 1; }
body.has-banner .topbar { padding-top: 56px; }

/* ===========================================================================
   FULL-SCREEN GAME MODAL (#game-modal)
   =========================================================================== */
.game-modal { position: fixed; inset: 0; z-index: 9000; display: none; flex-direction: column; background: #000; }
.game-modal.open { display: flex; }
body.gm-locked { overflow: hidden; }
.gm-bar { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; height: 48px; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.gm-logo { font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: -0.03em; }
.gm-logo .dot { color: var(--accent); }
.gm-title { flex: 1 1 auto; min-width: 0; color: var(--dim); font-size: 12px; letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-pop { flex: 0 0 auto; color: var(--dim); font-size: 16px; padding: 4px 8px; }
.gm-pop:hover { color: var(--accent); }
.gm-close { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font-size: 14px; }
.gm-close:hover { border-color: var(--accent); color: var(--accent); }
.gm-main { flex: 1 1 auto; display: flex; min-height: 0; background: #000; }
.gm-stage { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }
.gm-frame { flex: 1 1 auto; width: 100%; height: 100%; border: 0; background: #000; }
.gm-rail { display: none; flex: 0 0 auto; align-items: flex-start; justify-content: center; padding: 14px 8px; background: #000; }
.gm-leader { display: none; flex: 0 0 auto; justify-content: center; align-items: center; padding: 8px 0; background: #000; overflow: hidden; }
@media (min-width: 1200px) { .gm-rail { display: flex; } }
@media (max-width: 768px) { .gm-leader { display: flex; } }

/* ===========================================================================
   ACCOUNT SLIDE-IN PANEL (accounts.js)
   =========================================================================== */
.acct-overlay { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.acct-overlay.show { opacity: 1; pointer-events: auto; }
.acct-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 9999; width: 360px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--line); transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1); display: flex; flex-direction: column; }
.acct-panel.open { transform: none; }
.acct-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.acct-head b { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.acct-close { background: transparent; border: none; color: var(--dim); font-size: 15px; }
.acct-close:hover { color: var(--accent); }
.acct-body { padding: 18px 20px; overflow-y: auto; }
.acct-note { color: var(--dim); font-size: 11px; line-height: 1.7; margin: 10px 0 14px; }
.acct-lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin: 12px 0 6px; }
.acct-input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); font-size: 13px; padding: 11px 12px; outline: none; transition: border-color 0.1s; }
.acct-input:focus { border-color: var(--accent); }
.acct-action { display: block; width: 100%; text-align: center; margin-top: 10px; background: transparent; color: var(--text);
  border: 1px solid var(--line); padding: 11px 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; transition: border-color 0.1s, color 0.1s, background 0.1s; }
.acct-action:hover { border-color: var(--accent); color: var(--accent); }
.acct-action.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.acct-action.primary:hover { background: transparent; color: var(--accent); }
.acct-action.danger:hover { border-color: var(--danger); color: var(--danger); }
.acct-err { color: var(--danger); font-size: 11px; min-height: 14px; margin-top: 8px; }
.acct-hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.acct-user { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.acct-avatar { font-size: 26px; }
.acct-uname { font-size: 15px; font-weight: 800; }
.acct-sub { font-size: 10px; color: var(--dim); }
.acct-tokenbox { background: var(--bg); border: 1px solid var(--accent); padding: 12px; margin-bottom: 14px; }
.acct-token { display: block; word-break: break-all; font-size: 11px; color: var(--accent); background: rgba(0,0,0,0.4); padding: 8px; margin-top: 6px; }

/* ===========================================================================
   RATINGS (ratings.js)
   =========================================================================== */
.stars { display: inline-flex; gap: 1px; line-height: 1; }
.stars .star { background: none; border: none; padding: 0 1px; cursor: crosshair; font-size: 14px; line-height: 1;
  color: color-mix(in srgb, var(--text) 22%, transparent); transition: transform 0.1s, color 0.1s; }
.stars .star.on { color: var(--accent); }
.stars .star.hover-on { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.stars .star:hover { transform: scale(1.2); }
.stars .star.bump { animation: star-pop 0.32s ease; }
@keyframes star-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.card-rating { display: flex; align-items: center; gap: 7px; margin-top: 8px; position: relative; z-index: 2; }
.card-rating .stars .star { font-size: 13px; }
.card-rating .rate-meta { font-size: 10px; color: var(--dim); }
.rating-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 4px; }
.rating-block .rating-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.rating-widget { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rating-widget .rw-stars .star { font-size: 28px; padding: 0 2px; }
.rating-widget .rw-meta { font-size: 13px; color: var(--dim); }

/* ===========================================================================
   KEYBOARD HINT BAR + CHEATSHEET (shortcuts.js)
   =========================================================================== */
.card.kb-focus { outline: 1px solid var(--accent); outline-offset: 2px; }
#kb-hintbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9996; display: flex; align-items: center;
  justify-content: center; gap: 14px; background: rgba(10,10,10,0.94); border-top: 1px solid var(--line);
  padding: 7px 14px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
#kb-hintbar b { color: var(--accent); }
#kb-hintbar #kb-hint-x { background: transparent; border: none; color: var(--dim); font-size: 12px; }
#kb-hintbar #kb-hint-x:hover { color: var(--text); }
@media (max-width: 560px) { #kb-hintbar { display: none; } }
#sc-modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); }
#sc-modal.open { display: flex; }
.sc-box { background: var(--surface); border: 1px solid var(--line); padding: 22px; max-width: 440px; width: 92vw; }
.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sc-head b { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.sc-close { background: transparent; border: none; color: var(--dim); font-size: 15px; }
.sc-close:hover { color: var(--accent); }
.sc-table { width: 100%; border-collapse: collapse; }
.sc-table td { padding: 7px 4px; font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--line); }
.sc-table td:first-child { width: 42%; }
.sc-table kbd { display: inline-block; background: var(--bg); border: 1px solid var(--line); padding: 2px 7px;
  font: 600 11px var(--mono); color: var(--accent); margin: 1px; }

/* ===========================================================================
   FLOATING BUTTONS (effects.js)
   =========================================================================== */
#fx-scrolltop { position: fixed; bottom: 5rem; left: 1.6rem; z-index: 9998; width: 42px; height: 42px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 18px; opacity: 0;
  transform: translateY(10px); pointer-events: none; transition: opacity 0.2s, transform 0.2s, border-color 0.1s, color 0.1s; }
#fx-scrolltop.show { opacity: 1; transform: none; pointer-events: auto; }
#fx-scrolltop:hover { border-color: var(--accent); color: var(--accent); }

#discord-float { position: fixed; left: 1.5rem; bottom: 1.5rem; z-index: 9998; display: inline-flex; align-items: center;
  gap: 8px; background: transparent; color: var(--dim); border: 1px solid var(--line);
  padding: 9px 14px 9px 12px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.1s, border-color 0.1s; }
#discord-float svg { width: 18px; height: 18px; display: block; }
#discord-float:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) { #discord-float .df-label { display: none; } #discord-float { padding: 11px; } }

#bmac-float { position: fixed; left: 1.5rem; bottom: 4.6rem; z-index: 9998; display: inline-flex; align-items: center;
  gap: 8px; background: transparent; color: var(--dim); border: 1px solid var(--line);
  padding: 8px 13px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; transition: color 0.1s, border-color 0.1s; }
#bmac-float .bmac-emoji { font-size: 13px; }
#bmac-float:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) { #bmac-float .bmac-label { display: none; } #bmac-float { padding: 11px; } }
body.has-coffee #fx-scrolltop { bottom: 8rem; }

/* first-visit discord popup (effects.js) */
.discord-pop { position: fixed; bottom: 1.4rem; left: 50%; z-index: 9997; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; max-width: 92vw;
  transform: translate(-50%, 160%); opacity: 0; transition: transform 0.32s cubic-bezier(.2,.7,.3,1), opacity 0.32s; }
.discord-pop.show { transform: translate(-50%, 0); opacity: 1; }
.discord-pop .dp-ico { font-size: 20px; }
.discord-pop .dp-text { display: flex; flex-direction: column; line-height: 1.3; }
.discord-pop .dp-text b { font-size: 12px; letter-spacing: 0.04em; }
.discord-pop .dp-text span { color: var(--dim); font-size: 10px; }
.discord-pop .dp-join { background: var(--accent); color: #000; font-weight: 700; font-size: 11px; padding: 8px 14px; text-transform: uppercase; }
.discord-pop .dp-close { background: transparent; border: none; color: var(--dim); font-size: 13px; }
.discord-pop .dp-close:hover { color: var(--text); }

/* popup-blocked notice (settings.js builds it inline; nothing needed here) */

/* ===========================================================================
   SEO GAME LANDING PAGES (server-rendered)
   =========================================================================== */
.crumb { color: var(--dim); font-size: 11px; letter-spacing: 0.04em; margin-bottom: 22px; }
.crumb a { color: var(--dim); } .crumb a:hover { color: var(--accent); }
.crumb b { color: var(--text); } .crumb span { margin: 0 6px; color: var(--line); }
.seo-title { margin: 0 0 6px; font-weight: 800; letter-spacing: -0.04em; font-size: clamp(30px, 6vw, 52px); }
.seo-cat { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 18px; }
.seo-desc { color: #cfcfcf; font-size: 13px; line-height: 1.9; max-width: 66ch; }
.seo-play { display: inline-block; margin: 22px 0 8px; background: var(--accent); color: #000; font-weight: 800;
  font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; padding: 14px 26px; transition: opacity 0.1s; }
.seo-play:hover { opacity: 0.85; }
.seo-share { display: inline-block; margin: 22px 0 8px; background: transparent; color: var(--text); border: 1px solid var(--line);
  font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; padding: 12px 24px; cursor: crosshair;
  transition: border-color 0.1s, color 0.1s; }
.seo-share:hover { border-color: var(--accent); color: var(--accent); }
.seo-h2 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; margin: 40px 0 14px; color: var(--text); }
.seo-list { color: #cfcfcf; font-size: 12px; line-height: 1.9; max-width: 66ch; padding-left: 20px; margin: 0 0 8px; }
.seo-list li { margin: 6px 0; }
.seo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.seo-tag { font-size: 10px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  padding: 4px 9px; letter-spacing: 0.04em; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rel-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid transparent; padding: 16px; transition: border-color 0.1s, background 0.1s; }
.rel-card:hover { background: var(--surface2); border-left-color: var(--accent); }
.rel-cat { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.rel-name { font-size: 14px; font-weight: 700; color: var(--text); }
.back { color: var(--dim); } .back:hover { color: var(--accent); }
@media (max-width: 560px) { .rel-grid { grid-template-columns: 1fr; } }

/* ===========================================================================
   CATEGORY PAGES (server-rendered)
   =========================================================================== */
.cat-page { max-width: 1100px; padding: 5vh 26px 12vh; }
.cat-page #cat-search { margin: 8px 0 18px; width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); color: var(--text); font-family: var(--mono); font-size: 14px; padding: 14px 16px; outline: none; }
.cat-page #cat-search:focus { border-color: var(--accent); }
.cat-layout { display: grid; grid-template-columns: 200px 1fr; gap: 26px; align-items: start; }
.cat-sidebar { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 3px; }
.cat-side-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin-bottom: 8px; }
.cat-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px;
  color: var(--dim); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid transparent;
  transition: color 0.1s, border-color 0.1s; }
.cat-link:hover { color: var(--text); border-color: var(--line); }
.cat-link.active { color: var(--accent); border-color: var(--accent); }
.cat-link .cat-n { font-size: 10px; opacity: 0.7; }
.cat-main #grid { margin-top: 0; }
@media (max-width: 760px) { .cat-layout { grid-template-columns: 1fr; } .cat-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .cat-link { flex: 0 0 auto; } .cat-side-title { width: 100%; } }

/* stat chips (profile pages) */
.stats-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.stat-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 10px 16px; }
.stat-chip .sc-ico { font-size: 14px; }
.stat-chip .sc-val { font-weight: 700; font-size: 12px; color: var(--text); letter-spacing: 0.04em; }

/* ===========================================================================
   MEDIA HUB (media.html)
   =========================================================================== */
.md-service { transition: border-color 0.1s, color 0.1s; }
.md-service:hover, .md-service.sel { border-color: var(--accent); color: var(--accent); }
.md-hot { margin-top: 26px; }
.md-hot h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin: 0 0 12px; }
.md-hot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.md-hot-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  border-left: 2px solid transparent; padding: 14px; text-align: left; transition: border-color 0.1s, background 0.1s; }
.md-hot-card:hover { background: var(--surface2); border-left-color: var(--accent); }
.md-hot-card .hc-tag { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.md-hot-card .hc-title { font-weight: 700; color: var(--text); font-size: 13px; }
.md-hot-card .hc-sub { color: var(--dim); font-size: 11px; }
.md-panel { transition: opacity 0.2s ease, transform 0.2s ease; }
.md-panel.fx-slide-l { opacity: 0; transform: translateX(-16px); }
.md-panel.fx-slide-r { opacity: 0; transform: translateX(16px); }
@media (max-width: 560px) { .md-hot-grid { grid-template-columns: 1fr; } }

/* ===========================================================================
   PROXY PAGE (proxy.html)
   =========================================================================== */
#px-tips { color: var(--dim); font-size: 12px; min-height: 1.3em; margin-bottom: 14px; transition: opacity 0.28s ease; }
#px-tips.fx-tag-out { opacity: 0; }
.px-connecting { display: none; align-items: center; gap: 12px; margin-top: 16px; color: var(--accent); font-weight: 600; }
body.connecting .px-connecting { display: flex; }
.fx-spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: fx-spin 0.7s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }

/* ===========================================================================
   ABOUT PAGE (about.html)
   =========================================================================== */
.about-sec { margin: 34px 0; }
.about-sec h3 { font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 8px; transition: color 0.1s; display: inline-block; }
.about-sec h3:hover { color: var(--accent); }
.about-ascii { color: var(--accent); font-size: 9px; line-height: 1.1; white-space: pre; overflow-x: auto; margin: 0 0 18px; }
.belief-list { list-style: none; padding: 0; }
.belief-list li { padding: 8px 0 8px 24px; position: relative; color: #cfcfcf; }
.belief-list li::before { content: "\203A"; color: var(--accent); position: absolute; left: 6px; }

/* ===========================================================================
   404 PAGE
   =========================================================================== */
.fof-big { position: relative; cursor: crosshair; user-select: none; font-weight: 800; }
.fof-big::before, .fof-big::after { content: "404"; position: absolute; left: 0; top: 0; width: 100%; opacity: 0.8; }
.fof-big::before { color: var(--accent); animation: fx-glitch1 1.4s steps(2) infinite; }
.fof-big::after { color: #fff; animation: fx-glitch2 1.4s steps(2) infinite; }
.fof-big.fx-boom { animation: fx-boom 1.1s ease forwards; }
@keyframes fx-glitch1 { 0% { transform: translate(0,0); clip-path: inset(0 0 60% 0); } 50% { transform: translate(-3px,1px); clip-path: inset(50% 0 10% 0); } 100% { transform: translate(2px,-1px); clip-path: inset(10% 0 70% 0); } }
@keyframes fx-glitch2 { 0% { transform: translate(0,0); clip-path: inset(60% 0 0 0); } 50% { transform: translate(3px,-1px); clip-path: inset(20% 0 40% 0); } 100% { transform: translate(-2px,1px); clip-path: inset(70% 0 5% 0); } }
@keyframes fx-boom { 0% { transform: scale(1); } 30% { transform: scale(1.3) rotate(-3deg); } 60% { transform: scale(0.6) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
.fof-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */
@media (max-width: 560px) {
  body { font-size: 12px; }
  .hub { padding: 5vh 20px 7vh; }
  .menu { margin-top: 6vh; }
  .topbar { padding: 16px 18px; }
  .gx, .wrap, .foot { padding-left: 18px; padding-right: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
