/* willyou.web.app — shared pixel styling. */

/* Self-hosted OFL fonts (latin subset, ~30KB total, preloaded in each page's
   <head>). font-display:swap keeps text visible on slow links — with the
   preload the font is usually ready before first paint, so no swap/CLS. */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/press-start-2p-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'VT323';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/vt323-latin.woff2') format('woff2');
}

:root {
  /* default (valentine) — JS overrides via WY.applyTheme */
  --bg: #ffd9e8; --bg2: #ffb3d1; --panel: #fff0f6; --border: #ff5c8a;
  --ink: #6a1b3a; --muted: #b23a67; --accent: #c2185b; --accent2: #ff8fb3;
  --yes: #c2185b; --yesInk: #ffffff; --no: #e6c7d4; --noInk: #6a1b3a;
  --pixel: 'Press Start 2P', system-ui, sans-serif;
  --body: 'VT323', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { min-height: 100%; background: var(--bg2); }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  background-repeat: no-repeat;
  -webkit-font-smoothing: none;
  image-rendering: -moz-crisp-edges;
}

/* pixelated sprites */
.wy-sprite { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

/* chunky pixel card */
.panel {
  background: var(--panel);
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .18);
  padding: 20px;
}

h1, h2, h3, .pixel { font-family: var(--pixel); line-height: 1.5; }

/* pixel buttons */
.btn {
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--ink);
  background: var(--accent2);
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .22);
  padding: 12px 16px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: transform .06s ease;
  user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0, 0, 0, .22); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-yes { background: var(--yes); color: var(--yesInk); }
.btn-no { background: var(--no); color: var(--noInk); }

/* form controls */
label { display: block; font-weight: bold; margin: 14px 0 6px; }
input[type=text], input[type=url], textarea, select {
  width: 100%;
  font-family: var(--body);
  font-size: 20px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--border);
  padding: 8px 10px;
}
textarea { resize: vertical; min-height: 72px; line-height: 1.3; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 16px; color: var(--muted); margin-top: 4px; }
.counter { font-size: 14px; color: var(--muted); float: right; font-weight: normal; }

/* chip pickers */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--pixel); font-size: 11px; padding: 8px 10px; cursor: pointer;
  border: 3px solid var(--border); background: #fff; color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: inset 3px 3px 0 rgba(0,0,0,.15); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.sticker-btn {
  border: 3px solid var(--border); background: #fff; padding: 6px; cursor: pointer;
  display: grid; place-items: center; aspect-ratio: 1;
}
.sticker-btn[aria-pressed="true"] { outline: 3px solid var(--accent); background: #fff7fb; }
.sticker-btn .wy-sprite { width: 40px; height: 40px; }
.sticker-none { font-family: var(--pixel); font-size: 9px; color: var(--muted); }

a { color: var(--accent); }
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.bob { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* CRT scanlines (optional overlay) */
.crt::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(rgba(0,0,0,.10) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

.center { text-align: center; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
