:root {
  --bg: #1a1c1e;
  --bg-2: #202224;
  --surface: #2a2c2f;
  --surface-2: #34363a;
  --surface-3: #3f4246;
  --border: #393b3e;
  --text: #ffffff;
  --text-2: #c3c4c6;
  --text-3: #8d8f93;
  --green: #00a86b;
  --green-hover: #00bf7a;
  --blue: #3a6df0;
  --blue-hover: #5282ff;
  --red: #e5484d;
  --gold: #f5c23b;
  --online: #02b757;
  --ingame: #00a2ff;
  --radius: 8px;
  --topbar-h: 60px;
  --sidebar-w: 216px;
  --font-head: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Phones and tablets: feels like an app. No text resizing when the phone turns, no grey flash on taps,
   and a quick double tap on a button, link or tile never zooms the page (pinch zoom still works). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
::selection { background: var(--blue); }

/* ---------- icons (mask-based so they take currentColor) ---------- */
.i {
  display: inline-block; width: 20px; height: 20px; flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  vertical-align: middle;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--bg-2); border-bottom: 1px solid #111;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--text); position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-toggle::before {
  content: ''; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18M3 12h18M3 18h18" stroke="black" stroke-width="2.4" stroke-linecap="round"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18M3 12h18M3 18h18" stroke="black" stroke-width="2.4" stroke-linecap="round"/></svg>') center/contain no-repeat;
}
.logo {
  position: relative; font: 400 29px/1 'Lilita One', var(--font-head); letter-spacing: 0.03em; color: #fff;
  display: inline-flex; align-items: center; white-space: nowrap; user-select: none;
  text-shadow: 0 2px 0 #000;
}
.logo-cube { width: 1.02em; height: 1.02em; margin: -0.08em 0.02em 0; transition: transform .3s cubic-bezier(.3,1.8,.5,1); filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }
.logo:hover .logo-cube { transform: rotate(-12deg) scale(1.12) translateY(-2px); }
.logo-spark { position: absolute; right: -12px; top: -8px; font-size: 13px; color: #ffd23f; text-shadow: none; animation: spark 2.4s ease-in-out infinite; }
@keyframes spark { 50% { transform: scale(1.35) rotate(20deg); opacity: .6; } }
.logo-o {
  display: inline-block; width: 0.74em; height: 0.74em; margin: 0 0.05em;
  background: currentColor; border-radius: 2px; position: relative; transform: rotate(15deg);
}
.logo-o::after {
  content: ''; position: absolute; width: 30%; height: 30%; left: 35%; top: 35%; background: var(--bg-2);
}
.top-links { display: flex; gap: 4px; }
.top-links a {
  font: 700 16px var(--font-head); padding: 8px 12px; border-radius: 8px; color: var(--text);
}
.top-links a:hover { background: var(--surface-2); }
.search {
  flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center;
}
.search input {
  width: 100%; height: 38px; padding: 0 14px 0 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); outline: none;
}
.search input:focus { border-color: var(--text-3); }
.search-icon {
  position: absolute; left: 12px; width: 18px; height: 18px; background: var(--text-3);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.6" stroke-linecap="round"><circle cx="10.5" cy="10.5" r="6.5"/><path d="m20 20-4.5-4.5"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.6" stroke-linecap="round"><circle cx="10.5" cy="10.5" r="6.5"/><path d="m20 20-4.5-4.5"/></svg>') center/contain no-repeat;
}
.top-right { display: flex; align-items: center; gap: 6px; }
.top-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 24px; font-weight: 700; }
.top-user:hover { background: var(--surface-2); }
.top-user .headshot { width: 32px; height: 32px; }
.badge-dot {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font: 700 11px/18px var(--font); text-align: center;
}
.dropdown {
  position: absolute; top: calc(var(--topbar-h) - 6px); right: 12px; min-width: 200px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.dropdown a, .dropdown button {
  display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 6px;
  background: none; border: 0; text-align: left; font-weight: 600;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 40;
  background: var(--bg-2); padding: 12px 8px; overflow-y: auto; border-right: 1px solid #111;
  transition: transform .2s ease;
}
.sidebar .side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; font-weight: 700; }
.sidebar .side-user .headshot { width: 36px; height: 36px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px;
  font: 600 16px var(--font); color: var(--text-2);
}
.sidebar nav a:hover { background: var(--surface); color: var(--text); }
.sidebar nav a.side-getapp { margin-top: 6px; color: var(--text); border: 1px dashed var(--border); }
.sidebar nav a.active { background: var(--surface-2); color: var(--text); }
.sidebar nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.sidebar hr { border: 0; border-top: 1px solid var(--border); margin: 10px 6px; }
.sidebar .side-cta { margin: 10px 6px; }
.sidebar-scrim { display: none; }
body.sidebar-hidden .sidebar { transform: translateX(-100%); }
body.sidebar-hidden .main { margin-left: 0; }

.main {
  margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 24px) 32px 64px;
  min-height: 100vh; transition: margin-left .2s ease;
}
.page { max-width: 1200px; margin: 0 auto; }
.page.wide { max-width: 1400px; }

@media (max-width: 1100px) {
  .main { margin-left: 0; padding-left: 20px; padding-right: 20px; }
  .sidebar { transform: translateX(-100%); box-shadow: 8px 0 30px rgba(0,0,0,.5); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.5); z-index: 39; }
}
@media (max-width: 760px) {
  .top-links { display: none; }
  .topbar { gap: 8px; padding: 0 8px; }
  .logo { font-size: 20px; }
  .top-user span { display: none; }
  .main { padding: calc(var(--topbar-h) + 16px) 16px 48px; }
  h1 { font-size: 24px; }
}
@media (max-width: 520px) {
  .logo { display: none; }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 8px; border: 0;
  font: 700 15px var(--font-head); background: var(--surface-2); color: var(--text);
  transition: background .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); }
