:root {
  --bg: #0b1410; --panel: #12201a; --panel2: #182b22; --line: #2a4436;
  --text: #eef5f0; --muted: #8fa89a; --accent: #ffd23f; --accent2: #3ee08f; --boost: #ffb13b;
  --danger: #ff5a5f; --home: #7a5cff; --home-d: #5a3fd6; --away: #c0262d; --away-d: #9e1e24;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.h { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em; }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud .stickzone { pointer-events: auto; }
.sb { position: absolute; top: calc(10px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch;
  background: rgba(8, 14, 11, .88); border: 1px solid #ffffff22; border-radius: 12px; overflow: hidden;
  box-shadow: 0 6px 20px #0008; font-weight: 800; }
.sb .tm { display: flex; align-items: center; gap: 7px; padding: 5px 10px; }
.sb .tm .ab { font-size: 13px; letter-spacing: .06em; }
.sb .tm .sc { font-size: 22px; font-weight: 900; min-width: 20px; text-align: center; }
.sb .home { background: linear-gradient(90deg, var(--home), var(--home-d)); }
.sb .away { background: linear-gradient(90deg, var(--away-d), var(--away)); }
.sb .mid { white-space: nowrap; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2px 11px; font-size: 10px; color: var(--muted); min-width: 74px; }
.sb .mid b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.sb .mid b.ot { color: var(--accent); }
.pause { position: absolute; top: calc(12px + var(--sat)); right: calc(12px + var(--sar)); width: 38px; height: 38px; border-radius: 10px; border: 1px solid #ffffff2a;
  background: rgba(8, 14, 11, .8); font-weight: 900; display: grid; place-items: center; font-size: 13px; }
.sit { position: absolute; top: calc(60px + var(--sat)); left: 50%; transform: translateX(-50%); background: var(--accent); color: #1a1400;
  font-weight: 900; font-size: 12px; padding: 3px 10px; border-radius: 999px; letter-spacing: .04em; white-space: nowrap; }
.sit.hot { background: var(--danger); color: #fff; }
.feed { position: absolute; top: calc(88px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.feed div { background: rgba(8, 14, 11, .85); border: 1px solid #ffffff1c; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; animation: fin .2s ease-out; }
.feed b.h0 { color: #b9a8ff; } .feed b.h1 { color: #ff9a9d; } .feed i { color: var(--accent); font-style: normal; font-weight: 900; }
@keyframes fin { from { opacity: 0; transform: translateY(-4px); } }
.tip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(150px + var(--sat)); background: rgba(8, 14, 11, .9);
  border: 1px solid #ffffff22; border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 10px; font-size: 13px;
  width: max-content; max-width: min(92vw, 460px); line-height: 1.35; }
.tip b { color: var(--accent); }

/* touch controls */
.stickzone { position: absolute; left: 0; bottom: 0; width: 55vw; height: 62vh; touch-action: none; }
.stick { position: absolute; left: calc(28px + var(--sal)); bottom: calc(42px + var(--sab)); width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff14, #ffffff08); border: 2px solid #ffffff30; transition: opacity .2s; }
.stick.idle { opacity: .55; }
.knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffffcc, #ffffff66); box-shadow: 0 4px 12px #0007; }
.btns { position: absolute; right: calc(18px + var(--sar)); bottom: calc(30px + var(--sab)); width: 210px; height: 190px; pointer-events: none; }
.tb { position: absolute; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; text-align: center;
  border: 2px solid #ffffff55; box-shadow: 0 6px 16px #0008; line-height: 1.05; letter-spacing: .02em; touch-action: none; pointer-events: auto; transition: transform .06s; }
.tb.down { transform: scale(.93); filter: brightness(1.15); }
.tb small { display: block; font-size: 9px; opacity: .75; font-weight: 800; margin-top: 3px; }
.tb.boost { right: 0; bottom: 0; width: 112px; height: 112px; background: radial-gradient(circle at 35% 30%, #ffd08a, #f07a1a); color: #2a1200; font-size: 14px; }
.tb.boost svg { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.tb.boost b { font-size: 22px; line-height: 1; font-style: italic; }
.tb.boost.empty { filter: grayscale(.7) brightness(.8); }
.tb.jump { right: 124px; bottom: 6px; width: 82px; height: 82px; background: radial-gradient(circle at 35% 30%, #7af0b4, #1fb46d); color: #00230f; font-size: 14px; }
.tb.jump.air { background: radial-gradient(circle at 35% 30%, #a3f7ff, #22a5c7); color: #001a22; }
svg .trk { fill: none; stroke: #0007; stroke-width: 7; }
svg .val { fill: none; stroke: var(--boost); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .08s linear; }

/* desktop boost gauge */
.gauge { position: absolute; right: calc(20px + var(--sar)); bottom: calc(20px + var(--sab)); width: 112px; height: 112px; border-radius: 50%; background: rgba(8, 14, 11, .85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #ffffff1c; }
.gauge svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); }
.gauge b { font-size: 32px; font-weight: 900; font-style: italic; line-height: 1; }
.gauge span { font-size: 9px; font-weight: 900; color: var(--muted); letter-spacing: .14em; }

/* desktop extras */
.keys { position: absolute; bottom: calc(12px + var(--sab)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 300px); }
.key { white-space: nowrap; background: rgba(8, 14, 11, .88); border: 1px solid #ffffff22; border-radius: 8px; padding: 4px 8px; }
.key kbd { font-family: inherit; font-weight: 900; color: var(--text); background: #ffffff14; border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
.radar { position: absolute; right: calc(14px + var(--sar)); top: calc(60px + var(--sat)); background: rgba(8, 14, 11, .82); border: 1px solid #ffffff22; border-radius: 10px; padding: 6px; }
.radar canvas { display: block; width: 168px; height: 108px; }

.banner { position: absolute; left: 0; right: 0; top: 34%; text-align: center; }
.banner .big { font-size: min(76px, 17vw); color: var(--accent); text-shadow: 0 4px 0 #0007, 0 0 30px #ffd23f66; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.banner.bad .big { color: #ff8a8d; text-shadow: 0 4px 0 #0007, 0 0 30px #ff5a5f55; }
.banner.info .big { font-size: min(46px, 11vw); color: var(--text); }
.banner.count .big { font-size: min(110px, 24vw); color: var(--text); }
.banner .small { font-size: min(14px, 3.4vw); font-weight: 800; letter-spacing: .1em; padding: 0 12px; text-shadow: 0 2px 6px #000a; text-transform: uppercase; }
.banner .rep { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 900; letter-spacing: .1em; background: rgba(8, 14, 11, .85); border: 1px solid #ffffff2a;
  border-radius: 999px; padding: 8px 14px; color: var(--text); pointer-events: auto; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.replaytag { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--sab)); background: var(--danger); color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .12em; padding: 5px 12px; border-radius: 999px; }
body.replay #touch, body.replay .gauge, body.replay .keys, body.replay .feed, body.replay .tip, body.replay .sit { display: none; }

/* ------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  background: radial-gradient(120% 60% at 50% 0%, #1e4a30 0%, var(--bg) 60%); padding: var(--sat) var(--sar) var(--sab) var(--sal); }
.screen.overlay { background: rgba(6, 11, 8, .86); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.screen .wrap { padding: 22px 16px 28px; max-width: 540px; margin: 0 auto; }
.logo { text-align: center; margin: 6px 0 14px; }
.logo .t1, .logo .t2 { font-size: 40px; line-height: .9; }
.logo .t2 { color: var(--accent); }
.logo .sub { color: var(--muted); font-size: 11px; letter-spacing: .3em; margin-top: 6px; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.card p, .card li { font-size: 13px; line-height: 1.45; color: #cfdcd4; }
.card ul { padding-left: 18px; display: grid; gap: 5px; }
.card b { color: var(--text); }
.lbl { font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .14em; margin-bottom: 8px; text-transform: uppercase; }
.lbl.mt { margin-top: 12px; }
.teams { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; flex: 1; }
.team { border-radius: 10px; padding: 6px 0 5px; text-align: center; font-size: 10px; font-weight: 900; border: 2px solid transparent; background: var(--panel2); }
.team .dot { width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 4px; border: 3px solid; }
.team.sel { border-color: var(--accent); background: #2a2a10; }
.team.off { opacity: .3; pointer-events: none; }
.vs { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.inp { width: 100%; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-weight: 800; font-size: 15px; text-transform: uppercase; user-select: text; -webkit-user-select: text; outline: none; margin-bottom: 6px; }
.inp:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel2); border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.chip.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.player { display: flex; gap: 12px; align-items: center; }
.carprev { width: 96px; height: 64px; flex: 0 0 96px; background: radial-gradient(circle at 50% 60%, #1e6c35, #12201a 75%); border-radius: 12px; border: 1px solid var(--line); }
.pinfo { flex: 1; min-width: 0; }
.note { font-size: 11px; color: var(--muted); }
.hint { font-size: 11px; color: var(--muted); margin-top: 9px; line-height: 1.35; }
.hint b { color: var(--accent); }
.go { display: block; width: 100%; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #ffe066, #f0b400);
  color: #241900; font-size: 20px; box-shadow: 0 8px 20px #f0b40044; text-align: center; }
.go:active { transform: translateY(1px); }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.set { background: var(--panel2); border-radius: 10px; padding: 8px 9px; display: flex; justify-content: space-between; align-items: center; gap: 6px; text-align: left; }
.set b { color: var(--accent); white-space: nowrap; }
.record { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 12px; letter-spacing: .04em; }
.foot { display: flex; justify-content: center; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.link { color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; gap: 10px; }
.head .t { font-size: 26px; }
.head .s { font-size: 12px; color: var(--muted); font-weight: 700; text-align: right; }
.btn { padding: 9px 12px; border-radius: 10px; font-weight: 900; font-size: 13px; letter-spacing: .03em; }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg button { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 2px; text-align: center; font-size: 13px; font-weight: 900; line-height: 1.15; text-transform: uppercase; font-style: italic; }
.seg button.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }

/* scoreboard tables */
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px 8px; margin-bottom: 10px; font-size: 12px; overflow-x: auto; }
.board table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th { color: var(--muted); font-size: 10px; letter-spacing: .08em; font-weight: 900; text-align: center; padding: 5px 3px; }
.board th:first-child, .board td:first-child { text-align: left; }
.board td { padding: 6px 3px; text-align: center; font-weight: 800; border-top: 1px solid #ffffff10; }
.board td.nm { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.board td.nm i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.board tr.you td { color: var(--accent); }
.board tr.sep td { border-top: 2px solid var(--line); }
.board .mvp { font-size: 9px; background: var(--accent); color: #1a1400; border-radius: 4px; padding: 1px 4px; margin-left: 5px; font-style: italic; }
.statgrid.small { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.statgrid.small div { background: var(--panel2); border-radius: 10px; padding: 7px 4px; }
.statgrid.small b { display: block; font-size: 18px; }
.statgrid.small span { font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ft-head { text-align: center; font-size: 34px; color: var(--accent); margin-top: 8px; }
.ft-head.bad { color: #ff8a8d; }
.ft-score { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 8px 0 6px; font-weight: 900; font-size: 15px; letter-spacing: .06em; }
.ft-score b { font-size: 46px; font-style: italic; }
.ft-goals { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.card.you .rating { display: flex; align-items: baseline; gap: 8px; justify-content: center; margin-bottom: 10px; }
.card.you .rating b { font-size: 40px; font-style: italic; color: var(--accent); }
.card.you .rating span { color: var(--muted); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }
.card.you .rating span.mvp { color: #1a1400; background: var(--accent); border-radius: 6px; padding: 2px 7px; font-style: italic; }

@media (max-height: 560px) and (orientation: landscape) {
  .feed { top: calc(56px + var(--sat)); left: calc(14px + var(--sal)); transform: none; align-items: flex-start; }
  .sit { top: calc(56px + var(--sat)); }
  .tip { top: auto; bottom: calc(14px + var(--sab)); }
  .stickzone { height: 100vh; width: 50vw; }
  .stick { bottom: calc(24px + var(--sab)); }
  .btns { bottom: calc(16px + var(--sab)); }
  .banner { top: 26%; }
}
@media (min-width: 900px) { .feed { top: calc(60px + var(--sat)); left: calc(14px + var(--sal)); transform: none; align-items: flex-start; } }

/* Studio credit and link back to the games page, the same on every Game Golem Studios title screen */
.ggs-foot { text-align: center; font-size: 11px; margin-top: 12px; }
.ggs-foot a { color: var(--muted); text-underline-offset: 2px; }

/* multiplayer */
.card.mp { margin-top: 10px; }
.mprow { display: flex; gap: 6px; align-items: center; }
.mprow .or { color: var(--muted); font-size: 11px; font-weight: 800; }
.mprow .btn { white-space: nowrap; }
.mprow .btn:disabled { opacity: .5; }
.inp.code { margin: 0; flex: 1; min-width: 70px; text-align: center; letter-spacing: .3em; font-size: 16px; }
#mp-err:empty { display: none; }
#mp-err { color: #ffb0b2; }
.codecard { text-align: center; }
.roomcode { font-size: 54px; letter-spacing: .22em; color: var(--accent); line-height: 1.05; margin: 2px 0 6px; padding-left: .22em; }
.lbteams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lbteams .card { margin-bottom: 8px; }
.lbh { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; }
.lbh i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid; flex: 0 0 auto; }
.lbp { background: var(--panel2); border-radius: 8px; padding: 7px 8px; font-size: 13px; font-weight: 800; margin-top: 5px; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; }
.lbp.you { color: var(--accent); }
.lbp.bot { color: var(--muted); font-style: italic; font-weight: 700; background: none; border: 1px dashed var(--line); }
.lbp .tag { font-size: 9px; background: #ffffff1a; color: var(--text); border-radius: 4px; padding: 1px 4px; letter-spacing: .06em; }
.lbp .tag.you { background: var(--accent); color: #1a1400; }
.btn.wide { width: 100%; margin-bottom: 10px; }
.settings.mt { margin-top: 10px; }
.seg button:disabled { opacity: .3; }
#ft-again:disabled { filter: grayscale(.8); opacity: .7; }
/* Online play: the Online / Local tabs and the studio's server list */
.seg.two { grid-template-columns: repeat(2, 1fr); }
.seg.qpm { margin-bottom: 6px; }
.mptabs { margin-bottom: 10px; }
.btn.qp { background: var(--accent); color: #1a1400; border-color: var(--accent); font-size: 15px; padding: 11px 12px; }
.btn.qp.wait { background: var(--panel2); color: var(--text); border-color: var(--line); }
.srvl { display: flex; flex-direction: column; gap: 5px; }
.srow { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: left; width: 100%; }
.srow:hover { border-color: var(--accent); }
.srow.off { opacity: .5; }
.srow div { flex: 1; min-width: 0; }
.srow b { display: block; font-size: 13px; }
.srow small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow span { font-weight: 900; font-size: 12px; color: var(--accent2); white-space: nowrap; }
.srow.off span { color: var(--muted); }
