:root {
  --bg: #120d0a; --panel: #1f1712; --panel2: #2a2019; --line: #46362a;
  --text: #f7f1ea; --muted: #b39f8c; --accent: #ffd23f; --accent2: #3ee08f;
  --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, #hud .meter { pointer-events: auto; }
.sb { position: absolute; top: calc(10px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch;
  background: rgba(18, 12, 8, .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; }
.poss { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; visibility: hidden; }
.poss.on { visibility: visible; }
.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(18, 12, 8, .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; }
.tip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(92px + var(--sat)); background: rgba(18, 12, 8, .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); }
.auto { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(200px + var(--sab)); background: rgba(18, 12, 8, .85);
  border: 1px solid #ffffff22; border-radius: 999px; padding: 4px 11px; font-size: 11px; font-weight: 900; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.auto { bottom: calc(250px + var(--sab)); }
body.desk .auto { bottom: calc(70px + var(--sab)); }

/* touch controls */
.stickzone { position: absolute; left: 0; bottom: 0; width: 46vw; max-width: 260px; height: 250px; 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; }
.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: 190px; height: 180px; 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.a { right: 0; bottom: 0; width: 104px; height: 104px; background: radial-gradient(circle at 35% 30%, #ffe57a, #f0b400); color: #2a1e00; font-size: 15px; }
.tb.b { right: 112px; bottom: 8px; width: 70px; height: 70px; background: radial-gradient(circle at 35% 30%, #7af0b4, #1fb46d); color: #00230f; font-size: 11px; }
.tb.s { right: 24px; bottom: 116px; width: 62px; height: 62px; background: radial-gradient(circle at 35% 30%, #8fb3ff, #3a64d8); color: #fff; font-size: 10px; }
.tb.a.def { background: radial-gradient(circle at 35% 30%, #ff9a9d, #e0353b); color: #fff; }
.tb small { display: block; font-size: 9px; opacity: .75; font-weight: 800; margin-top: 2px; }
.tb.a.charge { box-shadow: 0 0 0 6px #ffd23f55, 0 0 0 12px #ffd23f22, 0 6px 16px #0008; }
.tb .ring { position: absolute; inset: -7px; border-radius: 50%; }

/* stamina */
.stam { position: absolute; right: calc(24px + var(--sar)); bottom: calc(214px + var(--sab)); width: 76px; font-size: 8px; font-weight: 900; color: var(--muted); letter-spacing: .1em; text-align: center; }
.stam .bar { height: 5px; border-radius: 3px; background: #0008; margin-top: 3px; overflow: hidden; border: 1px solid #ffffff1a; }
.stam .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3ee08f, #b6f04a); }
.stam .bar i.low { background: linear-gradient(90deg, #ff5a5f, #ffb13b); }
body.desk .stam { right: auto; left: calc(14px + var(--sal)); bottom: calc(14px + var(--sab)); width: 190px; text-align: left; background: rgba(18, 12, 8, .85);
  border: 1px solid #ffffff1a; border-radius: 10px; padding: 7px 10px; font-size: 10px; }
body.desk .stam .bar { height: 7px; }

/* 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 - 440px); }
.key { white-space: nowrap; background: rgba(18, 12, 8, .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; }

.banner { position: absolute; left: 0; right: 0; top: 40%; text-align: center; }
.banner .big { font-size: min(72px, 16vw); color: var(--accent); text-shadow: 0 4px 0 #0007, 0 0 30px #ffd23f66; animation: pop .5s 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 .small { font-size: min(14px, 3.4vw); font-weight: 800; letter-spacing: .18em; 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(18, 12, 8, .85); border: 1px solid #ffffff2a;
  border-radius: 999px; padding: 7px 13px; color: var(--text); pointer-events: auto; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ------------------------------------------------------------ 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%, #5a3317 0%, var(--bg) 60%); padding: var(--sat) var(--sar) var(--sab) var(--sal); }
.screen.overlay { background: rgba(14, 9, 6, .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; }
.row { display: flex; gap: 8px; margin-bottom: 8px; }
.inp { flex: 1; 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; }
.inp:focus { border-color: var(--accent); }
.inp.num { flex: 0 0 64px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel2); border: 1px solid var(--line); padding: 7px 11px; 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; }
.pinfo { flex: 1; min-width: 0; }
.note { font-size: 11px; color: var(--muted); }
.jersey { width: 64px; height: 70px; flex: 0 0 64px; border-radius: 12px 12px 8px 8px; background: var(--home); border: 3px solid #f2c94c;
  display: grid; place-items: center; font-size: 28px; font-weight: 900; color: #f2c94c; }
.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; }
.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; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.play { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: left; }
.play.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.play canvas { width: 100%; height: 84px; display: block; background: #b9834e; }
.play .nm { padding: 7px 9px 2px; font-weight: 900; font-size: 14px; }
.play .ds { padding: 0 9px 5px; font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.play .you { margin: 0 9px 9px; font-size: 10px; font-weight: 900; color: var(--accent); }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg button { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 2px; text-align: center; font-size: 10px; font-weight: 900; line-height: 1.15; text-transform: uppercase; }
.seg button.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.statgrid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; }
.statgrid .v { font-weight: 900; font-variant-numeric: tabular-nums; }
.statgrid .v.r { text-align: right; }
.statgrid .k { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; align-self: center; }
.statgrid.small { grid-template-columns: repeat(3, 1fr); background: none; border: 0; padding: 0; margin: 0; 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: 30px; color: var(--accent); margin-top: 8px; }
.ft-head.bad { color: #ff8a8d; } .ft-head.draw { color: var(--text); }
.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; }

/* scoreboard extras */
.sb .shot { display: flex; align-items: center; justify-content: center; min-width: 34px; padding: 0 7px; background: #000; color: #ffb13b; font-size: 17px; font-weight: 900;
  font-variant-numeric: tabular-nums; border-left: 1px solid #ffffff22; border-right: 1px solid #ffffff22; }
.sb .shot.low { color: #ff5a5f; }
.sb .bonus { font-size: 8px; letter-spacing: .08em; opacity: .9; visibility: hidden; }
.sb .bonus.on { visibility: visible; }
.tb.a.ft { background: radial-gradient(circle at 35% 30%, #ffe57a, #f0b400); }
.tb.off { opacity: .35; }
.tb.b.def { background: radial-gradient(circle at 35% 30%, #ffc27a, #e07b1f); color: #2a1300; }

/* line score on the full-time screen */
.lines { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 10px; font-size: 13px; }
.lines th, .lines td { padding: 6px 4px; text-align: center; font-variant-numeric: tabular-nums; }
.lines th { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.lines td:first-child, .lines th:first-child { text-align: left; padding-left: 12px; font-weight: 900; }
.lines td:last-child { font-weight: 900; color: var(--accent); }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.style { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; text-align: left; }
.style b { display: block; font-size: 12px; }
.style span { display: block; font-size: 10px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.style.sel { border-color: var(--accent); background: #2f2810; }
.grade { font-size: 40px; font-style: italic; color: var(--accent); font-weight: 900; }

@media (max-height: 560px) and (orientation: landscape) {
  .tip { top: calc(56px + var(--sat)); }
  .auto { bottom: calc(12px + var(--sab)); }
  .sb .tm { padding: 3px 8px; }
  .sb .tm .sc { font-size: 18px; }
  .sit { top: calc(48px + var(--sat)); }
}
.ft-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; }
.ft-score span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-score span:first-child { text-align: right; }
.ft-score b { white-space: nowrap; font-size: 42px; }

/* 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; }

/* play with friends */
.go2 { display: block; width: 100%; padding: 11px; border-radius: 14px; margin-top: 8px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 16px; text-align: center; }
.go2:active { transform: translateY(1px); }
.card .mt, .note.mt { margin-top: 8px; }
.inp.code { text-align: center; letter-spacing: .4em; font-size: 22px; font-weight: 900; }
.roomcard { text-align: center; }
.roomcode { font-size: 56px; letter-spacing: .18em; color: var(--accent); line-height: 1.1; margin: 2px 0 6px; user-select: text; -webkit-user-select: text; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg2 button { background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 9px 6px; font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.seg2 button .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid; }
.seg2 button.sel { border-color: var(--accent); background: #2f2810; }
.plist { display: grid; gap: 6px; }
.prow { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.prow .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.prow .nm { font-weight: 900; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .ps { color: var(--muted); font-weight: 800; font-size: 11px; letter-spacing: .06em; }
.prow .tag { font-size: 9px; font-weight: 900; letter-spacing: .1em; color: #1a1400; background: var(--accent); border-radius: 999px; padding: 2px 6px; }
.prow .tag.warn { background: var(--danger); color: #fff; }
.waiting { text-align: center; color: var(--muted); font-weight: 800; margin-top: 12px; letter-spacing: .04em; }
.mperr { background: #3a1416; border: 1px solid #ff5a5f66; color: #ffd0d1; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 10px; line-height: 1.4; }
.go:disabled { filter: grayscale(.8) brightness(.7); }
/* Online play: the Online / Local tabs and the studio's server list */
.mptabs { margin-bottom: 10px; }
.srow { width: 100%; text-align: left; border: 1px solid var(--line); cursor: pointer; }
.srow:hover { border-color: var(--accent); }
.srow.off { opacity: .5; cursor: default; }
.srow .ps { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }
.srow.off .tag { background: var(--line); color: var(--text); }

/* cloud saves line on the menu */
.cloud { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.cloud:empty { display: none; }
.cloud .pill { display: inline-block; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 900; text-decoration: none; }
.cloud b { color: var(--text); }
.cloud a:not(.pill) { color: var(--muted); }
