:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #64727d;
  --paper: #f3f4ed;
  --panel: #ffffff;
  --line: #cfd8d1;
  --field: #1f8a4d;
  --field-dark: #176c3d;
  --accent: #ff595e;
  --blue: #2676d2;
  --gold: #ffd166;
  --shadow: 0 20px 54px rgba(23, 32, 38, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(23, 32, 38, 0.025) 0, rgba(23, 32, 38, 0.025) 1px, transparent 1px, transparent 38px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  overflow-x: hidden;
}

button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

main {
  min-height: 100vh;
}

.game-shell {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 1120px;
  padding: 16px 14px 28px;
}

.game-copy {
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  line-height: 0.98;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.game-copy p:last-child,
.content-section p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.game-panel {
  background: #101820;
  border: 1px solid rgba(23, 32, 38, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  overflow: clip;
  width: 100%;
}

.hud {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #101820;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hud div {
  background: linear-gradient(180deg, #fdfef7, #edf3ea);
  border-right: 1px solid rgba(23, 32, 38, 0.12);
  min-width: 0;
  padding: 11px 13px;
}

.hud div:last-child {
  border-right: 0;
}

.hud span {
  color: #52616b;
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  line-height: 1.1;
}

.canvas-wrap {
  background: #101820;
  display: flex;
  justify-content: center;
  position: relative;
  touch-action: none;
  width: 100%;
}

canvas {
  aspect-ratio: 960 / 620;
  display: block;
  height: auto;
  width: 100%;
}

body:not(.game-started) #restart-btn {
  display: none;
}

body:not(.game-started) .controls {
  justify-content: flex-end;
}

.overlay {
  align-items: center;
  background: rgba(16, 24, 32, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 16px;
  position: absolute;
}

.overlay[hidden] {
  display: none;
}

.overlay-box {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(23, 32, 38, 0.18);
  max-width: 440px;
  padding: 22px;
  text-align: center;
}

.overlay-box h2 {
  font-size: clamp(1.55rem, 7vw, 2.8rem);
  line-height: 1;
  margin-bottom: 10px;
}

.overlay-box p {
  color: var(--muted);
  line-height: 1.5;
}

#overlay-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

button {
  align-items: center;
  background: linear-gradient(180deg, #263845, #172026);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

button:hover {
  background: linear-gradient(180deg, #314756, #1c2b35);
}

button:focus-visible {
  outline: 3px solid rgba(38, 118, 210, 0.45);
  outline-offset: 2px;
}

.controls {
  align-items: center;
  background: #fbfcf7;
  border-top: 1px solid rgba(23, 32, 38, 0.1);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.controls p {
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
  text-align: right;
}

#restart-btn {
  background: linear-gradient(180deg, #2f86ea, #2169bf);
}

#restart-btn:hover {
  background: linear-gradient(180deg, #3993fb, #236fc9);
}

.audio-toggle {
  background: linear-gradient(180deg, #fff7d2, #f6d56e);
  color: #172026;
  min-width: 104px;
}

.audio-toggle:hover {
  background: linear-gradient(180deg, #fffce8, #f3cc55);
}

.audio-toggle[aria-pressed="false"] {
  background: linear-gradient(180deg, #e6edf2, #c9d5dd);
  color: #52616b;
}

.content-section {
  margin: 0 auto;
  max-width: 920px;
  padding: 22px 14px;
}

.content-section h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.faq {
  padding-bottom: 46px;
}

details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 10px 0;
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 850;
}

details p {
  color: var(--muted);
  margin: 12px 0 0;
}

@media (min-width: 760px) {
  .game-panel {
    width: min(100%, max(760px, calc((100vh - 300px) * 1.548)));
  }
}

@media (max-width: 560px) {
  .game-shell {
    gap: 16px;
    padding-left: 10px;
    padding-right: 10px;
  }

  h1 {
    font-size: clamp(1.85rem, 10vw, 2.4rem);
  }

  .hud div {
    padding: 8px 7px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .controls p {
    text-align: left;
  }

  button {
    width: 100%;
  }

  .overlay-box {
    padding: 18px 14px;
  }
}

/* Bitesize visual refresh */
:root {
  --ink: #172026;
  --muted: rgba(23, 32, 38, 0.68);
  --paper: #fff8ea;
  --panel: #ffffff;
  --line: rgba(78, 41, 29, 0.15);
  --field: #10874c;
  --field-dark: #0a5f38;
  --accent: #e84d2a;
  --blue: #2676d2;
  --gold: #ffc857;
  --shadow: 0 24px 70px rgba(23, 32, 38, 0.18);
}

html {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 200, 87, 0.34), transparent 27%),
    radial-gradient(circle at 88% 16%, rgba(16, 135, 127, 0.18), transparent 25%),
    linear-gradient(180deg, #fff8ea 0%, #e9f3df 46%, #b6d68a 100%);
}

.game-panel,
.overlay-box,
details {
  border-radius: 8px;
}

.game-panel {
  border: 8px solid rgba(255, 248, 234, 0.86);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(78, 41, 29, 0.12);
}

.hud {
  background: #172026;
}

.hud div,
.controls {
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(239, 247, 229, 0.92)),
    #fff8ea;
}

button {
  border-radius: 8px;
  background: linear-gradient(180deg, #243947, #172026);
}

#restart-btn {
  background: linear-gradient(180deg, var(--accent), #a9261b);
}

.audio-toggle {
  background: linear-gradient(180deg, #fff5c2, var(--gold));
}

.overlay {
  background: rgba(18, 24, 28, 0.62);
  backdrop-filter: blur(5px);
}

.content-section {
  border-top: 1px solid rgba(78, 41, 29, 0.08);
}

/* 2026 quality pass: night-stadium football skin. */
:root {
  --ink: #fff6df;
  --muted: rgba(255, 246, 223, 0.72);
  --paper: #071119;
  --panel: rgba(10, 22, 27, 0.9);
  --line: rgba(255, 246, 223, 0.14);
  --field: #19a85e;
  --field-dark: #0d6f42;
  --accent: #ff7146;
  --blue: #38d8ff;
  --gold: #ffd15f;
  --shadow: 0 28px 78px rgba(0, 0, 0, 0.42);
}

html {
  background:
    radial-gradient(circle at 18% 10%, rgba(56, 216, 255, 0.2), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(255, 209, 95, 0.15), transparent 30%),
    linear-gradient(180deg, #071119 0%, #10231c 55%, #071119 100%);
}

.game-copy,
.game-panel,
.overlay-box,
details,
.content-section {
  border-color: var(--line);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 246, 220, 0.1), rgba(255, 246, 220, 0.045)),
    var(--panel);
  box-shadow: var(--shadow);
}

h1,
h2,
.hud strong {
  color: var(--ink);
}

.game-copy p:last-child,
.content-section p,
.overlay-box p {
  color: var(--muted);
}

.eyebrow,
#overlay-kicker {
  color: var(--blue);
}

.game-panel {
  border: 1px solid rgba(56, 216, 255, 0.22);
  border-radius: 18px;
}

.hud {
  background: rgba(5, 12, 18, 0.92);
}

.hud div,
.controls {
  border-color: rgba(255, 246, 220, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 246, 220, 0.12), rgba(255, 246, 220, 0.05)),
    rgba(5, 12, 18, 0.65);
}

.hud span {
  color: rgba(255, 246, 223, 0.58);
}

.canvas-wrap {
  background:
    radial-gradient(circle at center, rgba(25, 168, 94, 0.18), transparent 52%),
    #071119;
}

canvas {
  filter: saturate(1.08) contrast(1.04);
}

button {
  border: 1px solid rgba(255, 209, 95, 0.28);
  border-radius: 999px;
  color: #1a1008;
  background: linear-gradient(180deg, var(--gold), #ff934d);
  box-shadow: 0 14px 30px rgba(255, 147, 77, 0.22);
}

button:hover {
  background: linear-gradient(180deg, #ffe08a, #ff9d5c);
}

#restart-btn {
  background: linear-gradient(180deg, var(--accent), #d53022);
  color: var(--ink);
}

.overlay {
  background: rgba(5, 12, 18, 0.72);
  backdrop-filter: blur(10px);
}

/* 2026 embed fit audit: keep the football canvas inside narrow mobile iframes. */
html,
body,
main,
.game-shell,
.game-panel,
.canvas-wrap {
  max-width: 100%;
  overflow-x: hidden;
}

.game-panel,
.canvas-wrap,
#game {
  min-width: 0;
}

.canvas-wrap {
  display: block;
}

#game {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 560px) {
  .game-panel {
    width: 100%;
  }

  .canvas-wrap {
    width: 100%;
  }
}
