:root {
  --field: #16834b;
  --field-dark: #0d5e37;
  --line: rgba(255,255,255,.88);
  --purple: #241640;
  --text-soft: #cfc4e8;
  --cyan: #2ee1d0;
  --p1: #ffcf45;
  --p2: #6fc8ff;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body { margin: 0; }

/* Soccer keeps the shared Touch 2 Tech header structure, but the page is light.
   Give the shared header controls enough contrast to read as buttons on the light field. */
.app-header__back,
.app-header__fullscreen {
  background: rgba(255, 255, 255, 0.78);
  color: var(--t2t-stage-text);
  border: 2px solid rgba(36, 22, 64, 0.35);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(36, 22, 64, 0.12);
}

.app-header__back:hover,
.app-header__fullscreen:hover {
  background: #ffffff;
  border-color: rgba(36, 22, 64, 0.55);
}

.app-header__back:active,
.app-header__fullscreen:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(36, 22, 64, 0.12);
}


.soccer-page {
  height: calc(100vh - var(--app-header-height, 72px));
  min-height: 0;
  box-sizing: border-box;
  padding: 12px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scoreboard {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 18px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.score-card {
  min-width: 0;
  padding: 8px 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(34,20,61,.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.score-card span { color: var(--text-soft); font-weight: 700; }
.score-card strong { font-size: 30px; line-height: 1; }
.player-one strong { color: var(--p1); }
.player-two strong { color: var(--p2); }

.match-status { text-align: center; min-width: 150px; }
.match-status span {
  display: block;
  min-width: 110px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #241640;
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 5px;
}

.secondary-btn {
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: #211331;
  color: #fff;
  padding: 6px 13px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.secondary-btn:hover, .secondary-btn:focus-visible { border-color: var(--cyan); }

.game-shell {
  position: relative;
  width: min(1200px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.16);
  background: var(--field-dark);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-help {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(12,7,22,.72);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.game-help span + span { border-left: 1px solid rgba(255,255,255,.25); padding-left: 8px; }

.controls-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
}
.controls-modal[hidden] { display: none; }

.controls-card {
  width: min(820px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  box-sizing: border-box;
  padding: 28px 32px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 26px;
  background: #241640;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.controls-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow { color: var(--cyan); font-weight: 900; letter-spacing: 1.4px; font-size: 13px; }
.controls-card h2 { margin: 5px 0 0; color: #fff; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; }

.done-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--cyan);
  color: #171026;
  padding: 12px 25px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.setting-field { display: block; }
.setting-field > span { display: block; color: #fff; font-weight: 800; margin-bottom: 7px; }
.setting-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: #140c24;
  color: #fff;
  padding: 11px 12px;
  font: inherit;
  font-weight: 700;
}
.setting-field select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.control-player {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: rgba(12,7,22,.32);
}
.control-player h3, .instructions h3 { margin: 0 0 7px; color: #fff; font-size: 19px; }
.control-player p, .instructions li { color: var(--text-soft); line-height: 1.5; }

.key-row { display: flex; justify-content: center; gap: 7px; margin-top: 7px; }
kbd {
  min-width: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  color: #20152d;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15);
  text-align: center;
  font: 800 15px/1 system-ui, sans-serif;
}

.computer-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid rgba(111,200,255,.25);
  background: rgba(111,200,255,.08);
}
.computer-badge {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(111,200,255,.16);
  border: 2px solid var(--p2);
  font-size: 28px;
}
.computer-panel strong { color: #fff; }
.computer-panel p { margin: 3px 0 0; color: var(--text-soft); }

.instructions { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.instructions ol { margin: 0; padding-left: 22px; }

@media (max-width: 720px) {
  .soccer-page { padding: 8px 10px 10px; }
  .scoreboard { gap: 7px; grid-template-columns: 1fr auto 1fr; }
  .score-card { padding: 7px 9px; }
  .score-card span { font-size: 12px; }
  .score-card strong { font-size: 23px; }
  .match-status { min-width: 75px; }
  .match-status span { font-size: 14px; }
  .secondary-btn { padding: 5px 9px; font-size: 12px; }
  .game-help { font-size: 10px; bottom: 7px; }
  .controls-card { padding: 22px 18px; }
  .settings-grid, .control-grid { grid-template-columns: 1fr; }
  .controls-head { margin-bottom: 18px; }
}