.btn.primary:hover { background: var(--blue-hover); }
.btn.green { background: var(--green); }
.btn.green:hover { background: var(--green-hover); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn.danger:hover { background: rgba(229,72,77,.12); }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.white { background: #fff; color: #111; }
.btn.white:hover { background: #e4e4e4; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 14px; color: var(--text-2); }
.field .hint { font-size: 13px; color: var(--text-3); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); outline: none;
}
.field textarea { resize: vertical; min-height: 100px; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.code-area { font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, monospace !important; min-height: 280px !important; tab-size: 2; white-space: pre; }
.form-error { color: #ff8a8e; font-weight: 600; min-height: 22px; margin: 4px 0 8px; }

.card { background: var(--surface); border-radius: 12px; padding: 20px; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- headshots & presence ---------- */
.headshot {
  width: 48px; height: 48px; border-radius: 50%; background: #4b4e53 linear-gradient(180deg,#5a5e64,#3d4044);
  object-fit: cover; flex: none; position: relative;
}
.hs-wrap { position: relative; display: inline-block; flex: none; }
.hs-wrap .presence {
  position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 10px; min-height: 10px;
  border-radius: 50%; border: 3px solid var(--bg);
}
.presence.online { background: var(--online); }
.presence.ingame { background: var(--ingame); }
.presence.offline { display: none; }

/* ---------- sections ---------- */
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head a.see-all { margin-left: auto; font-weight: 700; color: var(--text-2); font-size: 15px; }
.section-head a.see-all:hover { color: var(--text); }

/* ---------- game tiles ---------- */
.grid {
  display: grid; gap: 22px 16px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.hrow {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 180px); gap: 16px;
  overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity;
}
.hrow > * { scroll-snap-align: start; }
.tile { position: relative; min-width: 0; }
.tile-thumb {
  display: block; position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2);
}
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.tile:hover .tile-thumb img { transform: scale(1.04); }
.tile-thumb .fallback {
  width: 100%; height: 100%; display: grid; place-items: center; font: 900 42px var(--font-head);
}
.tile-pic { position: relative; }
.tile-play {
  position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; border-radius: 10px;
  background: var(--green); display: grid; place-items: center; opacity: 0; transform: translateY(6px);
  transition: opacity .15s, transform .15s; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.tile:hover .tile-play { opacity: 1; transform: none; }
.tile-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 700 15px/1.25 var(--font-head); margin-top: 8px; min-height: 2.5em;
}
.tile-meta { display: flex; gap: 12px; margin-top: 4px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.tile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tile-meta .i { width: 15px; height: 15px; }
.tile .live-dot { color: var(--online); }
.tile-activity { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: 13px; color: var(--text-2); }
.tile-activity a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.tile-record { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: 12px; line-height: 1.4; }
.tile-record > .i { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--gold); }
.tile-record > span { min-width: 0; }
.tile-record > span > span, .tile-record small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile-record small { font-size: 12px; color: var(--text-2); }
.tile-record:hover { text-decoration: underline; text-underline-offset: 3px; }
.tile-record.empty-record { color: var(--text-3); }
.tile-meta { flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }

/* ---------- friends row ---------- */
.friends-row { display: flex; gap: 18px; overflow-x: auto; padding: 4px 2px 10px; }
.friend-bubble { width: 92px; flex: none; text-align: center; }
.friend-bubble .headshot { width: 92px; height: 92px; }
.friend-bubble .name { font-weight: 700; font-size: 14px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-bubble .status { font-size: 12px; color: var(--ingame); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-bubble.add .headshot { display: grid; place-items: center; background: var(--surface); border: 2px dashed var(--surface-3); font-size: 36px; color: var(--text-2); }

/* ---------- home header ---------- */
.home-hello { display: flex; align-items: center; gap: 18px; }
.home-hello .headshot { width: 84px; height: 84px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--border); background: transparent;
  font-weight: 700; font-size: 14px; color: var(--text-2);
}
.chip:hover { background: var(--surface); color: var(--text); }
.chip.active { background: #fff; color: #111; border-color: #fff; }
.game-categories { flex-wrap: nowrap; overflow-x: auto; margin: 16px 0; padding-bottom: 5px; }
.game-categories .chip { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; }
.category-count { font-size: 12px; opacity: .65; }
.discovery-results { margin-top: 10px; font-size: 14px; }

/* ---------- game details ---------- */
.game-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 28px; }
.game-hero { border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface); position: relative; }
.game-hero img { width: 100%; height: 100%; object-fit: cover; }
/* (a game with no picture: its first letter fills the cover, not a thin strip across the top) */
.game-hero .fallback { width: 100%; height: 100%; display: grid; place-items: center; font: 900 clamp(64px, 14vw, 140px)/1 var(--font-head); color: #fff; }
.game-more { margin-top: 18px; }
.game-more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font: 700 15px var(--font); color: var(--text-2); }
.game-more .stats-row { margin-top: 6px; }
.game-info h1 { font-size: 32px; line-height: 1.15; word-break: break-word; }
.game-by { margin-top: 8px; color: var(--text-2); font-weight: 600; }
.game-by a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
/* "Requested by": whose Game Request this game came from (pages/game.js). */
.game-idea { display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 44px; margin: 10px 0 6px; padding: 4px 14px 4px 6px; border-radius: 22px; background: linear-gradient(90deg, rgba(245,194,59,.18), rgba(245,194,59,.06)); box-shadow: inset 0 0 0 1.5px rgba(245,194,59,.45); color: var(--text); font: 700 15px var(--font); }
.game-idea:hover { background: rgba(245,194,59,.24); }
.game-idea b { font-weight: 800; }
.game-idea-face { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.game-idea[hidden] { display: none; }
.game-activity { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 14px; color: var(--text-2); font-size: 14px; }
.game-activity a { text-decoration: underline; text-underline-offset: 3px; }
.game-record { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; margin-top: 10px; }
.game-record button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 0; border: 0; background: none; text-align: left; font-size: 14px; font-weight: 700; color: var(--text); max-width: 100%; }
.game-record button > .i { width: 16px; height: 16px; flex: none; color: var(--gold); }
.game-record button > .i:last-child { color: var(--text-2); }
.game-record-who { color: var(--text-2); font-size: 13px; }
.game-record-who a { text-decoration: underline; text-underline-offset: 3px; }
.play-count-help, .lb-direction { font-size: 13px; margin: 12px 0; }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); vertical-align: -2px; margin-left: 3px; }
.verified::after { content: ''; width: 9px; height: 9px; background: #fff; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="m4 12 5 5L20 6"/></svg>') center/contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="m4 12 5 5L20 6"/></svg>') center/contain no-repeat; }
.maturity { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--text-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }
.play-btn {
  margin-top: 22px; width: 100%; height: 64px; border-radius: 12px; border: 0; background: var(--green);
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px rgba(0,168,107,.25);
}
.play-btn:hover { background: var(--green-hover); }
.play-btn .i { width: 34px; height: 34px; }
.game-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.vote-box { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 700; }
.vote-btn:hover { background: var(--surface); color: var(--text); }
.vote-btn.on { color: var(--text); }
.vote-btn.on .i { color: var(--green); }
.vote-btn.down.on .i { color: var(--red); }
.vote-bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.vote-bar > div { height: 100%; background: var(--text-2); }
.fav-btn.on .i { color: var(--gold); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 36px 0 22px; }
.tabs button {
  background: none; border: 0; padding: 12px 18px; font: 700 16px var(--font-head); color: var(--text-3);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.active { color: var(--text); border-color: var(--text); }
.description { white-space: pre-wrap; color: var(--text-2); font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-top: 24px; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat .label { font-size: 13px; color: var(--text-3); font-weight: 700; }
.stat .value { font: 700 17px var(--font-head); margin-top: 2px; word-break: break-word; }

.server-list { display: grid; gap: 12px; }
.server {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 18px; align-items: center;
  background: var(--surface); border-radius: 10px; padding: 14px 16px;
}
.server .fill { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.server .fill > div { height: 100%; background: var(--green); }
.server .people { display: flex; flex-wrap: wrap; gap: 6px; }
.server .people .headshot { width: 38px; height: 38px; }
.more-count { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 13px; font-weight: 700; }

@media (max-width: 900px) {
  .game-top { grid-template-columns: 1fr; }
  .server { grid-template-columns: 1fr; }
}

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 24px; align-items: center; background: var(--surface); border-radius: 14px; padding: 24px; }
.profile-head .headshot { width: 128px; height: 128px; }
.profile-head h1 { font-size: 30px; }
.profile-stats { display: flex; gap: 28px; margin-top: 12px; }
.profile-stats .n { font: 800 18px var(--font-head); }
.profile-stats .l { color: var(--text-3); font-size: 13px; font-weight: 700; }
.profile-body { display: grid; grid-template-columns: 320px 1fr; gap: 28px; margin-top: 28px; }
.bodyshot-card { background: radial-gradient(circle at 50% 35%, #4a4d52, #2a2c2f 70%); border-radius: 14px; aspect-ratio: 3/4; display: grid; place-items: center; overflow: hidden; }
.bodyshot-card img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 900px) {
  .profile-body { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }
}

/* ---------- people list ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 12px; padding: 12px;
}
.person .headshot { width: 64px; height: 64px; }
.person .who { min-width: 0; flex: 1; }
.person .who .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who .un { color: var(--text-3); font-size: 14px; }
.person .who .st { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who .st.ingame { color: var(--ingame); }
.person .who .st.online { color: var(--online); }
.person .acts { display: flex; gap: 6px; }

/* ---------- auth / landing ---------- */
.auth-card { background: rgba(32,34,36,.94); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.5); max-width: 420px; width: 100%; justify-self: end; }
.auth-card h2 { font-size: 22px; margin-bottom: 18px; text-align: center; }
.auth-card .fine { font-size: 13px; color: var(--text-3); margin-top: 12px; text-align: center; }
.auth-page { display: grid; place-items: center; min-height: calc(100vh - var(--topbar-h) - 120px); }
.auth-page .auth-card { justify-self: center; }
.auth-stack { display: grid; gap: 16px; width: min(420px, 100%); }
.auth-stack .auth-card { max-width: none; }
.idea-saved { display: grid; gap: 6px; padding: 16px 18px; border-radius: 14px; background: #ffd23f; color: #17181c; font-weight: 700; border: 3px solid #17181c; box-shadow: 4px 4px 0 #000; }
.idea-saved b { font: 800 17px var(--font-head); }
.idea-saved span { font-size: 18px; font-weight: 800; }
@media (max-width: 900px) {
  .auth-card { justify-self: stretch; max-width: none; }
}

/* ---------- avatar editor ---------- */
.avatar-layout { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 24px; align-items: start; }
.avatar-stage {
  position: sticky; top: calc(var(--topbar-h) + 20px);
  background: radial-gradient(circle at 50% 30%, #53575d, #2a2c2f 72%); border-radius: 14px; aspect-ratio: 4/5; overflow: hidden;
}
.avatar-stage canvas { width: 100% !important; height: 100% !important; display: block; cursor: grab; touch-action: none; }
.avatar-stage .stage-tag { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.45); padding: 3px 10px; border-radius: 6px; font-weight: 700; font-size: 13px; }
.avatar-stage .save-state { position: absolute; right: 12px; top: 12px; background: rgba(0,0,0,.45); padding: 3px 10px; border-radius: 6px; font-weight: 700; font-size: 13px; }
.avatar-stage .stage-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.6); font-size: 13px; }
.editor-panel { background: var(--surface); border-radius: 14px; padding: 18px; }
.editor-panel h3 { margin: 18px 0 10px; }
.editor-panel h3:first-child { margin-top: 0; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 8px; }
.swatch { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--blue); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.item {
  background: var(--bg); border: 2px solid transparent; border-radius: 10px; padding: 8px; text-align: center;
  font-weight: 700; font-size: 13px; color: var(--text-2);
}
.item:hover { border-color: var(--surface-3); color: var(--text); }
.item.active { border-color: var(--blue); color: var(--text); }
.item .pic { aspect-ratio: 1; border-radius: 8px; background: radial-gradient(circle at 50% 35%, #4a4d52, #2d2f32); margin-bottom: 6px; display: grid; place-items: center; overflow: hidden; }
.item .pic img { width: 100%; height: 100%; object-fit: cover; }
.body-map { display: grid; grid-template-columns: repeat(4, 38px); grid-template-rows: 38px 76px 76px; gap: 3px; justify-content: center; margin: 4px 0 14px; }
.body-map button { border: 2px solid rgba(0,0,0,.35); border-radius: 4px; padding: 0; }
.body-map button.active { outline: 3px solid #fff; outline-offset: 1px; }
.body-map .bm-head { grid-column: 2 / 4; grid-row: 1; width: 44px; justify-self: center; border-radius: 10px; }
.body-map .bm-torso { grid-column: 2 / 4; grid-row: 2; }
.body-map .bm-leftArm { grid-column: 4; grid-row: 2; }
.body-map .bm-rightArm { grid-column: 1; grid-row: 2; }
.body-map .bm-leftLeg { grid-column: 3; grid-row: 3; }
.body-map .bm-rightLeg { grid-column: 2; grid-row: 3; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; font-weight: 700; color: var(--text-2); }
.seg button.active { background: var(--surface-3); color: var(--text); }
@media (max-width: 860px) {
  .avatar-layout { grid-template-columns: 1fr; }
  .avatar-stage { position: relative; top: 0; max-width: 420px; margin: 0 auto; width: 100%; aspect-ratio: 1; }
}

/* ---------- game rows (Dream Studio's game form) ---------- */
.create-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .create-grid { grid-template-columns: 1fr; } }
.creation {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border-radius: 12px; padding: 12px;
}
.creation img, .creation .fallback { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.creation .meta { color: var(--text-3); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.creation .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .creation { grid-template-columns: 56px 1fr; } .creation .acts { grid-column: 1 / -1; justify-content: flex-start; } .creation img { width: 56px; height: 56px; } }
.dropzone {
  border: 2px dashed var(--surface-3); border-radius: 12px; padding: 28px; text-align: center; color: var(--text-2);
  background: var(--bg); transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--blue); background: rgba(58,109,240,.08); }
.dropzone strong { color: var(--text); }
.file-pill { display: inline-flex; gap: 8px; align-items: center; background: var(--surface-2); padding: 6px 12px; border-radius: 20px; font-weight: 700; margin-top: 10px; }
.thumb-preview { width: 100%; aspect-ratio: 16/9; border-radius: 10px; background: var(--bg); object-fit: cover; }
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step-list li { counter-increment: step; position: relative; padding-left: 38px; margin-bottom: 14px; color: var(--text-2); }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.step-list li strong { color: var(--text); }
.docs { font-size: 15px; color: var(--text-2); }
.docs code, .docs pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.docs pre { background: var(--bg); padding: 14px; border-radius: 10px; overflow-x: auto; color: #d6e2ff; line-height: 1.5; }
.docs code { background: var(--bg); padding: 1px 5px; border-radius: 4px; color: #d6e2ff; }
.docs pre code { background: none; padding: 0; }
.docs h3 { margin: 20px 0 8px; color: var(--text); }
details.card summary { cursor: pointer; font: 700 16px var(--font-head); }
details.card[open] summary { margin-bottom: 12px; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--text-3); padding: 40px 16px; background: var(--surface); border-radius: 12px; }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.empty .empty-go { margin-top: 10px; min-height: 48px; padding: 0 22px; font-size: 16px; }
.loading-spin { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 42px; height: 42px; background: var(--text-2); animation: spin 1s cubic-bezier(.6,0,.4,1) infinite; border-radius: 4px; position: relative; }
.spinner::after { content: ''; position: absolute; inset: 35%; background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; }
.toast { background: #fff; color: #111; padding: 12px 18px; border-radius: 10px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toast-in .2s ease; }
.toast.error { background: var(--red); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px; width: min(460px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal.wide { width: min(1100px, 100%); height: min(760px, 92vh); display: flex; flex-direction: column; padding: 14px; }
.modal h2 { margin-bottom: 10px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal iframe { flex: 1; border: 0; border-radius: 10px; background: #000; width: 100%; }

.footer { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* ---------- Vibux ---------- */
.vbx { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; white-space: nowrap; }
.vbx .coin, .coin-lg {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff5b8 0 18%, #ffc933 45%, #d89400 80%); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 0 0 1.5px #7a5200;
}
.vbx .coin::after { content: ''; position: absolute; inset: 30%; border-radius: 2px; background: rgba(122,82,0,.55); transform: rotate(15deg); }
.top-vibux { display: flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.top-vibux:hover { background: var(--surface-2); }
@media (max-width: 760px) { .top-vibux { padding: 0 9px; } }

/* ---------- shop ---------- */
.shop-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.balance-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: linear-gradient(135deg, #3a2f0b, #2a2c2f 70%); border: 1px solid #5b4a13; }
.balance-card .vbx { font: 800 28px var(--font-head); }
.balance-card .vbx .coin { width: 28px; height: 28px; }
.earn-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; }
.earn { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface); font-weight: 600; color: var(--text-2); }
.earn b { color: var(--text); display: block; }
.earn .em { font-size: 26px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 20px; }
.shop-card { background: var(--surface); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.shop-card:hover { transform: translateY(-3px); border-color: var(--surface-3); }
.shop-card .pic { aspect-ratio: 1; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #4a4d52, #2a2c2f 75%); overflow: hidden; position: relative; }
.shop-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.shop-card .nm { font: 700 15px var(--font-head); }
.shop-card .kind { font-size: 13px; color: var(--text-3); font-weight: 700; text-transform: capitalize; margin-top: -6px; }
.shop-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.shop-card.owned .pic::after { content: '✓ Owned'; position: absolute; top: 8px; left: 8px; background: var(--green); color: #fff; font: 800 11px var(--font-head); padding: 3px 8px; border-radius: 6px; }
.item .lock-tag { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.65); font-size: 12px; }
.item .pic { position: relative; }
.item.locked .pic img { filter: saturate(.6) brightness(.8); }

/* ---------- leaderboard (game page) ---------- */
.lb-list { display: grid; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 52px 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface); }
.lb-row.me { outline: 2px solid var(--blue); }
.lb-row .rank { font: 800 18px var(--font-head); text-align: center; color: var(--text-2); }
.lb-row .rank.top { font-size: 26px; }
.lb-row .who { min-width: 0; }
.lb-row .who a { font-weight: 700; }
.lb-row .who .un { color: var(--text-3); font-size: 13px; }
.lb-row .val { font: 800 18px var(--font-head); }
.lb-mine { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: rgba(58,109,240,.15); border: 1px solid rgba(58,109,240,.4); font-weight: 700; }

/* ---------- home: make a game + start here ---------- */
.make-bar { margin-top: 26px; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: linear-gradient(135deg, #2c3b73, #262a3a); border: 1px solid #3c4b86; }
.make-bar .lead { font: 800 16px var(--font-head); padding-left: 8px; white-space: nowrap; }
.make-bar input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 0; padding: 0 14px; background: rgba(0,0,0,.35); outline: none; font-size: 16px; font-weight: 600; }
.make-bar input:focus { box-shadow: 0 0 0 2px #ffd23f; }
@media (max-width: 760px) { .make-bar { flex-wrap: wrap; } .make-bar .lead { width: 100%; padding: 4px; } }
.start-here { display: flex; align-items: center; gap: 18px; margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, #0f6b45, #1d2a25); border: 1px solid #1b8a5c; }
.start-here img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex: none; }
.start-here h3 { font-size: 20px; }
.start-here p { margin: 4px 0 0; color: #cfe9dc; }

/* ---------- builder ---------- */
.credits-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(245,194,59,.14); color: #ffd76a; font-weight: 800; font-size: 14px; white-space: nowrap; }
.credits-pill .i { width: 15px; height: 15px; }
.bs-hero { max-width: 820px; margin: 10px auto 0; text-align: center; }
.bs-cube { width: 84px; height: 84px; margin: 0 auto 10px; animation: cube-bob 3s ease-in-out infinite; }
@keyframes cube-bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.bs-hero h1 { font-size: clamp(28px, 4vw, 42px); }
.bs-hero > p { font-size: 18px; margin: 10px auto 22px; max-width: 620px; }
.bs-prompt { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); border: 2px solid #3c4b86; text-align: left; }
.bs-prompt textarea { width: 100%; border: 0; outline: none; background: var(--bg); border-radius: 12px; padding: 14px; font: 600 18px/1.45 var(--font); color: var(--text); resize: vertical; min-height: 96px; }
.bs-prompt textarea:focus { box-shadow: 0 0 0 2px #ffd23f; }
.bs-ideas { justify-content: center; margin-top: 16px; }

.bw-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bw-head h1 { font-size: 26px; }
.bw-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 18px; margin-top: 16px; height: calc(100vh - var(--topbar-h) - 140px); min-height: 560px; }
@media (max-width: 1000px) { .bw-grid { grid-template-columns: 1fr; height: auto; } .bw-chat { height: 520px; } .bw-screen { height: 60vh; } }
.bw-chat { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: 16px; padding: 12px; min-height: 0; }
.bw-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; min-height: 0; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.msg .txt { padding: 10px 14px; border-radius: 16px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.msg.engine .txt { background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.engine .cube { width: 32px; height: 32px; flex: none; }
.msg.kid { align-self: flex-end; }
.msg.kid .txt { background: #ffd23f; color: #231a00; border-bottom-right-radius: 4px; }
.msg.kid .headshot { width: 36px; height: 36px; }
.msg.warn .txt { background: #4a3413; border: 1px solid #a57418; }
.msg.err .txt { background: #4a1c1f; border: 1px solid #a83a40; }
.bw-progress { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #22306a, #1f2433); border: 1px solid #3c4b86; }
.bw-line { font: 800 15px var(--font-head); margin-bottom: 8px; }
.bw-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.bw-bar > div { height: 100%; width: 4%; border-radius: 4px; background: linear-gradient(90deg, #ffd23f, #5cc93a); transition: width .5s ease; }
.bw-blocks { position: relative; width: 44px; height: 44px; flex: none; }
.bw-blocks i { position: absolute; width: 18px; height: 18px; border-radius: 4px; animation: stack 1.6s ease-in-out infinite; }
.bw-blocks i:nth-child(1) { left: 0; bottom: 0; background: #ff5a4e; }
.bw-blocks i:nth-child(2) { left: 22px; bottom: 0; background: #3d7bff; animation-delay: .2s; }
.bw-blocks i:nth-child(3) { left: 11px; bottom: 22px; background: #ffd23f; animation-delay: .4s; }
.bw-blocks i:nth-child(4) { left: 11px; bottom: 44px; background: #5cc93a; animation-delay: .6s; opacity: 0; }
@keyframes stack { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px) rotate(12deg); } }
.bw-blocks.big { width: 88px; height: 88px; transform: scale(1.8); transform-origin: bottom center; margin-bottom: 30px; }
.bw-tweaks { max-height: 84px; overflow: hidden; }
.bw-tweaks .chip { height: 30px; font-size: 13px; }
.bw-input { display: flex; gap: 8px; align-items: flex-end; }
.bw-input textarea { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 10px 12px; font: 600 15px/1.4 var(--font); color: var(--text); resize: none; outline: none; }
.bw-input textarea:focus { border-color: #ffd23f; }
.bw-input .btn { height: 44px; }
.bw-stage { display: flex; flex-direction: column; min-height: 0; }
.bw-screen { flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; background: #0d0e10; border: 1px solid var(--border); }
.bw-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.bw-empty { height: 100%; display: grid; place-content: center; justify-items: center; color: var(--text-3); font-weight: 700; }
.bw-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.bs-ideas .chip { height: auto; min-height: 34px; padding: 6px 14px; line-height: 1.25; }
@media (max-width: 760px) {
  .start-here { flex-wrap: wrap; gap: 12px; }
  .start-here img { width: 64px; height: 64px; }
  .start-here > div { flex: 1 1 180px; }
  .start-here .btn { margin-left: 0 !important; width: 100%; }
}

/* ---------- credits & plans (/upgrade) ---------- */
a.credits-pill u { margin-left: 6px; color: var(--gold); text-decoration: none; font-weight: 800; }
a.credits-pill:hover { filter: brightness(1.15); }
.up-page { max-width: 1080px; }
.up-page .btn { min-height: 44px; }
.up-ic { display: block; flex: none; object-fit: contain; }
.up-back { height: 48px; padding: 0 20px 0 14px; font-size: 16px; margin-bottom: 18px; }
.up-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 24px; align-items: center; }
.up-hero h1 { margin: 0 0 6px; font: 900 32px var(--font-head); }
.up-hero p { margin: 0; max-width: 560px; }
.up-wallet { display: flex; gap: 10px; }
.up-wallet > div { background: var(--surface); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; min-width: 128px; }
.up-wallet .up-ic { width: 36px; height: 36px; }
.up-wallet span { display: block; color: var(--text-3); font-size: 13px; font-weight: 700; }
.up-wallet b { display: block; font: 800 20px var(--font-head); white-space: nowrap; }
.up-wallet small { display: block; color: var(--text-3); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.up-plan-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); }
.up-plan-ic .i { width: 20px; height: 20px; }
.up-note-bar { margin-top: 16px; display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 12px 14px; font-size: 15px; background: var(--surface); border: 1px solid var(--border); }
.up-note-bar .i { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--blue-hover); }
.up-note-bar.warn { border-color: rgba(245,194,59,.55); background: rgba(245,194,59,.08); }
.up-note-bar.warn .i { color: var(--gold); }
.up-note-bar.bad { border-color: rgba(229,72,77,.6); background: rgba(229,72,77,.08); }
.up-note-bar.bad .i { color: var(--red); }
.up-mine { margin-top: 18px; display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; border: 1px solid var(--green); }
.up-mine .up-ic { width: 44px; height: 44px; }
.up-mine-txt { flex: 1 1 260px; min-width: 0; }
.up-mine-txt b { font: 800 17px var(--font-head); }
.up-mine-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.up-h { font: 800 21px var(--font-head); margin: 34px 0 4px; }
.up-sub { margin: 0 0 14px; color: var(--text-3); font-weight: 600; font-size: 15px; }
.up-costs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.up-cost { background: var(--surface); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.up-cost .up-ic { width: 32px; height: 32px; }
.up-cost span { display: block; color: var(--text-2); font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.up-cost b { display: block; font: 800 16px var(--font-head); }
.up-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.up-plan { background: var(--surface); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border); min-width: 0; }
.up-plan.current { border-color: var(--green); }
.up-plan-name { font: 800 20px var(--font-head); display: flex; align-items: center; gap: 10px; }
.up-plan-name .up-ic { width: 36px; height: 36px; }
.up-price { font: 900 32px var(--font-head); line-height: 1.1; }
.up-price small { font: 600 15px var(--font); color: var(--text-3); margin-left: 4px; }
.up-big { font-weight: 800; color: var(--gold); }
.up-ex { color: var(--text-2); font-size: 14.5px; font-weight: 600; margin-top: -4px; }
.up-plan ul { list-style: none; padding: 0; margin: 2px 0 6px; display: grid; gap: 7px; color: var(--text-2); flex: 1; align-content: start; }
.up-plan li { display: flex; gap: 8px; align-items: flex-start; }
.up-plan li .i { width: 16px; height: 16px; color: var(--green-hover); margin-top: 3px; }
.up-plan-foot { color: var(--text-3); font-size: 13.5px; font-weight: 600; text-align: center; min-height: 44px; display: grid; place-items: center; }
.up-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.up-pack { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 12px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; transition: border-color .15s; }
.up-pack:hover { border-color: var(--surface-3); }
.up-pack:disabled { opacity: .6; }
.up-pack .up-ic { width: 56px; height: 56px; order: -1; margin-top: 22px; }
.up-pack-main { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; flex: 1; }
.up-pack { position: relative; }
.up-tag { position: absolute; top: 10px; left: 8px; right: 8px; text-align: center; font: 700 12.5px var(--font-head); color: var(--gold); }
.up-pack-n { font: 900 26px var(--font-head); line-height: 1.15; display: flex; flex-direction: column; align-items: center; }
.up-pack-n small { font: 700 15px var(--font); color: var(--text-3); }
.up-pack-ex { color: var(--text-2); font-size: 13px; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.up-pack .btn { width: 100%; min-height: 44px; margin-top: auto; }
.up-grownups { margin-top: 34px; background: var(--surface); border-radius: 14px; padding: 18px 20px; }
.up-grownups h2 { font: 800 18px var(--font-head); display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.up-grownups h2 .i { color: var(--text-2); }
.up-grownups ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.up-grownups a { color: var(--blue-hover); text-decoration: underline; }
.up-history { padding: 4px 16px; }
.up-history > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.up-history > div:last-child { border-bottom: 0; }
.up-history b { text-align: right; min-width: 64px; }
.up-history .up-st { font: 700 12px var(--font-head); color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }
.up-gate .up-gate-q { font: 800 20px var(--font-head); color: var(--text); margin: 6px 0 8px; }
.up-gate label { display: block; font-weight: 700; color: var(--text-2); margin: 12px 0 6px; }
.up-gate input { width: 100%; height: 48px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); padding: 0 12px; font-size: 18px; }
.up-gate input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.up-gate .up-gate-err { color: var(--red); font-weight: 700; min-height: 22px; margin-top: 8px; }
.up-gate .up-gate-cost { color: var(--text); font-weight: 700; }
.up-gate .acts .btn { min-height: 44px; }
.modal.up-gate { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal.up-gate .acts { position: sticky; bottom: -24px; margin: 16px -24px -24px; padding: 12px 24px 20px; background: var(--surface); }
.up-gate .up-gate-note { color: var(--gold); font-weight: 700; }
.modal-back:has(.up-gate) { align-items: start; }
@media (min-height: 700px) { .modal-back:has(.up-gate) { align-items: center; } }
@media (max-height: 500px) {
  .modal.up-gate { padding: 16px 20px 20px; }
  .modal.up-gate h2 { font-size: 18px; margin-bottom: 4px; }
  .up-gate p { margin: 4px 0; font-size: 14.5px; }
  .up-gate .up-gate-q { font-size: 17px; margin: 4px 0; }
  .up-gate label { margin: 6px 0 4px; }
  .up-gate input { height: 44px; }
  .up-gate .up-gate-err { min-height: 0; margin-top: 4px; }
  .modal.up-gate .acts { flex-direction: row; bottom: -20px; margin: 10px -20px -20px; padding: 10px 20px 14px; }
  .modal.up-gate .acts .btn { width: auto; flex: 1; }
}
@media (max-width: 900px) {
  .up-hero { grid-template-columns: minmax(0, 1fr); }
  .up-wallet { flex-wrap: wrap; }
  .up-wallet > div { flex: 1 1 140px; }
}
@media (max-width: 560px) {
  .up-hero h1 { font-size: 26px; }
  .up-packs { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .up-pack { flex-direction: row; text-align: left; padding: 12px; gap: 12px; }
  .up-pack .up-ic { width: 48px; height: 48px; margin-top: 0; }
  .up-pack-main { align-items: flex-start; }
  .up-tag { position: static; margin: 0; }
  .up-tag:empty { display: none; }
  .up-pack-n { font-size: 22px; flex-direction: row; align-items: baseline; gap: 6px; }
  .up-pack .btn { width: auto; flex: none; margin-top: 0; padding: 0 16px; }
  .up-wallet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .up-wallet > div { flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 10px; }
  .up-wallet .up-ic { width: 28px; height: 28px; }
  .up-wallet b { font-size: 18px; }
  .up-cost { padding: 10px 12px; }
  .up-history > div { grid-template-columns: minmax(0, 1fr) auto; }
  .up-history > div > .muted { grid-column: 1; grid-row: 2; font-size: 13.5px; }
  .up-history b { grid-row: 1 / span 2; grid-column: 2; }
  .up-gate .acts { flex-direction: column-reverse; }
  .up-gate .acts .btn { width: 100%; }
}
.plan-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; font: 800 13px var(--font-head); padding: 4px 10px; border-radius: 999px; margin-left: 8px; }
.plan-badge img { width: 16px; height: 16px; flex: none; }
.plan-badge.creator { background: rgba(0,168,107,.18); color: #3ce0a0; border: 1.5px solid rgba(0,168,107,.6); }
.plan-badge.studio { background: rgba(245,194,59,.16); color: var(--gold); border: 1.5px solid rgba(245,194,59,.6); }
.make-credits { display: inline-flex; align-items: center; gap: 4px; height: 46px; padding: 0 12px; border-radius: 12px; background: rgba(0,0,0,.35); font: 800 16px var(--font-head); color: var(--gold); white-space: nowrap; }
.make-credits svg { width: 16px; height: 16px; }
.make-credits:hover { background: rgba(0,0,0,.5); }
.thumb-pick { margin: 6px 0 14px; }
.thumb-pick .thumb-preview { margin: 0; }
.thumb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumb-tabs .chip:disabled { opacity: .45; cursor: not-allowed; }
.thumb-tip { font-size: 13px; margin: 6px 0 0; }
.lobby-tag { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 800; color: var(--gold); background: rgba(245,194,59,.14); border-radius: 6px; padding: 2px 7px; }
.studio-btn { color: var(--gold); }

/* ---------- builder: live status, undo & versions; "Change with AI" ---------- */
.bw-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.bw-live { font: 800 15px var(--font-head); padding: 10px 14px; border-radius: 12px; background: var(--surface); }
.bw-live span { font: 600 14px var(--font); color: var(--text-3); }
.bw-live.ok { color: #3ce0a0; }
.bw-live.new { color: #8fb0ff; }
.bw-live.warn { flex: 1 1 280px; font-size: 17px; color: #ffe08a; background: rgba(245,194,59,.16); border: 2px solid var(--gold); }
.bw-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.bw-tools .btn { height: 44px; }
.btn.pulse { animation: pulse-ring 1.6s ease-in-out infinite; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 6px rgba(245,194,59,.45); } }
@media (prefers-reduced-motion: reduce) { .btn.pulse { animation: none; box-shadow: 0 0 0 3px rgba(245,194,59,.6); } }
.bw-versions { width: min(560px, calc(100vw - 32px)); }
.bw-vlist { display: grid; gap: 8px; max-height: min(60vh, 520px); overflow-y: auto; margin-top: 6px; color: var(--text); }
.bw-vrow { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); }
.bw-vrow.now { border: 2px solid rgba(0,168,107,.6); }
.bw-vrow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-vrow .dim { font-size: 14px; }
.bw-vrow .btn { height: 44px; flex: none; }
.bw-vempty { padding: 6px 2px; }
.bw-choice { flex-wrap: wrap; }
.bw-choice .btn { height: 48px; font-size: 16px; }
.my-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mg-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface); min-width: 0; }
.mg-thumb { display: block; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--bg); }
.mg-thumb img, .mg-thumb .fallback { width: 100%; height: 100%; object-fit: cover; }
.mg-thumb .fallback { display: grid; place-items: center; font: 900 32px var(--font-head); color: #fff; }
.mg-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-card .btn { height: 44px; font-size: 16px; }
.play-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.play-row .play-btn { margin-top: 0; flex: 1 1 140px; width: auto; }
.ai-change-btn { flex: 1 1 180px; height: 64px; border-radius: 12px; font-size: 18px; box-shadow: 0 6px 18px rgba(58,109,240,.25); }
/* Narrow screens: the builder's column never grows past the screen, its buttons wrap instead. */
@media (max-width: 1000px) {
  .bw-grid { grid-template-columns: minmax(0, 1fr); }
  .bw-actions { flex-wrap: wrap; }
}
/* A modal taller than the screen scrolls (its top stays reachable), and one never grows wider than it. */
.modal-back { overflow-y: auto; overscroll-behavior: contain; grid-template-columns: minmax(0, 1fr); }
/* Publish / Update: Cancel and Update stay in sight while the form scrolls. */
.bw-publish .acts { position: sticky; bottom: 0; z-index: 1; margin: 20px -24px -24px; padding: 14px 24px 24px; background: var(--surface); border-radius: 0 0 14px 14px; }
/* Tweak ideas: exactly two rows of 30px chips (no half-cut third row). */
.bw-tweaks { max-height: 68px; }
.bw-status { scroll-margin: calc(var(--topbar-h) + 12px) 0 12px; }
@media (max-width: 520px) {
  .bw-vrow { flex-wrap: wrap; }
  .bw-vrow > div { flex: 1 1 100%; }
  .bw-vrow .btn { width: 100%; }
}

/* ---------- home: "Make your own game" card ---------- */
.make-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-top: 22px;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px 32px 26px 22px;
  border-radius: 26px; border: 3px solid #17181c; box-shadow: 0 6px 0 #17181c, 0 18px 44px rgba(61,123,255,.22);
  background: radial-gradient(circle at 14% 22%, rgba(255,255,255,.2), transparent 42%), linear-gradient(120deg, #6b3cf0 0%, #3d7bff 55%, #13b3c6 100%);
}
.make-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(rgba(255,255,255,.16) 2px, transparent 2.5px) 0 0 / 22px 22px; -webkit-mask: linear-gradient(90deg, transparent 20%, #000 90%); mask: linear-gradient(90deg, transparent 20%, #000 90%); }
.mh-art { position: relative; width: 230px; aspect-ratio: 240 / 232; }
.mh-art svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 7px 0 rgba(23,24,28,.35)); }
.mh-cube { transform-box: fill-box; transform-origin: 50% 100%; animation: mh-drop .7s cubic-bezier(.3,1.6,.5,1) var(--d, 0s) both; }
.mh-cube.top { animation: mh-drop .7s cubic-bezier(.3,1.6,.5,1) var(--d, 0s) both, mh-bob 2.4s ease-in-out calc(var(--d, 0s) + .8s) infinite; }
@keyframes mh-drop { from { transform: translateY(-170px); opacity: 0; } 40% { opacity: 1; } }
@keyframes mh-bob { 50% { transform: translateY(-9px) rotate(-4deg); } }
.mh-spark { position: absolute; color: #ffe066; font-size: 22px; line-height: 1; text-shadow: 0 0 12px rgba(255,224,102,.9); animation: mh-twinkle 2.2s ease-in-out infinite; }
.mh-spark.s1 { left: 2%; top: 10%; }
.mh-spark.s2 { right: 2%; top: 26%; font-size: 16px; animation-delay: .6s; }
.mh-spark.s3 { right: 8%; bottom: 6%; animation-delay: 1.1s; }
.mh-spark.s4 { left: 8%; bottom: 20%; font-size: 14px; animation-delay: 1.6s; }
@keyframes mh-twinkle { 0%, 100% { transform: scale(.55) rotate(0); opacity: .35; } 50% { transform: scale(1.2) rotate(90deg); opacity: 1; } }
.mh-title { font: 400 clamp(32px, 4vw, 50px)/1.02 'Lilita One', var(--font-head); letter-spacing: .01em; color: #fff; text-shadow: 0 3px 0 #17181c; }
.mh-sub { margin: 8px 0 0; font: 800 clamp(17px, 1.8vw, 21px)/1.35 'Nunito', var(--font); color: #eef3ff; }
.mh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.mh-go {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 70px; padding: 0 32px;
  border-radius: 20px; border: 3px solid #17181c; box-shadow: 0 6px 0 #17181c; background: #ffd23f; color: #17181c;
  font: 400 30px 'Lilita One', var(--font-head); letter-spacing: .02em; transition: transform .12s, box-shadow .12s, background .12s;
}
.mh-go::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%); transform: translateX(-120%); animation: mh-shine 3.4s ease-in-out 1.2s infinite; }
@keyframes mh-shine { 45%, 100% { transform: translateX(120%); } }
.mh-go:hover { background: #ffdc5c; transform: translateY(-2px); box-shadow: 0 8px 0 #17181c; }
.mh-go:active { transform: translateY(4px); box-shadow: 0 2px 0 #17181c; }
.mh-go .rocket { display: inline-block; transition: transform .35s cubic-bezier(.3,1.8,.5,1); }
.mh-go:hover .rocket { transform: translate(5px, -6px) rotate(-8deg) scale(1.15); }
.mh-credits, .mh-mine {
  display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px; border-radius: 999px;
  background: rgba(23,24,28,.32); border: 2px solid rgba(255,255,255,.35); font: 900 17px 'Nunito', var(--font); white-space: nowrap;
}
.mh-credits { color: #ffe27a; }
.mh-credits:hover, .mh-mine:hover { background: rgba(23,24,28,.55); }
.mh-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.mh-ideas-lead { font: 900 16px 'Nunito', var(--font); color: #e3eaff; }
.mh-idea {
  display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px; border-radius: 16px;
  background: #fff; color: #17181c; border: 3px solid #17181c; box-shadow: 0 4px 0 #17181c;
  font: 900 18px 'Nunito', var(--font); transform: rotate(-2deg); transition: transform .18s cubic-bezier(.3,1.8,.5,1);
}
.mh-idea:nth-of-type(even) { transform: rotate(2deg); }
.mh-idea span { font-size: 26px; line-height: 1; }
.mh-idea:hover { transform: rotate(0) scale(1.07); }
.mh-idea:active { transform: scale(.97); }
@media (max-width: 1000px) {
  .make-hero { grid-template-columns: 170px minmax(0, 1fr); gap: 18px; padding: 20px 22px 22px 16px; }
  .mh-art { width: 170px; }
}
@media (max-width: 760px) {
  .make-hero { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 16px 14px 20px; text-align: center; border-radius: 22px; }
  .make-hero::before { -webkit-mask: none; mask: none; opacity: .5; }
  .mh-art { width: 140px; margin: 0 auto; }
  .mh-actions, .mh-ideas { justify-content: center; }
  .mh-go { width: 100%; height: 66px; font-size: 27px; }
  .mh-ideas-lead { width: 100%; }
  .mh-idea { padding: 0 14px; font-size: 16px; }
}

/* ---------- daily prizes: home cards ---------- */
.daily-row { margin-top: 16px; }
.daily-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.daily-card { display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 2px solid var(--border); font-family: 'Nunito', var(--font); }
.daily-card.streak.ready { background: linear-gradient(135deg, #5c2b0a, var(--surface) 72%); border-color: #ff9a2e; }
.daily-card.spin.ready { background: linear-gradient(135deg, #521848, var(--surface) 72%); border-color: #ff4f8b; }
.dc-emoji { font-size: 44px; line-height: 1; flex: none; }
.daily-card.streak.ready .dc-emoji { animation: dl-hop 1.6s ease-in-out infinite; }
.daily-card.spin.ready .dc-emoji { animation: dc-turn 5s linear infinite; }
@keyframes dc-turn { to { transform: rotate(360deg); } }
.dc-main { flex: 1; min-width: 0; }
.dc-title { font: 900 19px/1.2 'Nunito', var(--font); }
.dc-note { margin-top: 4px; color: var(--text-2); font: 800 15px 'Nunito', var(--font); }
.dc-note b { color: #fff; font-variant-numeric: tabular-nums; }
.dc-dots { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.dc-dots span { width: 18px; height: 18px; border-radius: 6px; background: var(--surface-3); }
.dc-dots span.on { background: #ff9a2e; box-shadow: 0 0 8px rgba(255,154,46,.6); }
.dc-dots span.gift { width: 26px; height: 26px; display: grid; place-items: center; font-size: 17px; background: rgba(180,92,255,.25); border: 2px solid #b45cff; }
.dc-dots span.gift.on { background: #ff9a2e; border-color: #ff9a2e; }
.dc-btn { flex: none; min-width: 56px; height: 56px; padding: 0 18px; border-radius: 16px; border: 3px solid #17181c; box-shadow: 0 4px 0 #17181c; font: 400 21px 'Lilita One', var(--font-head); letter-spacing: .02em; white-space: nowrap; transition: transform .1s, box-shadow .1s; }
.dc-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #17181c; }
.dc-btn.gold { background: #ffd23f; color: #17181c; }
.dc-btn.pink { background: #ff4f8b; color: #fff; text-shadow: 0 2px 0 #17181c; }
.dc-btn.ghost { width: 56px; padding: 0; background: var(--surface-2); border-color: var(--border); box-shadow: none; font-size: 26px; }
@media (max-width: 760px) { .daily-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
@media (max-width: 480px) {
  .daily-card { flex-wrap: wrap; }
  .daily-card .dc-btn.gold, .daily-card .dc-btn.pink { flex: 1 1 100%; }
}

/* ---------- daily prizes: top bar ---------- */
.spin-btn { font-size: 22px; line-height: 1; }
.spin-btn .badge-dot.dot { min-width: 0; width: 13px; height: 13px; padding: 0; top: 4px; right: 4px; border: 2px solid var(--bg-2); animation: dl-dot 1.6s ease-in-out infinite; }
@keyframes dl-dot { 50% { transform: scale(1.3); } }
@media (max-width: 420px) { .top-right { gap: 2px; } .top-right .icon-btn { width: 36px; } }

/* ---------- daily prizes: streak + wheel popup ---------- */
.dl-back { z-index: 180; }
.dl-modal {
  position: relative; width: min(660px, 100%); margin: auto; padding: 26px 24px 24px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, #312b66 0%, #232538 62%); border: 3px solid #17181c; box-shadow: 0 8px 0 #17181c, 0 30px 80px rgba(0,0,0,.6);
  font-family: 'Nunito', var(--font); animation: dl-in .35s cubic-bezier(.3,1.5,.5,1);
}
.dl-modal.wheel { width: min(520px, 100%); }
@keyframes dl-in { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.dl-x, .dl-mute { position: absolute; top: 10px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255,255,255,.09); color: #fff; font-size: 24px; font-weight: 900; z-index: 3; }
.dl-x { right: 10px; }
.dl-mute { left: 10px; }
.dl-x:hover, .dl-mute:hover { background: rgba(255,255,255,.18); }
.dl-title { padding: 6px 54px 0; font: 400 clamp(27px, 5vw, 38px)/1.08 'Lilita One', var(--font-head); letter-spacing: .01em; text-shadow: 0 3px 0 #17181c; overflow-wrap: anywhere; }
.dl-sub { margin: 8px 0 0; font: 800 18px/1.35 'Nunito', var(--font); color: #d9dcff; }
.dl-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 24px 0 4px; }
.dl-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 2px 9px; border-radius: 16px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.12); }
.dl-day-n { font: 900 12px 'Nunito', var(--font); color: #b9bdd9; text-transform: uppercase; white-space: nowrap; }
.dl-day-ic { font-size: 30px; line-height: 1.1; }
.dl-day-amt { font: 900 15px 'Nunito', var(--font); color: #ffe27a; white-space: nowrap; }
.dl-day.special { background: linear-gradient(180deg, rgba(180,92,255,.4), rgba(255,79,139,.25)); border-color: #b45cff; }
.dl-day.done { background: rgba(0,192,127,.18); border-color: rgba(0,192,127,.6); }
.dl-day.done .dl-day-amt { color: #7ef0c2; }
.dl-day.today { background: linear-gradient(180deg, #ffe066, #ffb020); border: 3px solid #17181c; transform: translateY(-5px); box-shadow: 0 0 0 4px rgba(255,210,63,.35), 0 0 26px rgba(255,210,63,.7); animation: dl-glow 1.4s ease-in-out infinite; }
.dl-day.today .dl-day-n, .dl-day.today .dl-day-amt { color: #17181c; }
.dl-day.today .dl-day-ic { animation: dl-hop 1.4s ease-in-out infinite; }
.dl-day.pop .dl-day-ic { animation: dl-pop .6s cubic-bezier(.3,1.8,.5,1); }
.dl-ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%) rotate(-5deg); padding: 1px 8px; border-radius: 7px; border: 2px solid #17181c; background: #ff4f8b; color: #fff; font: 900 11px 'Nunito', var(--font); white-space: nowrap; }
@keyframes dl-glow { 50% { box-shadow: 0 0 0 7px rgba(255,210,63,.22), 0 0 42px rgba(255,210,63,.95); } }
@keyframes dl-hop { 50% { transform: translateY(-5px) scale(1.1); } }
@keyframes dl-pop { from { transform: scale(0) rotate(-30deg); } }
.dl-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 20px; }
.dl-big {
  min-width: 240px; max-width: 100%; height: 72px; padding: 0 34px; border-radius: 20px; border: 3px solid #17181c; box-shadow: 0 6px 0 #17181c;
  background: #ffd23f; color: #17181c; font: 400 32px 'Lilita One', var(--font-head); letter-spacing: .02em; transition: transform .1s, box-shadow .1s, background .1s;
}
.dl-big:hover { background: #ffdc5c; transform: translateY(-2px); box-shadow: 0 8px 0 #17181c; }
.dl-big:active { transform: translateY(4px); box-shadow: 0 2px 0 #17181c; }
.dl-big:disabled { cursor: wait; opacity: .9; transform: none; box-shadow: 0 6px 0 #17181c; }
.dl-claim:not(:disabled) { animation: dl-wiggle 2.4s ease-in-out 1s infinite; }
.dl-spin-go { background: #ff4f8b; color: #fff; text-shadow: 0 2px 0 #17181c; }
.dl-spin-go:hover { background: #ff6ba0; }
.dl-ok { background: #00c07f; color: #fff; text-shadow: 0 2px 0 #17181c; }
.dl-ok:hover { background: #10d18f; }
@keyframes dl-wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-3deg) scale(1.04); } 82% { transform: rotate(3deg) scale(1.04); } 88% { transform: rotate(-2deg); } 94% { transform: rotate(1deg); } }
.dl-won { display: flex; align-items: center; gap: 12px; font: 400 42px 'Lilita One', var(--font-head); color: #ffe27a; text-shadow: 0 3px 0 #17181c; animation: dl-pop .5s cubic-bezier(.3,1.8,.5,1); }
.dl-won .coin-lg { width: 40px; height: 40px; }
.dl-item-won { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 18px; background: rgba(255,255,255,.08); border: 3px solid var(--rc, #a3adba); box-shadow: 0 0 24px var(--rc, transparent); text-align: left; }
.dl-item-won .em { font-size: 42px; line-height: 1; }
.dl-item-won b { display: block; font: 900 19px 'Nunito', var(--font); }
.dl-item-won a { display: inline-flex; align-items: center; min-height: 40px; font: 900 16px 'Nunito', var(--font); color: #8fd0ff; }
.dl-next { font: 800 17px 'Nunito', var(--font); color: #c9cce8; }
.dl-next b { color: #ffe27a; }
.dl-tomorrow { font: 900 18px 'Nunito', var(--font); color: #d9dcff; outline: none; }
.dl-tomorrow b { color: #fff; font-variant-numeric: tabular-nums; }
.dl-tomorrow.big { display: flex; flex-direction: column; gap: 6px; font: 400 32px/1.1 'Lilita One', var(--font-head); color: #fff; text-shadow: 0 3px 0 #17181c; }
.dl-tomorrow.big span { font: 900 18px 'Nunito', var(--font); color: #d9dcff; text-shadow: none; }
.dl-link { margin-top: 12px; min-height: 48px; padding: 0 16px; border: 0; background: none; color: #a9c4ff; font: 900 17px 'Nunito', var(--font); text-decoration: underline; text-underline-offset: 4px; }
.dl-odds { margin-top: 4px; padding: 16px; border-radius: 18px; background: rgba(0,0,0,.3); text-align: left; font: 700 15px/1.4 'Nunito', var(--font); }
.dl-odds p { margin: 0 0 10px; }
.dl-odds p.dim { margin: 12px 0 0; font-size: 14px; color: #a7aac4; }
.dl-odds-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 72px auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.07); }
.dl-odds-row .em { font-size: 22px; text-align: center; }
.dl-odds-row .bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.dl-odds-row .bar span { display: block; height: 100%; border-radius: 5px; }
.dl-odds-row b { font-weight: 900; white-space: nowrap; text-align: right; }
.dl-wheel-wrap { position: relative; width: min(360px, 76vw); aspect-ratio: 1; margin: 22px auto 0; }
.dl-wheel { display: block; width: 100%; height: 100%; filter: drop-shadow(0 7px 0 #17181c); }
.dl-wheel-wrap.waiting .dl-wheel { animation: dl-wobble .45s ease-in-out infinite; }
@keyframes dl-wobble { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.dl-w-emoji { font-size: 22px; }
.dl-w-label { font: 400 15px 'Lilita One', var(--font-head); letter-spacing: .02em; fill: #fff; stroke: #17181c; stroke-width: 3.5px; stroke-linejoin: round; paint-order: stroke; }
.dl-bulb { fill: #ffe27a; animation: dl-bulb 1s steps(2) infinite; }
.dl-bulb.b { fill: #fff; animation-delay: .5s; }
@keyframes dl-bulb { 50% { opacity: .3; } }
.dl-pointer { position: absolute; top: -14px; left: 50%; width: 46px; height: 56px; margin-left: -23px; transform-origin: 50% 14px; z-index: 1; }
.dl-pointer svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 0 rgba(23,24,28,.6)); }
.dl-pointer.tick { animation: dl-tick .14s ease-out; }
@keyframes dl-tick { 45% { transform: rotate(-16deg); } }
.dl-hub { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; border: 4px solid #17181c; background: radial-gradient(circle at 35% 30%, #fff 0 12%, #ffd23f 55%, #e0a800); font-size: clamp(22px, 5vw, 34px); }
.dl-prize {
  position: absolute; inset: 3% -2%; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px;
  border-radius: 28px; border: 4px solid var(--rc, #ffd23f); background: radial-gradient(circle at 50% 30%, #3d3780, #232538 75%);
  box-shadow: 0 0 0 5px rgba(23,24,28,.6), 0 0 60px var(--rc, #ffd23f); animation: dl-prize-in .5s cubic-bezier(.3,1.6,.5,1);
}
@keyframes dl-prize-in { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.dl-prize .em { font-size: 66px; line-height: 1; animation: dl-pop .6s .15s cubic-bezier(.3,1.8,.5,1) both; }
.dl-prize .em .coin-lg { display: block; width: 66px; height: 66px; }
.dl-prize .you { font: 900 17px 'Nunito', var(--font); letter-spacing: .08em; text-transform: uppercase; color: #d9dcff; }
.dl-prize b { padding: 0 10px; font: 400 30px/1.1 'Lilita One', var(--font-head); color: #fff; text-shadow: 0 3px 0 #17181c; }
.dl-prize .dl-big { height: 60px; min-width: 180px; margin-top: 6px; font-size: 26px; }
.dl-wear { display: inline-flex; align-items: center; min-height: 44px; font: 900 17px 'Nunito', var(--font); color: #8fd0ff; }
.dl-prize.rarity-common, .dl-item-won.rarity-common { --rc: #a3adba; }
.dl-prize.rarity-rare, .dl-item-won.rarity-rare { --rc: #3e9bff; }
.dl-prize.rarity-epic, .dl-item-won.rarity-epic { --rc: #b45cff; }
.dl-prize.rarity-legendary, .dl-item-won.rarity-legendary { --rc: #ffb020; }
.dl-fx { position: fixed; inset: 0; z-index: 400; pointer-events: none; overflow: hidden; }
.dl-coin { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff5b8 0 18%, #ffc933 45%, #d89400 80%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 0 0 2px #7a5200; }
.dl-confetti { position: absolute; left: -5px; top: -7px; width: 10px; height: 14px; border-radius: 2px; }
.dl-lift { position: fixed; box-shadow: 0 0 0 3px #ffd23f, 0 0 30px rgba(255,210,63,.85); transition: opacity .35s; }
.dl-lift.bump { animation: dl-bump .5s cubic-bezier(.3,1.8,.5,1); }
.dl-lift.out { opacity: 0; }
@keyframes dl-bump { 40% { transform: scale(1.25); } }
@media (max-width: 600px) {
  .dl-modal { padding: 20px 12px 18px; border-radius: 22px; }
  .dl-x, .dl-mute { top: 6px; }
  .dl-x { right: 6px; }
  .dl-mute { left: 6px; }
  .dl-sub { font-size: 16px; }
  .dl-week { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; }
  .dl-day.special { grid-column: span 2; }
  .dl-big { width: 100%; min-width: 0; height: 68px; font-size: 29px; }
  .dl-won { font-size: 36px; }
  .dl-tomorrow.big { font-size: 27px; }
  .dl-odds-row { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .dl-odds-row .bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-cube, .mh-cube.top, .mh-spark, .mh-go::after, .dl-modal, .dl-day.today, .dl-day.today .dl-day-ic, .dl-day.pop .dl-day-ic,
  .dl-claim:not(:disabled), .dl-won, .dl-bulb, .dl-pointer.tick, .dl-wheel-wrap.waiting .dl-wheel, .dl-prize, .dl-prize .em,
  .daily-card.streak.ready .dc-emoji, .daily-card.spin.ready .dc-emoji, .spin-btn .badge-dot.dot, .dl-lift.bump { animation: none; }
}
.dl-day-ic .coin-lg { width: 30px; height: 30px; vertical-align: middle; }
.dl-coins { display: inline-flex; }
.dl-coins .coin-lg + .coin-lg { margin-left: -14px; transform: translateY(-5px); }
.dl-day-ic, .dl-odds-row .em { display: grid; place-items: center; min-height: 33px; }
.dl-odds-row .em .coin-lg { width: 22px; height: 22px; }
.dl-pointer { top: -3%; width: 12.8%; height: 13%; margin-left: -6.4%; transform-origin: 50% 25%; }
.dc-note .vbx .coin { width: 16px; height: 16px; }
.mh-title .nowrap, .dl-sub .nowrap { white-space: nowrap; }
.dl-modal .coin-lg::after, .dc-note .coin-lg::after { content: ''; position: absolute; inset: 30%; border-radius: 3px; background: rgba(122,82,0,.55); transform: rotate(15deg); }
@media (max-width: 420px) { .top-user { display: none; } }
/* Tablets: the top bar keeps its buttons on screen (the name shows in the sidebar and on the profile). */
@media (max-width: 1000px) { .top-user span { display: none; } .top-user { padding-right: 4px; } }

/* ---------- daily prizes: prize-wheel icon (the 🎡 emoji is a dark Ferris wheel on some tablets) ---------- */
.wheel-ic { position: relative; display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -.24em; flex: none; }
.wheel-ic::before, .wheel-ic::after { content: ''; position: absolute; background: center / contain no-repeat; }
.wheel-ic::before { inset: 0; background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-20 -20 40 40'><circle r='19.5' fill='%2317181c'/><path d='M0 0L0.00 -16.50A16.5 16.5 0 0 1 11.67 -11.67Z' fill='%23f5a623'/><path d='M0 0L11.67 -11.67A16.5 16.5 0 0 1 16.50 0.00Z' fill='%233e9bff'/><path d='M0 0L16.50 0.00A16.5 16.5 0 0 1 11.67 11.67Z' fill='%2300b374'/><path d='M0 0L11.67 11.67A16.5 16.5 0 0 1 0.00 16.50Z' fill='%23ff4f8b'/><path d='M0 0L0.00 16.50A16.5 16.5 0 0 1 -11.67 11.67Z' fill='%238b5cf6'/><path d='M0 0L-11.67 11.67A16.5 16.5 0 0 1 -16.50 0.00Z' fill='%23ff7a1a'/><path d='M0 0L-16.50 0.00A16.5 16.5 0 0 1 -11.67 -11.67Z' fill='%230fb5c9'/><path d='M0 0L-11.67 -11.67A16.5 16.5 0 0 1 -0.00 -16.50Z' fill='%23e5484d'/><g stroke='%2317181c' stroke-width='1.6'><path d='M0.00 -16.50L0.00 16.50'/><path d='M11.67 -11.67L-11.67 11.67'/><path d='M16.50 0.00L-16.50 0.00'/><path d='M11.67 11.67L-11.67 -11.67'/></g><circle r='5' fill='%23ffd23f' stroke='%2317181c' stroke-width='2'/><circle cx='-1.4' cy='-1.6' r='1.4' fill='%23fff'/></svg>"); transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.wheel-ic::after { left: 50%; top: -18%; width: 42%; height: 46%; transform: translateX(-50%); background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 22'><path d='M3 3h14L10 19Z' fill='%23fff' stroke='%2317181c' stroke-width='3' stroke-linejoin='round'/></svg>"); }
.spin-btn .wheel-ic { width: 27px; height: 27px; }
.spin-btn:hover .wheel-ic::before { transform: rotate(90deg); }
.dc-emoji .wheel-ic { display: block; width: 46px; height: 46px; }
.daily-card.spin.ready .dc-emoji.wheel { animation: none; }
.daily-card.spin.ready .dc-emoji .wheel-ic::before { animation: dc-turn 6s linear infinite; }
.dc-btn .wheel-ic { width: 26px; height: 26px; }
.dl-hub img { width: 72%; height: 72%; }

/* Bigger, brighter small print for early readers. */
.dl-day-n { font-size: 15px; color: #d4d7f0; }
.dl-ribbon { top: -13px; padding: 1px 9px; font-size: 14px; }
.dl-odds { font-size: 17px; }
.dl-odds p.dim { font-size: 16px; color: #cdd0ea; }
.toast.dl-toast { background: #ffd23f; color: #17181c; border: 3px solid #17181c; font: 900 19px 'Nunito', var(--font); }

/* Tablets in portrait (up to 900px): the nav links move into the ☰ menu so the top bar's buttons stay on screen. */
@media (max-width: 900px) { .top-links { display: none; } }
/* Game Requests' top link only where the top bar has room (phones held sideways keep their ☰ and Back buttons whole). */
@media (max-width: 1000px) { .top-links a[href="/requests"] { display: none; } }

/* Phones: a shorter "Make your own game" card and daily row, so the games start sooner. */
@media (max-width: 600px) {
  .home-hello { gap: 14px; }
  .home-hello .headshot { width: 60px !important; height: 60px !important; }
  .make-hero { grid-template-columns: 84px minmax(0, 1fr); gap: 0 12px; padding: 14px 14px 18px; text-align: left; }
  .mh-body { display: contents; }
  .mh-art { grid-row: 1; width: 84px; margin: 0; }
  .mh-title { grid-row: 1; grid-column: 2; font-size: 31px; }
  .mh-sub, .mh-actions, .mh-ideas { grid-column: 1 / -1; }
  .mh-sub { margin-top: 10px; text-align: center; font-size: 17px; }
  .mh-actions { margin-top: 14px; gap: 10px; }
  .mh-credits, .mh-mine { height: 44px; }
  .mh-ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
  .mh-ideas-lead { display: none; }
  .mh-idea { flex-direction: column; justify-content: center; gap: 2px; min-height: 78px; padding: 6px 4px; font-size: 15px; line-height: 1.1; text-align: center; }
  .mh-idea span { font-size: 28px; }
}
@media (max-width: 480px) {
  .daily-card { flex-wrap: nowrap; gap: 10px; min-height: 0; padding: 12px; }
  .daily-card .dc-btn.gold, .daily-card .dc-btn.pink { flex: none; padding: 0 14px; font-size: 19px; }
  .dc-plus { display: none; }
  .dc-emoji { font-size: 36px; }
  .dc-emoji .wheel-ic { width: 38px; height: 38px; }
  .dc-title { font-size: 17px; }
  .dc-dots { gap: 4px; }
  .dc-dots span { width: 14px; height: 14px; border-radius: 5px; }
  .dc-dots span.gift { width: 22px; height: 22px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .daily-card.spin.ready .dc-emoji .wheel-ic::before { animation: none; }
  .wheel-ic::before { transition: none; }
}

/* ---------- voice prompting (voice.js): one giant mic → "I heard: …" → Make it! ---------- */
.vc { --vc-ink: #17181c; --vc-sun: #ffd23f; --vc-red: #ff4d5e; display: grid; justify-items: center; gap: 12px; text-align: center; width: 100%; }
.vc-main { display: grid; justify-items: center; gap: 30px; width: 100%; }
.vc-side { display: grid; gap: 6px; min-width: 0; max-width: 680px; }
.vc-mic {
  position: relative; width: 136px; height: 136px; flex: none; padding: 0; border-radius: 50%; border: 4px solid var(--vc-ink);
  background: var(--vc-sun); color: var(--vc-ink); display: grid; place-items: center;
  box-shadow: 0 7px 0 var(--vc-ink), 0 16px 34px rgba(0,0,0,.4); transition: transform .12s, box-shadow .12s, background .2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.vc-mic .vc-glyph { position: relative; z-index: 1; width: 58px; height: 58px; }
.vc-mic:hover { transform: translateY(-2px); }
.vc-mic:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--vc-ink), 0 6px 16px rgba(0,0,0,.4); }
.vc-mic:focus-visible { outline: 4px solid #fff; outline-offset: 6px; }
.vc[data-state="idle"] .vc-mic:not(:disabled) { animation: vc-breathe 2.6s ease-in-out infinite; }
.vc-mic.nudge:not(:disabled) { animation: vc-nudge 1s ease-in-out infinite !important; }
.vc-mic.on { background: var(--vc-red); color: #fff; }
.vc-mic.on.stopping { background: #c9404d; }
.vc-mic.hear .vc-glyph { animation: vc-bump .28s ease-out; }
.vc-mic:disabled { background: var(--surface-3); color: var(--text-3); border-color: #111; cursor: default; box-shadow: none; transform: none; }
.vc-rings { position: absolute; inset: 0; pointer-events: none; }
.vc-rings i { position: absolute; inset: -4px; border-radius: 50%; border: 5px solid var(--vc-red); opacity: 0; }
.vc-mic.on:not(.stopping) .vc-rings i { animation: vc-ring 1.8s ease-out infinite; }
.vc-mic.on .vc-rings i:nth-child(2) { animation-delay: .6s; }
.vc-mic.on .vc-rings i:nth-child(3) { animation-delay: 1.2s; }
@keyframes vc-ring { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes vc-breathe { 50% { transform: scale(1.05); } }
@keyframes vc-nudge { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-4px); } }
@keyframes vc-bump { 50% { transform: scale(1.18); } }
.vc-live { font: 800 clamp(22px, 3vw, 30px)/1.3 var(--font-head); overflow-wrap: anywhere; min-height: 1.3em; }
.vc-prompt { display: block; }
.vc-sub { display: block; margin-top: 4px; font: 700 17px/1.35 var(--font); color: var(--text-2); }
.vc-wait { color: var(--text-2); }
.vc-interim { color: #dcdde1; }
.vc-hint { font: 700 16px var(--font); color: var(--text-2); }
.vc-note { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
/* "I heard: …" */
.vc-card {
  width: min(680px, 100%); padding: 20px; border-radius: 22px; background: var(--surface); border: 3px solid var(--vc-sun);
  box-shadow: 0 12px 34px rgba(0,0,0,.35); text-align: left; animation: vc-in .25s cubic-bezier(.3,1.4,.5,1);
}
@keyframes vc-in { from { transform: scale(.94); opacity: 0; } }
.vc-heard-label { font: 800 17px var(--font-head); color: var(--vc-sun); }
.vc-heard { margin: 8px 0 18px; font: 800 clamp(21px, 2.8vw, 28px)/1.3 var(--font-head); overflow-wrap: anywhere; }
.vc-acts { display: flex; gap: 12px; flex-wrap: wrap; }
.vc-btn {
  flex: 1 1 200px; min-height: 64px; padding: 0 18px; border: 0; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 21px var(--font-head); color: #fff; background: var(--surface-3); box-shadow: 0 5px 0 #1f2124; transition: transform .1s, box-shadow .1s, filter .15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.vc-btn:hover { filter: brightness(1.1); }
.vc-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #1f2124; }
.vc-btn.go { background: var(--green); box-shadow: 0 5px 0 #00633f; }
.vc-btn.go:active { box-shadow: 0 1px 0 #00633f; }
.vc-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.vc-cost { font: 800 14px var(--font-head); padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.28); color: #ffe27a; }
/* friendly "oops" screens */
.vc-oops { width: min(620px, 100%); display: grid; justify-items: center; gap: 12px; padding: 22px 18px; border-radius: 22px; background: var(--surface); border: 2px solid var(--surface-3); }
.vc-pic { position: relative; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: #c9cbd0; border: 4px solid #111; }
.vc-pic .vc-glyph { width: 46px; height: 46px; }
.vc-badge { position: absolute; right: -10px; bottom: -8px; font-size: 42px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.vc-otext { display: grid; gap: 4px; }
.vc-oops h3 { font: 800 clamp(20px, 2.6vw, 25px)/1.25 var(--font-head); }
.vc-kid { margin: 0; font: 700 18px/1.35 var(--font); color: var(--text-2); }
.vc-grown { margin: 0; max-width: 520px; font-size: 14px; line-height: 1.45; color: var(--text-3); }
.vc-grown b { color: var(--text-2); }
.vc-retry { flex: none; width: min(320px, 100%); }
.vc-allow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
.vc-bar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 6px; border-radius: 999px; background: #fff; color: #333; font: 700 15px var(--font); max-width: 260px; }
.vc-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-lock { position: relative; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; background: #ffe27a; font: 800 15px var(--font-head); color: #17181c; box-shadow: 0 0 0 3px #ffd23f; }
.vc-tap { position: absolute; left: 50%; top: 22px; font-size: 26px; transform: translateX(-30%); animation: vc-tap 1.2s ease-in-out infinite; }
@keyframes vc-tap { 50% { transform: translate(-30%, -5px); } }
.vc-arrow { font-size: 24px; color: var(--text-3); }
.vc-toggle { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border-radius: 14px; background: var(--bg); font-size: 22px; }
.vc-toggle i { position: relative; width: 48px; height: 28px; border-radius: 999px; background: #34c759; }
.vc-toggle i::after { content: ''; position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
/* the side-panel layout: mic on the left, words on the right */
.vc-row { justify-items: stretch; text-align: left; gap: 8px; }
.vc-row .vc-main { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; gap: 16px; }
.vc-row .vc-mic { width: 96px; height: 96px; border-width: 3px; box-shadow: 0 5px 0 var(--vc-ink), 0 10px 22px rgba(0,0,0,.35); }
.vc-row .vc-mic .vc-glyph { width: 42px; height: 42px; }
.vc-row .vc-live { font-size: 20px; max-height: 5.4em; overflow-y: auto; }
.vc-row .vc-sub { font-size: 15px; }
.vc-row .vc-hint { font-size: 14px; }
.vc-row .vc-note { font-size: 12px; }
.vc-row .vc-card { width: 100%; padding: 14px; border-radius: 18px; }
.vc-row .vc-heard { margin: 4px 0 12px; font-size: 19px; max-height: 6.5em; overflow-y: auto; }
.vc-row .vc-btn { flex-basis: 140px; min-height: 56px; padding: 0 10px; font-size: 17px; white-space: nowrap; }
.vc-row .vc-cost { font-size: 12px; padding: 2px 6px; }
.vc-row .vc-oops { width: 100%; padding: 14px; grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; }
.vc-row .vc-pic { width: 72px; height: 72px; border-width: 3px; }
.vc-row .vc-pic .vc-glyph { width: 32px; height: 32px; }
.vc-row .vc-badge { font-size: 30px; right: -8px; bottom: -6px; }
.vc-row .vc-oops h3 { font-size: 18px; }
.vc-row .vc-kid { font-size: 15px; }
.vc-row .vc-allow, .vc-row .vc-grown, .vc-row .vc-retry { grid-column: 1 / -1; }
.vc-row .vc-allow { justify-content: flex-start; }
.vc-row .vc-retry { width: 100%; min-height: 56px; font-size: 18px; }
@media (max-width: 520px) {
  .vc-mic { width: 120px; height: 120px; }
  .vc-mic .vc-glyph { width: 52px; height: 52px; }
  .vc-btn { flex-basis: 100%; }
  .vc-row .vc-btn { flex-basis: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .vc-mic, .vc-mic .vc-glyph, .vc-rings i, .vc-card, .vc-tap { animation: none !important; }
  .vc-mic.on .vc-rings i:first-child { opacity: .6; transform: scale(1.2); }
}

/* builder start: the mic is the picture; ideas are big tap tiles */
.bs-hero h1 { margin-bottom: 40px; }
.bs-voice { display: grid; justify-items: center; }
.bs-credits { margin-top: 22px; }
/* what a build costs, shown before the kid talks: ⚡1 = 🎮, what you have, the free first build */
.bs-cost { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin: 22px auto 0; padding: 12px 16px; max-width: 620px; border-radius: 16px; background: rgba(245,194,59,.10); border: 2px solid rgba(245,194,59,.35); }
.bs-cost.out { border-color: var(--gold); background: rgba(245,194,59,.18); }
.bs-cost-eq { display: inline-flex; align-items: center; gap: 6px; font: 800 24px var(--font-head); }
.bs-bolt { color: var(--gold); }
.bs-eq { color: var(--text-2); }
.bs-game { font-size: 28px; }
.bs-cost-l { font-size: 16px; color: var(--text-2); }
.bs-cost-have { font-weight: 700; font-size: 17px; }
.bs-cost-have b { color: var(--gold); font-size: 24px; }
.bs-cost-free, .bs-cost-need { flex-basis: 100%; font-weight: 800; font-size: 17px; }
.bs-cost-free { color: #7ee2a8; }
.bs-cost-need { color: var(--gold); }
.bs-cost-more { min-height: 44px; }
/* The free first build waits for a grown-up to check the email (pages/builder.js). */
.bs-cost-verify { flex-basis: 100%; display: grid; justify-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; text-align: center; background: rgba(126,226,168,.10); border: 2px dashed rgba(126,226,168,.45); }
.bs-cost-verify b { color: #7ee2a8; font-size: 17px; font-weight: 800; }
.bs-cost-verify span { color: var(--text-2); font-weight: 700; }
.bs-cost-verify .btn { min-height: 44px; }
.bs-resting { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto; padding: 18px 20px; max-width: 620px; border-radius: 18px; background: var(--surface); border: 2px dashed var(--surface-3); font-size: 18px; text-align: left; }
.bs-resting .em { font-size: 44px; line-height: 1; }
.bs-or { margin: 30px 0 12px; font-size: 20px; color: var(--text-2); }
.bs-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 0; }
.bs-idea {
  min-height: 92px; padding: 10px 8px; border-radius: 16px; border: 2px solid var(--surface-3); background: var(--surface); color: var(--text);
  display: grid; place-content: center; justify-items: center; gap: 4px; font: 800 16px/1.2 var(--font-head); transition: transform .12s, border-color .12s, background .12s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bs-idea .em { font-size: 36px; line-height: 1.1; }
.bs-idea:hover { transform: translateY(-2px); border-color: var(--gold); background: var(--surface-2); }
.bs-idea:active { transform: translateY(1px); }
@media (max-width: 520px) { .bs-ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* builder workspace: the mic sits under the tweak ideas; a bit more room for it on tablets */
.bw-voice { flex: none; padding-top: 4px; border-top: 1px solid var(--border); }
/* tweak ideas: one row of big tap chips that scrolls sideways */
.bw-tweaks { flex: none; flex-wrap: nowrap; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scrollbar-width: thin; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.bw-tweaks .chip { flex: none; height: 56px; padding: 0 18px; border-radius: 28px; font-size: 16px; color: var(--text); background: var(--surface-2); border-color: var(--surface-3); }
@media (max-width: 1000px) { .bw-chat { height: 640px; } }

/* game page: "✨ Make a game like this!" */
.like-this {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; min-height: 76px; padding: 12px 16px; border-radius: 16px;
  background: linear-gradient(120deg, #8f63ff, #ff5aa8); color: #fff; box-shadow: 0 5px 0 #4f2d9a; transition: transform .12s, box-shadow .12s, filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.like-this:hover { filter: brightness(1.07); transform: translateY(-1px); }
.like-this:active { transform: translateY(4px); box-shadow: 0 1px 0 #4f2d9a; }
.lt-ico { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.22); font-size: 30px; }
.lt-txt { display: grid; gap: 2px; min-width: 0; }
.lt-txt b { font: 800 20px/1.2 var(--font-head); }
.lt-txt span { font: 700 15px/1.3 var(--font); color: #fbeaff; }
.lt-go { margin-left: auto; flex: none; font: 900 26px var(--font-head); }
@media (max-width: 520px) {
  .like-this { gap: 12px; padding: 12px; }
  .lt-ico { width: 44px; height: 44px; font-size: 26px; }
  .lt-txt b { font-size: 18px; }
  .lt-txt span { font-size: 14px; }
  .lt-go { display: none; }
}

/* ---------- phones & tablets (iPhone / iPad / Android) ---------- */
/* Safari on iPhone/iPad zooms the whole page into any text field under 16px, and doesn't zoom back.
   Keep every field at 16px on touch screens. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea,
  .bw-input textarea, textarea.code-area { font-size: 16px !important; }
}
/* 100vh on phones is the height with the browser bars hidden, so "full screen" boxes ran under
   Safari's toolbar. dvh is the height you can actually see. */
@supports (height: 100dvh) {
  body, .main { min-height: 100dvh; }
  .auth-page { min-height: calc(100dvh - var(--topbar-h) - 120px); }
  .modal.wide { height: min(760px, 92dvh); }
  @media (min-width: 1001px) { .bw-grid { height: calc(100dvh - var(--topbar-h) - 140px); } }
}
/* Bigger tap area for the small "See All →" links (same look). */
.section-head a.see-all { padding: 10px 6px; margin: -10px -6px; }
/* "Pick your look" on a phone: four looks per row (two rows, no odd one out), and the
   "This is me!" button stays on screen instead of hiding under the skin colours. */
@media (max-width: 560px) {
  .modal-back .pick { max-height: 92vh; max-height: 92dvh; padding-bottom: 0; }
  .modal-back .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .modal-back .pick-acts { position: sticky; bottom: 0; z-index: 1; margin: 12px -16px 0 !important; padding: 10px 16px 16px;
    background: var(--surface); box-shadow: 0 -12px 16px var(--surface); }
  .modal-back .pick-acts .grow { display: none; }
  .modal-back .pick-acts [data-done] { order: -1; flex: 1 1 100%; min-height: 52px; font-size: 18px; }
  .modal-back .pick-acts [data-shuffle], .modal-back .pick-acts [data-skip] { flex: 1 1 0; min-height: 46px; }
}

/* ---------- sign up / log in (kid-sized: 56px+ fields and buttons) ---------- */
.auth-card.kid { padding: 26px 22px 22px; border-radius: 22px; }
.auth-card.kid h2 { font: 900 26px/1.15 var(--font-head); margin-bottom: 18px; }
.auth-card.kid .field { margin-bottom: 14px; }
.auth-card.kid .field label { font: 800 16px var(--font-head); color: var(--text); }
.auth-card.kid .field input { height: 56px; border-radius: 14px; padding: 0 16px; font: 700 18px var(--font); border-width: 2px; }
.auth-card.kid .field .hint { font-size: 14px; font-weight: 600; }
.pw-wrap, .name-wrap { display: flex; gap: 8px; }
.pw-wrap input, .name-wrap input { flex: 1; min-width: 0; }
.pw-toggle, .name-shuffle {
  flex: none; width: 64px; height: 56px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2);
  display: grid; place-items: center; align-content: center; gap: 0; font-size: 22px; line-height: 1; padding: 0;
}
.pw-toggle small, .name-shuffle small { font: 800 12px var(--font-head); color: var(--text-2); margin-top: 2px; }
.pw-toggle:hover, .name-shuffle:hover { background: var(--surface-3); }
.name-shuffle:active span { display: inline-block; transform: rotate(180deg); transition: transform .2s; }
.auth-go {
  display: block; width: 100%; min-height: 60px; margin-top: 4px; border: 0; border-radius: 16px; background: var(--green); color: #fff;
  font: 900 21px var(--font-head); box-shadow: 0 5px 0 #00633f; transition: transform .08s, box-shadow .08s, background .15s;
}
.auth-go:hover { background: var(--green-hover); }
.auth-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #00633f; }
.auth-go:disabled { opacity: .6; cursor: wait; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; border-radius: 16px; background: #fff; color: #1f1f1f;
  font: 800 18px var(--font-head); border: 2px solid #dadce0; box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.google-btn:hover { background: #f4f6f8; }
.google-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.google-btn .g-logo { width: 24px; height: 24px; flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--text-3); font: 800 14px var(--font-head); text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 2px; background: var(--border); border-radius: 1px; }
.parent-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(245,194,59,.12); color: #ffe08a; text-align: center; font-weight: 700; font-size: 15px; }
.auth-card.kid .fine { font-size: 16px; font-weight: 600; margin-top: 14px; }
.auth-card.kid .fine a { color: #8fb3ff; text-decoration: underline; font-weight: 800; padding: 8px 2px; }
.auth-forgot { display: block; margin: 10px auto 0; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--text-2); font: 700 15px var(--font); text-decoration: underline; }
.forgot-note { margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; text-align: center; }
/* "Forgot your password?", the reset page and the "email checked" page (pages/auth.js). */
.forgot-note label { display: block; margin-bottom: 6px; font: 800 15px var(--font-head); text-align: left; }
.forgot-note .input { height: 48px; margin-bottom: 10px; font: 700 17px var(--font); }
.forgot-note .btn { min-height: 48px; }
.forgot-msg { margin-top: 10px; }
.forgot-msg:empty { display: none; }
.forgot-msg a, .bs-dev-link { color: var(--text-3); font-size: 13px; text-decoration: underline; }
.forgot-note .hint { display: block; margin-top: 8px; font-size: 14px; color: var(--text-3); }
.email-checked { text-align: center; }
.email-checked .checked-text { margin: 0 0 18px; font-size: 18px; font-weight: 700; line-height: 1.4; }
a.auth-go { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.auth-guest {
  display: block; width: 100%; min-height: 56px; margin-top: 12px; border-radius: 16px; border: 2px dashed var(--surface-3); background: transparent;
  color: var(--text); font: 800 18px var(--font-head);
}
.auth-guest:hover { background: var(--surface-2); }
.auth-keep { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); }
.auth-keep .headshot { width: 64px; height: 64px; border-radius: 50%; background: #45484d; flex: none; }
.auth-keep b { display: block; font: 900 18px var(--font-head); }
.auth-keep span { color: var(--text-2); font-weight: 700; }
@media (max-width: 560px) {
  .auth-page { place-items: start center; min-height: 0; }
  .auth-card.kid { padding: 20px 16px 18px; }
  .auth-card.kid h2 { font-size: 24px; }
}

/* ---------- guests: top bar chip, side lock ---------- */
.guest-chip { display: flex; align-items: center; height: 40px; border-radius: 20px; background: var(--surface-2); overflow: hidden; flex: none; }
.gc-tag { height: 100%; padding: 0 10px 0 12px; border: 0; background: none; font: 800 14px var(--font-head); white-space: nowrap; color: var(--text); }
.gc-tag:hover { background: var(--surface-3); }
.gc-go { display: flex; align-items: center; height: 100%; padding: 0 14px; background: var(--green); color: #fff; font: 800 14px var(--font-head); white-space: nowrap; border-radius: 0 20px 20px 0; }
.gc-go:hover { background: var(--green-hover); }
.guest-head .headshot { background: #45484d; border-radius: 50%; }
.guest-dd { min-width: 250px; }
.guest-dd .gd-head { padding: 8px 12px 10px; color: var(--text-2); font-weight: 700; font-size: 14px; }
.guest-dd a, .guest-dd button { min-height: 48px; font-size: 16px; }
.guest-dd .gd-go { background: var(--green); color: #fff; font-weight: 800; }
.guest-dd .gd-go:hover { background: var(--green-hover); }
.sidebar nav .side-lock { margin-left: auto; font-size: 14px; }
@media (max-width: 760px) {
  .guest-head { display: none; }
}
@media (max-width: 420px) {
  .gc-more { display: none; }
  .gc-tag { padding: 0 8px 0 10px; }
}

/* ---------- guests: "Sign up to …" card (and the same card as a page) ---------- */
.gl-back { z-index: 180; }
.gl-card {
  position: relative; width: min(420px, 100%); margin: auto; padding: 28px 22px 22px; border-radius: 26px; background: var(--surface); text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); animation: gl-in .22s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes gl-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.gl-art {
  width: 104px; height: 104px; margin: 0 auto 12px; border-radius: 30px; display: grid; place-items: center; font-size: 58px; line-height: 1;
  background: linear-gradient(135deg, #ffd23f, #ff8a3d); border: 3px solid #17181c; box-shadow: 5px 5px 0 #000; transform: rotate(-4deg);
}
.gl-card h2 { font: 900 26px/1.15 var(--font-head); margin: 4px 0 6px; }
.gl-card p { margin: 0 0 16px; color: var(--text-2); font-weight: 700; font-size: 18px; }
.gl-perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.gl-perks > span { display: grid; gap: 2px; padding: 8px 2px 6px; border-radius: 14px; background: var(--surface-2); font: 800 12px var(--font-head); color: var(--text-2); }
.gl-perks b { font-size: 26px; line-height: 1.1; }
.gl-go {
  display: flex; align-items: center; justify-content: center; min-height: 60px; border-radius: 16px; background: var(--green); color: #fff;
  font: 900 21px var(--font-head); box-shadow: 0 5px 0 #00633f;
}
.gl-go:hover { background: var(--green-hover); }
.gl-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #00633f; }
.gl-login { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 12px; border-radius: 14px; border: 2px solid var(--border); font: 800 17px var(--font-head); color: var(--text-2); }
.gl-login:hover { background: var(--surface-2); color: var(--text); }
.gl-x { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--surface-2); font: 800 20px var(--font-head); }
.gl-x:hover { background: var(--surface-3); }
.gl-page { display: grid; place-items: center; padding: 24px 0 8px; }
.gl-page .gl-card { animation: none; box-shadow: 0 20px 60px rgba(0,0,0,.35); }

/* ---------- guests: home ---------- */
.guest-save {
  display: flex; align-items: center; gap: 16px; margin: 0 0 28px; padding: 16px 18px; border-radius: 20px; color: #17181c;
  background: linear-gradient(120deg, #ffd23f, #ffb13b); border: 3px solid #17181c; box-shadow: 5px 5px 0 #000;
}
.guest-save .gs-icons { font-size: 34px; letter-spacing: -4px; flex: none; }
.guest-save .gs-text { flex: 1; min-width: 0; }
.guest-save b { display: block; font: 900 22px/1.15 var(--font-head); }
.guest-save span { font-weight: 800; font-size: 16px; }
.guest-save .gs-go { flex: none; display: flex; align-items: center; min-height: 56px; padding: 0 22px; border-radius: 14px; background: var(--green); color: #fff; font: 900 19px var(--font-head); box-shadow: 0 4px 0 #00633f; }
.guest-save:hover .gs-go { background: var(--green-hover); }
.home-hello .guest-tag { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font: 800 14px var(--font-head); color: var(--text-2); }
@media (max-width: 560px) {
  .guest-save { flex-wrap: wrap; gap: 10px 14px; padding: 14px; }
  .guest-save .gs-go { flex: 1 1 100%; justify-content: center; }
}
.gl-art .gl-coin { width: 62px; height: 62px; }
.gl-art .gl-coin::after, .gl-perks .coin-lg::after { content: ''; position: absolute; inset: 30%; border-radius: 3px; background: rgba(122,82,0,.55); transform: rotate(15deg); }
.gl-perks .coin-lg { width: 26px; height: 26px; margin: 2px auto 3px; }
.guest-save .gs-icons { display: flex; align-items: center; gap: 2px; letter-spacing: 0; }
.guest-save .gs-icons .coin-lg { width: 32px; height: 32px; margin-right: 2px; }
.guest-save .gs-icons .coin-lg::after { content: ''; position: absolute; inset: 30%; border-radius: 3px; background: rgba(122,82,0,.55); transform: rotate(15deg); }

/* ==========================================================================
   Phones & tablets: safe areas, a thumb-sized top bar, the bottom tab bar
   (a side rail on phones held sideways), bigger tap targets, no hover-only UI.
   index.html uses viewport-fit=cover, so the notch and home bar insets are ours to keep clear.
   ========================================================================== */
:root {
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
  --tabbar-h: 64px;
  --tabbar-space: 0px; /* room kept free at the bottom for the tab bar (0 when there is none) */
}
.topbar { height: calc(var(--topbar-h) + var(--sat)); padding: var(--sat) calc(16px + var(--sar)) 0 calc(16px + var(--sal)); }
.sidebar { top: calc(var(--topbar-h) + var(--sat)); padding-left: calc(8px + var(--sal)); bottom: var(--tabbar-space); }
.main { padding-top: calc(var(--topbar-h) + var(--sat) + 24px); padding-bottom: calc(64px + var(--tabbar-space)); }
.dropdown { top: calc(var(--topbar-h) + var(--sat) - 6px); right: calc(12px + var(--sar)); max-height: calc(100vh - var(--topbar-h) - var(--sat) - var(--tabbar-space) - 12px); max-height: calc(100dvh - var(--topbar-h) - var(--sat) - var(--tabbar-space) - 12px); overflow-y: auto; overscroll-behavior: contain; }
.toasts { bottom: calc(20px + var(--tabbar-space) + var(--sab)); width: max-content; max-width: calc(100vw - 32px); }
.toast { text-align: center; }
.modal-back { padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); }
body.lp-mode .main { padding-top: calc(var(--topbar-h) + var(--sat)); }
@media (max-width: 1100px) {
  .main { padding-left: calc(20px + var(--sal)); padding-right: calc(20px + var(--sar)); }
  body.sidebar-open .sidebar-scrim { inset: calc(var(--topbar-h) + var(--sat)) 0 0 0; }
}
@media (max-width: 760px) {
  .topbar { padding: var(--sat) calc(8px + var(--sar)) 0 calc(8px + var(--sal)); }
  .main { padding: calc(var(--topbar-h) + var(--sat) + 16px) calc(16px + var(--sar)) calc(48px + var(--tabbar-space)) calc(16px + var(--sal)); }
}

/* Hidden until a phone or touch tablet needs them. */
.tabbar, .search-toggle, .search-close, .back-btn { display: none; }
.back-btn::before {
  content: ''; width: 24px; height: 24px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><path d="m15 5-7 7 7 7"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><path d="m15 5-7 7 7 7"/></svg>') center/contain no-repeat;
}
.search-toggle .search-icon { position: static; width: 22px; height: 22px; background: currentColor; }
.search-close::before {
  content: ''; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.8" stroke-linecap="round"><path d="M18 6 6 18M6 6l12 12"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.8" stroke-linecap="round"><path d="M18 6 6 18M6 6l12 12"/></svg>') center/contain no-repeat;
}

/* Touch screens: every button a finger can hit (48px), nothing that only shows on hover. */
@media (pointer: coarse), (hover: none) {
  .icon-btn { width: 48px; height: 48px; border-radius: 12px; }
  .top-vibux { height: 44px; border-radius: 22px; }
  .top-user { min-height: 48px; }
  .btn { height: 48px; padding: 0 20px; border-radius: 12px; font-size: 16px; }
  .btn.small { height: 44px; padding: 0 16px; font-size: 15px; }
  .chip { height: 44px; padding: 0 16px; border-radius: 22px; font-size: 15px; }
  .bw-tweaks .chip { height: 56px; }
  .vote-btn { min-height: 48px; padding: 8px 12px; }
  .tabs button { min-height: 52px; }
  .seg button { min-height: 44px; }
  .dropdown a, .dropdown button { min-height: 52px; font-size: 17px; }
  .sidebar nav a { min-height: 52px; font-size: 17px; }
  .search input { height: 44px; }
  .top-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .guest-chip { height: 44px; border-radius: 22px; }
  .gc-go { border-radius: 0 22px 22px 0; }
  .section-head a.see-all { padding: 12px 8px; margin: -12px -8px; }
  .modal .acts .btn { min-height: 52px; }
  .dl-item-won a, .dl-wear { min-height: 48px; }
  .auth-forgot { min-height: 48px; }
  /* The green ▶ on game tiles was hover-only: on a touch screen it is always there. */
  .tile-play { opacity: 1; transform: none; width: 48px; height: 48px; border-radius: 14px; border: 3px solid #17181c; box-shadow: 0 3px 0 #17181c; }
  .tile-play .i { width: 22px; height: 22px; }
  .tile-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #17181c; }
  .tile:hover .tile-thumb img { transform: none; }
  .tile-title { padding: 2px 0; }
  .shop-card:hover { transform: none; }
}

/* ---------- the tab bar: phones, and touch tablets held upright ---------- */
@media (max-width: 760px), (max-width: 1100px) and (pointer: coarse) {
  :root { --tabbar-space: calc(var(--tabbar-h) + var(--sab)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 48; display: flex; align-items: stretch; justify-content: space-around;
    height: calc(var(--tabbar-h) + var(--sab)); padding: 0 calc(4px + var(--sar)) var(--sab) calc(4px + var(--sal));
    background: rgba(32,34,36,.97); border-top: 1px solid #111; box-shadow: 0 -6px 20px rgba(0,0,0,.25);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .tabbar a {
    flex: 1 1 0; min-width: 0; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #a9abb0; font: 800 12.5px/1 var(--font-head); letter-spacing: .01em; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .tb-ic { position: relative; display: grid; place-items: center; width: 52px; height: 32px; border-radius: 16px; transition: background .15s, transform .1s; }
  .tb-ic .i { width: 25px; height: 25px; }
  .tb-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a.active { color: #fff; }
  .tabbar a.active .tb-ic { background: rgba(255,255,255,.14); }
  .tabbar a:active .tb-ic { transform: scale(.92); }
  .tabbar .badge-dot { top: -4px; right: 2px; }
  /* Make: the big yellow block in the middle (the brand's call to action). */
  .tabbar a.tb-make { color: #fff; }
  .tb-make .tb-ic {
    width: 58px; height: 44px; margin-top: -18px; border-radius: 16px; background: #ffd23f; color: #17181c;
    border: 3px solid #17181c; box-shadow: 0 4px 0 #17181c;
  }
  .tb-make .tb-ic .i { width: 26px; height: 26px; }
  .tabbar a.tb-make.active .tb-ic { background: #ffdc5c; }
  .tabbar a.tb-make:active .tb-ic { transform: translateY(3px); box-shadow: 0 1px 0 #17181c; }
  .tb-signup .tb-ic { background: var(--green); color: #fff; }
  .tabbar a.tb-signup { color: #fff; }
  body.lp-mode .tabbar { display: none; }
  @media (pointer: coarse) { body.typing .tabbar { display: none; } }
  body.lp-mode { --tabbar-space: 0px; }
  .back-btn:not([hidden]) { display: grid; }
  /* The bottom bar has Friends: the top bar keeps coins, the daily spin and settings. */
  .top-right a.icon-btn[href="/friends"] { display: none; }
}

/* ---------- upright phones: brand cube, 🔍 opens search over the top bar ---------- */
@media (max-width: 600px) {
  .topbar { gap: 4px; }
  .logo { display: inline-flex; font-size: 30px; padding: 6px 4px; }
  .logo > span, .logo .logo-spark { display: none; }
  .back-btn:not([hidden]) + .logo { display: none; }
  .search { display: none; }
  .search-toggle { display: grid; margin-left: auto; }
  body.search-open .search {
    display: flex; position: absolute; z-index: 3; left: 0; right: 0; top: var(--sat); height: var(--topbar-h); max-width: none; margin: 0;
    gap: 6px; padding: 0 calc(8px + var(--sar)) 0 calc(8px + var(--sal)); background: var(--bg-2);
  }
  body.search-open .search-icon { left: calc(22px + var(--sal)); }
  body.search-open .search input { height: 46px; border-radius: 14px; }
  body.search-open .search-close { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text); }
  .top-right { gap: 2px; }
  .top-vibux { padding: 0 10px; }
}
@media (max-width: 420px) { .top-right .icon-btn { width: 44px; } }

/* ---------- phones held sideways: the tab bar becomes a rail on the left (the screen is short) ---------- */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1100px) {
  :root { --tabbar-space: 0px; --rail-w: calc(84px + var(--sal)); }
  .topbar { height: calc(54px + var(--sat)); }
  .main { padding-top: calc(54px + var(--sat) + 14px); }
  .sidebar { top: calc(54px + var(--sat)); }
  .dropdown { top: calc(48px + var(--sat)); }
  .tabbar {
    top: calc(54px + var(--sat)); right: auto; width: var(--rail-w); height: auto; flex-direction: column; justify-content: space-evenly;
    padding: 4px 0 calc(4px + var(--sab)) var(--sal); border-top: 0; border-right: 1px solid #111; box-shadow: 6px 0 20px rgba(0,0,0,.2);
  }
  .tabbar a { flex: 1 1 0; max-width: none; max-height: 68px; }
  .tb-make .tb-ic { margin-top: 0; height: 40px; }
  body:not(.lp-mode) .main { margin-left: var(--rail-w); padding-left: 16px; }
  body:not(.lp-mode) .toasts { left: calc(50% + var(--rail-w) / 2); }
  body.sidebar-open .sidebar { z-index: 49; }
}

/* ---------- game page on phones and tablets ---------- */
.play-float { display: none; }
@media (max-width: 760px), (max-width: 1100px) and (pointer: coarse) {
  .play-float:not([hidden]) {
    position: fixed; z-index: 47; right: calc(16px + var(--sar)); bottom: calc(var(--tabbar-space) + 14px);
    display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 26px 0 22px; border-radius: 20px;
    background: var(--green); color: #fff; font: 900 21px var(--font-head); border: 3px solid #17181c; box-shadow: 0 5px 0 #17181c, 0 10px 26px rgba(0,0,0,.45);
    animation: play-float-in .25s cubic-bezier(.3,1.5,.5,1);
  }
  .play-float .i { width: 24px; height: 24px; }
  .play-float:active { transform: translateY(3px); box-shadow: 0 2px 0 #17181c; }
  .game-actions { gap: 4px 6px; }
  .vote-box { margin-left: auto; }
}
@keyframes play-float-in { from { transform: translateY(20px) scale(.9); opacity: 0; } }
/* Phones held sideways: picture on the left, title and ▶ Play on the right (both on the first screen). */
@media (max-height: 500px) and (orientation: landscape) and (min-width: 560px) {
  .game-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .game-info h1 { font-size: 24px; }
  .game-by { margin-top: 4px; }
  .maturity { margin-top: 6px; }
  .play-row { margin-top: 12px; }
  .play-btn { height: 60px; }
  .like-this { min-height: 64px; padding: 8px 12px; }
  .lt-txt span { display: none; }
}

/* ---------- one big yellow "Make a new game" button (the object library) ---------- */
.btn.make-new { height: 52px; padding: 0 22px; border-radius: 16px; background: #ffd23f; color: #17181c; border: 3px solid #17181c; box-shadow: 0 4px 0 #17181c; font: 800 18px var(--font-head); }
.btn.make-new:hover { background: #ffdc5c; }
.btn.make-new:active { transform: translateY(3px); box-shadow: 0 1px 0 #17181c; }

/* ---------- avatar editor on phones: a shorter stage, so the item tabs show on the first screen ---------- */
@media (max-width: 860px) {
  .avatar-head { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
  .avatar-head::-webkit-scrollbar { display: none; }
  .avatar-head h1 { flex: none; order: -2; }
  .avatar-head .btn { flex: none; }
  /* (Shop was the last of five buttons in a row that scrolls sideways with no scrollbar: off screen on every phone) */
  .avatar-head a[href="/shop"] { order: -1; }
  .avatar-layout { margin-top: 10px !important; gap: 14px; }
  .avatar-stage { aspect-ratio: auto; height: clamp(240px, 42vh, 420px); max-width: none; }
  .avatar-stage { height: clamp(240px, 42dvh, 420px); }
  .editor-panel { padding: 12px; }
  .editor-panel .stabs { position: sticky; top: calc(var(--topbar-h) + var(--sat)); z-index: 5; margin: -12px -12px 12px !important; padding: 12px 12px 10px; background: var(--surface); border-radius: 14px 14px 0 0; }
  .stab { min-height: 48px; padding: 0 18px; font-size: 15px; }
}
@media (max-width: 860px) and (orientation: landscape) and (max-height: 500px) {
  /* Sideways phone: stage on the left, items on the right. */
  .avatar-layout { grid-template-columns: minmax(200px, 38%) minmax(0, 1fr); }
  .avatar-stage { position: sticky; top: calc(54px + var(--sat) + 10px); height: calc(100vh - 54px - var(--sat) - 24px); height: calc(100dvh - 54px - var(--sat) - 24px); }
  .editor-panel .stabs { top: calc(54px + var(--sat)); }
}
@media (pointer: coarse) { .stab { min-height: 48px; } .tile-title { min-height: 44px; } .logo { min-height: 44px; min-width: 44px; } }

/* ---------- rows of chips on phones: one row you slide sideways (not three rows of words) ---------- */
@media (max-width: 600px) {
  .charts-bar .chips, #lbStats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; max-width: calc(100% + 32px); }
  .charts-bar .chips::-webkit-scrollbar, #lbStats::-webkit-scrollbar { display: none; }
  .charts-bar .chip, #lbStats .chip { flex: none; }
  .charts-bar { gap: 10px; }
  .charts-bar .chips { flex: 1 1 100%; }
  .charts-bar select { flex: 1 1 100%; min-height: 48px; }
}

/* ---------- daily prizes on phones held sideways: the wheel on the left, words and the button on the right ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .dl-modal { padding: 14px 18px 16px; }
  .dl-title { font-size: 28px; }
  .dl-sub { margin-top: 4px; font-size: 16px; }
  .dl-week { margin: 14px 0 0; }
  .dl-day { padding: 8px 2px 6px; }
  .dl-foot { margin-top: 12px; gap: 8px; }
  .dl-big { height: 60px; font-size: 27px; }
  .dl-modal.wheel { width: min(780px, 100%); }
  .dl-modal.wheel .dl-body { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto auto auto auto 1fr; column-gap: 22px; align-items: center; text-align: center; }
  .dl-modal.wheel .dl-title { grid-row: 2; } .dl-modal.wheel .dl-sub { grid-row: 3; } .dl-modal.wheel .dl-foot { grid-row: 4; }
  .dl-modal.wheel .dl-link { grid-row: 5; } .dl-modal.wheel .dl-odds { grid-row: 6; align-self: start; }
  .dl-modal.wheel .dl-wheel-wrap { grid-column: 1; grid-row: 1 / -1; width: min(300px, calc(100vh - 90px)); width: min(300px, calc(100dvh - 90px)); margin: 10px 0 4px; }
  .dl-modal.wheel .dl-body > :not(.dl-wheel-wrap):not(.dl-mute) { grid-column: 2; }
  .dl-modal.wheel .dl-title { padding: 0 56px; }
  .dl-modal.wheel .dl-foot { margin-top: 14px; }
  .dl-modal.wheel .dl-link { margin-top: 4px; align-self: start; }
}
@media (pointer: coarse), (hover: none) {
  .top-user { min-width: 48px; justify-content: center; }
  details.card summary { min-height: 44px; display: flex; align-items: center; }
  .bs-credits { min-height: 44px; }
  button.see-all { min-height: 44px; }
  .rar-badge { font-size: 12px !important; }
}

/* ==========================================================================
   App chrome (one look for menus, buttons, dialogs, toasts and empty states)
   App tokens + SVG icons (ui.js icon()) + icon-pack pictures (ui.js pic()); no emoji in the chrome.
   ========================================================================== */
:root {
  --focus: #7fb0ff;
  --ease-out: cubic-bezier(.2,.8,.3,1);
  --shadow-pop: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
}
html { background: var(--bg); }
/* The Home Screen app has no browser bars: no rubber-band bounce showing past the page. */
html.standalone, html.standalone body { overscroll-behavior-y: none; }
/* Older iPhone Safari (no dvh): the visible height. */
@supports (-webkit-touch-callout: none) and (not (height: 100dvh)) {
  body, .main { min-height: -webkit-fill-available; }
}
.sidebar, .dropdown, .modal-back, .modal { overscroll-behavior: contain; }

/* Focus rings: only for the keyboard, the same everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus { outline: none; }
:where(a, button, select, summary, [tabindex], [role="button"], [role="menuitem"]):focus-visible,
:where(input, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tabbar a:focus-visible { outline: none; }
.tabbar a:focus-visible .tb-ic { outline: 3px solid var(--focus); outline-offset: 1px; }

/* Icon-pack pictures. */
.vbpic { display: inline-block; flex: none; object-fit: contain; vertical-align: middle; user-select: none; -webkit-user-drag: none; }

/* Buttons: one set of sizes and states. */
.btn { cursor: pointer; user-select: none; text-decoration: none; line-height: 1; }
.btn .i { width: 18px; height: 18px; }
.btn.small .i { width: 16px; height: 16px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; pointer-events: none; }
.btn.danger:not(.ghost) { font-weight: 800; }
.btn.danger:focus-visible { outline-color: #ff9a9e; }
.btn.yellow { background: #ffd23f; color: #17181c; }
.btn.yellow:hover { background: #ffdc5c; }
.icon-btn { cursor: pointer; transition: background .15s; }
.icon-btn .i { width: 22px; height: 22px; }
.icon-btn:active { background: var(--surface-3); }

/* Top bar. */
.top-links a.active, .top-links a[aria-current="page"] { background: var(--surface-2); }
.gc-tag { display: flex; align-items: center; gap: 6px; }
.gc-tag .i { width: 18px; height: 18px; }

/* Side nav: a clear "you are here". */
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { position: relative; transition: background .12s, color .12s; }
.sidebar nav a .i { width: 22px; height: 22px; }
.sidebar nav a.active { font-weight: 700; }
.sidebar nav a.active::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--text); }
.sidebar .side-user { border-radius: 10px; margin-bottom: 4px; }
.sidebar .side-user:hover { background: var(--surface); }

/* The account menu. */
.dropdown { min-width: 240px; border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop); animation: dd-in .14s var(--ease-out); transform-origin: top right; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dropdown a, .dropdown button { border-radius: 10px; color: var(--text); font: 600 16px var(--font); cursor: pointer; }
.dropdown a .i, .dropdown button .i { width: 20px; height: 20px; color: var(--text-2); }
.dropdown a:hover .i, .dropdown button:hover .i { color: var(--text); }
.dropdown #logoutBtn { color: #ff9a9e; }
.dropdown #logoutBtn .i { color: #ff9a9e; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.dropdown .dd-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.dropdown .dd-head span { display: grid; min-width: 0; }
.dropdown .dd-head b { font: 800 16px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown .dd-head small { color: var(--text-3); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-dd .gd-go .i { color: #fff; }
@media (max-width: 600px) {
  /* Phones: the menu spans the screen under the top bar (thumb-sized rows, nothing off the edge). */
  .dropdown { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); min-width: 0; }
}

/* Footer: quiet, and every link a finger can hit. */
.footer { align-items: center; row-gap: 4px; }
.footer a { color: var(--text-2); }
@media (pointer: coarse), (hover: none) {
  .footer { gap: 0 4px; }
  .footer > span { flex: 1 1 100%; padding: 4px 0; }
  .footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; margin-left: -10px; }
  .footer a + a { margin-left: 0; }
}
@media (max-width: 760px) { .footer { margin-top: 40px; } }

/* Empty states: a picture, a line, maybe one button. */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid var(--border); }
.empty .big { font-size: 0; margin-bottom: 4px; }
.empty img.big, .empty .vbpic.big { width: 88px; height: 88px; }
.empty h1, .empty h2 { color: var(--text); }
.empty p { margin: 0; max-width: 44ch; }
.empty .btn { margin-top: 10px; }

/* Toasts: a dark card with a coloured icon, above the tab bar. */
.toast { display: flex; align-items: center; gap: 10px; text-align: left; background: #f4f5f6; color: #16181a; padding: 12px 16px; border-radius: 12px; font: 700 15px/1.3 var(--font); box-shadow: 0 12px 32px rgba(0,0,0,.45); max-width: min(480px, calc(100vw - 32px)); transition: opacity .2s, transform .2s; }
.toast .toast-ic { width: 22px; height: 22px; color: var(--green); }
.toast.error .toast-ic { color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* Dialogs. */
.modal { border: 1px solid var(--border); border-radius: 16px; animation: modal-in .18s var(--ease-out); max-height: calc(100dvh - 32px - var(--sat) - var(--sab)); overflow-y: auto; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal h2 { font-size: 22px; }
.modal .acts { flex-wrap: wrap; }
@media (max-width: 480px) {
  .modal { padding: 20px 18px; }
  .modal .acts { flex-direction: column-reverse; }
  .modal .acts .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dropdown, .modal, .toast, .gl-card { animation: none !important; transition: none !important; }
}

/* Guests: pictures instead of emoji. */
.gl-art { font-size: 0; }
.gl-art .vbpic { width: 84px; height: 84px; transform: rotate(4deg); filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.gl-perks b { display: grid; place-items: center; height: 38px; }
.gl-go { gap: 10px; }
.gl-go .i { width: 22px; height: 22px; }
.gl-x { display: grid; place-items: center; }
.guest-save .gs-icons .vbpic { width: 36px; height: 36px; margin-right: -4px; }
.guest-save .gs-go { gap: 8px; }
.home-hello .guest-tag { display: inline-flex; align-items: center; gap: 6px; }
.home-hello .guest-tag .i { width: 16px; height: 16px; }

/* Home: the "Make your own game" card's pictures. */
.mh-go .rocket { width: 34px; height: 34px; margin: -6px 0; }
.mh-idea .vbpic { width: 28px; height: 28px; margin: -4px 0; }
.mh-mine { display: inline-flex; align-items: center; gap: 8px; }

/* A game tile whose pictures failed. */
.fallback.fallback-pic { display: grid; place-items: center; background: var(--surface-2); }
.fallback.fallback-pic .vbpic { width: 40%; height: auto; opacity: .85; }

/* Small links a finger can still hit on touch screens (same look). */
@media (pointer: coarse), (hover: none) {
  .game-by a, a.inline-tap { display: inline-flex; align-items: center; min-height: 44px; }
  .back-link { display: inline-flex; align-items: center; min-height: 44px; }
  .person .who .name { display: block; padding: 11px 0; margin: -11px 0; } /* a 44 px tap area, same look */
  .swatches { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  /* Game tiles: the whole card opens the game (the title's link stretches over it); the picture, the play
     button, the genre and the record line sit above it. Their small links get a 44 px tap area from invisible
     padding that negative margins take back, so cards look and lay out exactly as before. */
  .tile-title::after { content: ''; position: absolute; inset: 0; }
  .tile-pic { z-index: 1; }
  .tile-activity a, .game-activity a, .game-record-who a { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; margin: -13px -8px; }
  .game-activity a { margin-block: -12px; } /* 14 px text on a 20 px line */
  .game-record-who a { margin-block: 0; } /* already in a 44 px row (the record button) */
  .tile-record { position: relative; z-index: 1; padding: 14px 0 13px; margin: -6px 0 -13px; }
  .hrow { padding-bottom: 14px; } /* room for the record line's tap area at the foot of a sliding row */
}
.lt-ico .vbpic { width: 70%; height: 70%; }
.lb-row .rank.top { display: grid; place-items: center; }
.item .lock-tag .i { width: 12px; height: 12px; }
.of-acts .btn .i { width: 16px; height: 16px; }
/* Sign up / log in: icons in the labels and the small field buttons. */
.auth-card .field label { display: flex; align-items: center; gap: 8px; }
.auth-card .field label .i { width: 18px; height: 18px; color: var(--text-2); }
.pw-toggle .i, .name-shuffle .i { width: 22px; height: 22px; }
.name-shuffle:active .i { transform: rotate(180deg); transition: transform .2s; }
.parent-note { display: flex; gap: 8px; align-items: flex-start; justify-content: center; text-align: left; }
.parent-note .i { width: 18px; height: 18px; margin-top: 2px; }
.auth-guest { display: flex; align-items: center; justify-content: center; gap: 8px; }
.idea-saved b { display: flex; align-items: center; gap: 8px; }
/* Avatar editor outfits: the slot picture is the full card width, and its buttons never grow past the card. */
body .outfit { min-width: 0; }
body .outfit .of-pic { width: 100%; min-height: 72px; }
body .outfit .of-acts .btn { min-width: 0; padding: 0 6px; gap: 4px; }
/* A question that deletes or ends something: the confirm button is solid red. */
.modal .btn.danger { background: var(--red); color: #fff; border: 0; }
.modal .btn.danger:hover { background: #f05a5f; }

/* Guests: "Sign in" first, then a quiet "New here? Create an account" (owner, 2026-09-29). */
.sidebar .side-cta { display: grid; gap: 8px; }
.sidebar .side-cta .side-cta-alt { text-align: center; font-size: 14px; color: var(--text-2); text-decoration: underline; padding: 10px 4px; min-height: 44px; box-sizing: border-box; }

/* Home header (owner, 2026-09-29): the name, then the day prize and the spin as compact chips beside it. */
.home-page .home-hello { flex-wrap: wrap; }
.home-page .home-hello .hh-name { min-width: 0; }
.home-page .hh-daily { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.hd-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 16px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; font: 600 14px var(--font); text-align: left;
  transition: transform .12s ease, border-color .15s ease, background .15s ease; }
.hd-chip:hover { border-color: var(--surface-3); background: var(--surface-2); }
.hd-chip:active { transform: scale(.96); }
.hd-chip .vbpic { width: 34px; height: 34px; flex: none; }
.hd-chip .hd-txt { display: grid; line-height: 1.15; }
.hd-chip .hd-txt b { font: 800 14px var(--font-head); }
.hd-chip .hd-txt span { font-size: 12px; color: var(--text-2); }
.hd-chip.streak.ready { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.hd-chip.streak.ready .hd-txt span { color: var(--gold); font-weight: 700; }
.hd-chip.spin.ready { border-color: #ff5ca8; background: color-mix(in srgb, #ff5ca8 14%, var(--surface)); }
.hd-chip.spin.ready .hd-txt span { color: #ff8cc3; font-weight: 700; }
.hd-chip.ready .vbpic { animation: hd-bob 1.8s ease-in-out infinite; }
@keyframes hd-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .hd-chip.ready .vbpic { animation: none; } }
@media (max-width: 640px) {
  .home-page .hh-daily { margin-left: 0; width: 100%; }
  .hd-chip { flex: 1 1 0; min-width: 0; }
}

/* Dream Studio in the sidebar: a bolt on a gold tile. */
.sidebar a.side-dream { font-weight: 800; }
.sidebar a.side-dream .sd-bolt { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(160deg, #ffd65a, #f5a623); color: #3b2a00; box-shadow: 0 2px 0 #b97a0c, 0 0 0 1px #00000022 inset; }
.sidebar a.side-dream .sd-bolt .i { width: 18px; height: 18px; }
.sidebar a.side-dream:hover .sd-bolt { filter: brightness(1.08); }

/* Touch screens: the top bar's own links (Charts, Avatar, Dream Studio) are the side menu's and the tab bar's again,
   35 px tall, and they squeeze the search box to one letter on a tablet. One way to each place (the owner,
   2026-11-11: "everything simplified"). Computers keep them. */
@media (pointer: coarse) { .top-links { display: none; } }
