:root {
  color-scheme: dark;
  --navy: #070a28;
  --ink: #fffef4;
  --lime: #d4f86d;
  --violet: #a18aff;
  --cyan: #a2f4ff;
  font-family: 'Arial Black', Impact, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #05051e; color: var(--ink); }
button, select { font: inherit; }
button { cursor: pointer; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--lime); outline-offset: 5px; }
button:disabled, select:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#topbar { position: fixed; z-index: 8; inset: 0 0 auto; height: 58px; padding: 15px 23px; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.brand { color: #e3e9ff; font-size: 10px; text-decoration: none; letter-spacing: 1px; line-height: 24px; text-shadow: 2px 2px #05051e; pointer-events: auto; }
.tools { display: flex; gap: 5px; pointer-events: auto; }
.icon-btn { display: grid; place-items: center; width: 33px; height: 33px; padding: 0; border: 3px solid #34547d; border-bottom-width: 5px; background: #b2f6ff; color: #23437b; border-radius: 2px; font-size: 21px; line-height: 1; box-shadow: 3px 3px 0 #080a25; }
.icon-btn:hover { background: #e6fcff; transform: translateY(-1px); }
.icon-btn[aria-pressed=false] { background: #90b5d0; color: #47607b; }
#menu { position: fixed; inset: 0; z-index: 3; }
.menu-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.game-logo { width: min(650px, 79vw); height: min(48vh, 390px); margin: 1vh 0 -1vh; display: flex; align-items: center; justify-content: center; }
.game-logo svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 0 #02031b80); }
.title-buttons { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 15px; margin-top: 1vh; }
.arcade-button { position: relative; display: grid; place-items: center; min-height: 42px; padding: 8px 25px; border: 5px solid #324e7a; border-bottom-width: 7px; background: linear-gradient(#ffffff, #dfe3e8); color: #294877; font-family: Impact, 'Arial Black', Arial, sans-serif; font-size: 21px; line-height: 1.05; font-weight: 900; text-shadow: 1px 1px #f9fdff; letter-spacing: .1px; border-radius: 7px; box-shadow: 4px 4px 0 #04051b; transform: skew(-3deg); transition: transform .1s, filter .1s; }
.arcade-button:hover { filter: brightness(1.12); transform: skew(-3deg) scale(1.035); }
.arcade-button:active { transform: skew(-3deg) translateY(3px); box-shadow: 2px 1px 0 #04051b; }
.arcade-button.friendly { width: 360px; min-height: 83px; font-size: 38px; border-width: 7px; border-bottom-width: 10px; }
.arcade-button.compact { min-width: 256px; min-height: 37px; font-size: 17px; border-width: 3px; border-bottom-width: 5px; }
.title-hint { margin: 31px 10px 0; text-align: center; color: #edf7db; font-size: 10px; letter-spacing: .5px; text-shadow: 2px 2px #163815; }
.title-footer { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #cbd4e3; font-size: 8px; letter-spacing: .6px; text-shadow: 1px 2px #070a28; }
.publisher-mark { position: absolute; right: 30px; bottom: 37px; color: #a994ff; font-size: 37px; font-style: italic; font-family: Impact, 'Arial Black', sans-serif; transform: rotate(-8deg); letter-spacing: -1px; text-shadow: -3px 0 #111136, 0 3px #111136, 3px 0 #111136, 0 -3px #111136, 4px 5px #f2f8bc; }
.publisher-mark>span:first-child { display: block; margin: 0 0 -14px 18px; color: var(--lime); font-size: 35px; }
.publisher-club { font-size: 23px; }
#select-screen { padding: 30px 5% 24px; overflow: auto; }
body[data-screen=select] #topbar .brand { visibility: hidden; }
body[data-screen=select] #topbar .tools { margin-right: 40px; }
.back-button { position: absolute; top: 11px; right: 17px; border: 0; padding: 0; background: none; color: #fff; font-family: Impact, 'Arial Black', sans-serif; font-size: 41px; line-height: .9; text-shadow: 3px 2px #05051b; z-index: 5; }
.selection-top { text-align: center; margin: 0 0 20px; }
.selection-top>span { font: 900 9px Arial, sans-serif; color: #9faed7; letter-spacing: 2px; }
.selection-top h2 { color: #a8f1ff; font-family: Impact, 'Arial Black', sans-serif; font-size: 30px; letter-spacing: 1px; margin: 7px 0 6px; text-shadow: 3px 3px #7a376a, 1px 1px #0b0c2d; }
.selection-top p { margin: 0; color: #e2e5f5; font: 800 9px Arial, sans-serif; letter-spacing: 1px; }
.club-grid { width: min(830px, 96%); display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px 13px; margin: 4px 0 20px; }
.club-btn { position: relative; min-height: 59px; padding: 8px 3px; border: 2px solid transparent; background: #0711284d; color: #d0d9ed; border-radius: 2px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; font: 900 9px Arial, sans-serif; letter-spacing: 1px; text-shadow: 2px 2px #080d20; }
.club-btn:hover { background: #a0bce61a; }
.club-btn.selected { border-color: #e5f8ff; background: #a8baff24; }
.flag { font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 34px; line-height: 1.05; text-shadow: none; }
.club-btn.selected:before { position: absolute; content: '▼'; top: -22px; color: #f1faff; font-size: 14px; text-shadow: 2px 2px #14112f; }
.crest { display: grid; place-items: center; width: 43px; height: 47px; border: 3px solid #f6fbff91; background: var(--club-color); color: #18233e; clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%); font-size: 17px; font-weight: 900; text-shadow: 1px 1px #fff5; }
.selection-bottom { display: grid; grid-template-columns: minmax(260px, 420px) minmax(330px, 490px); align-items: end; gap: 12px; width: min(940px, 100%); margin-top: auto; }
.lineup-wrap { position: relative; align-self: center; width: 100%; padding-bottom: 26px; }
#lineup { width: 100%; height: auto; display: block; }
.lineup-roles { display: flex; justify-content: space-around; margin-top: -15px; color: #eef4dc; font: 900 8px Arial, sans-serif; text-shadow: 2px 2px #142824; letter-spacing: .2px; }
.team-panel { padding: 10px 10px 20px; align-self: center; background: #07102a3d; border-radius: 3px; }
.team-panel h3 { color: var(--lime); margin: 0 0 4px; text-align: center; font-family: Impact, 'Arial Black', sans-serif; font-size: 24px; letter-spacing: 1px; text-shadow: 2px 2px #162a14; text-transform: uppercase; }
#club-style { font: 800 8px Arial,sans-serif; letter-spacing: 1px; color: #b6cbda; text-align: center; margin: 0 0 14px; text-transform: uppercase; }
.club-stats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 7px; }
.stat-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 3px; color: #fbfff1; font: 900 9px Arial, sans-serif; letter-spacing: -.2px; text-shadow: 2px 2px #0b1a19; }
.stat-track { height: 10px; background: #0009; border: 1px solid #0c1730; display: block; }
.stat-fill { display: block; height: 100%; width: var(--stat); background: #99efff; }
.stat-row:nth-child(2n) .stat-fill { background: #8cf769; }
.formation-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin: 0 0 8px; font: 900 8px Arial,sans-serif; color: #d1e2f5; text-shadow: 2px 2px #111c30; }
.formation-picker>span { margin-right: 5px; }
.formation-picker button { padding: 5px 8px; border: 2px solid #7894c2; background: #162950ce; color: #c9dbee; font: 900 8px Arial,sans-serif; }
.formation-picker button.selected { background: #c1f692; border-color: #edffd5; color: #254139; }
.pass-intent { position: absolute; bottom: 17px; left: 50%; transform: translateX(-50%); padding: 8px 13px; background: #0c2336d9; border: 2px solid #c8f75d; color: #eaffc7; font: 900 10px Arial,sans-serif; letter-spacing: .4px; white-space: nowrap; text-shadow: 1px 2px #0c2336; }
.pass-intent small { display: block; margin-top: 3px; text-align: center; font-size: 7px; color: #c9d5e9; }
.match-options { align-self: center; position: relative; z-index: 4; margin: 2px 0 12px; color: #d9e6f8; font: 900 9px Arial, sans-serif; text-shadow: 2px 2px #06152a; }
.match-options summary { cursor: pointer; text-align: center; padding: 7px 15px; background: #101a38aa; border: 1px solid #bbd4ff55; list-style: none; }
.match-options summary::-webkit-details-marker { display: none; }
.match-options>div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; background: #101a38ee; border: 2px solid #617696; position: absolute; bottom: 32px; left: 50%; width: 320px; transform: translateX(-50%); box-shadow: 4px 4px #070b20; }
.match-options label { color: #b5c4de; font-size: 8px; text-shadow: none; }
.match-options select { display: block; margin-top: 7px; width: 100%; padding: 7px 5px; border: 1px solid #8ca6d9; background: #202d50; color: #edf4ff; font: 900 9px Arial, sans-serif; }
.arcade-button.ready { width: 224px; min-height: 66px; font-size: 34px; margin-bottom: 5px; }
.selection-help { font: 900 8px Arial,sans-serif; margin: 6px 0 0; text-align: center; color: #d2dfcc; text-shadow: 2px 2px #102823; }
#hud { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
body.playing #topbar { height: 45px; padding: 10px 18px; }
body.playing #topbar .brand { display: none; }
body.playing #topbar .tools { margin-left: auto; margin-right: 39px; }
body.playing .tools .icon-btn { width: 29px; height: 29px; font-size: 17px; }
body.playing #help { display: none; }
.scoreboard { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 21px; min-width: 230px; padding: 3px 20px 5px; border: 2px solid #5d548b; border-top: 0; background: linear-gradient(#312662, #151d45); box-shadow: 0 4px 8px #0004; }
.score-team { text-align: center; min-width: 54px; display: grid; gap: 1px; }
.score-team b { font-family: Impact, 'Arial Black', sans-serif; font-size: 26px; line-height: 1; color: #ffdb71; text-shadow: 2px 2px #17112d; }
.score-team span { font: 900 7px Arial,sans-serif; letter-spacing: 1px; color: #e9f4ff; }
.clock { text-align: center; white-space: nowrap; }
.clock strong { font-family: Impact, 'Arial Black', sans-serif; font-size: 25px; line-height: 1; font-weight: 900; color: #ffff72; text-shadow: 2px 2px #17112d; font-variant-numeric: tabular-nums; }
.clock small { display: block; margin-top: 1px; font: 900 7px Arial,sans-serif; color: #d4f4d5; letter-spacing: .6px; }
#pause { position: absolute; top: 10px; right: 18px; width: 29px; height: 29px; font-size: 17px; pointer-events: auto; }
.hud-left { position: absolute; top: 12px; left: 18px; display: grid; gap: 4px; font: 900 8px Arial,sans-serif; letter-spacing: .6px; text-shadow: 2px 2px #0c2518; }
.hud-left>span+span { font-size: 7px; color: #ddedca; }
#announcement { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); width: 90%; text-align: center; color: #f4fae8; font-family: Impact, 'Arial Black', sans-serif; font-size: clamp(40px, 7vw, 84px); font-weight: 900; letter-spacing: 1px; text-shadow: 4px 4px #22396d, -2px -2px #22396d, 2px -2px #22396d, -2px 2px #22396d; }
#announcement small { display: block; font: 900 12px Arial,sans-serif; letter-spacing: 1px; margin-top: 10px; text-shadow: 2px 2px #1c2b55; }
.match-hints { position: absolute; left: 0; right: 0; top: 25%; text-align: center; color: #fff; font: 900 10px Arial,sans-serif; text-shadow: 2px 2px #14351e; }
.modal { position: fixed; z-index: 12; inset: 0; padding: 20px; display: grid; place-items: center; background: #03051caa; overflow: auto; }
.modal-card { position: relative; width: min(450px, 100%); padding: 28px; background: linear-gradient(#1c2d54, #101b3b); border: 4px solid #8ca4d9; border-bottom-width: 7px; border-radius: 4px; box-shadow: 6px 6px #04051d; }
.eyebrow { font: 900 9px Arial,sans-serif; letter-spacing: 1.4px; color: #a4ecff; }
.modal-card h2 { font-family: Impact, 'Arial Black', sans-serif; font-size: 38px; color: #f1f4f8; text-shadow: 3px 3px #263c6b; margin: 12px 0 20px; letter-spacing: 1px; }
.modal-card p { font: 12px/1.75 Arial,sans-serif; color: #c9d5e9; }
.primary, .secondary { display: block; width: 100%; padding: 12px; border: 3px solid #5d76a4; border-bottom-width: 5px; color: #263e6a; background: #eff1ef; font-family: Impact, 'Arial Black', sans-serif; font-size: 22px; font-weight: 900; box-shadow: 3px 3px #070b24; }
.primary>span { float: right; }
.secondary { margin-top: 12px; background: #344d7b; color: #edf6ff; border-color: #738fc1; font: 900 11px Arial,sans-serif; }
.primary:hover, .secondary:hover { filter: brightness(1.15); }
.close-modal { position: absolute; right: 13px; top: 10px; color: #e3f1fa; background: none; border: 0; font-size: 25px; }
.result-score { font: 900 73px/1 Impact, 'Arial Black', sans-serif; color: #e9f89c; text-align: center; margin: 15px 0; text-shadow: 3px 3px #1d315a; }
.result-clubs { display: flex; justify-content: space-between; font: 900 11px Arial,sans-serif; color: #cad7f0; }
.result-stats { margin: 22px 0; display: grid; gap: 9px; }
.result-stats>div { display: flex; justify-content: space-between; color: #b7c9e8; font: 900 10px Arial,sans-serif; }
.result-stats b { color: #fff; font-size: 13px; }
.help-row { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 0; border-bottom: 1px solid #7792c744; font: 11px/1.4 Arial,sans-serif; color: #c3d4ee; }
.help-row strong { font-weight: 700; color: #f0f5ff; }
kbd { font-family: Arial,sans-serif; padding: 2px 4px; border: 1px solid #98b0d1; background: #172750; color: #eef9ff; font-size: 10px; }
#boot { position: fixed; z-index: 20; inset: 0; background: #070a28; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 15px; }
.boot-mark { color: #e8f0fc; font: italic 900 60px Impact,'Arial Black',sans-serif; text-shadow: 4px 4px #465b8f; }
.boot-mark span { color: var(--lime); }
#boot p { font: 900 10px Arial,sans-serif; letter-spacing: 1.5px; color: #b2c5ea; }
#boot .primary { width: 220px; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: 90%; padding: 12px 18px; border: 2px solid #8da6d1; background: #17254a; box-shadow: 4px 4px #05051d; font: 12px/1.5 Arial,sans-serif; text-align: center; }
#touch { position: fixed; z-index: 8; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: space-between; align-items: end; padding: 0 22px; pointer-events: none; }
#stick { position: relative; width: 115px; height: 115px; border-radius: 50%; border: 2px solid #e8f5ff77; background: #12342e44; pointer-events: auto; touch-action: none; }
#stick-knob { position: absolute; left: 33px; top: 33px; width: 45px; height: 45px; border-radius: 50%; background: #e9f5ff88; border: 2px solid #e9f5ff99; pointer-events: none; }
.touch-actions { display: flex; align-items: end; gap: 8px; pointer-events: auto; }
.touch-actions button { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 2px solid #d6edff99; background: #183a3c99; color: #fff; font: 900 10px Arial,sans-serif; touch-action: none; }
.touch-actions .shoot { width: 73px; height: 73px; background: #d6f383da; border-color: #f5ffd7; color: #1d4535; font: 900 22px Impact,'Arial Black',sans-serif; }
body.touch-mode .match-hints { display: none; }
@media (max-width: 900px) {
  .game-logo { width: min(600px, 85vw); }
  .club-grid { gap: 9px; }
  .club-btn { min-height: 55px; }
  .selection-bottom { grid-template-columns: 1fr 1.3fr; }
  .club-stats { column-gap: 10px; }
  .stat-row { grid-template-columns: 81px 1fr; font-size: 8px; }
  .publisher-mark { right: 20px; font-size: 30px; }
}
@media (max-width: 650px) {
  #topbar { padding: 10px 13px; }
  .brand { font-size: 8px; }
  .icon-btn { width: 29px; height: 29px; font-size: 18px; }
  .tools { gap: 4px; }
  .game-logo { width: 96vw; height: min(46vh, 330px); margin-top: 6vh; }
  .title-buttons { gap: 14px; }
  .arcade-button.friendly { width: 300px; min-height: 73px; font-size: 31px; }
  .arcade-button.compact { min-width: 236px; font-size: 16px; min-height: 36px; }
  .title-hint { font-size: 8px; margin-top: 25px; }
  .publisher-mark { right: 17px; bottom: 33px; font-size: 25px; }
  .publisher-club { font-size: 16px; }
  .publisher-mark>span:first-child { font-size: 25px; margin-bottom: -10px; }
  .title-footer { font-size: 6px; bottom: 8px; }
  #select-screen { padding: 51px 5% 20px; }
  .selection-top { margin-bottom: 23px; }
  .selection-top h2 { font-size: 25px; }
  .selection-top>span { font-size: 7px; }
  .selection-top p { font-size: 7px; }
  .club-grid { width: 100%; grid-template-columns: repeat(6, 1fr); gap: 11px 4px; margin-bottom: 15px; }
  .club-btn { min-height: 45px; padding: 3px; gap: 3px; font-size: 7px; }
  .flag { font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 34px; line-height: 1.05; text-shadow: none; }
.club-btn.selected:before { top: -15px; font-size: 10px; }
  .flag { font-size: 27px; }
  .formation-picker { gap: 3px; font-size: 7px; }
  .formation-picker button { font-size: 7px; padding: 5px 6px; }
  .pass-intent { bottom: 139px; font-size: 8px; max-width: 90%; white-space: normal; text-align: center; }
  .crest { width: 32px; height: 35px; font-size: 13px; }
  .selection-bottom { grid-template-columns: 1fr; gap: 0; margin-top: 0; }
  .lineup-wrap { width: min(350px, 100%); justify-self: center; padding-bottom: 7px; }
  #lineup { max-height: 135px; object-fit: contain; }
  .lineup-roles { margin-top: -12px; font-size: 6px; justify-content: center; gap: 37px; }
  .team-panel { padding: 10px 4px 15px; }
  .team-panel h3 { font-size: 22px; }
  #club-style { font-size: 7px; margin-bottom: 10px; }
  .club-stats { gap: 6px 12px; }
  .stat-row { font-size: 7px; grid-template-columns: 74px 1fr; }
  .stat-track { height: 8px; }
  .match-options { margin-bottom: 11px; margin-top: 4px; }
  .arcade-button.ready { width: 200px; min-height: 55px; font-size: 29px; }
  .selection-help { font-size: 6px; }
  .scoreboard { gap: 13px; min-width: 195px; padding: 3px 9px 5px; }
  .score-team { min-width: 42px; }
  .score-team b, .clock strong { font-size: 23px; }
  .score-team span, .clock small { font-size: 6px; }
  body.playing #topbar { padding: 7px 10px; }
  body.playing #topbar .tools { margin-right: 32px; }
  body.playing #music, body.playing #sound { display: none; }
  body.playing .tools .icon-btn, #pause { width: 27px; height: 27px; font-size: 16px; }
  #pause { top: 7px; right: 10px; }
  .hud-left { top: 58px; left: 12px; font-size: 6px; }
  .hud-left>span+span { font-size: 6px; }
  .modal-card { padding: 23px; }
  .modal-card h2 { font-size: 32px; }
  #touch { padding: 0 14px; bottom: 21px; }
  #stick { width: 98px; height: 98px; }
  #stick-knob { width: 40px; height: 40px; left: 27px; top: 27px; }
  .touch-actions { gap: 6px; }
  .touch-actions button { width: 41px; height: 41px; font-size: 8px; }
  .touch-actions .shoot { width: 63px; height: 63px; font-size: 20px; }
}
@media (max-height: 580px) and (min-width: 651px) {
  .game-logo { width: 440px; height: 53vh; margin-top: -1vh; }
  .title-buttons { gap: 8px; margin-top: -1vh; }
  .arcade-button.friendly { width: 300px; min-height: 62px; font-size: 30px; border-width: 5px; border-bottom-width: 7px; }
  .arcade-button.compact { min-height: 30px; padding: 5px 20px; font-size: 14px; }
  .title-hint { margin-top: 14px; font-size: 8px; }
  #select-screen { padding-top: 15px; padding-bottom: 10px; }
  .selection-top { margin-bottom: 15px; }
  .selection-top h2 { font-size: 25px; }
  .selection-top>span, .selection-top p { font-size: 7px; }
  .club-grid { margin-bottom: 10px; gap: 9px; }
  .club-btn { min-height: 40px; font-size: 7px; padding: 3px; gap: 2px; }
  .flag { font-size: 25px; }
  .formation-picker { margin-bottom: 5px; }
  .formation-picker button { padding: 3px 6px; font-size: 7px; }
  .crest { width: 29px; height: 33px; font-size: 12px; }
  .selection-bottom { grid-template-columns: 1fr 1.5fr; margin-top: auto; }
  .lineup-wrap { max-width: 330px; padding-bottom: 8px; }
  .lineup-roles { font-size: 6px; margin-top: -11px; }
  .team-panel { padding: 5px 8px 10px; }
  .team-panel h3 { font-size: 20px; }
  #club-style { font-size: 7px; margin-bottom: 10px; }
  .club-stats { row-gap: 5px; }
  .stat-track { height: 8px; }
  .match-options { margin-bottom: 6px; }
  .match-options summary { padding: 5px 12px; font-size: 8px; }
  .arcade-button.ready { min-height: 48px; font-size: 26px; width: 190px; border-width: 4px; border-bottom-width: 6px; }
  .selection-help { display: none; }
  .publisher-mark { bottom: 25px; }
  .modal-card { padding: 18px 25px; }
  .modal-card h2 { margin: 9px 0; font-size: 30px; }
  .result-score { font-size: 52px; margin: 10px 0; }
  .result-stats { margin: 14px 0; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
