/* "Sunny Pixel Cabana" — design direction chosen by a committee of LLMs
   (Kimi-K2.7 proposal, Qwen3.6-35B verdict, DeepSeek-V4 scanlines),
   synthesized by the humble-jungle AI. Press Start 2P is self-hosted, OFL
   licensed (see /licenses.txt). */
@font-face {
  font-family: "Press Start 2P";
  src: url("/press-start-2p.woff2") format("woff2");
  font-display: swap;
}
:root {
  --bg: #3a1c0b;
  --panel: #ffe6a5;
  --panel2: #fff3cd;
  --ink: #1a0f05;
  --pink: #ff4ecd;
  --cyan: #00b8d9;
  --yellow: #ffcf40;
  --danger: #ff2a2a;
  --shadow: 4px 4px 0 #1a0f05;
  --pixel: "Press Start 2P", monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; justify-content: center;
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(420px 260px at 12% 4%, rgba(255, 214, 107, .25), transparent 70%),
    radial-gradient(500px 300px at 88% 12%, rgba(255, 78, 205, .16), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 46px, rgba(0, 0, 0, .10) 46px 52px),
    var(--bg);
}
.card { width: min(880px, 100vw); padding: 1rem 1rem 2rem; }

header h1 {
  margin: .6rem 0 0; font-family: var(--pixel); font-size: 1.5rem;
  color: var(--yellow); text-shadow: var(--shadow); letter-spacing: .02em;
  animation: marquee-tilt 3.2s ease-in-out infinite;
}
@keyframes marquee-tilt {
  0%, 100% { transform: rotate(-.6deg); } 50% { transform: rotate(.6deg); }
}
.tagline {
  background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--shadow);
  padding: .6rem .8rem; margin: .9rem 0 1rem; line-height: 1.5;
  transform: rotate(-.4deg);
}
.ai { color: #b3128f; font-weight: 700; }

.stage { position: relative; border: 3px solid var(--ink); box-shadow: var(--shadow); }
canvas { width: 100%; height: auto; display: block; background: #87ceeb;
  touch-action: manipulation; }
/* CRT nod (committee member A): scanlines on the "screen" only */
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, .07) 0 2px, transparent 2px 4px);
}
.overlay {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(255, 230, 165, .93); padding: 1rem;
}
.overlay.hidden { display: none; }
.overlay h2 { margin: 0 0 .6rem; font-family: var(--pixel); font-size: 1.15rem;
  text-shadow: 3px 3px 0 rgba(255, 78, 205, .55); }
.overlay p { margin: .25rem 0; }
.keys { font-size: .9rem; opacity: .75; }

button {
  margin-top: .9rem; padding: .7rem 1.5rem; font-family: var(--pixel);
  font-size: .85rem; border: 3px solid var(--ink); background: var(--pink);
  color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .45);
  box-shadow: var(--shadow); cursor: pointer; border-radius: 0;
}
#playbtn { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
button:hover { background: #ff6ed8; }
button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
button:disabled { opacity: .5; cursor: default; animation: none; }
#againbtn { background: var(--cyan); }

.finalscore { font-family: var(--pixel); font-size: 1rem; margin-top: .5rem; }
.finalscore span { color: #b3128f; }
.submitrow { display: flex; gap: .6rem; margin-top: .6rem; }
.submitrow input[type=text] {
  padding: .6rem .7rem; border: 3px solid var(--ink); background: #fff;
  color: var(--ink); font-size: 1rem; width: 11rem; border-radius: 0;
  box-shadow: var(--shadow);
}
.submitrow button { margin-top: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; }
.fine { font-size: .78rem; opacity: .72; }

.board {
  margin-top: 1.3rem; background: var(--panel); border: 3px solid var(--ink);
  box-shadow: var(--shadow); padding: .8rem 1rem 1rem; transform: rotate(.3deg);
}
.board h3 { margin: 0 0 .6rem; font-family: var(--pixel); font-size: .95rem; }
#leaderboard { margin: 0; padding-left: 0; list-style: none;
  counter-reset: rank; }
#leaderboard li {
  counter-increment: rank; display: flex; gap: .7rem; align-items: baseline;
  padding: .3rem .5rem; max-width: 26rem;
}
#leaderboard li:nth-child(odd) { background: var(--panel2); }
#leaderboard li::before {
  content: counter(rank); font-family: var(--pixel); font-size: .8rem;
  color: #b3128f; min-width: 1.6rem;
}
#leaderboard .score { margin-left: auto; font-family: var(--pixel);
  font-size: .8rem; }
#leaderboard li:first-child::after { content: " 👑"; }

footer {
  margin-top: 1.6rem; font-size: .9rem; line-height: 1.55;
  background: var(--panel); border: 3px solid var(--ink);
  box-shadow: var(--shadow); padding: .7rem .9rem; transform: rotate(-.3deg);
}
footer a { color: #b3128f; }
#go-quip { color: #b3128f; font-style: italic; max-width: 34rem; }
@media (max-width: 540px) {
  header h1 { font-size: 1.05rem; }
  .submitrow { flex-direction: column; }
}
