/* Bhayson Games — site styles. Dark is the default; [data-mode="light"] switches. */
:root {
  color-scheme: dark;
  --bg: #0a0d18;
  --bg-glow: rgba(53, 230, 196, 0.07);
  --surface: #121729;
  --surface-2: #1a2138;
  --surface-3: #232b47;
  --line: #262f4c;
  --text: #e8ebf7;
  --muted: #8c94b3;
  --accent: #35e6c4;
  --accent-ink: #062a24;
  --accent-soft: rgba(53, 230, 196, 0.12);
  --warm: #ffb547;
  --warm-ink: #231400;
  --pink: #ff6fb5;
  --violet: #9d7bff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --radius: 14px;
  --radius-sm: 10px;
  --topbar-h: 64px;
  --side-w: 236px;
  --font-display: 'Bungee', 'Arial Black', Impact, sans-serif;
  --font-ui: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
:root[data-mode="light"] {
  color-scheme: light;
  --bg: #eef1f8;
  --bg-glow: rgba(11, 143, 120, 0.06);
  --surface: #ffffff;
  --surface-2: #e4e9f4;
  --surface-3: #d6dded;
  --line: #d3daea;
  --text: #10152a;
  --muted: #566081;
  --accent: #0b8f78;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 143, 120, 0.1);
  --warm: #ffb547;
  --warm-ink: #231400;
  --pink: #d63d8a;
  --violet: #6a4ee0;
  --shadow: 0 10px 28px rgba(26, 36, 70, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 70% -10%, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ico { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.selectable { user-select: all; -webkit-user-select: all; font-weight: 600; color: var(--text); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding-inline: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
/* logo: the howling wolf + BHAYSON (Oxanium, slanted) + GAMES in the brand gradient */
.logo { --brand-cyan: #00e5ff; --brand-magenta: #ff2ec4; display: inline-flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; }
[data-mode="light"] .logo { --brand-cyan: #0093b0; --brand-magenta: #d4139f; }
.logo-mark { width: auto; height: 38px; flex: none; margin: -4px 0; }
.logo-word { font-family: 'Oxanium', var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1; display: inline-block; transform: skewX(-9deg); }
.logo-sub { font-family: 'Oxanium', var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); align-self: flex-end; padding-bottom: 2px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-magenta)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { color: var(--pink); }
.icon-btn[aria-pressed="true"] .ico path { fill: currentColor; }
.menu-btn { display: none; }
.search-trigger {
  margin-left: auto; margin-right: auto;
  display: flex; align-items: center; gap: 10px;
  width: min(460px, 100%); height: 42px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); text-align: left;
}
.search-trigger span { flex: 1; }
.search-trigger kbd { font: 600 12px var(--font-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; }
.search-trigger:hover { border-color: var(--surface-3); color: var(--text); }
.topbar-actions { display: flex; gap: 4px; }
.search-btn-sm { display: none; }
:root[data-mode="light"] .when-light, :root:not([data-mode="light"]) .when-dark { display: block; }
:root[data-mode="light"] .when-dark, :root:not([data-mode="light"]) .when-light { display: none; }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  height: calc(100vh - var(--topbar-h) - env(safe-area-inset-top, 0px));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 12px 24px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin;
}
.drawer-head { display: none; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 10px 4px; }
.drawer-tools { display: inline-flex; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nav-group:last-of-type { border-bottom: 0; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  font-weight: 500; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.studio-card {
  margin-top: 8px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted);
}
.studio-card strong { color: var(--text); font-size: 14px; }
.studio-card em { font-style: normal; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.studio-card em .ico { width: 16px; height: 16px; }
.studio-card:hover { border-color: var(--accent); }
.scrim { position: fixed; inset: 0; background: rgba(5, 7, 14, 0.6); z-index: 45; }

main { min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 36px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 12px; border: 0;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn .ico { width: 18px; height: 18px; }
.btn-play { background: var(--warm); color: var(--warm-ink); box-shadow: 0 6px 20px rgba(255, 181, 71, 0.28); }
.btn-play:hover { box-shadow: 0 8px 28px rgba(255, 181, 71, 0.42); transform: translateY(-1px); }
.btn-play:active { transform: translateY(1px); }
.btn-big { height: 56px; padding: 0 34px; font-size: 18px; border-radius: 14px; }
.btn-big .ico { width: 22px; height: 22px; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-ghost .ico { width: 16px; height: 16px; }

/* ---------- hero ---------- */
/* The top of the home page: one or more featured games. Slides sit on top of each other (the tallest sets the
   height, so nothing jumps) and fade from one to the next. */
.hero { display: flex; flex-direction: column; gap: 16px; }
.hero-track { display: grid; touch-action: pan-y; }
.hero-slide {
  grid-area: 1 / 1; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; align-items: center;
}
.is-carousel .hero-slide { opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
.is-carousel .hero-slide.is-current { opacity: 1; visibility: visible; z-index: 1; transition: opacity .45s ease .12s, visibility 0s; }
.hero-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-why {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.hero-why .ico { width: 14px; height: 14px; }
.hero-cat { color: var(--muted); }
.hero-stats { font-size: 14px; font-weight: 600; color: var(--text); margin-top: -4px; }
.hero-nav { display: flex; align-items: stretch; gap: 10px; }
.hero-arrow {
  flex: none; width: 44px; display: grid; place-items: center; border-radius: 12px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); cursor: pointer;
}
.hero-arrow:hover { border-color: var(--accent); }
.hero-arrow .ico { width: 20px; height: 20px; }
.hero-arrow.is-next .ico { transform: scaleX(-1); }
.hero-tabs { flex: 1 1 auto; min-width: 0; display: flex; gap: 10px; }
.hero-tab {
  --accent: #35E6C4;
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px 8px; text-align: left;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.hero-tab:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.hero-tab.is-current { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.hero-tab img { flex: none; width: 64px; height: 36px; border-radius: 7px; object-fit: cover; background: #05070e; }
.ht-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ht-text b, .ht-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-text b { font-size: 14px; font-weight: 700; }
.ht-text small { font-size: 12px; color: var(--muted); }
.ht-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.ht-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.hero-tab.is-current .ht-bar i { width: 100%; }
.hero.is-auto .hero-tab.is-current .ht-bar i { width: 0; animation: hero-fill var(--hero-time, 8s) linear forwards; }
.hero.is-paused .hero-tab.is-current .ht-bar i { animation-play-state: paused; }
@keyframes hero-fill { from { width: 0; } to { width: 100%; } }
.hero-screen {
  position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%;
  border-radius: 18px; overflow: hidden; background: #05070e;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 7%, transparent), 0 0 60px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow);
}
.hero-poster, .hero-demo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.hero-demo { pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.hero-demo.is-on { opacity: 1; }
.live-chip {
  position: absolute; left: 14px; top: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(5, 7, 14, 0.66); color: #fff; backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.live-chip i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hero-info { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hero-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4.2vw, 58px); line-height: 1; letter-spacing: 0.01em; }
.hero-tag { font-size: 17px; color: var(--muted); max-width: 34ch; }
.hero-facts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.hero-facts li { display: inline-flex; align-items: center; gap: 6px; }
.hero-facts .ico { width: 16px; height: 16px; }

/* ---------- sections + cards ---------- */
.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.section-head h2 .ico { color: var(--accent); }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--muted); min-height: 36px; padding: 0 2px; }
.see-all .ico { width: 16px; height: 16px; }
.see-all:hover { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.grid-tight { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-media {
  position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%;
  border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.card-video.is-on { opacity: 1; }
.card[data-preview] .card-media::after {
  content: ''; position: absolute; right: 8px; bottom: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(5, 7, 14, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='%23fff'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: opacity .2s ease; pointer-events: none;
}
.card.is-playing .card-media::after { opacity: 0; }
.card-media .badge { z-index: 2; }
.card:hover .card-media, .card:focus-visible .card-media {
  transform: translateY(-3px);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.card:hover .card-media img { transform: scale(1.04); }
.card:focus-visible { outline: none; }
.card.is-soon .card-media img { filter: saturate(0.8) brightness(0.85); }
.card-body { display: flex; flex-direction: column; gap: 1px; padding-inline: 2px; }
.card-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 13px; color: var(--muted); }
.badge {
  position: absolute; left: 10px; top: 10px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.badge-new { background: var(--warm); color: var(--warm-ink); }
.badge-soon { background: rgba(5, 7, 14, 0.72); color: #fff; backdrop-filter: blur(6px); }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s ease, background .15s ease;
}
.cat-tile .ico { grid-row: span 2; width: 26px; height: 26px; color: var(--accent); }
.cat-tile span { font-weight: 700; }
.cat-tile small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cat-tile:hover { border-color: var(--accent); background: var(--surface-2); }

.dev-band {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 26px 28px; border-radius: 18px;
  background:
    radial-gradient(500px 200px at 100% 0%, color-mix(in srgb, var(--violet) 22%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}
.dev-band > div { display: flex; flex-direction: column; gap: 8px; max-width: 60ch; }
.dev-band h2 { font-size: 22px; }
.dev-band p:not(.eyebrow) { color: var(--muted); }

/* ---------- ads ---------- */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--surface-2) 45%, transparent) 10px 20px);
}
.ad-slot:not(.is-house) > span { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.ad-slot:not(.is-house) > small { font-size: 12px; opacity: .8; }
.ad-leaderboard { height: 90px; width: 100%; max-width: 728px; margin-inline: auto; }
.ad-mrec { width: 300px; max-width: 100%; height: 250px; }

/* our own ads (house ads) */
.ad-slot.is-house { display: block; border: 0; background: none; }
.ad-slot.is-house:empty { border: 1px solid var(--line); background: var(--surface); }
.hads {
  --ad-accent: #35e6c4; --ad-ink: #07101c;
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; height: 100%; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ad-accent) 35%, var(--line)); border-radius: var(--radius-sm);
  background: linear-gradient(100deg, color-mix(in srgb, var(--ad-accent) 14%, var(--surface)) 0%, var(--surface) 72%);
  color: var(--text); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.hads:hover { border-color: var(--ad-accent); box-shadow: 0 0 0 1px var(--ad-accent); }
.hads-media {
  flex: none; display: grid; place-items: center; overflow: hidden; align-self: stretch;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--ad-accent) 42%, #0a0d18), #0a0d18 78%); color: var(--ad-accent);
}
.hads-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hads-media svg { width: 34%; max-width: 64px; height: auto; }
.hads-media img.hads-mark { width: 42%; max-width: 96px; height: auto; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .45)); }
.hads-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.hads-h { font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hads-b { font-size: 13px; line-height: 1.35; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hads-cta {
  flex: none; padding: 9px 16px; border-radius: 999px; background: var(--ad-accent); color: var(--ad-ink);
  font-weight: 800; font-size: 13px; white-space: nowrap;
}
.hads-tag {
  position: absolute; top: 5px; right: 8px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); pointer-events: none;
}
.hads-banner { padding-right: 16px; }
.hads-banner .hads-media { aspect-ratio: 16 / 9; }
.hads-box { flex-direction: column; align-items: stretch; gap: 0; }
.hads-box .hads-media { height: 128px; }
.hads-box .hads-copy { padding: 10px 14px 0; }
.hads-box .hads-cta { align-self: flex-start; margin: 10px 14px 14px; }
.hads-tag { top: 6px; left: 6px; right: auto; padding: 2px 6px; border-radius: 5px; background: rgba(5, 7, 14, .72); color: #cfd5ea; }
.hads-box .hads-tag, .hads-break .hads-tag { top: 8px; left: 8px; padding: 3px 7px; }
/* inside the player's ad break (always dark) */
.ad-break { container-type: size; }
.hads-break {
  flex-direction: column; align-items: stretch; gap: 0; width: min(440px, 92%); height: auto; flex: none; text-align: left;
  background: #10152a; color: #e8ebf7; border-color: color-mix(in srgb, var(--ad-accent) 45%, #262f4c);
}
.hads-break .hads-media { aspect-ratio: 16 / 9; }
.hads-break .hads-copy { padding: 14px 16px 2px; }
.hads-break .hads-h { font-size: 19px; white-space: normal; }
.hads-break .hads-b { font-size: 14px; color: #9aa3c2; white-space: normal; }
.hads-break .hads-cta { align-self: flex-start; margin: 12px 16px 16px; }
@container (max-height: 470px) {
  .hads-break .hads-media { aspect-ratio: auto; height: 28cqh; }
  .hads-break .hads-copy { padding: 10px 14px 0; }
  .hads-break .hads-h { font-size: 17px; }
  .hads-break .hads-b { white-space: nowrap; }
  .hads-break .hads-cta { margin: 10px 14px 12px; padding: 8px 14px; }
}
@container (max-height: 300px) {
  .hads-break .hads-media { display: none; }
}

/* live-demo ads: the game playing itself (or its clip) over the picture */
.hads-live, .hads-pl { position: relative; }
.hads-live > img, .hads-pl > img { position: absolute; inset: 0; }
.hads-live > svg, .hads-pl > svg { position: relative; }
.hads-demo, .hads-video, .hads-plframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: cover; background: #05070e;
}
.hads-demo, .hads-video { pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.hads-demo.is-on, .hads-video.is-on { opacity: 1; }
.hads.is-live .hads-tag { display: inline-flex; align-items: center; gap: 5px; }
.hads.is-live .hads-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 6px #ff4d6d; animation: blink 1.4s ease-in-out infinite; }
/* playable ads: a small game inside the ad */
.hads-plgo {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, rgba(5,7,14,0) 30%, rgba(5,7,14,.55)); color: #fff;
  font-weight: 800; font-size: 14px; letter-spacing: .02em; text-shadow: 0 1px 3px rgba(0,0,0,.6); cursor: pointer;
}
.hads-plgo svg { width: 30px; height: 30px; max-width: none; padding: 7px; border-radius: 50%; background: var(--ad-accent); color: var(--ad-ink); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.hads-plgo:hover svg { transform: scale(1.08); }
.hads-pl.is-open .hads-plgo, .hads-pl.is-open > img { display: none; }
.hads-plframe { z-index: 3; }
.hads-plx {
  position: absolute; bottom: 6px; right: 6px; z-index: 4; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(5,7,14,.75); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}
/* a playable in the box spot takes the whole box while it's being played */
.hads-box .hads-pl.is-open { position: absolute; inset: 0; height: auto; z-index: 3; }
.hads-banner .hads-plgo { font-size: 0; gap: 0; }
.hads-banner .hads-plgo svg { width: 26px; height: 26px; padding: 6px; }
/* a playable in a game break: the game is big, the text and button come from the playable itself */
.ad-break.has-playable { gap: 10px; padding: 12px; }
.ad-break.has-playable .hads-break { width: min(calc(70cqh * 16 / 9), 96cqw); border-radius: 12px; }
.ad-break.has-playable .hads-break .hads-media { display: block; aspect-ratio: 16 / 9; height: auto; }
.ad-break.has-playable .hads-break .hads-copy, .ad-break.has-playable .hads-break .hads-cta { display: none; }
.ad-break.has-playable .ab-back { border-color: #35e6c4; color: #35e6c4; font-weight: 700; }
@container (max-height: 300px) {
  .ad-break.has-playable .ab-label, .ad-break.has-playable .ab-bar { display: none; }
  .ad-break.has-playable .hads-break { width: min(calc(78cqh * 16 / 9), 96cqw); }
}
/* phones held upright: a tall frame, so the playable isn't a thin strip (playables resize to their frame) */
@container (max-aspect-ratio: 3 / 4) {
  .ad-break.has-playable .hads-break { width: min(calc(72cqh * 3 / 4), 96cqw); }
  .ad-break.has-playable .hads-break .hads-media { aspect-ratio: 3 / 4; }
}

/* video ads: our own short videos. They carry their own title and button, so the box and the break show just the video. */
.hads.is-video .hads-tag { left: auto; right: 6px; }
.hads-box.is-video .hads-media { position: absolute; inset: 0; height: auto; }
.hads-box.is-video .hads-copy, .hads-box.is-video .hads-cta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; padding: 0; }
.hads-box.is-video .hads-video, .ad-break.has-video .hads-video { object-fit: contain; }
.hads-box.is-video .hads-tag { top: 8px; right: 8px; }
.ad-break.has-video { gap: 10px; padding: 12px; }
.ad-break.has-video .hads-break { border-radius: 12px; }
.ad-break.has-video .hads-break .hads-media { display: block; height: auto; }
.ad-break.has-video .hads-break .hads-copy, .ad-break.has-video .hads-break .hads-tag { display: none; }
.ad-break.has-video .hads-break .hads-cta { align-self: center; margin: 10px 12px 12px; }
.ad-break.has-video.is-wide .hads-break { width: min(calc(60cqh * 16 / 9), 96cqw); }
.ad-break.has-video.is-wide .hads-break .hads-media { aspect-ratio: 16 / 9; }
.ad-break.has-video.is-square .hads-break { width: min(56cqh, 92cqw); }
.ad-break.has-video.is-square .hads-break .hads-media { aspect-ratio: 1 / 1; }
.ad-break.has-video.is-tall .hads-break { width: min(calc(62cqh * 9 / 16), 92cqw); }
.ad-break.has-video.is-tall .hads-break .hads-media { aspect-ratio: 9 / 16; }
@container (max-height: 420px) {
  .ad-break.has-video .ab-label, .ad-break.has-video .hads-break .hads-cta { display: none; }
  .ad-break.has-video.is-wide .hads-break { width: min(calc(72cqh * 16 / 9), 96cqw); }
}

/* ---------- page heads + prose ---------- */
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { display: inline-flex; align-items: center; gap: 12px; font-size: clamp(26px, 3vw, 34px); font-weight: 800; }
.page-head h1 .ico { width: 28px; height: 28px; color: var(--accent); }
.page-head p { color: var(--muted); max-width: 62ch; }
.page-head .count { font-size: 13px; font-variant-numeric: tabular-nums; }
.narrow { max-width: 760px; }
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h2 { font-size: 21px; margin-top: 14px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.panel h3 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.panel-next h3 { color: var(--violet); }
.code-block { position: relative; border-radius: var(--radius); background: #070a13; border: 1px solid var(--line); }
.code-block pre { margin: 0; padding: 18px; overflow-x: auto; font: 13px/1.6 var(--font-mono); color: #cfe9ff; }
.copy-btn { position: absolute; right: 10px; top: 10px; padding: 5px 12px; border-radius: 8px; border: 1px solid #2a3452; background: #121a2e; color: #cfe9ff; font-size: 12px; font-weight: 600; }
.copy-btn:hover { border-color: var(--accent); }
.submit-form { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { min-width: 200px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.submit-form .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; }
.form-note { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.empty { color: var(--muted); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* ---------- game page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 13px; color: var(--muted); margin: -8px 0 -26px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--accent); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.game-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.game-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.side-h { font-size: 16px; }
.side-list { display: flex; flex-direction: column; gap: 10px; }
.mini { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; transition: background .15s ease; }
.mini img { width: 128px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; }
.mini span { display: flex; flex-direction: column; min-width: 0; }
.mini strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini small { color: var(--muted); font-size: 12px; }
.mini:hover { background: var(--surface-2); }

.player {
  position: relative; aspect-ratio: 16 / 9; max-width: 100%;
  border-radius: 18px; overflow: hidden; background: #05070e;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 0 50px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow);
}
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.cover-bg { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); max-width: none; object-fit: cover; filter: blur(26px) brightness(0.45) saturate(1.2); }
.cover-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; text-align: center; }
/* moving cover: the game playing itself, or a clip, behind the Play button */
.cover-demo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; border: 0; object-fit: cover; pointer-events: none; opacity: 0; transition: opacity .6s ease; background: #05070e; }
.cover-demo.is-on { opacity: 1; }
.player-cover::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s ease;
  background: radial-gradient(ellipse 60% 55% at 50% 55%, rgba(5, 7, 14, .62), rgba(5, 7, 14, .18) 70%, rgba(5, 7, 14, .05)); }
.player-cover.has-motion::after { opacity: 1; }
.player-cover.has-motion .cover-thumb { display: none; }
.cover-thumb { width: min(360px, 48vw); height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 16px 40px rgba(0,0,0,.5); }
.cover-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 3vw, 34px); color: #fff; letter-spacing: 0.01em; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.soon-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: rgba(5,7,14,.7); color: #fff; font-weight: 700; }
.player-stage { position: absolute; inset: 0; background: #05070e; }
.player-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa3c4; font-size: 14px; pointer-events: none; }
.stage-loading::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin .8s linear infinite; margin-bottom: 44px; grid-area: 1 / 1; }
.stage-loading span { grid-area: 1 / 1; margin-top: 40px; }
@keyframes spin { to { transform: rotate(360deg); } }
.player.is-happy { animation: happy 1.2s ease; }
@keyframes happy { 30% { box-shadow: 0 0 0 3px var(--warm), 0 0 70px rgba(255,181,71,.55); } }

.ad-break {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #05070e; color: #e8ebf7; text-align: center; padding: 20px;
}
.ad-break .ab-label { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #8c94b3; }
.ad-break .ab-box {
  width: min(420px, 90%); aspect-ratio: 16 / 9; max-width: 100%; border-radius: 12px;
  border: 1px dashed #3a4466; display: grid; place-items: center; color: #8c94b3; font-size: 14px;
  background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,.03) 12px 24px);
}
.ad-break .ab-count { font-size: 15px; font-variant-numeric: tabular-nums; }
.ad-break .ab-bar { width: min(420px, 90%); height: 4px; border-radius: 4px; background: #232b47; overflow: hidden; }
.ad-break .ab-bar i { display: block; height: 100%; width: 0; background: #35e6c4; }
.ad-break .ab-close { padding: 8px 16px; border-radius: 10px; border: 1px solid #3a4466; background: transparent; color: #cfd5ea; font-size: 13px; }

.theater-exit {
  position: absolute; z-index: 6; left: 0; right: 0; top: 0;
  height: calc(44px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0 calc(8px + env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 4px;
  border: 0; border-bottom: 1px solid #1a2138; background: #05070e; color: #e8ebf7;
  font-size: 14px; font-weight: 600; text-align: left;
}
.theater-exit .ico { width: 20px; height: 20px; }
.rotate-hint { position: absolute; z-index: 4; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(5,7,14,.75); color: #fff; font-size: 13px; white-space: nowrap; pointer-events: none; }

/* Theater: the player takes the whole screen (phones, or when fullscreen isn't allowed) */
.player.is-theater {
  position: fixed; inset: 0; z-index: 100; aspect-ratio: auto; max-width: none;
  border-radius: 0; border: 0; box-shadow: none;
  background: #05070e;
}
.player.is-theater .player-stage { inset: calc(44px + env(safe-area-inset-top, 0px)) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
body.has-theater { overflow: hidden; }
.player:fullscreen { border-radius: 0; border: 0; aspect-ratio: auto; }

.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.pb-title { display: flex; flex-direction: column; min-width: 0; }
.pb-title strong { font-size: 18px; }
.pb-title span { color: var(--muted); font-size: 13px; }
.pb-title a { color: var(--accent); }
/* bigger finger targets for small text links (the line height doesn't change) */
.pb-title a, .details dd a { display: inline-block; padding: 7px 0; margin: -7px 0; }
.pb-actions { display: flex; gap: 6px; }
.pb-actions .icon-btn { background: var(--surface); border-color: var(--line); }
.pb-actions .icon-btn:hover { border-color: var(--accent); }

.about-game { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.about-game h2 { font-size: 20px; }
.about-game h2:not(:first-child) { margin-top: 10px; }
.about-game .lede { font-size: 17px; font-weight: 600; }
.about-game p { max-width: 68ch; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.controls-one { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.shell-loading { display: flex; align-items: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.shell-loading span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.control-col { padding: 16px; border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.control-col h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.control-col h3 .ico { width: 18px; height: 18px; }
.control-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.control-col li { display: flex; flex-direction: column; gap: 4px; }
.keys { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.key {
  display: inline-block; min-width: 30px; padding: 3px 9px; text-align: center;
  font: 600 12.5px/1.4 var(--font-mono); color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 7px;
}
.key-or { font-size: 11px; color: var(--muted); }
.does { font-size: 14px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 0; }
.details div { display: flex; flex-direction: column; gap: 2px; }
.details dt { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.details dd { margin: 0; font-weight: 600; }
.details a { color: var(--accent); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--muted); }

/* ---------- search ---------- */
#search-input::-webkit-search-cancel-button, #search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-panel {
  position: fixed; z-index: 60; inset: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 16px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; gap: 16px; overflow-y: auto;
}
.search-box { width: min(760px, 100%); display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box > .ico { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--text); font: 500 17px var(--font-ui); outline: none; }
.search-body { width: min(760px, 100%); display: flex; flex-direction: column; gap: 16px; }
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip .ico { width: 16px; height: 16px; color: var(--accent); }
.chip:hover { border-color: var(--accent); }

/* ---------- 404 ---------- */
.not-found { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 40px 0; }
.big-404 { font-family: var(--font-display); font-size: clamp(64px, 12vw, 120px); line-height: 1; color: var(--accent); text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.not-found h1 { font-size: 28px; }
.not-found p { color: var(--muted); }
.nf-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- footer ---------- */
.footer { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 42ch; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.footer-cols div { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-cols h3 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.footer-cols a:hover { color: var(--accent); }
.footer-note { color: var(--muted); font-size: 13px; }
.footer-legal { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- players: chip, toasts, leaderboards, achievements, profiles ---------- */
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; min-width: 42px; padding: 0 11px; border-radius: 12px;
  border: 1px solid transparent; color: var(--text); white-space: nowrap; max-width: 190px;
}
.player-chip:hover { background: var(--surface-2); }
.player-chip.has-player { border-color: var(--line); background: var(--surface); padding: 0 6px 0 10px; }
.player-chip .ico { width: 18px; height: 18px; color: var(--accent); }
.pc-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pc-level { font: 700 11px var(--font-ui); padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.pt-stack { position: absolute; z-index: 30; top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.pt {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 16px; border-radius: 14px; text-align: center;
  background: rgba(8, 11, 22, .88); color: #fff; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity .3s ease, transform .3s ease;
}
.pt.is-in { opacity: 1; transform: none; }
.pt b { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.pt b .ico { width: 16px; height: 16px; }
.pt span { font-size: 12px; color: #c4cae2; }
.pt-gold { border-color: rgba(255, 181, 71, .55); }
.pt-gold b { color: #ffcd7a; }

.lb, .ach { display: flex; flex-direction: column; gap: 12px; }
.lb h2, .ach h2, .profile-sec h2 { display: inline-flex; align-items: center; gap: 10px; }
.lb h2 .ico, .ach h2 .ico, .profile-sec h2 .ico { color: var(--warm); }
.lb-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.lb-title { font-weight: 700; }
.lb-select { font: 600 14px var(--font-ui); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; max-width: 100%; }
.lb-tabs { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.lb-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lb-tabs button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.lb-list li.is-me { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(53, 230, 196, .5); }
.lb-rank { font-weight: 800; color: var(--muted); text-align: center; }
.lb-list li.top1 .lb-rank { color: #ffc94d; }
.lb-list li.top2 .lb-rank { color: #c9d2e6; }
.lb-list li.top3 .lb-rank { color: #e0955a; }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name:hover { color: var(--accent); }
.lb-lv { font-size: 12px; color: var(--muted); }
.lb-score { font-weight: 800; }
.lb-empty, .lb-hint, .lb-me { color: var(--muted); font-size: 14px; }
.lb-me b { color: var(--text); }

.lb-overlay { position: absolute; inset: 0; z-index: 35; display: grid; place-items: center; padding: 14px; background: rgba(5, 7, 14, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lb-overlay-card { width: min(520px, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); }
.lb-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-overlay-head strong { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.lb-overlay-head .ico { color: var(--warm); }
.lb-overlay .lb-list li { padding: 6px 10px; }

.ach-sum { color: var(--muted); font-size: 14px; }
.ach-sum b { color: var(--text); }
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.ach-grid li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.ach-grid li:not(.is-on) { opacity: .62; }
.ach-grid li.is-on { border-color: color-mix(in srgb, var(--warm) 45%, var(--line)); }
.ach-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.ach-grid li.is-on .ach-ic { background: color-mix(in srgb, var(--warm) 22%, transparent); color: var(--warm); }
.ach-txt { display: flex; flex-direction: column; min-width: 0; }
.ach-txt strong { font-size: 14px; }
.ach-txt small, .ach-meta small { color: var(--muted); font-size: 12px; }
.ach-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ach-meta b { font-size: 12px; color: var(--accent); }

.sort-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: -18px; }
.sort-row .chip { color: var(--muted); }
.sort-row .chip.is-on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.profile { display: flex; flex-direction: column; gap: 20px; max-width: 860px; width: 100%; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; overflow-wrap: anywhere; }
.profile-head > div:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.avatar { flex: none; width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font: 400 32px var(--font-display); color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 30%, transparent); }
.avatar .ico { width: 32px; height: 32px; }
.linkish { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 14px; min-height: 32px; }
.linkish .ico { width: 16px; height: 16px; }
.xp-card, .profile-sec { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.profile-sec h2 { font-size: 18px; }
.profile-sec h2 small { font-size: 14px; font-weight: 600; }
.xp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.xp-level { font: 400 22px var(--font-display); color: var(--accent); }
.xp-bar { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--violet)); min-width: 6px; }
.pf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pf-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.pf-list a { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-list a strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-list a small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-list a:hover strong { color: var(--accent); }
.pf-score { font-weight: 800; }
.pf-rank { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 34px; text-align: right; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; min-width: 0; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; height: 46px; }
.inline-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-note { font-size: 14px; color: var(--pink); }
.form-note.is-ok { color: var(--accent); }
.code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-row code { font: 700 16px var(--font-mono); letter-spacing: .06em; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }

/* ---------- app install + offline games ---------- */
button.nav-item { width: 100%; background: none; border: 0; text-align: left; font: inherit; font-weight: 500; cursor: pointer; }
.off-btn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; white-space: nowrap; position: relative; overflow: hidden; }
.off-btn .off-ic { display: inline-flex; }
.off-btn .ico { width: 18px; height: 18px; }
.pb-actions .off-btn.is-idle { color: var(--accent); }
.pb-actions .off-btn.is-saved { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pb-actions .off-btn.is-update { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 50%, var(--line)); }
.pb-actions .off-btn.is-confirm { color: #ff6b7d; border-color: #ff6b7d; }
.pb-actions .off-btn.is-saving { color: var(--text); cursor: progress;
  background: linear-gradient(90deg, var(--accent-soft) var(--p, 0%), var(--surface) var(--p, 0%)); }
.card.is-saved-offline .card-media::before {
  content: ''; position: absolute; z-index: 3; left: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(5, 7, 14, .72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2335e6c4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v10.5M7.5 10.5 12 15l4.5-4.5M5 19.5h14'/%3E%3C/svg%3E") center / 15px no-repeat;
  box-shadow: 0 0 0 1px rgba(53, 230, 196, .5);
}
.net-bar {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 39;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: color-mix(in srgb, var(--warm) 16%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--warm) 40%, var(--line));
  font-size: 14px; font-weight: 600; text-align: center;
}
.net-bar .ico { width: 18px; height: 18px; color: var(--warm); }
.net-bar a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.offline-page { display: flex; flex-direction: column; gap: 22px; }
.off-sec { display: flex; flex-direction: column; gap: 12px; }
.off-sec h2 { font-size: 20px; display: flex; align-items: baseline; gap: 10px; }
.off-sec h2 small { font-size: 13px; font-weight: 600; }
.off-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--warm) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warm) 40%, var(--line)); font-weight: 600; }
.off-note .ico { color: var(--warm); }
.off-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.off-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.off-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.off-main img, .off-noimg { width: 96px; flex: none; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.off-main > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.off-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.off-main small { color: var(--muted); font-size: 12px; }
.off-new { color: var(--warm); }
.off-row .icon-btn { flex: none; color: var(--muted); }
.off-row .icon-btn:hover, .off-row .icon-btn.is-confirm { color: #ff6b7d; background: var(--surface-2); }
.install-card { flex-direction: row; align-items: center; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.install-card > div { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.install-card p { flex: 1; min-width: 0; font-size: 14px; }
.install-card .btn { flex: none; }
.sheet { position: fixed; inset: 0; z-index: 130; display: grid; align-items: end; justify-items: center; padding: 16px; background: rgba(5, 7, 14, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 20px; margin-bottom: env(safe-area-inset-bottom, 0px); border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sheet-card h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.sheet-card h2 .ico { color: var(--accent); flex: none; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 721px) { .sheet { align-items: center; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-side { position: static; }
  .game-side .ad-mrec { display: none; }
  .side-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 999px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: auto;
    width: min(300px, 86vw);
    padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
    background: var(--bg); border-right: 1px solid var(--line);
    transform: translateX(-102%); transition: transform .22s ease; visibility: hidden;
  }
  .sidebar.is-open { transform: none; visibility: visible; }
  .drawer-head { display: flex; }
  .hero-slide { grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
  .hero-tab img { display: none; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 58px; }
  main { padding: 16px 16px 40px; gap: 28px; }
  .search-trigger { display: none; }
  .search-btn-sm { display: inline-grid; }
  .topbar-actions { margin-left: auto; }
  .logo-word { font-size: 19px; }
  .logo-mark { height: 34px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card-title { font-size: 14px; }
  .controls, .two-up { grid-template-columns: minmax(0, 1fr); }
  .about-game { padding: 18px; }
  .dev-band { padding: 20px; }
  .footer, .footer-cols { grid-template-columns: minmax(0, 1fr); }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player { border-radius: 14px; }
  .cover-thumb { display: none; }
  .ad-leaderboard { height: 64px; }
  .hads-banner { gap: 10px; padding-right: 10px; }
  .hads-banner .hads-b { display: none; }
  .hads-banner .hads-media { aspect-ratio: 1 / 1; }
  .hads-banner .hads-h { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .hads-banner .hads-cta { padding: 7px 12px; font-size: 12px; }
  .crumbs { margin-bottom: -20px; }
  .topbar { gap: 8px; }
  .topbar-actions { gap: 2px; }
  .theme-btn { display: none; }
  .player-chip.has-player .pc-name { display: none; }
  .off-btn { padding: 0 11px; }
  .player-bar { flex-wrap: wrap; row-gap: 10px; }
  .pb-title { flex: 1 1 150px; }
  .off-main img, .off-noimg { width: 76px; }
  .off-row { gap: 8px; }
  .install-card { flex-wrap: wrap; }
  .player-chip.has-player { padding: 0 6px 0 8px; gap: 6px; }
  .player.is-theater .pt-stack { top: calc(58px + env(safe-area-inset-top, 0px)); }
  .lb-list li { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; }
  .lb-lv { display: none; }
  .lb-tabs button { padding: 6px 9px; }
  .ach-grid { grid-template-columns: minmax(0, 1fr); }
  .avatar { width: 58px; height: 58px; border-radius: 16px; font-size: 26px; }
  .xp-card, .profile-sec { padding: 16px; }
  .sort-row { margin-bottom: -12px; }
  .hero-tag { font-size: 16px; }
  .hero { gap: 12px; }
  .hero-slide { gap: 14px; }
  .hero-info { gap: 11px; }
  .hero-nav { gap: 6px; align-items: center; }
  .hero-arrow { width: 36px; height: 36px; border-radius: 10px; }
  .hero-arrow .ico { width: 18px; height: 18px; }
  .hero-tabs { gap: 6px; }
  /* phones: each game is a short bar that fills up while it shows */
  .hero-tab { height: 36px; padding: 0; border: 0; background: transparent; border-radius: 0; }
  .hero-tab.is-current { background: transparent; }
  .hero-tab .ht-text { display: none; }
  .ht-bar { top: 50%; bottom: auto; height: 5px; margin-top: -2.5px; border-radius: 99px; overflow: hidden; background: var(--line); }
  .hero-eyebrow { gap: 6px; font-size: 11px; }
  .hero-why { padding: 4px 8px 4px 7px; }
  .hero-why .ico { width: 12px; height: 12px; }
  .is-carousel .hero-tag { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (max-width: 419px) {
  .topbar .logo-sub { display: none; }
}
/* Small phones (iPhone SE, Galaxy S, phones with a bigger display size setting): everything a size smaller */
@media (max-width: 380px) {
  main { padding: 12px 12px 32px; gap: 22px; }
  .grid { gap: 10px; }
  .card-title { font-size: 13px; }
  .card-sub { font-size: 12px; }
  .section-head h2 { font-size: 18px; gap: 8px; }
  .page-head h1 { font-size: 24px; gap: 10px; }
  .page-head h1 .ico { width: 24px; height: 24px; }
  .hero-title { font-size: 30px; }
  .hero-tag { font-size: 15px; }
  .hero-facts { display: none; }
  .hero .btn-play { height: 44px; padding: 0 18px; font-size: 15px; }
  .hero-eyebrow { font-size: 10px; letter-spacing: 0.08em; }
  .cover-title { font-size: 20px; }
  .about-game { padding: 14px; gap: 12px; }
  .about-game h2 { font-size: 18px; }
  .about-game .lede { font-size: 15px; }
  .pb-title strong { font-size: 16px; }
  .pb-actions { gap: 4px; }
  .pb-actions .icon-btn { width: 38px; height: 38px; }
  .dev-band { padding: 16px; }
  .xp-card, .profile-sec { padding: 14px; }
}
/* On touch screens the phone controls come first on a game page */
@media (pointer: coarse) {
  .controls .control-col.is-touch { order: -1; }
}
/* Phones turned sideways (short, wide screens): the phone layout, sized to fit the screen's height */
@media (max-height: 540px) and (orientation: landscape) and (pointer: coarse) {
  :root { --topbar-h: 50px; }
  main { padding: 12px 20px 32px; gap: 22px; }
  .search-trigger { display: none; }
  .search-btn-sm { display: inline-grid; }
  .topbar-actions { margin-left: auto; }
  .theme-btn { display: none; }
  .icon-btn { width: 40px; height: 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .section-head h2 { font-size: 18px; }
  /* featured games: picture and words side by side, all of it on one screen */
  .hero-slide { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: center; }
  .hero-screen { max-height: calc(100vh - var(--topbar-h) - 84px); max-height: calc(100svh - var(--topbar-h) - 84px); }
  .hero-info { gap: 8px; }
  .hero-title { font-size: 28px; }
  .hero-tag { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-facts, .hero-stats { display: none; }
  .hero .btn-play { height: 40px; padding: 0 16px; font-size: 14px; }
  .hero-eyebrow { font-size: 10px; }
  .hero-nav { gap: 6px; align-items: center; }
  .hero-arrow { width: 34px; height: 34px; border-radius: 10px; }
  .hero-tab { height: 30px; padding: 0; border: 0; background: transparent; border-radius: 0; }
  .hero-tab.is-current { background: transparent; }
  .hero-tab .ht-text { display: none; }
  .ht-bar { top: 50%; bottom: auto; height: 5px; margin-top: -2.5px; border-radius: 99px; overflow: hidden; background: var(--line); }
  /* game page: the player fits the screen's height */
  .player { width: min(100%, calc((100vh - var(--topbar-h) - 28px) * 16 / 9)); width: min(100%, calc((100svh - var(--topbar-h) - 28px) * 16 / 9)); margin-inline: auto; border-radius: 14px; }
  .cover-thumb { display: none; }
  .cover-title { font-size: 22px; }
  .crumbs { display: none; }
  .page-head h1 { font-size: 24px; }
  .controls, .two-up { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer, .footer-cols { grid-template-columns: minmax(0, 1fr); }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* playing: no bar across the top, just a small round Back button, so the game gets the whole screen */
  .player.is-theater .player-stage { inset: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
  .theater-exit {
    left: calc(8px + env(safe-area-inset-left, 0px)); right: auto; top: 8px; width: 38px; height: 38px; padding: 0;
    justify-content: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
    background: rgba(5,7,14,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: .85;
  }
  .theater-exit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .player.is-theater .pt-stack { top: 8px; }
  .ad-leaderboard { height: 64px; }
}
@media (max-width: 359px) {
  .topbar { padding-inline: 10px; gap: 6px; }
  .topbar .logo-word { font-size: 17px; }
  .topbar .logo-mark { height: 30px; }
  .topbar .icon-btn { width: 38px; }
  .player-chip.has-player .ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.stage-error::before { display: none; }
.stage-error::before { display: none; }
.stage-error span { margin-top: 0; padding: 0 20px; text-align: center; color: #cfd5ea; }
