:root {
  --navy: #1f3f8c; --navy-deep: #14285c; --cream: #f7f2e6; --coral: #f26b3a; --cyan: #3dd1c5; --yellow: #f5e563;
  --top-h: 58px; --bar-h: 46px; --foot-h: 76px; --gap: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { margin: 0; color: var(--cream); font-family: "Nunito", system-ui, sans-serif; background: var(--navy-deep); overflow-x: hidden; }
/* first screen: header + game + footer exactly one viewport tall; the about section scrolls below it */
.fold { height: 100dvh; display: grid; grid-template-rows: var(--top-h) 1fr var(--foot-h);
  background: radial-gradient(1200px 600px at 50% -10%, #f0a24a 0%, #e0623a 22%, #7a2f55 48%, var(--navy-deep) 75%); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); }
.brand-text { font-family: "Fredoka", system-ui, sans-serif; font-weight: 700; font-size: 26px; letter-spacing: 1px; margin: 0;
  text-shadow: 0 3px 0 var(--navy-deep); }
.brand-text .accent { color: var(--coral); }
.tagline { font-size: 13px; font-weight: 700; opacity: .8; margin-left: 6px; padding-left: 12px; border-left: 2px solid rgba(247,242,230,.35); }
.links a { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--cream);
  background: rgba(20,40,92,.55); border: 2px solid var(--cyan); border-radius: 999px; padding: 6px 14px; }

/* stage: the plate is sized so that plate + bar fit the row height, never wider than the viewport */
.stage { display: flex; align-items: center; justify-content: center; padding: var(--gap) 16px; min-height: 0; }
.plate { width: min(100%, calc((100dvh - var(--top-h) - var(--foot-h) - var(--bar-h) - 2 * var(--gap) - 12px) * 16 / 9));
  background: var(--cream); border: 4px solid var(--navy); border-radius: 18px;
  box-shadow: 0 8px 0 var(--navy-deep), 0 24px 50px rgba(0,0,0,.35); overflow: hidden; min-width: 0; }
#unity-container { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1a1830; }
#unity-canvas { width: 100%; height: 100%; display: block; }
#unity-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(180deg, #f0a24a, #d9503f 60%, #7a2f55); color: var(--cream); font-weight: 800; }
.spin { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-10px) rotate(4deg);} }
.bar { width: 300px; max-width: 70%; height: 16px; border: 3px solid var(--navy); border-radius: 999px; background: var(--cream); overflow: hidden; }
#unity-loading .note { font-size: 12px; font-weight: 700; opacity: .8; }
#unity-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--coral)); transition: width .2s; }
#unity-warning { display: none; position: absolute; left: 12px; right: 12px; top: 12px; }
#unity-warning div { padding: 10px 14px; border-radius: 10px; margin-bottom: 6px; font-weight: 800; }
#unity-warning .warn { background: var(--yellow); color: var(--navy-deep); }
#unity-warning .err { background: var(--coral); color: white; }
.plate-bar { min-width: 0; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  color: var(--navy); font-weight: 800; }
.hints { min-width: 0; display: flex; flex-wrap: nowrap; gap: 16px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.hint-long { opacity: .75; font-weight: 700; }
kbd { display: inline-block; min-width: 22px; padding: 1px 5px; margin-right: 2px; border: 2px solid var(--navy); border-bottom-width: 4px;
  border-radius: 6px; background: white; font: 700 11px "Nunito", sans-serif; text-align: center; }
.bar-right { display: flex; align-items: center; gap: 12px; }
.version { font-size: 11px; opacity: .55; font-weight: 700; white-space: nowrap; }
#fullscreen { font: 800 13px "Nunito", sans-serif; color: var(--cream); background: var(--navy); border: 0; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; white-space: nowrap; }
#fullscreen:hover { background: var(--coral); }
.pill-link { font: 800 13px "Nunito", sans-serif; color: var(--navy); background: transparent; border: 2px solid var(--navy); border-radius: 999px;
  padding: 6px 12px; white-space: nowrap; }
.pill-link:hover { background: var(--navy); color: var(--cream); text-decoration: none; }
html { scroll-behavior: smooth; }

/* footer: badge + channel + credit, one row */
.bottom { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 22px; padding: 0 22px;
  border-top: 2px solid rgba(247,242,230,.15); background: rgba(16,16,34,.35); }
.badge { display: flex; align-items: center; gap: 14px; color: var(--cream); }
.badge img { display: block; height: 44px; width: auto; border-radius: 999px; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.badge:hover { text-decoration: none; filter: brightness(1.12); }
.channel { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); font-size: 14px; padding: 8px 14px;
  border: 2px solid rgba(247,242,230,.25); border-radius: 999px; white-space: nowrap; }
.channel svg { color: #ff4a4a; }
.channel:hover { border-color: var(--yellow); text-decoration: none; }
.fine { justify-self: end; font-size: 12px; opacity: .75; text-align: right; }

/* about (below the fold) */
.about { min-height: 100dvh; padding: 48px 22px 56px; border-top: 2px solid rgba(247,242,230,.12); }
.about-inner { max-width: 1100px; margin: 0 auto; }
.about h2 { font-family: "Fredoka", system-ui, sans-serif; font-size: 34px; margin: 0 0 12px; color: var(--yellow); text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.about .lead { font-size: 18px; line-height: 1.55; max-width: 820px; margin: 0 0 26px; }
.info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: rgba(247,242,230,.06); border: 2px solid rgba(247,242,230,.14); border-radius: 16px; padding: 18px 20px; }
.card h3 { font-family: "Fredoka", system-ui, sans-serif; font-size: 20px; margin: 0 0 10px; color: var(--coral); }
.card ul { margin: 0; padding-left: 18px; line-height: 1.6; font-size: 15px; }
.card li { margin-bottom: 4px; }
.card kbd { border-color: var(--cream); background: rgba(255,255,255,.12); color: var(--cream); }
.about .center { text-align: center; margin-top: 22px; justify-self: auto; }

/* narrow screens: stack, allow scrolling only there */
@media (max-width: 900px) {
  .fold { height: auto; grid-template-rows: auto 1fr auto; }
  .info { grid-template-columns: 1fr; }
  .about { padding: 32px 16px; }
  .tagline, .hint-long, .fine { display: none; }
  .plate { width: 100%; }
  .hints { flex-wrap: wrap; white-space: normal; }
  .plate-bar { flex-wrap: wrap; height: auto; padding: 8px 12px; row-gap: 6px; }
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; row-gap: 6px; }
  .top > * { min-width: 0; }
  .brand-text { font-size: 22px; }
  .links a { font-size: 12px; padding: 5px 10px; }
  .plate-bar > * { min-width: 0; }
  .version { display: none; }
  body { overflow-x: hidden; }
  .channel { white-space: normal; }
  .bottom { grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; justify-items: center; text-align: center; }
  .badge { flex-direction: column; gap: 6px; }
}
@media (max-height: 700px) { :root { --foot-h: 64px; } .badge img { height: 38px; } }
body.mobile .hints { display: none; }
