/* oddbit look: toy-box stickers on a night-ink ground. Thick ink outlines, hard offset
   shadows, one bright accent per game (set --accent on a page or card). */
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
:root {
  --ink: #1a1433;          /* outlines, text, night background */
  --ink-2: #2a2250;        /* raised night surfaces */
  --paper: #ffffff;        /* cards */
  --fog: #efedf7;          /* quiet fills on cards */
  --muted: #6b6488;
  --bit: #ffd23f;          /* brand yellow: the "bit" */
  --pop: #ff5d8f;
  --mint: #37d99a;
  --accent: var(--bit);
  --display: "Bricolage", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --line: 3px;
  --lift: 0 4px 0 var(--ink);
  color-scheme: dark;
  font-family: var(--body);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--ink); color: var(--ink);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--bit); outline-offset: 3px; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
  font: 800 20px/1 var(--display); letter-spacing: -.01em; cursor: pointer;
  border: var(--line) solid var(--ink); border-radius: 14px; padding: 15px 26px;
  background: var(--accent); color: var(--ink); box-shadow: var(--lift);
  transition: transform .06s, box-shadow .06s; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--paper); }
.btn.wide { width: 100%; }
.btn.small { font-size: 15px; padding: 9px 14px; border-radius: 11px; }

/* ---- HUD chips over the game canvas ----------------------------------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
}
.chip {
  font: 800 17px/1 var(--display); color: #fff; background: var(--ink);
  border: 2px solid rgba(255,255,255,.18); border-radius: 999px; padding: 9px 14px;
  font-variant-numeric: tabular-nums; display: inline-flex; gap: 6px; align-items: center;
  white-space: nowrap;
}
.chip.icon { pointer-events: auto; cursor: pointer; padding: 8px 11px; font-size: 18px; }
.chip.home { pointer-events: auto; text-decoration: none; }

/* ---- Start / end cards ------------------------------------------------ */
.overlay {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(26, 20, 51, .62); padding: 16px; overflow-y: auto;
  animation: fade .18s ease-out;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.card {
  position: relative; background: var(--paper); width: min(370px, 100%);
  border: var(--line) solid var(--ink); border-radius: 26px; box-shadow: 8px 8px 0 var(--ink);
  padding: 0 20px 20px; text-align: center; margin: auto;
  animation: pop .28s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.85) rotate(-2deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .card, .overlay { animation: none; } }
.card-art {
  margin: 0 -20px 16px; height: 128px; border-radius: 23px 23px 0 0; background: var(--accent);
  border-bottom: var(--line) solid var(--ink); display: grid; place-items: center; overflow: hidden;
  font-size: 76px; position: relative;
}
.card-art::before {   /* confetti bits */
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(var(--ink) 1.6px, transparent 1.8px);
  background-size: 18px 18px;
}
.card-art span { position: relative; filter: drop-shadow(3px 3px 0 var(--ink)); }
.title {
  font: 800 30px/1.02 var(--display); letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance;
}
.lede { margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; text-align: left; }
.steps li {
  display: flex; gap: 10px; align-items: center; background: var(--fog); border-radius: 12px;
  padding: 9px 12px; font-size: 15px; line-height: 1.3;
}
.steps b { font-family: var(--display); font-weight: 800; }
.steps .k {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--ink); font-size: 15px;
}
.best { margin: 12px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.best:empty { display: none; }

.stamp {
  display: inline-block; font: 800 22px/1 var(--display); letter-spacing: .02em; text-transform: uppercase;
  background: var(--ink); color: var(--accent); padding: 9px 14px; border-radius: 10px;
  transform: rotate(-3deg); margin-top: -22px; position: relative; top: -2px;
}
.score {
  font: 800 54px/1 var(--display); letter-spacing: -.03em; margin: 14px 0 4px;
  font-variant-numeric: tabular-nums;
}
.score small { font-size: 22px; letter-spacing: 0; }
.sub { margin: 0; color: var(--muted); font-size: 15px; }
.sub.win { color: var(--ink); font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

/* ---- More games ------------------------------------------------------ */
.more { margin-top: 20px; padding-top: 14px; border-top: 2px dashed #d9d5e8; text-align: left; }
.eyebrow {
  font: 800 12px/1 var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin: 0 0 10px;
}
.more-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  --accent: var(--bit);
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--accent); border: var(--line) solid var(--ink); border-radius: 16px;
  padding: 10px 12px; box-shadow: var(--lift); min-height: 84px; position: relative;
}
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tile-emoji { font-size: 30px; line-height: 1; filter: drop-shadow(2px 2px 0 var(--ink)); }
.tile-title { font: 800 15px/1.1 var(--display); letter-spacing: -.01em; }
.tile.soon { background: transparent; border-style: dashed; box-shadow: none; color: var(--muted); }
.tile.soon .tile-emoji { filter: grayscale(1); opacity: .6; }
.tag {
  position: absolute; top: -9px; right: 8px; font: 800 11px/1 var(--display); text-transform: uppercase;
  letter-spacing: .08em; background: var(--ink); color: #fff; padding: 4px 7px; border-radius: 6px;
}

.foot { margin-top: 16px; font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }

/* ---- Toast ----------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 40px);
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 999px; border: 2px solid var(--bit);
  opacity: 0; transition: .2s; z-index: 20; font: 700 15px var(--body);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
