:root {
  --bg: #0b1410; --panel: #12201a; --panel2: #182b22; --line: #2a4436;
  --text: #eef5f0; --muted: #8fa89a; --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(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; }
.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(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; }
.tip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(92px + 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); }
.auto { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(200px + var(--sab)); background: rgba(8, 14, 11, .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.fk .stam, body.fk .auto, body.fk .keys { display: none; }
body.desk .stam { right: auto; left: calc(14px + var(--sal)); bottom: calc(14px + var(--sab)); width: 190px; text-align: left; background: rgba(8, 14, 11, .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(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: 180px; height: 117px; }

/* free-kick meter */
.meter { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--sab)); width: min(320px, calc(100vw - 24px)); background: rgba(8, 14, 11, .93);
  border: 1px solid #ffffff22; border-radius: 14px; padding: 9px 12px 10px; }
.meter .ttl { display: flex; justify-content: space-between; font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .1em; gap: 8px; }
.meter .ttl .hl { color: var(--accent); }
.meter > .ttl:first-child { margin-bottom: 7px; }
.meter > .ttl:first-child span:last-child { color: var(--text); }
.curl { position: relative; height: 22px; border-radius: 11px; margin: 5px 0 9px; touch-action: none; cursor: ew-resize;
  background: linear-gradient(90deg, #58a6ff, #58a6ff22 45%, #ffffff22 50%, #ffd23f22 55%, #ffd23f); }
.curl .mid { position: absolute; left: 50%; top: 3px; bottom: 3px; width: 2px; background: #fff6; }
.needle { position: absolute; top: -4px; width: 5px; height: 30px; margin-left: -2px; background: #fff; border-radius: 3px; box-shadow: 0 0 6px #fff; left: 50%; }
.pow { position: relative; height: 16px; border-radius: 8px; background: #ffffff14; overflow: hidden; margin-top: 5px; }
.pow i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #3ee08f, #ffd23f 80%, #ff5a5f); }
.pow .mk { position: absolute; top: 0; bottom: 0; left: 64%; width: 16%; border-left: 2px solid #fff; border-right: 2px solid #fff; background: #ffffff1c; }
.meter .help { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.35; }
.meter .help b { color: var(--text); }
.mbtns { display: flex; gap: 8px; margin-top: 9px; }
.mbtns .btn { flex: 1; }
.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); }
.btn.strike { background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; font-style: italic; text-transform: uppercase; touch-action: none; }
.btn.strike.down { filter: brightness(1.15); box-shadow: 0 0 0 4px #ffd23f55; }

.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(8, 14, 11, .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; } }
.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; }

/* ------------------------------------------------------------ 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; }
.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; }
.card.cloud { margin-top: 12px; margin-bottom: 0; font-size: 12px; }
.cloud .ph { display: flex; justify-content: space-between; font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .14em; margin-bottom: 6px; }
.cloud .rec { font-size: 13px; color: #cfdcd4; line-height: 1.45; }
.cloud .rec b { color: var(--text); }
.cloud .cl { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.cloud .muted { color: var(--muted); line-height: 1.4; flex: 1; min-width: 160px; }
.cloud .muted b { color: var(--text); }
.cloud .muted a { color: var(--muted); }
.cloud .pill { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 900; font-size: 12px; color: var(--text); text-decoration: none; white-space: nowrap; }
.cloud a.pill { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.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: #1d5a2c; }
.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; }

@media (max-height: 560px) and (orientation: landscape) {
  .tip { top: calc(88px + var(--sat)); }
  .meter { bottom: calc(10px + var(--sab)); left: calc(12px + var(--sal)); transform: none; width: 290px; }
  .stam { bottom: calc(200px + var(--sab)); }
  .auto { bottom: calc(12px + var(--sab)); }
}

/* 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 */
.go.alt { margin-top: 10px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); box-shadow: none; font-size: 17px; padding: 12px; }
.go:disabled, .btn:disabled { opacity: .55; cursor: default; }
.card.mt, .settings.mt { margin-top: 10px; }
.inp.code { font-size: 22px; letter-spacing: .35em; text-align: center; font-weight: 900; }
.mp-err { text-align: center; color: #ffb3b5; font-size: 13px; font-weight: 700; min-height: 18px; margin-top: 8px; }
.codecard { text-align: center; }
.roomcode { font-size: 56px; font-weight: 900; font-style: italic; letter-spacing: .18em; color: var(--accent); line-height: 1.05; text-shadow: 0 4px 0 #0007; user-select: all; -webkit-user-select: all; }
.codecard .hint { margin-top: 6px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side { background: var(--panel2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 8px; font-weight: 900; font-size: 13px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.side.sel { border-color: var(--accent); background: #2a2a10; }
.side .dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid; flex: 0 0 18px; }
.mp-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-th { font-weight: 900; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border-left: 4px solid var(--c); padding-left: 7px; margin-bottom: 6px; }
.mp-p { background: var(--panel2); border-radius: 9px; padding: 6px 8px; margin-bottom: 5px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.mp-p b { font-size: 13px; }
.mp-p span { color: var(--muted); font-weight: 700; }
.mp-p em { font-style: normal; font-size: 9px; font-weight: 900; letter-spacing: .1em; color: #1a1400; background: var(--accent); border-radius: 4px; padding: 1px 4px; }
.mp-p em.wait { background: #ffffff22; color: var(--muted); }
.mp-p.me { outline: 2px solid var(--accent); }
.mp-p.ai { color: var(--muted); font-style: italic; }
.mp-wait { text-align: center; color: var(--muted); font-weight: 800; margin-top: 4px; }
.coach { font-size: 12px; color: var(--muted); margin: -2px 0 8px; font-weight: 700; }
.play:disabled, .seg button:disabled { opacity: .5; }
.toast { position: absolute; left: 50%; transform: translateX(-50%); top: calc(92px + var(--sat)); background: rgba(8, 14, 11, .92); border: 1px solid #ffffff2a;
  border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 800; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
/* Online play: the Online / Local tabs and the studio's server list */
.mptabs { margin-bottom: 10px; }
.mptabs .side { padding: 9px 8px; text-transform: uppercase; font-style: italic; }
.srvl { display: flex; flex-direction: column; }
.srow { width: 100%; text-align: left; border: 1px solid transparent; cursor: pointer; flex-wrap: nowrap; }
.srow:hover { border-color: var(--accent); }
.srow.off { opacity: .5; cursor: default; }
.srow b { flex: 0 0 auto; }
.srow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow em { font-size: 10px; }
