/* Homivoo — arcade cabinet at night: ink-blue ground, coin-yellow accent, cyan for interaction.
   Layout: sticky marquee header, content column ~1120px, games in a responsive grid. */
:root {
  --ink: #0d0e1c;
  --panel: #171830;
  --panel-2: #20224a;
  --line: #2e3166;
  --text: #ecebff;
  --muted: #a4a6cf;
  --coin: #ffc93c;
  --coin-ink: #2a1d00;
  --cyan: #3fd6df;
  --danger: #ff6b7a;
  --good: #6be19b;
  --f-display: "Bungee", "Impact", "Arial Black", sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 10px;
  --wrap: 1120px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 17px/1.65 var(--f-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--ink);
}
img, svg { max-width: 100%; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--coin); }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * 16px);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--coin); color: var(--coin-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 1.35rem; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.logo:hover { color: var(--text); }
.logo .coin { width: 22px; height: 22px; border-radius: 50%; background: var(--coin); box-shadow: inset -3px -3px 0 #d79a00; flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 700; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.nav-toggle { display: none; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 700 .9rem var(--f-body); cursor: pointer; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-bottom: 1px solid var(--line); display: none;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 8px 16px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

main { flex: 1; }
.section { padding-block: 48px; }
.section + .section { padding-top: 0; }

/* Type */
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 5.5vw, 3.4rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.eyebrow { font: 700 .78rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--coin); margin-bottom: 10px; display: block; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }

/* Hero */
.hero { padding-block: 56px 40px; border-bottom: 1px solid var(--line);
  background: radial-gradient(800px 300px at 85% 0%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero h1 .hl { color: var(--coin); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.marquee { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.marquee-screen { aspect-ratio: 4/3; max-width: 100%; border-radius: 10px; background: #070814; position: relative; overflow: hidden; }
.marquee-screen canvas { width: 100%; height: 100%; display: block; }
.marquee-cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font: .8rem var(--f-mono); color: var(--muted); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; border: 2px solid transparent;
  font: 700 1rem var(--f-body); text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coin); color: var(--coin-ink); box-shadow: 0 4px 0 #b88400; }
.btn-primary:hover { color: var(--coin-ink); background: #ffd665; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }

/* Game cards */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.game-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: var(--text); transition: transform .15s ease, border-color .15s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--coin); color: var(--text); }
.game-card .thumb { aspect-ratio: 16/10; background: #070814; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.game-card .thumb svg { width: 100%; height: 100%; display: block; }
.game-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-card h3 { margin: 0; }
.game-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tag { font: 600 .72rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

/* Feature list */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.features h3 { color: var(--coin); }
.features p { color: var(--muted); margin: 0; }

/* Prose (legal + articles) */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 700; }
.table-scroll { overflow-x: auto; }
.updated { font: .85rem var(--f-mono); color: var(--muted); }
.page-head { padding-block: 44px 8px; }
.breadcrumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.callout { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--coin); border-radius: 8px; padding: 14px 18px; margin: 0 0 1.2em; }
kbd { font: .85em var(--f-mono); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: 1px 7px; color: var(--text); white-space: nowrap; }

/* Game shell */
.game-shell { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; margin-block: 8px 36px; }
.game-shell > * { min-width: 0; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; position: relative; }
.stage-inner { position: relative; margin: 0 auto; max-width: 560px; touch-action: none; }
.stage canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: #070814; }
.hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.stat span { display: block; font: 700 .7rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat b { font: 400 1.5rem var(--f-display); font-variant-numeric: tabular-nums; color: var(--coin); }
.side { display: flex; flex-direction: column; gap: 14px; }
.side .controls { display: flex; flex-wrap: wrap; gap: 8px; }
.side .hint { font-size: .9rem; color: var(--muted); margin: 0; }
@media (max-width: 860px) { .game-shell { grid-template-columns: 1fr; } }

.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: color-mix(in srgb, #070814 82%, transparent); border-radius: 10px; padding: 20px; z-index: 5; }
.overlay h2 { font: 400 clamp(1.4rem, 4vw, 2rem) var(--f-display); color: var(--coin); margin: 0; }
.overlay p { margin: 0; color: var(--muted); max-width: 34ch; }

.dpad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 8px; justify-content: center; margin-top: 14px; }
.dpad button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font-size: 1.3rem; cursor: pointer; touch-action: manipulation; }
.dpad button:active { background: var(--line); }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .dpad { display: grid; } }

/* 2048 */
.board-2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; background: #070814; border-radius: 10px; aspect-ratio: 1; max-width: 100%; }
.tile { display: grid; place-items: center; border-radius: 8px; background: #1a1c3a; font: 400 clamp(1rem, 5.5vw, 2rem) var(--f-display); color: var(--text); font-variant-numeric: tabular-nums; }
.tile.pop { animation: pop .16s ease-out; }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
.t2 { background: #2b2e63; } .t4 { background: #353a85; } .t8 { background: #1f7f8a; } .t16 { background: #22a3ad; color: #04161a; }
.t32 { background: #3fd6df; color: #04161a; } .t64 { background: #e8a33c; color: #2a1d00; } .t128 { background: #ffc93c; color: #2a1d00; font-size: clamp(.9rem, 4.6vw, 1.7rem); }
.t256 { background: #ffd96e; color: #2a1d00; font-size: clamp(.9rem, 4.6vw, 1.7rem); } .t512 { background: #ff9a6b; color: #2a0d00; font-size: clamp(.9rem, 4.6vw, 1.7rem); }
.t1024 { background: #ff6b7a; color: #2a0006; font-size: clamp(.75rem, 3.8vw, 1.4rem); } .t2048, .tbig { background: #6be19b; color: #04210f; font-size: clamp(.75rem, 3.8vw, 1.4rem); }

/* Memory */
.board-memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card { aspect-ratio: 3/4; border: 0; padding: 0; background: none; cursor: pointer; perspective: 600px; }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform .35s ease; transform-style: preserve-3d; }
.card.flipped .card-inner, .card.matched .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-back { background: repeating-linear-gradient(45deg, #24275a 0 8px, #1c1e47 8px 16px); border: 2px solid var(--line); }
.card-back::after { content: ""; width: 26%; aspect-ratio: 1; border-radius: 50%; background: var(--coin); opacity: .85; }
.card-front { background: #0b0c1d; border: 2px solid var(--line); transform: rotateY(180deg); font-size: clamp(1.6rem, 8vw, 2.8rem); line-height: 1; }
.card.matched .card-front { border-color: var(--good); }
@media (prefers-reduced-motion: reduce) { .card-inner { transition: none; } .tile.pop { animation: none; } .game-card { transition: none; } }

/* Tic-tac-toe */
.board-ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; aspect-ratio: 1; }
.cell { background: #0b0c1d; border: 2px solid var(--line); border-radius: 10px; font: 400 clamp(2rem, 12vw, 4rem) var(--f-display); cursor: pointer; color: var(--text); }
.cell.x { color: var(--coin); } .cell.o { color: var(--cyan); }
.cell.win { background: var(--panel-2); border-color: var(--good); }
.cell:disabled { cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 8px 12px; font: 700 .85rem var(--f-body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.status-line { text-align: center; font-weight: 700; margin: 0 0 12px; min-height: 1.6em; }

/* Minesweeper */
.board-mines { display: grid; gap: 3px; margin: 0 auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mcell { aspect-ratio: 1; border: 0; border-radius: 4px; background: #2b2e63; color: var(--text); font: 700 clamp(.75rem, 3.2vw, 1.05rem) var(--f-mono); cursor: pointer; padding: 0; box-shadow: inset 0 -3px 0 #1c1e47; }
.mcell.open { background: #0b0c1d; box-shadow: none; cursor: default; }
.mcell.flag { color: var(--danger); }
.mcell.boom { background: var(--danger); color: #2a0006; }
.n1 { color: #5fa8ff; } .n2 { color: var(--good); } .n3 { color: var(--danger); } .n4 { color: #b88cff; } .n5 { color: #ff9a6b; } .n6 { color: var(--cyan); } .n7, .n8 { color: var(--muted); }

/* Ads — hidden until an AdSense unit is pasted inside */
.ad-slot { margin-block: 28px; text-align: center; min-height: 100px; }
.ad-slot:not(:has(ins)) { display: none; }
.ad-label { display: block; font: 600 .68rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding-block: 14px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Forms */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.field input, .field textarea, .field select { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font: 1rem var(--f-body); }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.form-note { font-size: .92rem; color: var(--muted); }
.form-status { font-weight: 700; color: var(--good); min-height: 1.4em; margin: 0; }
.contact-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; }
.contact-grid > * { min-width: 0; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #0a0b17; margin-top: 56px; }
.site-footer .wrap { padding-block: 40px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid > * { min-width: 0; }
.footer-grid h4 { font: 700 .75rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text); text-decoration: none; font-size: .95rem; }
.footer-grid a:hover { color: var(--coin); }
.footer-grid p { color: var(--muted); font-size: .92rem; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid .about-col { grid-column: 1 / -1; } }

/* Cookie notice */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--panel); border-top: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.cookie-banner .inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.cookie-banner p { margin: 0; font-size: .93rem; color: var(--muted); max-width: 80ch; }

/* 404 */
.notfound { text-align: center; padding-block: 80px; }
.notfound .big { font: 400 clamp(4rem, 18vw, 9rem) var(--f-display); color: var(--coin); line-height: 1; }

/* Mole Bonk */
.board-mole { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 440px; margin: 0 auto; }
.hole { aspect-ratio: 1; border: 0; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, #050611 45%, #20224a 47%, #171830 70%); position: relative; overflow: hidden; cursor: pointer; touch-action: manipulation; }
.hole .mole { position: absolute; left: 22%; right: 22%; bottom: -60%; height: 62%; border-radius: 50% 50% 30% 30%; background: #ff9a6b; transition: bottom .12s ease-out; }
.hole .mole::before, .hole .mole::after { content: ""; position: absolute; top: 28%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: #2a0d00; }
.hole .mole::before { left: 28%; } .hole .mole::after { right: 28%; }
.hole.up .mole { bottom: 12%; }
.hole.gold .mole { background: var(--coin); box-shadow: 0 0 18px var(--coin); }
.hole.bonk .mole { bottom: 12%; background: var(--danger); }

/* Echo Pads */
.board-echo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 400px; margin: 0 auto; }
.pad { aspect-ratio: 1; border: 0; border-radius: 22px; cursor: pointer; opacity: .45; transition: opacity .08s, transform .08s; touch-action: manipulation; }
.pad.lit { opacity: 1; transform: scale(1.03); box-shadow: 0 0 30px currentColor; }
.pad:nth-child(1) { background: var(--coin); color: var(--coin); } .pad:nth-child(2) { background: var(--cyan); color: var(--cyan); }
.pad:nth-child(3) { background: var(--danger); color: var(--danger); } .pad:nth-child(4) { background: var(--good); color: var(--good); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--muted); }

/* Slide 15 */
.board-slide { display: grid; gap: 8px; max-width: 440px; margin: 0 auto; aspect-ratio: 1; }
.stile { border: 0; border-radius: 10px; background: #2b2e63; color: var(--text); font: 400 clamp(1.1rem, 5vw, 1.9rem) var(--f-display); cursor: pointer; box-shadow: inset 0 -4px 0 #1c1e47; }
.stile.home { background: #353a85; color: var(--coin); }
.stile.blank { background: transparent; box-shadow: none; cursor: default; }

/* Four in a Row */
.board-c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px; background: #20224a; border-radius: 14px; max-width: 480px; margin: 0 auto; }
.c4cell { aspect-ratio: 1; border: 0; border-radius: 50%; background: #070814; cursor: pointer; padding: 0; }
.c4cell.p1 { background: var(--coin); } .c4cell.p2 { background: var(--cyan); }
.c4cell.win { box-shadow: 0 0 0 3px #fff inset; }

/* Lights Off */
.board-lights { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; }
.light { aspect-ratio: 1; border: 0; border-radius: 12px; background: #1a1c3a; cursor: pointer; transition: background .12s, box-shadow .12s; }
.light.on { background: var(--coin); box-shadow: 0 0 18px color-mix(in srgb, var(--coin) 60%, transparent); }

/* Ball Sort */
.board-sort { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding-block: 10px; }
.tube { width: 52px; height: 210px; border: 2px solid var(--line); border-top: 0; border-radius: 0 0 26px 26px; background: #0b0c1d; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; padding: 6px 0; cursor: pointer; transition: transform .12s; }
.tube.sel { transform: translateY(-12px); border-color: var(--cyan); }
.tube.full { border-color: var(--good); }
.ball { width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: inset -4px -5px 0 rgba(0,0,0,.2); }
@media (max-width: 480px) { .tube { width: 42px; height: 172px; } .ball { width: 32px; height: 32px; } }
