/* 10 Bit Games — shared styles for every page.
   The world: a made-up "10-Bit" handheld console. Games are cartridges on a shelf;
   each game page runs the game inside the console's screen. */

:root {
  --shelf: #1C1430;      /* page ground */
  --shelf-2: #251A3D;    /* raised surfaces: chips, inputs */
  --line: #3A2C5C;       /* dividers */
  --ink: #FFF6E6;        /* main text */
  --dim: #C3B4E2;        /* secondary text */
  --yolk: #FFD23F;       /* primary action, highlights */
  --led: #FF4D5E;
  --cart-plastic: #3B3550;

  --fd: 'Pixelify Sans', 'Rubik', system-ui, sans-serif;  /* display: 20px and up only */
  --fb: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --t-display: clamp(40px, 4.4vw, 56px);
  --t-section: 32px;
  --t-title: 20px;
  --t-lead: 17px;
  --t-body: 16px;
  --t-small: 13px;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--shelf);
  color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--fb);
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--yolk); color: #150F22; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yolk); outline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- pixel characters ---------- */
.spr {
  --s: 3;
  display: block;
  flex: none;
  width: calc(var(--fw) * var(--s) * 1px);
  height: calc(32 * var(--s) * 1px);
  background: var(--img) 0 0 / calc(var(--fw) * var(--n) * var(--s) * 1px) 100% no-repeat;
  image-rendering: pixelated;
  animation: spr var(--dur) steps(var(--n)) infinite;
}
@keyframes spr { to { background-position: calc(var(--fw) * var(--n) * var(--s) * -1px) 0; } }
.spr-bobby  { --img: url(sprites/bobby.png);  --fw: 32; --n: 6;  --dur: 1.5s; }
.spr-psykoh { --img: url(sprites/psykoh.png); --fw: 40; --n: 8;  --dur: 2s; }
.spr-patchy { --img: url(sprites/patchy.png); --fw: 32; --n: 32; --dur: 8s; }
.spr-zest   { --img: url(sprites/zest.png);   --fw: 32; --n: 32; --dur: 8s; }
.spr-fizz   { --img: url(sprites/fizz.png);   --fw: 32; --n: 8;  --dur: 1.2s; }
.spr-kip    { --img: url(sprites/kip.png);    --fw: 32; --n: 8;  --dur: 1.6s; }
.spr-rita   { --img: url(sprites/rita.png);   --fw: 32; --n: 8;  --dur: 2.4s; }
.blob { --s: 3; display: block; flex: none; width: calc(16 * var(--s) * 1.45px); height: calc(13 * var(--s) * 1.45px); shape-rendering: crispEdges; overflow: visible; }
.blob .eyeshut { display: none; }
.blob.blink .eyewhite, .blob.blink .pupil { display: none; }
.blob.blink .eyeshut { display: inline; }
@media (prefers-reduced-motion: reduce) { .spr { animation: none; } }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 14px; padding-block: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo .wm { font: 700 28px/1 var(--fd); color: var(--ink); padding-top: 3px; white-space: nowrap; }
.logo .wm b { font-weight: inherit; color: var(--yolk); }
.top nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.top nav a { text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; color: var(--dim); }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); background: var(--shelf-2); }
.search { background: var(--shelf-2); border: 2px solid var(--line); color: var(--ink); font: inherit; font-size: 16px; padding: 7px 12px; border-radius: 8px; width: 200px; }
.search::placeholder { color: #9E8FC0; }
.search:focus { outline: none; border-color: var(--yolk); }

/* ---------- the console ---------- */
.console {
  position: relative;
  background: url(tex/grain.png), linear-gradient(180deg, #6448AE, #583D9C);
  border-radius: 22px 22px 34px 34px;
  padding: 18px 22px;
  box-shadow: 0 18px 30px -12px #000a, inset 0 2px 0 #ffffff33, inset 0 -5px 0 #0000004d;
}
.console::before { content: ""; position: absolute; inset: 8px; border-radius: 14px 14px 22px 22px; box-shadow: inset 0 0 0 1px #00000040, 0 1px 0 #ffffff14; pointer-events: none; }
.screw { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #9A86D2, #3F2C74 70%); box-shadow: 0 1px 0 #ffffff1f, inset 0 0 0 1px #00000040; z-index: 1; }
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4.5px; height: 1px; background: #24174A; transform: rotate(38deg); }
.screw.tl { top: 16px; left: 16px; } .screw.tr { top: 16px; right: 16px; }
.screw.bl { bottom: 16px; left: 16px; } .screw.br { bottom: 16px; right: 16px; }
.grille { position: absolute; right: 40px; bottom: 22px; width: 42px; height: 28px; background: radial-gradient(circle, #24174A 0 1.7px, transparent 2.1px) 0 0 / 7px 7px; transform: rotate(-24deg); opacity: .85; }
.cbody { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; }
.scol { flex: 1; min-width: 0; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #0C0A10; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 8px #231A35, inset 0 3px 10px #000a; }
.screen video { display: block; width: 100%; height: 100%; object-fit: contain; }
.screen .tag { position: absolute; left: 10px; bottom: 10px; background: #0C0A10d9; font: 500 var(--t-small)/1 var(--fb); padding: 6px 9px; border-radius: 4px; text-decoration: none; }
.screen .tag:hover { color: var(--yolk); }
.bezel-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; font: 600 12px/1 var(--fb); letter-spacing: .14em; text-transform: uppercase; color: #C9B8F0; }
.led { width: 9px; height: 9px; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 2px #0004; flex: none; }
.pills { display: flex; gap: 14px; margin-left: auto; }
.pill { display: flex; align-items: center; gap: 6px; color: #2A1C50; text-shadow: 0 1px 0 #ffffff1f; font-size: 10px; letter-spacing: .12em; }
.pill i { width: 22px; height: 7px; border-radius: 4px; background: #2A1C50; box-shadow: inset 0 -2px 0 #0006; transform: rotate(-18deg); }
.bezel-foot .brand { margin-left: 14px; }
.dpad { width: 62px; height: 62px; position: relative; flex: none; }
.dpad::before, .dpad::after { content: ""; position: absolute; background: #241A38; border-radius: 4px; box-shadow: inset 0 -3px 0 #0008, inset 0 1px 0 #ffffff14; }
.dpad::before { left: 21px; top: 0; width: 20px; height: 62px; }
.dpad::after { top: 21px; left: 0; height: 20px; width: 62px; }
.dpad i { position: absolute; left: 25px; top: 25px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #140D22, #241A38); z-index: 1; }
.abtn { display: flex; gap: 12px; flex: none; }
.abtn i { position: relative; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FF8AA0, #E94B6A 55%, #B4304E); box-shadow: inset 0 -3px 0 #0005, 0 2px 0 #00000040; }
.abtn i + i { background: radial-gradient(circle at 35% 30%, #FFE98A, #FFD23F 55%, #C49B12); transform: translateY(-10px); }
.abtn b { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font: 700 11px/1 var(--fb); color: #2A1C50; text-shadow: 0 1px 0 #ffffff26; }
/* the slot on top, with today's cartridge plugged in */
.slot { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 196px; height: 14px; z-index: 3; background: url(tex/grain.png), #2E1F5C; border-radius: 7px 7px 3px 3px; box-shadow: inset 0 4px 4px #000a, 0 1px 0 #ffffff1a; }
.peek { position: absolute; left: 50%; top: -86px; transform: translateX(-50%); width: 170px; height: 88px; overflow: hidden; z-index: 0; }
.peek .cart { margin-top: 8px; filter: none; transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.peek .cart:hover, .peek .cart:focus-visible { transform: translateY(-7px); }
.peek :is(.meta, .desc, .sticker, .dbadge, .win video) { display: none; }

/* ---------- homepage hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 84px 36px; }
.hero h1 { font: 700 var(--t-display)/1.05 var(--fd); margin: 0; }
.hero h1 em { font-style: normal; color: var(--yolk); }
.hero .lead { color: var(--dim); font-size: var(--t-lead); line-height: 1.55; max-width: 38ch; margin: 16px 0 22px; }
.lbl { font: 500 var(--t-small)/1 var(--fb); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin: 0 0 4px; }
.daily { display: grid; }
.daily a { display: flex; align-items: center; gap: 12px; text-decoration: none; border-bottom: 1px solid var(--line); padding: 12px 0; }
.daily a:first-child { border-top: 1px solid var(--line); }
.daily .ic { width: 52px; height: 52px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 3px var(--c); flex: none; }
.daily .ic img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.daily strong { display: block; font: 700 var(--t-title)/1.15 var(--fd); }
.daily small { display: block; color: var(--dim); font-size: var(--t-small); }
.daily a:hover strong { color: var(--c); }
.daily .go { margin-left: auto; font: 500 15px/1 var(--fb); color: var(--yolk); white-space: nowrap; }

/* ---------- the shelf of cartridges ---------- */
.shelfhead { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.shelfhead h2, .section-h { font: 700 var(--t-section)/1.1 var(--fd); margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: 500 15px/1 var(--fb); color: var(--dim); background: var(--shelf-2); border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--shelf); }
.touchhint { display: none; width: 100%; margin: 0; color: var(--dim); font-size: 15px; }
@media (hover: none) { .touchhint { display: block; } }
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 26px; padding-block: 26px 8px; margin: 0; list-style: none; padding-inline: 0; }
.shelf > li { min-width: 0; }
.empty { color: var(--dim); }

.cart { position: relative; display: block; text-decoration: none; filter: drop-shadow(0 12px 10px #0009); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.cart:hover, .cart:focus-visible { transform: translateY(-10px); }
.cart .body {
  background: url(tex/grain.png), linear-gradient(180deg, #625A7C, #4B4462);
  border-radius: 0 0 10px 10px;
  padding: 12px 14px 14px;
  box-shadow: inset 0 2px 0 #ffffff22;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.cart .grip { height: 3px; margin: 3px 34px 24px 4px; background: var(--cart-plastic); border-radius: 2px; box-shadow: 0 6px 0 var(--cart-plastic), 0 12px 0 var(--cart-plastic); }
.cart .body::after { content: ""; display: block; width: 0; height: 0; margin: 12px auto 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid var(--cart-plastic); }
.cart .label { position: relative; background: url(tex/paper.png?v=2) 0 0 / 160px, var(--c); /* printed-paper grain on the label colour; the screenshot window sits on top of it */ border-radius: 4px; padding: 6px 6px 0; box-shadow: 0 0 0 3px var(--cart-plastic); }
.cart .win { position: relative; aspect-ratio: 1 / 1; background: #150F22; border-radius: 2px; overflow: hidden; }
.cart .win img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.cart .win video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0C0A10; opacity: 0; transition: opacity .18s ease-out; }
.cart.previewing .win video { opacity: 1; }
.cart .name { margin: 0; color: #150F22; font: 700 var(--t-title)/1.15 var(--fd); padding: 0 2px; height: calc(2.3em + 16px); display: flex; align-items: center; overflow: hidden; }
.cart .sticker { position: absolute; top: -12px; right: -8px; z-index: 2; filter: drop-shadow(0 2px 0 #00000059); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.cart:hover .sticker { transform: rotate(-8deg) translateY(-2px); }
.cart .dbadge { position: absolute; left: 10px; top: 10px; z-index: 2; font: 700 12px/1 var(--fb); letter-spacing: .08em; text-transform: uppercase; background: var(--yolk); color: #150F22; padding: 6px 9px 5px; border-radius: 4px; border: 2px solid #150F22; transform: rotate(-6deg); box-shadow: 0 3px 0 #B8900F, 0 8px 14px -2px #000000b3; }
.cart .meta { margin: 10px 2px 0; font-size: var(--t-small); color: var(--dim); }
.cart .desc { margin: 2px 2px 0; font-size: var(--t-small); color: #A898C8; }

/* ---------- Bobby + footer ---------- */
.about-strip { display: flex; gap: 20px; align-items: center; padding-block: 36px 8px; flex-wrap: wrap; }
.speech { position: relative; background: var(--ink); color: #150F22; border-radius: 14px; padding: 16px 20px; max-width: 560px; font-size: 15px; line-height: 1.5; }
.speech::before { content: ""; position: absolute; left: -10px; top: 24px; border: 10px solid transparent; border-left: 0; border-right-color: var(--ink); }
.speech a { font-weight: 600; }
.site-foot { border-top: 2px solid #2F2448; margin-top: 28px; padding-block: 24px 40px; display: flex; justify-content: center; gap: 10px 22px; flex-wrap: wrap; color: var(--dim); font-size: 14px; text-align: center; }
.site-foot span { order: 1; flex-basis: 100%; font-size: var(--t-small); }
.site-foot a { color: var(--dim); }
.site-foot a:hover { color: var(--ink); }

/* ---------- cartridge mini (game page title) ---------- */
.minicart { width: 60px; flex: none; background: url(tex/grain.png), linear-gradient(180deg, #625A7C, #4B4462); border-radius: 0 0 6px 6px; padding: 6px 5px 5px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.minicart::before { content: ""; display: block; height: 3px; margin: 2px 18px 6px 2px; background: var(--cart-plastic); border-radius: 2px; box-shadow: 0 5px 0 var(--cart-plastic); }
.minicart .lab { background: url(tex/paper.png?v=2) 0 0 / 120px, var(--c); padding: 3px; border-radius: 3px; }
.minicart img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; image-rendering: pixelated; }

/* ---------- game page: the same template for every game ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: stretch; margin-top: 12px; }
.player { background: url(tex/grain.png), linear-gradient(180deg, #3E3060, #2C2146); border-radius: 20px; padding: 14px 14px 8px; box-shadow: 0 24px 40px -24px #000, inset 0 1px 0 #ffffff26; display: flex; flex-direction: column; min-width: 0; }
.player .screen { aspect-ratio: auto; height: clamp(420px, calc(100dvh - 196px), 780px); border-radius: 8px; box-shadow: 0 0 0 3px #0C0A10; }
.player iframe { display: block; width: 100%; height: 100%; border: 0; background: #0C0A10; }
.bezelrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 12px 6px 4px; }
.ctl { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #D6CAEE; }
.key { font: 600 12px/1 var(--fb); letter-spacing: .06em; text-transform: uppercase; background: #150F22; color: var(--c); border-radius: 4px; padding: 6px 8px; box-shadow: inset 0 -2px 0 #ffffff1a; white-space: nowrap; }
.tools { margin-left: auto; display: flex; gap: 6px; }
.tools button { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: #00000040; color: #E8DEFF; font: 500 14px/1 var(--fb); cursor: pointer; }
.tools button:hover { background: #00000070; }
.tools svg { width: 18px; height: 18px; }
/* "fullscreen" that also works where the browser has no fullscreen support (iPhone) */
.player.is-full { position: fixed; inset: 0; z-index: 100; border-radius: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: #0C0A10; }
.player.is-full .screen { height: auto; flex: 1; border-radius: 0; box-shadow: none; }
.player.is-full .bezelrow { padding: 8px 12px; }
.player.is-full .ctl { display: none; }
body.no-scroll { overflow: hidden; }

.side { display: flex; flex-direction: column; min-width: 0; padding-top: 6px; }
.gtitle { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.gtitle h1 { font: 700 var(--t-section)/1.05 var(--fd); margin: 0; }
.gtitle p { margin: 6px 0 0; color: var(--dim); font-size: var(--t-small); }
.gtitle p b { color: var(--c); font-weight: 500; }
.side h2 { font: 700 var(--t-title)/1.1 var(--fd); margin: 0 0 14px; }
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; line-height: 1.45; }
.steps li::before { content: counter(step); counter-increment: step; font: 700 14px/1 var(--fb); background: var(--c); color: #150F22; border-radius: 4px; height: 28px; display: grid; place-items: center; }
.host { display: flex; align-items: flex-end; gap: 12px; padding-top: 18px; border-top: 2px dashed var(--line); color: var(--dim); font-size: 15px; line-height: 1.45; }

.read { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; margin-top: 76px; padding-top: 40px; border-top: 2px dashed var(--line); }
.read h2 { font: 700 var(--t-section)/1.1 var(--fd); margin: 0 0 14px; }
.read p, .read li { font-size: var(--t-lead); line-height: 1.65; color: #E9E0F7; max-width: 62ch; }
.read p { margin: 0 0 14px; }
.read ul { margin: 0; padding-left: 20px; }
.read li + li { margin-top: 8px; }
.more { margin-top: 64px; }
.more .shelf { padding-top: 22px; }
/* three to a row: show three, so the fourth never sits alone on its own line */
@media (max-width: 1100px) and (min-width: 641px) { .more .shelf > li:nth-child(4) { display: none; } }

/* ---------- info pages (about, contact, privacy, terms) ---------- */
.doc { max-width: 68ch; margin-inline: auto; padding-block: 40px 20px; }
.doc h1 { font: 700 var(--t-display)/1.05 var(--fd); margin: 0 0 8px; }
.doc .updated { color: var(--dim); font-size: var(--t-small); margin: 0 0 28px; }
.doc h2 { font: 700 var(--t-title)/1.2 var(--fd); margin: 40px 0 10px; }
.doc p, .doc li { font-size: var(--t-lead); line-height: 1.7; color: #E9E0F7; }
.doc p { margin: 0 0 14px; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--yolk); text-underline-offset: 3px; }
.doc .intro { display: flex; gap: 22px; align-items: center; margin-bottom: 18px; }
.doc .email { font: 700 var(--t-title)/1.2 var(--fd); color: var(--yolk); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero, .stage { grid-template-columns: minmax(0, 1fr); }
  .stage { gap: 28px; }
  .player .screen { height: clamp(360px, calc(100dvh - 110px), 720px); }
  .read { grid-template-columns: minmax(0, 1fr); gap: 36px; margin-top: 48px; }
}
@media (max-width: 640px) {
  .logo .wm { font-size: 24px; }
  .top .search, .top nav { display: none; }
  .hero { padding-top: 70px; gap: 28px; }
  .console { padding: 14px; border-radius: 16px 16px 24px 24px; }
  .cbody .dpad, .cbody .abtn, .grille, .screw, .pills { display: none; }
  .slot { width: 152px; }
  .peek { top: -74px; height: 76px; width: 130px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .cart .name { font-size: 17px; }
  .cart .desc { display: none; }
  .player { padding: 8px 8px 4px; border-radius: 14px; }
  .player .screen { height: calc(100dvh - 120px); min-height: 340px; }
  .ctl { font-size: 13px; }
  .doc .intro { flex-direction: column; align-items: flex-start; }
}
/* phones held sideways: the console alone fills the window once the header scrolls away */
@media (max-height: 520px) {
  .player .screen { height: calc(100dvh - 72px); min-height: 0; }
  .bezelrow { padding-top: 6px; }
}
