:root {
  --navy: #0a1230;
  --panel: #0d1a3a;
  --line: #2c3c70;
  --line2: #3a4a80;
  --text: #f2f4ff;
  --muted: #c9d3ea;
  --dim: #b9c5e4;
  --pink: #ff4f8b;
  --pink2: #ff6a9c;
  --cyan: #3fd6ff;
  --gold: #ffd23f;
  --green: #9be35a;
  --grey: #8d9bbf;
  --sack: #e0a3a3;
  --orange: #ffb347;
  --pixel: 'Press Start 2P', monospace;
  --label: 'Silkscreen', monospace;
  --mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--navy); color: var(--text); font-family: var(--mono); overflow: hidden; }
body.scrolling { overflow-y: auto; }
button { font: inherit; cursor: pointer; }
.px { shape-rendering: crispEdges; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cyan { color: var(--cyan); }
.pink { color: var(--pink); }
.dim { color: var(--grey); }
[hidden] { display: none !important; }

/* ---------- Scene ---------- */
#scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
#sky { position: absolute; left: 0; right: 0; top: 0; height: 52vh; transition: transform 1.4s cubic-bezier(.5,0,.3,1); }
#sky > svg:first-child { width: 100%; height: 100%; display: block; }
#goalpost { position: absolute; left: max(3vw, calc(50% - 560px)); bottom: -2px; width: 120px; height: 140px; }
#field {
  position: absolute; left: 0; right: 0; top: 52vh; bottom: 0;
  background: repeating-linear-gradient(to bottom, #23703a 0, #23703a 6vh, #1e6433 6vh, #1e6433 12vh);
  border-top: 6px solid var(--text);
  transition: top 1.4s cubic-bezier(.5,0,.3,1);
}
#field::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(12vh - 3px), rgba(242,244,255,0.55) calc(12vh - 3px), rgba(242,244,255,0.55) 12vh);
}
.yardnum { position: absolute; left: 4vw; font-family: var(--pixel); font-size: 22px; color: rgba(242,244,255,0.45); }
#dim { position: absolute; inset: 0; background: #060c20; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(255,40,80,0.55); opacity: 0; transition: opacity .3s; pointer-events: none; }
#vignette.on { opacity: 1; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 3px); }

body.onfield #sky { transform: translateY(-115%); }
body.onfield #field { top: 0; }

