/* Funzigo — dark portal theme: top bar + left sidebar (CrazyGames-style), art tiles */
:root {
  --bg: #0f1020;
  --bg-2: #141634;
  --surface: #1b1d3a;
  --surface-2: #232650;
  --line: #2b2f5a;
  --ink: #f1f2ff;
  --muted: #9ca3c9;
  --brand: #ff8a4c;
  --brand-2: #ff3d8b;
  --accent: #7c5cff;
  --cta: #2ecc71;
  --pop: #ff3d8b;
  --radius: 14px;
  --shadow: 0 3px 12px rgba(0, 0, 0, .35);
  --shadow-lift: 0 14px 32px rgba(0, 0, 0, .5);
  --top-h: 60px;
  --side-w: 232px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900' viewBox='0 0 900 900'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Ccircle cx='120' cy='140' r='78'/%3E%3Cpath d='M700 40l120 210H580z'/%3E%3Crect x='380' y='250' width='150' height='150' rx='40' transform='rotate(18 455 325)'/%3E%3Ccircle cx='790' cy='520' r='62'/%3E%3Cpath d='M150 620l110 190H40z'/%3E%3Crect x='540' y='680' width='130' height='130' rx='34' transform='rotate(-14 605 745)'/%3E%3Ccircle cx='330' cy='520' r='44'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 900px 900px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: #b4a7ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(15, 16, 32, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn {
  display: none; width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 800; color: var(--ink); flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-word span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.header-tools { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; min-width: 0; }
.search-toggle { display: none; }
.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 520px; }
.search-icon { position: absolute; left: 14px; font-size: .85rem; pointer-events: none; opacity: .7; }
.search input {
  width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px 10px 38px;
  font: inherit; font-size: .9rem; color: var(--ink); background: var(--surface); outline: none;
  transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none;
}
.search input:focus { border-color: var(--accent); background: var(--surface-2); }
.search input::placeholder { color: var(--muted); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: 6px; z-index: 70; max-height: 60vh; overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-hit { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--ink); }
.search-hit img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.search-hit:hover, .search-hit.active { background: var(--surface-2); text-decoration: none; }
.search-hit-title { font-weight: 700; font-size: .9rem; }
.search-hit-cat { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: capitalize; }
.search-none { padding: 12px; color: var(--muted); font-size: .85rem; text-align: center; }
.search-label { padding: 8px 10px 6px; color: var(--muted); font-size: .76rem; font-weight: 700; line-height: 1.3; }
.random-btn {
  color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .88rem; font-weight: 800; white-space: nowrap;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); box-shadow: 0 4px 14px rgba(255, 61, 139, .3);
  transition: transform .15s, box-shadow .15s;
}
.random-btn:hover { text-decoration: none; transform: translateY(-2px) rotate(-3deg); box-shadow: 0 8px 20px rgba(255, 61, 139, .4); }

/* ---------- Shell: sidebar + main ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.sidebar {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 14px 10px 24px; border-right: 1px solid var(--line); background: var(--bg-2);
  scrollbar-width: thin;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-head { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; margin: 16px 12px 6px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  color: var(--ink); font-weight: 700; font-size: .9rem; transition: background .12s;
}
.side-link:hover { background: var(--surface); text-decoration: none; }
.side-ico { width: 22px; text-align: center; font-size: 1rem; }
.sidebar-backdrop { display: none; }
.main { min-width: 0; padding: 0 22px 40px; }
.chips { display: none; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; scroll-margin-top: calc(var(--top-h) + 12px); }
.section-head h2 { font-size: 1.2rem; margin: 0; font-weight: 800; color: var(--ink); }
.section-head a { font-size: .85rem; font-weight: 800; color: var(--brand); }
.section-blurb { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ---------- Tile grid ---------- */
.game-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-flow: dense; gap: 16px; margin-top: 12px;
}
.tile {
  position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); color: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 34px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 138, 76, .6); text-decoration: none; z-index: 2; color: #fff; }
