/* Fusebound. Pixel headings (Pixelify Sans), readable body (Nunito), a night
   pitch: navy, team orange and teal. Phone first; the field takes the width. */
:root {
  --bg: #0f1428; --bg2: #18203d; --panel: #1c2547; --line: #2e3a6b; --text: #e8ecff; --dim: #9aa5cf;
  --t0: #ff8a3d; --t1: #38c6c0; --good: #7dff7a; --bad: #ff5a4a; --fuse: #ffd34d;
  --px: 'Pixelify Sans', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 600 15px/1.45 Nunito, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app { max-width: 1100px; margin: 0 auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
h1, h2, .score, .banner, .turn { font-family: var(--px); letter-spacing: .02em; }
.t0 { color: var(--t0); } .t1 { color: var(--t1); } .g { color: var(--good); } .r { color: var(--bad); }
.t0bg { background: var(--t0); }
.sub { color: var(--dim); font-size: .9em; }

/* chunky pixel buttons */
.seg button, .play, .acts button, .sheet .row button, .map {
  background: var(--panel); border-radius: 6px; box-shadow: inset 0 -3px 0 #0005, 0 0 0 2px var(--line);
  padding: .55rem .8rem; min-height: 44px; transition: transform .05s;
}
.seg button:active, .play:active, .acts button:active, .map:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 #0005, 0 0 0 2px var(--line); }
button.on, .seg button.on { box-shadow: inset 0 -3px 0 #0005, 0 0 0 2px var(--t0); background: #3a2a2a; }
button.go, .play { background: var(--t0); color: #1a1206; font-family: var(--px); font-size: 1.05rem; box-shadow: inset 0 -4px 0 #0004, 0 0 0 2px #ffb47a; }
button:disabled { opacity: .4; }

/* home */
.home { padding: 1rem; display: grid; gap: 1rem; max-width: 640px; margin: 0 auto; }
.brand { display: flex; gap: .9rem; align-items: center; margin-top: .5rem; }
.brand img { image-rendering: pixelated; border-radius: 14px; }
.brand h1 { margin: 0; font-size: 2.1rem; line-height: 1; color: #fff; text-shadow: 3px 3px 0 var(--t0), 6px 6px 0 #0006; }
.brand p { margin: .25rem 0 0; color: var(--dim); }
.panel { background: var(--bg2); border-radius: 12px; padding: .9rem; box-shadow: 0 0 0 2px var(--line); }
.panel h2 { font-size: 1rem; margin: .6rem 0 .45rem; color: var(--fuse); }
.panel h2:first-child { margin-top: 0; }
.maps { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.map { display: grid; gap: .3rem; justify-items: center; padding: .5rem; }
.map .thumb canvas { width: 100%; max-width: 160px; image-rendering: pixelated; border-radius: 3px; display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .45rem; }
.seg button { display: grid; justify-items: center; line-height: 1.2; }
.seg small { color: var(--dim); font-weight: 600; font-size: .75rem; }
.play { width: 100%; margin-top: 1rem; padding: .85rem; font-size: 1.3rem; }
.links { display: flex; justify-content: center; gap: 1.2rem; }
.link { color: var(--dim); text-decoration: underline; padding: .5rem; }
footer { text-align: center; color: #5d6896; font-size: .75rem; padding-bottom: 1rem; }

/* match */
.match { display: flex; flex-direction: column; gap: .45rem; padding: .4rem .4rem 1rem; }
.hud { display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .2rem .3rem; }
.hud .icon { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 6px; background: var(--panel); box-shadow: 0 0 0 2px var(--line); }
.score { flex: 1; display: flex; gap: .5rem; align-items: baseline; justify-content: center; font-size: 1.15rem; }
.score b { font-size: 1.7rem; color: #fff; min-width: 1ch; text-align: center; }
.score i { color: var(--dim); font-style: normal; }
.turn { color: var(--dim); font-size: .9rem; white-space: nowrap; }
.fieldbox { position: relative; width: 100%; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 2px var(--line); background: #0f1428; }
.fieldbox canvas { display: block; touch-action: none; image-rendering: pixelated; }
.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: clamp(2rem, 9vw, 4.5rem); color: #fff; text-shadow: 4px 4px 0 var(--t0), 8px 8px 0 #0008; opacity: 0; }
.banner.show { animation: banner 1.1s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.08); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05); } }
.say .recap { color: var(--fuse); }
.say { margin: 0; min-height: 2.9em; padding: .1rem .3rem; color: #d6dcff; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.acts button { min-height: 64px; font-family: var(--px); font-size: 1.35rem; }
.acts button:disabled { opacity: .3; }

/* sheets */
.sheet { position: fixed; inset: 0; background: #070a18cc; display: grid; place-items: center; padding: 1rem; z-index: 10; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet .card { background: var(--bg2); border-radius: 12px; box-shadow: 0 0 0 2px var(--line), 0 20px 60px #0008; padding: 1.1rem; max-width: 520px; width: 100%; max-height: 90dvh; overflow: auto; }
.sheet h2 { margin: 0 0 .5rem; color: var(--fuse); }
.sheet ul { padding-left: 1.1rem; }
.sheet li { margin: .35rem 0; }
.sheet .row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.sheet .row button { flex: 1 1 auto; }
.result { font-size: 2rem; text-align: center; }
.result.w { color: var(--good); } .result.l { color: var(--bad); }
.big { font-family: var(--px); font-size: 2.6rem; text-align: center; margin: .2rem 0; }
.fatal { padding: 2rem; text-align: center; }

@media (min-width: 760px) {
  .match { padding: 1rem; }
  .maps { grid-template-columns: repeat(4, 1fr); }
}