/* ---------- Chrome ---------- */
.iconbtn { position: fixed; left: 20px; top: 20px; z-index: 20; width: 44px; height: 44px; background: #16224a; border: 2px solid var(--line2); color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; }
.iconbtn:hover { border-color: var(--cyan); }

#hud { position: fixed; top: 14px; left: 0; right: 0; z-index: 10; display: flex; justify-content: center; align-items: flex-start; gap: clamp(16px, 12vw, 170px); pointer-events: none; }
.hudbox { width: 130px; height: 64px; background: var(--panel); border: 2px solid var(--line); padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; }
.hudbox.right { align-items: flex-end; }
.hudbox .val { font-family: var(--pixel); font-size: 18px; }
.lbl { font-family: var(--label); font-size: 12px; letter-spacing: 2px; color: var(--dim); }
.hudmid { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.pips { display: flex; gap: 4px; }
.pip { width: 16px; height: 16px; background: #1f2b55; }
.pip.cur { box-shadow: inset 0 0 0 2px var(--pink); }

main { position: relative; z-index: 5; height: 100%; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }

/* ---------- Title ---------- */
.titleblock { position: absolute; top: 9vh; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 0 16px; }
.nflchip { font-family: var(--pixel); font-size: clamp(12px, 1.6vw, 18px); color: var(--navy); background: var(--gold); padding: 8px 14px 6px; letter-spacing: 4px; }
.logo { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: clamp(28px, 8.4vw, 76px); letter-spacing: 4px; white-space: nowrap; color: var(--text); text-shadow: -4px 0 0 var(--pink), 4px 0 0 var(--cyan); }
.subtitle { font-family: var(--label); font-size: clamp(18px, 2.4vw, 30px); letter-spacing: 12px; color: var(--cyan); }
.tag { margin: 0; font-size: 15px; letter-spacing: 1px; color: var(--muted); }
.ball-mascot { position: absolute; left: calc(50% - 500px); top: 30vh; width: 56px; height: 32px; filter: drop-shadow(0 0 10px rgba(255,210,63,0.75)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-6deg); } }
.startbox { position: absolute; left: 50%; transform: translateX(-50%); top: 68vh; width: min(610px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.bigbtn { height: 84px; background: var(--panel); border: 3px solid var(--cyan); box-shadow: 0 0 0 3px var(--navy), 0 0 24px rgba(63,214,255,0.45); color: var(--text); font-family: var(--pixel); font-size: clamp(16px, 2.2vw, 24px); letter-spacing: 6px; }
.bigbtn:hover { background: #13254f; }
.bigbtn.small { height: 64px; padding: 0 28px; font-size: 16px; border-color: var(--pink); box-shadow: 0 0 0 3px var(--navy), 0 0 20px rgba(255,79,139,0.4); }
.startrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; }
.chip { font-family: var(--label); font-size: 15px; letter-spacing: 2px; background: rgba(10,18,48,0.8); padding: 6px 10px; }
.smallbtn { font-family: var(--label); font-size: 14px; letter-spacing: 2px; color: var(--text); background: var(--panel); border: 2px solid var(--line2); padding: 10px 14px; }
.smallbtn:hover { border-color: var(--cyan); }

/* ---------- Prompt ---------- */
.promptcard { position: absolute; left: 50%; top: 22vh; transform: translateX(-50%); width: min(520px, 92vw); background: var(--panel); border: 2px solid var(--line); box-shadow: 6px 6px 0 rgba(4,8,22,0.6); padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; }
.kicker { font-family: var(--label); font-size: 14px; letter-spacing: 5px; color: var(--pink2); }
.promptcard h2 { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: clamp(16px, 2.1vw, 22px); line-height: 1.6; color: var(--text); }
.hint { font-family: var(--label); font-size: 13px; letter-spacing: 2px; color: var(--dim); }
.pill { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--line); padding: 10px 18px; font-family: var(--label); font-size: 14px; letter-spacing: 3px; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--cyan); }
.toast { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); max-width: 92vw; background: var(--panel); border: 2px solid var(--line); padding: 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: pop .18s ease-out; }
.toast .main { font-size: 16px; }
.toast .sub { font-family: var(--label); font-size: 12px; letter-spacing: 2px; color: var(--dim); }
.toast.warn { border-color: #6a4a20; background: rgba(13,26,58,0.92); }
.toast.warn .main { color: var(--orange); font-size: 15px; }
@keyframes pop { from { transform: translate(-50%, 6px); opacity: 0; } }
.inputbar { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 34px; background: rgba(6,10,28,0.9); display: flex; justify-content: center; align-items: center; gap: 14px; }
.dial { width: 70px; height: 70px; flex-shrink: 0; border-radius: 50%; border: 3px solid var(--cyan); background: var(--panel); display: flex; align-items: center; justify-content: center; font-family: var(--pixel); font-size: 18px; color: var(--cyan); }
.dial.hot { border-color: var(--pink); color: var(--pink); }
.inputwrap { width: min(440px, 60vw); display: flex; flex-direction: column; gap: 6px; }
#answer { height: 60px; background: var(--navy); border: 2px solid var(--cyan); color: var(--text); font-family: var(--mono); font-size: 22px; padding: 0 16px; outline: none; width: 100%; }
#answer:focus { box-shadow: 0 0 0 3px rgba(63,214,255,0.25); }
.clockbar { height: 4px; background: #1f2b55; }
#clockFill { height: 4px; width: 100%; background: var(--cyan); transition: width .1s linear; }
.hike { height: 60px; width: 110px; flex-shrink: 0; background: var(--pink); border: 2px solid #ffd0e0; color: var(--navy); font-family: var(--pixel); font-size: 16px; letter-spacing: 2px; }
.hike:hover { filter: brightness(1.1); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Flight ---------- */
#lines { position: absolute; inset: 0; }
.tline { position: absolute; left: 12vw; right: 12vw; border-top: 2px dashed; }
.tline span { position: absolute; right: 0; top: -22px; font-family: var(--label); font-size: 13px; letter-spacing: 2px; }
.tline.solid { border-top-style: solid; border-top-width: 3px; }
.tline.passed span { animation: flash .5s; }
@keyframes flash { 50% { color: #fff; text-shadow: 0 0 10px #fff; } }
.endzone { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,79,139,0.2); display: flex; align-items: center; justify-content: center; font-family: var(--pixel); font-size: clamp(18px, 3vw, 28px); letter-spacing: 3vw; color: rgba(242,244,255,0.35); }
#flyer { position: absolute; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
#flyBall { width: 70px; height: 40px; filter: drop-shadow(0 0 14px rgba(255,210,63,0.85)); animation: spin .5s linear infinite; }
@keyframes spin { 50% { transform: rotate(25deg) scale(1.05); } }
#flyCard { transform: rotate(-4deg); background: var(--panel); border: 2px solid var(--pink); box-shadow: 6px 6px 0 rgba(4,8,22,0.6); padding: 12px 22px; font-family: var(--pixel); font-size: clamp(12px, 1.6vw, 18px); letter-spacing: 2px; color: var(--pink2); white-space: nowrap; }

/* ---------- Result ---------- */
.resultblock { position: absolute; left: 0; right: 0; top: 16vh; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; padding: 0 16px; }
#resIcon { height: 90px; display: flex; align-items: center; justify-content: center; }
#resTier { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: clamp(26px, 4.4vw, 48px); letter-spacing: 6px; }
#resAnswer { font-size: 24px; color: var(--text); }
.respts { font-family: var(--pixel); font-size: 18px; }
.flavor { font-family: var(--label); font-size: 15px; letter-spacing: 3px; color: var(--muted); margin-bottom: 16px; }
.pop-in { animation: popin .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }

/* ---------- Summary ---------- */
#s-summary { overflow-y: auto; background: rgba(10,18,48,0.94); }
.summary { width: min(780px, 92vw); margin: 0 auto; padding: 84px 0 60px; display: flex; flex-direction: column; gap: 28px; }
.sumhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.minilogo { font-family: var(--pixel); font-size: 16px; text-shadow: -2px 0 0 var(--pink), 2px 0 0 var(--cyan); }
.bigscore { display: flex; align-items: baseline; gap: 14px; }
#sumScore { font-family: var(--pixel); font-size: clamp(40px, 7vw, 64px); }
.of { color: var(--dim); }
.curvewrap { display: flex; flex-direction: column; gap: 10px; }
#curve { width: 100%; height: 120px; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.rank { font-family: var(--label); font-size: 14px; letter-spacing: 3px; color: var(--cyan); }
.block { display: flex; flex-direction: column; gap: 12px; }
.chart { height: 230px; position: relative; background: repeating-linear-gradient(to bottom, #123f24 0, #123f24 46px, #0f3720 46px, #0f3720 92px); border: 2px solid var(--line); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.col { position: relative; }
.col .stem { position: absolute; left: 50%; top: 0; width: 2px; }
.col .dot { position: absolute; left: calc(50% - 8px); width: 16px; height: 16px; }
.col .dot.empty { border: 2px dashed var(--grey); top: 4px; }
.chartnums { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: 12px; color: var(--dim); }
.playbook { background: var(--panel); border: 2px solid var(--line); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.playbook .you { color: var(--cyan); }
.playbook b { color: var(--text); font-weight: 400; }
.btnrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pinkbtn { height: 52px; background: var(--pink); border: 2px solid #ffd0e0; color: var(--navy); font-family: var(--label); font-size: 15px; letter-spacing: 2px; padding: 0 18px; }
.outbtn { height: 52px; background: var(--panel); border: 2px solid var(--cyan); color: var(--text); font-family: var(--label); font-size: 15px; letter-spacing: 2px; }
.outbtn.dim { border-color: var(--line2); color: var(--text); }
.filmrow { width: 100%; display: grid; grid-template-columns: 30px 1fr 70px; align-items: center; gap: 12px; text-align: left; background: transparent; border: 0; border-top: 1px solid #1f2b55; padding: 12px 0; color: var(--text); }
.filmrow:hover { background: rgba(63,214,255,0.05); }
.filmrow .q { font-family: var(--label); font-size: 11px; letter-spacing: 2px; color: var(--dim); display: block; }
.filmrow .a { font-size: 16px; }
.filmrow .p { text-align: right; }
.filmdetail { margin: 0 0 12px 42px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.filmdetail .tierrow { display: flex; justify-content: space-between; gap: 12px; }
.filmdetail .names { line-height: 1.6; }
.filmdetail .mine { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.filmdetail .blurb { display: block; font-size: 12px; color: var(--dim); }
.logbook { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--label); font-size: 13px; letter-spacing: 2px; color: var(--dim); }

/* tier colors */
.t-td { color: var(--gold); } .t-hm { color: var(--pink2); } .t-post { color: var(--cyan); }
.t-curl { color: var(--green); } .t-check { color: var(--muted); } .t-sack { color: var(--sack); } .t-delay { color: var(--grey); }

/* ---------- Dialog ---------- */
dialog { background: var(--panel); color: var(--text); border: 3px solid var(--cyan); padding: 26px 28px; max-width: min(520px, 92vw); font-family: var(--mono); font-size: 15px; line-height: 1.6; }
dialog::backdrop { background: rgba(4,8,22,0.75); }
dialog h2 { margin: 0 0 10px; font-family: var(--pixel); font-weight: 400; font-size: 18px; color: var(--cyan); }
.tierlist { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.tierlist span { font-family: var(--label); display: inline-block; min-width: 120px; }

@media (max-width: 1000px) {
  #goalpost { width: 80px; height: 94px; }
  .ball-mascot { left: 4vw; top: 34vh; }
}
@media (max-width: 700px) {
  #hud { justify-content: space-between; gap: 6px; padding: 0 10px 0 74px; }
  .hudbox { width: 76px; height: 52px; padding: 6px 8px; }
  .hudbox .lbl { font-size: 10px; letter-spacing: 1px; }
  .pill { white-space: normal; width: 90vw; text-align: center; font-size: 12px; letter-spacing: 2px; }
  .hudbox .val { font-size: 14px; }
  .pip { width: 12px; height: 12px; }
  .inputbar { gap: 8px; padding: 16px 10px 24px; }
  .dial { width: 52px; height: 52px; font-size: 14px; }
  .hike { width: 84px; font-size: 13px; }
  #answer { font-size: 18px; }
  .ball-mascot, #goalpost { display: none; }
  .btnrow { grid-template-columns: 1fr; }
  .promptcard { top: 18vh; }
}

/* Keep the start button on one line on phones. */
.bigbtn { white-space: nowrap; }
@media (max-width: 700px) { #kickoffBtn { letter-spacing: 3px; font-size: 14px; } }