.tile-featured { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.tile-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tile-glow { position: absolute; inset: 0; background: radial-gradient(circle at 22% 18%, rgba(255,255,255,.3), transparent 42%), radial-gradient(circle at 82% 88%, rgba(0,0,0,.2), transparent 46%); }
.tile-emoji { font-size: clamp(3.4rem, 9vw, 4.6rem); line-height: 1; z-index: 1; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); transition: transform .18s ease; }
.tile-featured .tile-emoji { font-size: clamp(5rem, 13vw, 7.5rem); }
.tile:hover .tile-emoji { transform: scale(1.12) rotate(-4deg); }
.tile-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(6, 8, 20, .85));
  display: flex; justify-content: center; opacity: 0; transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease; pointer-events: none;
}
.tile:hover .tile-overlay { opacity: 1; transform: translateY(0); }
.tile-title {
  font-weight: 800; font-size: .95rem; color: #fff; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.18;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.tile-featured .tile-title { font-size: 1.15rem; }
@media (hover: none) { .tile-overlay { opacity: 1; transform: none; padding: 20px 10px 8px; } }

.tile-hero { grid-column: span 3; grid-row: span 2; aspect-ratio: auto; }
.tile-preview { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.tile-hero.has-preview .tile-preview { opacity: 1; }
.tile-hero.has-preview .tile-hero-overlay { background: linear-gradient(180deg, transparent, rgba(6, 8, 20, .92)); }
.tile-hero .tile-emoji { font-size: clamp(6rem, 16vw, 9rem); }
.tile-hero-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 60px 22px 20px;
  background: linear-gradient(180deg, transparent, rgba(6, 8, 20, .88));
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.tile-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 800; color: var(--brand); }
.tile-hero .tile-title { font-size: clamp(1.4rem, 3.4vw, 2rem); white-space: normal; text-align: left; }
.btn-play {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 1rem;
  padding: 10px 28px; border-radius: 999px; box-shadow: 0 6px 16px rgba(255, 61, 139, .35);
  transition: transform .15s, box-shadow .15s; border: 0; cursor: pointer; font-family: inherit;
}
.tile-hero:hover .btn-play { transform: scale(1.05); }
a.btn-play:hover { transform: translateY(-2px) scale(1.03); text-decoration: none; color: #fff; }
.tile-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3; background: var(--pop); color: #fff;
  font-size: .64rem; font-weight: 800; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.tile-badge-new { background: var(--cta); }

/* Per-game fallback gradients (art covers them when present) */
.tile .tile-art { background: linear-gradient(135deg, #7c5cff, #ff3d8b); }
.tile-daily-word  .tile-art { background: linear-gradient(135deg, #43d98c, #1fa563); }
.tile-2048        .tile-art { background: linear-gradient(135deg, #f7b733, #ee7752); }
.tile-sudoku      .tile-art { background: linear-gradient(135deg, #4facfe, #2b6de0); }
.tile-solitaire   .tile-art { background: linear-gradient(135deg, #2bb673, #0c7a4a); }
.tile-minesweeper .tile-art { background: linear-gradient(135deg, #ff7b6b, #d63c3c); }
.tile-snake       .tile-art { background: linear-gradient(135deg, #a8e063, #56ab2f); }
.tile-memory      .tile-art { background: linear-gradient(135deg, #f66bd8, #a24bcf); }
.tile-breakout    .tile-art { background: linear-gradient(135deg, #8a7ff0, #5b4fe9); }
.tile-block-fit   .tile-art { background: linear-gradient(135deg, #36d1dc, #4a7fe0); }
.tile-whack-a-mole .tile-art { background: linear-gradient(135deg, #f2994a, #b95f22); }
.tile-word-search .tile-art { background: linear-gradient(135deg, #26c6a2, #0d8f7a); }
.tile-hangman .tile-art { background: linear-gradient(135deg, #74c7f5, #3a86c9); }
.tile-simon .tile-art { background: linear-gradient(135deg, #ff5f6d, #ffc371); }
.tile-spider-solitaire .tile-art { background: linear-gradient(135deg, #8a63d2, #4527a0); }
.tile-mahjong .tile-art { background: linear-gradient(135deg, #f0c04b, #c98a2f); }
.tile-fifteen-puzzle .tile-art { background: linear-gradient(135deg, #6c8ff5, #3d5bd9); }
.tile-water-sort .tile-art { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.tile-number-match .tile-art { background: linear-gradient(135deg, #f472b6, #c026d3); }
.tile-yatzy .tile-art { background: linear-gradient(135deg, #fb7185, #be123c); }
.tile-connect-four .tile-art { background: linear-gradient(135deg, #facc15, #ea580c); }
.tile-checkers .tile-art { background: linear-gradient(135deg, #d97706, #7c2d12); }
.tile-block-drop .tile-art { background: linear-gradient(135deg, #22d3ee, #0e7490); }
.tile-gem-match .tile-art { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.tile-jigsaw .tile-art { background: linear-gradient(135deg, #4ade80, #0f766e); }
.tile-trivia .tile-art { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.tile-golf-solitaire .tile-art { background: linear-gradient(135deg, #86efac, #15803d); }

/* Collection rows: horizontal strips */
.game-grid.game-grid-row { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; scroll-snap-type: x proximity; }
.game-grid-row::-webkit-scrollbar { display: none; }
.game-grid-row .tile { flex: 0 0 150px; aspect-ratio: 1 / 1; scroll-snap-align: start; }

/* ---------- Tile artwork ---------- */
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s ease; }
.tile:hover .tile-img { transform: scale(1.3); }
/* The artwork is drawn with breathing room around the subject; zooming it in a
   touch crops that margin so the picture fills the tile edge to edge. */
.tile-img { transform: scale(1.18); transform-origin: 50% 50%; }
.tile-hero .tile-img { transform: scale(1.02); }
.tile-hero:hover .tile-img { transform: scale(1.06); }
.tile-art.has-art .tile-glow { display: none; }

/* ---------- Pre-play splash + brand screen ---------- */
.game-splash { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; transition: opacity .35s ease; }
.game-splash.no-art { background: linear-gradient(135deg, #232650, #0f1020); }
.game-splash::before { content: ''; position: absolute; inset: 0; background: rgba(6, 8, 20, .68); backdrop-filter: blur(4px); }
/* Self-playing preview under a lighter scrim (darker at the centre for the text) */
.splash-preview { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; z-index: 0; background: #0f1220; }
.game-splash.has-preview::before { background: radial-gradient(ellipse at center, rgba(6, 8, 20, .66), rgba(6, 8, 20, .28)); backdrop-filter: none; }
.game-splash.branding .splash-preview { display: none; }
.game-splash.gone { opacity: 0; pointer-events: none; }
.splash-inner { position: relative; z-index: 1; text-align: center; color: #fff; padding: 24px; max-width: 520px; }
.splash-emoji { font-size: 4rem; line-height: 1; margin-bottom: 10px; }
.splash-inner h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); margin: 0 0 8px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.splash-inner p { margin: 0 0 20px; opacity: .93; }
.splash-play { font-size: 1.15rem; padding: 14px 46px; }
.game-splash.branding::before { background: rgba(10, 11, 26, .94); backdrop-filter: blur(6px); }
.brand-screen { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; }
.brand-screen[hidden], .splash-inner[hidden] { display: none; }
.brand-screen-mark { filter: drop-shadow(0 10px 26px rgba(229, 52, 127, .4)); animation: brandPop .5s cubic-bezier(.2, 1.3, .5, 1) both; }
.brand-screen-word { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 800; color: #fff; animation: brandRise .45s .12s ease both; }
.brand-screen-word span { color: var(--brand); }
.brand-screen-bar { width: min(200px, 60vw); height: 5px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.18); animation: brandRise .45s .2s ease both; }
.brand-screen-bar i { display: block; width: 40%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: brandSlide 1.1s ease-in-out infinite; }
.bs-eye { transform-box: fill-box; transform-origin: center; animation: bsBlink 2.8s infinite; }
.bs-eye.r { animation-delay: .06s; }
.bs-smile { stroke-dasharray: 100; stroke-dashoffset: 100; animation: bsDraw 1.8s ease-in-out infinite; }
@keyframes bsBlink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes bsDraw { 0% { stroke-dashoffset: 100; } 45% { stroke-dashoffset: 0; } 72% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@keyframes brandPop  { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }
@keyframes brandRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes brandSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@media (prefers-reduced-motion: reduce) {
  .bs-eye, .bs-smile, .brand-screen-mark, .brand-screen-word, .brand-screen-bar { animation: none; }
  .bs-smile { stroke-dashoffset: 0; } .brand-screen-bar i { animation: none; width: 100%; }
}

/* ---------- Game page ---------- */
.crumbs { margin-top: 14px; font-size: .82rem; font-weight: 700; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .crumb-current { color: var(--ink); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.game-main { min-width: 0; }
.play-next { display: none; }
@media (min-width: 1250px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .play-next { display: block; position: sticky; top: calc(var(--top-h) + 16px); margin-top: 18px; }
}
.play-next-head { color: var(--ink); font-weight: 800; font-size: 1rem; margin: 0 0 10px; }
.play-next-item {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 8px; color: var(--ink);
  transition: transform .15s, border-color .15s;
}
.play-next-item:hover { text-decoration: none; transform: translateX(3px); border-color: var(--brand); }
.play-next-item img, .play-next-dice { grid-row: 1 / 3; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.play-next-dice { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.play-next-title { font-weight: 800; font-size: .88rem; line-height: 1.2; }
.play-next-cat { font-size: .72rem; color: var(--muted); font-weight: 700; }
.game-stage-wrap { margin-top: 14px; }
.game-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.game-title-row h1 { font-size: 1.5rem; margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.game-title-row .plays { color: var(--muted); font-size: .88rem; font-weight: 700; }
.game-stage {
  position: relative; background: #0a0b18; border-radius: var(--radius); overflow: hidden;
  height: min(78vh, 720px); height: min(78dvh, 720px); min-height: 420px;
  box-shadow: var(--shadow-lift); border: 1px solid var(--line);
}
.game-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 2px; }
.stage-bar-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stage-bar button {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: .85rem; cursor: pointer; font-weight: 800; transition: transform .15s, border-color .15s;
}
.stage-bar button:hover { transform: translateY(-2px); border-color: var(--brand); }
.like-btn .like-heart { display: inline-block; filter: grayscale(1); opacity: .65; transition: transform .2s ease, filter .2s, opacity .2s; }
.like-btn.liked { border-color: var(--cta); color: var(--cta); }
.like-btn.liked .like-heart { filter: none; opacity: 1; transform: scale(1.25); }
.dislike-btn { filter: grayscale(1); opacity: .75; }
.dislike-btn.disliked { filter: none; opacity: 1; border-color: var(--pop); }
.rating-pill { font-size: .8rem; font-weight: 800; color: var(--muted); padding: 0 4px; }
.rating-pill[hidden] { display: none; }
.fav-btn .fav-star { color: #f5b301; font-size: 1rem; line-height: 1; }
.fav-btn.on { border-color: #f5b301; }
.game-stage:fullscreen { height: 100%; max-height: none; border-radius: 0; }
.game-stage.faux-fullscreen { position: fixed; inset: 0; z-index: 9990; width: 100%; height: 100vh; height: 100dvh; max-height: none; min-height: 0; border-radius: 0; box-shadow: none; }
body.faux-lock { overflow: hidden; }
.faux-exit {
  position: fixed; z-index: 9991; top: calc(env(safe-area-inset-top, 0px) + 10px); right: calc(env(safe-area-inset-right, 0px) + 10px);
  background: rgba(10, 11, 26, .8); color: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-weight: 800; font-size: .85rem; cursor: pointer; backdrop-filter: blur(6px);
}
.game-info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-top: 22px; }
.game-info h2 { font-size: 1.1rem; margin: 0 0 8px; font-weight: 800; }
.game-info p { color: var(--muted); margin: 0 0 12px; }
.game-info .howto { white-space: pre-line; }
.game-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; margin: 4px 0 16px; padding: 14px 16px; background: var(--bg-2); border-radius: 12px; }
.game-meta div { display: flex; flex-direction: column; }
.game-meta dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.game-meta dd { margin: 0; font-size: .9rem; font-weight: 700; color: var(--ink); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.tag { background: var(--surface-2); color: #c9c0ff; font-size: .74rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }

/* ---------- Ads ---------- */
.ad-box { margin: 22px auto; text-align: center; min-height: 0; overflow: hidden; }
.ad-placeholder { background: var(--surface); border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .8rem; padding: 34px 10px; max-width: 728px; }

/* ---------- Static pages ---------- */
.page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; margin: 24px 0; max-width: 900px; }
.page h1 { margin-top: 0; font-weight: 800; }
.page h2 { font-size: 1.12rem; font-weight: 800; }
.page p, .page li { color: var(--muted); }
.page input, .page textarea { border: 1px solid var(--line) !important; background: var(--bg-2) !important; color: var(--ink) !important; }
.page button[type="submit"] { background: linear-gradient(90deg, var(--brand), var(--brand-2)) !important; }

/* ---------- Category hero ---------- */
.hero { padding: 26px 0 2px; }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 6px; font-weight: 800; }
.hero p { color: var(--muted); margin: 0; font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 52px; padding: 28px 0 36px; }
.footer-inner { text-align: center; color: var(--muted); }
.footer-brand { font-weight: 800; margin-bottom: 10px; color: var(--ink); }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { color: var(--muted); font-size: .9rem; font-weight: 700; }
.footer-copy { font-size: .8rem; }

/* ---------- Tablet & phone: sidebar becomes a drawer, chips appear ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; top: var(--top-h); left: 0; bottom: 0; width: min(300px, 84vw); height: auto; z-index: 55;
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-lift);
  }
  body.menu-open .sidebar { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 54; }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .main { padding: 0 14px 40px; }
  .chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 7px 14px; border-radius: 999px; font-size: .84rem; font-weight: 800; white-space: nowrap; }
  .chip:hover { text-decoration: none; border-color: var(--brand); }
  .random-btn span { display: none; }
  .random-btn { padding: 9px 12px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .logo { font-size: 1.1rem; }
  .logo-mark { width: 26px; height: 26px; }
  .search { display: none; position: absolute; left: 10px; right: 10px; top: calc(var(--top-h) + 6px); max-width: none; }
  .topbar.search-open .search { display: flex; }
  .search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 1rem; cursor: pointer; }
  .topbar.search-open .search-toggle { border-color: var(--brand); }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; }
  body { background-size: 640px 640px; }
  .tile-hero { grid-column: 1 / -1; grid-row: span 1; aspect-ratio: 3 / 2; }
  .tile-featured:not(.tile-hero) { grid-column: span 1; grid-row: span 1; aspect-ratio: 1 / 1; }
  .tile-hero-overlay { padding: 40px 16px 14px; }
  .btn-play { padding: 8px 20px; font-size: .9rem; }
  .tile-title { font-size: .78rem; }
  .game-grid-row .tile { flex-basis: 120px; }
  .game-grid.game-grid-row { gap: 14px; }
  .game-stage { height: min(74vh, 640px); height: min(calc(100dvh - 190px), 560px); min-height: 300px; }
  .stage-bar { padding: 10px 2px; gap: 6px; }
  .stage-bar-group { gap: 6px; }
  .stage-bar button { padding: 8px 12px; font-size: .8rem; }
  .fav-label, .rating-pill, .section-blurb { display: none; }
  .game-meta { grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; }
  .game-info { padding: 18px 16px; }
  .page { padding: 20px 16px; }
}
