:root {
  --bg-top: #d8efe8;
  --bg-bottom: #87b7cc;
  --panel-bg: rgba(7, 18, 25, 0.62);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text-main: #f5fbff;
  --text-dim: rgba(245, 251, 255, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: clamp(48px, 8vh, 92px);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition:
    opacity 240ms ease,
    transform 280ms ease;
}

body::before {
  top: 0;
  background:
    linear-gradient(180deg, rgba(3, 10, 16, 0.92), rgba(3, 10, 16, 0.18) 72%, transparent);
}

body::after {
  bottom: 0;
  transform: translateY(100%);
  background:
    linear-gradient(0deg, rgba(3, 10, 16, 0.92), rgba(3, 10, 16, 0.18) 72%, transparent);
}

body.kickoff-cinematic-active::before,
body.kickoff-cinematic-active::after {
  opacity: 1;
  transform: translateY(0);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.48), transparent 30%),
    radial-gradient(circle at 80% 15%, rgba(255, 211, 156, 0.36), transparent 24%),
    linear-gradient(135deg, rgba(7, 18, 25, 0.16), transparent 40%);
  pointer-events: none;
}

.shell {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.front-menu {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  padding: 22px;
  background: rgba(5, 16, 29, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.front-menu::before,
.front-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.front-menu::before {
  inset: -4%;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(4, 18, 32, 0.1)),
    url("../hf_20260308_013810_1090de8e-4c4c-4b02-8c4d-9353f9895604.png") center / cover no-repeat;
  animation: menu-pan 18s ease-in-out infinite alternate;
}

.front-menu::after {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(8, 20, 34, 0.04) 0%, rgba(8, 20, 34, 0.14) 42%, rgba(8, 20, 34, 0.34) 100%);
}

.front-menu.show {
  opacity: 1;
  pointer-events: auto;
}

.front-menu-hero {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(74vw, 920px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: translate(-50%, -50%);
  text-align: center;
  transition:
    top 720ms cubic-bezier(0.2, 0.8, 0.16, 1),
    width 720ms cubic-bezier(0.2, 0.8, 0.16, 1),
    transform 720ms cubic-bezier(0.2, 0.8, 0.16, 1);
}

.front-menu-logo {
  width: 100%;
  max-width: 880px;
  filter:
    drop-shadow(0 24px 34px rgba(122, 67, 8, 0.2))
    drop-shadow(0 18px 40px rgba(255, 255, 255, 0.16));
  animation: menu-logo-float 5.6s ease-in-out infinite;
  user-select: none;
}

.front-menu-card {
  position: relative;
  z-index: 3;
  width: min(720px, calc(100vw - 40px));
  margin: clamp(260px, 47vh, 390px) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  opacity: 0;
  transform: translateY(42px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 460ms ease,
    transform 620ms cubic-bezier(0.2, 0.8, 0.16, 1);
}

.front-menu.is-ready .front-menu-hero {
  top: 30px;
  width: min(320px, 34vw);
  transform: translateX(-50%);
}

.front-menu.is-ready .front-menu-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.front-menu.is-ready .front-menu-copy,
.front-menu.is-ready .front-menu-continue {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.front-menu-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.front-menu-copy {
  max-width: 580px;
  margin: 0;
  color: rgba(255, 253, 244, 0.92);
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  line-height: 1.6;
  letter-spacing: 0.035em;
  text-shadow: 0 12px 30px rgba(7, 18, 25, 0.22);
  transition:
    opacity 320ms ease,
    transform 320ms ease;
}

.front-menu-continue {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  background: rgba(6, 18, 32, 0.48);
  color: #fffdf8;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 22px 40px rgba(7, 18, 25, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  transition:
    opacity 320ms ease,
    transform 320ms ease,
    box-shadow 200ms ease;
  animation: menu-continue-pulse 2.3s ease-in-out infinite;
}

.front-menu-continue:hover,
.front-menu-continue:focus-visible {
  box-shadow:
    0 28px 48px rgba(7, 18, 25, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.menu-action {
  appearance: none;
  width: min(560px, 82vw);
  border: 1px solid rgba(138, 80, 15, 0.48);
  background: linear-gradient(180deg, #ffd85d 0%, #ffc907 56%, #f0ac00 100%);
  color: #723913;
  border-radius: 999px;
  padding: 1.18rem 1.9rem;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Avenir Next", sans-serif;
  font-size: clamp(1.08rem, 2.8vw, 1.95rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 22px 42px rgba(144, 84, 8, 0.28),
    inset 0 2px 0 rgba(255, 248, 210, 0.86),
    inset 0 -4px 0 rgba(165, 93, 10, 0.32);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.menu-action:hover,
.menu-action:focus-visible {
  transform: translateY(-3px) scale(1.015);
  box-shadow:
    0 28px 50px rgba(144, 84, 8, 0.34),
    inset 0 2px 0 rgba(255, 248, 210, 0.92),
    inset 0 -4px 0 rgba(165, 93, 10, 0.34);
  filter: saturate(1.06);
}

.menu-action-secondary {
  background: linear-gradient(180deg, #ffe16f 0%, #ffd339 56%, #f3b300 100%);
}

.online-setup,
.admin-editor {
  width: min(760px, 88vw);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  margin-top: 0;
  padding: 0 24px;
  border-radius: 34px;
  background: rgba(5, 17, 29, 0.66);
  border: 1px solid transparent;
  box-shadow: 0 26px 60px rgba(7, 18, 25, 0.28);
  backdrop-filter: blur(18px) saturate(115%);
  transition:
    max-height 360ms ease,
    opacity 320ms ease,
    transform 360ms ease,
    margin-top 320ms ease,
    padding 320ms ease,
    border-color 320ms ease;
}

.online-setup.show,
.admin-editor.show {
  max-height: 72vh;
  overflow: auto;
  opacity: 1;
  transform: translateY(0);
  margin-top: 8px;
  padding: 26px 24px 18px;
  border-color: rgba(255, 255, 255, 0.18);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.menu-field {
  display: block;
  margin-top: 14px;
}

.menu-field span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 248, 232, 0.82);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-field input,
.menu-field select,
.menu-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-main);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.menu-field textarea {
  min-height: 164px;
  resize: vertical;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.88rem;
}

.menu-field input::placeholder,
.menu-field textarea::placeholder {
  color: rgba(245, 251, 255, 0.44);
}

.menu-hint {
  margin: 18px 0 0;
  color: rgba(245, 251, 255, 0.78);
  font-size: 0.96rem;
  line-height: 1.55;
  text-align: center;
}

.menu-status {
  min-height: 1.5em;
  width: min(700px, 88vw);
  margin: 0;
  padding: 0.82rem 1.12rem;
  border-radius: 999px;
  background: rgba(6, 18, 32, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 16px 34px rgba(7, 18, 25, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff0d4;
  font-size: 0.98rem;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(12px);
}

.menu-status:empty {
  display: none;
}

.editor-divider {
  width: 100%;
  height: 1px;
  margin: 12px 0 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

.pitch-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.number-field input[type="number"] {
  -moz-appearance: textfield;
}

.color-field input[type="color"] {
  min-height: 56px;
  padding: 0.36rem;
  cursor: pointer;
}

.stripe-field {
  margin-top: 18px;
}

.stripe-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stripe-control input[type="range"] {
  flex: 1;
  accent-color: #ffc907;
}

.stripe-control strong {
  min-width: 2.5rem;
  color: #ffe9a7;
  font-size: 1rem;
  text-align: center;
}

.editor-actions {
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  margin-top: 6px;
}

.editor-actions .menu-action {
  width: auto;
  min-width: 180px;
  font-size: 0.98rem;
  padding: 0.95rem 1.35rem;
}

.menu-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 4;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: rgba(7, 18, 25, 0.58);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 12px 30px rgba(7, 18, 25, 0.2);
}

@keyframes menu-pan {
  0% {
    transform: scale(1.03) translate3d(-1.3%, -0.8%, 0);
  }

  100% {
    transform: scale(1.09) translate3d(1.2%, 1%, 0);
  }
}

@keyframes menu-logo-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes menu-continue-pulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

canvas {
  display: block;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  touch-action: none;
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  pointer-events: none;
}

.mobile-controls {
  position: fixed;
  inset: 0;
  z-index: 7;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.mobile-controls.show {
  opacity: 1;
}

.mobile-stick,
.mobile-action {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

.mobile-stick {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 140px;
  height: 140px;
  border-radius: 50%;
  pointer-events: auto;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(8, 26, 41, 0.68), rgba(5, 18, 29, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.mobile-stick-ring {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.02), transparent 66%);
}

.mobile-stick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 62%),
    linear-gradient(180deg, rgba(93, 183, 255, 0.76), rgba(38, 102, 199, 0.76));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 14px 28px rgba(8, 26, 41, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translate(calc(-50% + var(--thumb-x, 0px)), calc(-50% + var(--thumb-y, 0px)));
}

.mobile-stick-label {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  color: rgba(228, 240, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mobile-actions {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.mobile-action {
  position: relative;
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f7fbff;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    0 18px 36px rgba(7, 18, 25, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  transition:
    transform 120ms ease,
    filter 120ms ease,
    box-shadow 120ms ease;
}

.mobile-action.is-pressed {
  transform: translateY(2px) scale(0.96);
  filter: saturate(1.08);
}

.mobile-action-sprint {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(59, 164, 116, 0.88), rgba(22, 100, 74, 0.9));
  font-size: 0.78rem;
}

.mobile-action-kick {
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(255, 195, 63, 0.94), rgba(214, 128, 0, 0.94));
  color: #6d3402;
  font-size: 0.96rem;
}

body.touch-ui-active .hud {
  padding:
    max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

body.touch-ui-active .scoreboard {
  width: min(100%, 420px);
  margin: 0 auto;
  gap: 8px;
}

body.touch-ui-active .team-card,
body.touch-ui-active .clock-card {
  flex: 1 1 0;
  min-width: min(27vw, 110px);
  padding: 8px 10px;
  border-radius: 18px;
}

body.touch-ui-active .team-card strong,
body.touch-ui-active .clock-card strong {
  font-size: clamp(1.8rem, 7vw, 2.55rem);
}

body.touch-ui-active .team-name,
body.touch-ui-active .clock-label {
  margin-bottom: 4px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.scoreboard {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
}

.team-card,
.clock-card,
.panel,
.goal-banner,
.kickoff-countdown,
.end-screen {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow:
    0 18px 40px rgba(7, 18, 25, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.team-card,
.clock-card {
  min-width: 132px;
  padding: 14px 20px;
  border-radius: 22px;
  text-align: center;
}

.team-card strong,
.clock-card strong {
  display: block;
  font-family: "Impact", "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: 0.04em;
}

.team-name,
.clock-label,
.panel-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.team-card-blue strong {
  color: #8dc0ff;
}

.team-card-red strong {
  color: #ffb0ab;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.status-row.hidden {
  display: none;
}

.panel {
  max-width: min(420px, 48vw);
  padding: 14px 18px;
  border-radius: 18px;
}

.panel p {
  margin: 6px 0;
  color: var(--text-main);
  font-size: 0.95rem;
}

.panel code {
  display: inline-block;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.9em;
}

.panel-status {
  text-align: right;
}

.debug-text {
  min-height: 1.2em;
  color: rgba(255, 233, 171, 0.92);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.debug-panel {
  min-height: 8.6em;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c9f4ff;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.goal-banner,
.kickoff-countdown,
.end-screen {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.goal-banner {
  top: 24%;
  min-width: min(520px, calc(100vw - 40px));
  padding: 20px 28px;
  border-radius: 26px;
  text-align: center;
  font-family: "Impact", "Arial Narrow Bold", sans-serif;
  font-size: clamp(2rem, 7vw, 4.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.goal-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.goal-banner.blue {
  color: #b6d6ff;
  background:
    linear-gradient(135deg, rgba(47, 129, 255, 0.72), rgba(8, 22, 33, 0.9)),
    var(--panel-bg);
}

.goal-banner.red {
  color: #ffd0cb;
  background:
    linear-gradient(135deg, rgba(255, 91, 82, 0.72), rgba(8, 22, 33, 0.9)),
    var(--panel-bg);
}

.kickoff-countdown {
  top: 56%;
  z-index: 8;
  width: min(420px, calc(100vw - 36px));
  padding: 18px 22px 22px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 58%),
    linear-gradient(145deg, rgba(6, 28, 44, 0.88), rgba(9, 18, 31, 0.96)),
    var(--panel-bg);
  box-shadow:
    0 22px 60px rgba(5, 15, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.kickoff-countdown.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.kickoff-countdown::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.kickoff-countdown-label,
.kickoff-countdown-copy {
  display: block;
  position: relative;
  z-index: 1;
}

.kickoff-countdown-label {
  margin-bottom: 8px;
  color: rgba(228, 240, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.kickoff-countdown strong {
  position: relative;
  z-index: 1;
  display: block;
  font-family: "Impact", "Arial Narrow Bold", sans-serif;
  font-size: clamp(4.2rem, 12vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0.08em;
  color: #f5fbff;
  text-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(126, 206, 255, 0.22);
}

.kickoff-countdown-copy {
  margin-top: 10px;
  color: rgba(228, 240, 255, 0.72);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kickoff-countdown.go {
  background:
    radial-gradient(circle at top, rgba(255, 240, 181, 0.22), transparent 60%),
    linear-gradient(145deg, rgba(89, 53, 7, 0.9), rgba(16, 20, 29, 0.98)),
    var(--panel-bg);
}

.kickoff-countdown.go strong {
  color: #ffe58d;
  text-shadow:
    0 10px 30px rgba(78, 44, 7, 0.36),
    0 0 30px rgba(255, 203, 86, 0.26);
}

.end-screen {
  top: 50%;
  width: min(560px, calc(100vw - 40px));
  padding: 26px 28px 30px;
  border-radius: 28px;
  text-align: center;
}

.end-screen.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.end-screen h2 {
  margin: 0 0 10px;
  font-family: "Impact", "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.end-screen p {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 1rem;
}

@media (max-width: 900px) {
  .hud {
    padding: 14px;
  }

  .front-menu {
    padding: 16px;
  }

  .front-menu-hero {
    width: min(88vw, 720px);
  }

  .front-menu.is-ready .front-menu-hero {
    top: 22px;
    width: min(280px, 46vw);
  }

  .front-menu-card {
    width: min(720px, calc(100vw - 28px));
    margin-top: clamp(220px, 42vh, 340px);
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .pitch-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scoreboard {
    gap: 8px;
  }

  .team-card,
  .clock-card {
    min-width: unset;
    flex: 1;
    padding: 12px 14px;
    border-radius: 18px;
  }

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

  .panel {
    max-width: 100%;
  }

  .panel-status {
    text-align: left;
  }

  .kickoff-countdown {
    top: 58%;
    width: min(360px, calc(100vw - 28px));
  }

  .kickoff-countdown-label {
    letter-spacing: 0.2em;
  }

  .kickoff-countdown-copy {
    font-size: 0.8rem;
  }

  .mobile-stick {
    width: 124px;
    height: 124px;
  }

  .mobile-stick-thumb {
    width: 50px;
    height: 50px;
  }

  .mobile-action-sprint {
    width: 70px;
    height: 70px;
  }

  .mobile-action-kick {
    width: 92px;
    height: 92px;
  }
}

@media (max-width: 560px) {
  .front-menu {
    padding: 12px;
  }

  .front-menu-hero {
    width: min(92vw, 560px);
    gap: 14px;
  }

  .front-menu.is-ready .front-menu-hero {
    top: 16px;
    width: min(240px, 56vw);
  }

  .front-menu-copy {
    padding: 0 14px;
    font-size: 0.96rem;
  }

  .front-menu-continue {
    font-size: 0.74rem;
    letter-spacing: 0.09em;
  }

  .front-menu-card {
    width: calc(100vw - 18px);
    margin-top: clamp(180px, 37vh, 290px);
  }

  .menu-action {
    width: 100%;
    font-size: clamp(1rem, 5.8vw, 1.35rem);
    padding: 1rem 1.25rem;
  }

  .online-setup.show {
    padding: 20px 16px 16px;
  }

  .admin-editor.show {
    padding: 20px 16px 16px;
  }

  .pitch-editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-actions {
    flex-direction: column;
  }

  .editor-actions .menu-action {
    width: 100%;
  }

  .scoreboard {
    flex-wrap: wrap;
  }

  .clock-card {
    order: -1;
    width: 100%;
  }

  .panel p {
    font-size: 0.9rem;
  }

  body.touch-ui-active .scoreboard {
    flex-wrap: nowrap;
  }

  body.touch-ui-active .clock-card {
    order: 0;
    width: auto;
  }

  body.touch-ui-active .team-card,
  body.touch-ui-active .clock-card {
    min-width: 0;
    flex: 1;
    padding: 7px 8px;
    border-radius: 16px;
  }

  body.touch-ui-active .team-card strong,
  body.touch-ui-active .clock-card strong {
    font-size: clamp(1.52rem, 6vw, 2.05rem);
  }

  .mobile-stick {
    width: 112px;
    height: 112px;
  }

  .mobile-stick-thumb {
    width: 46px;
    height: 46px;
  }

  .mobile-actions {
    gap: 10px;
  }

  .mobile-action-sprint {
    width: 64px;
    height: 64px;
    font-size: 0.7rem;
  }

  .mobile-action-kick {
    width: 84px;
    height: 84px;
    font-size: 0.88rem;
  }
}

@media (max-height: 560px) {
  body.touch-ui-active .team-card,
  body.touch-ui-active .clock-card {
    padding: 6px 8px;
    border-radius: 14px;
  }

  body.touch-ui-active .team-card strong,
  body.touch-ui-active .clock-card strong {
    font-size: clamp(1.34rem, 5.8vw, 1.92rem);
  }

  body.touch-ui-active .team-name,
  body.touch-ui-active .clock-label {
    font-size: 0.56rem;
    letter-spacing: 0.14em;
  }

  .mobile-stick {
    width: 104px;
    height: 104px;
  }

  .mobile-stick-thumb {
    width: 42px;
    height: 42px;
  }

  .mobile-action-sprint {
    width: 58px;
    height: 58px;
  }

  .mobile-action-kick {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 900px), (max-height: 720px) {
  .front-menu {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .front-menu-hero {
    position: relative;
    top: auto;
    left: auto;
    width: min(92vw, 560px);
    margin: 0 auto;
    transform: none;
    gap: 12px;
  }

  .front-menu-logo {
    max-width: min(520px, 92vw);
  }

  .front-menu:not(.is-ready) .front-menu-card {
    display: none;
  }

  .front-menu.is-ready .front-menu-hero {
    top: auto;
    width: min(220px, 52vw);
    margin-bottom: 10px;
    transform: none;
  }

  .front-menu.is-ready .front-menu-copy,
  .front-menu.is-ready .front-menu-continue {
    display: none;
  }

  .front-menu-card {
    width: min(760px, calc(100vw - 24px));
    margin: 18px auto 0;
    gap: 14px;
  }

  .front-menu.is-ready .front-menu-card {
    margin-top: 14px;
  }

  .front-menu-copy {
    max-width: min(560px, 92vw);
    font-size: clamp(0.92rem, 2.2vw, 1.04rem);
    line-height: 1.45;
  }

  .front-menu-continue {
    padding: 0.82rem 1.2rem;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .menu-action {
    width: min(520px, 100%);
    padding: 0.92rem 1.2rem;
    font-size: clamp(0.96rem, 2.4vw, 1.22rem);
  }

  .online-setup,
  .admin-editor {
    width: 100%;
    padding: 0 16px;
    border-radius: 24px;
  }

  .online-setup.show,
  .admin-editor.show {
    max-height: none;
    overflow: visible;
    margin-top: 4px;
    padding: 18px 16px 14px;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .menu-field {
    margin-top: 10px;
  }

  .menu-field span {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }

  .menu-field input,
  .menu-field select,
  .menu-field textarea {
    border-radius: 16px;
    padding: 0.78rem 0.88rem;
    font-size: 0.94rem;
  }

  .menu-status {
    width: 100%;
    padding: 0.72rem 0.94rem;
    font-size: 0.9rem;
  }

  .menu-hint {
    margin-top: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
  }
}

@media (max-height: 560px) {
  .front-menu.is-ready .front-menu-hero {
    width: min(180px, 44vw);
    margin-bottom: 8px;
  }

  .front-menu-hero {
    width: min(76vw, 340px);
    gap: 8px;
  }

  .front-menu-logo {
    max-height: 170px;
    object-fit: contain;
  }

  .front-menu-card {
    margin-top: 12px;
  }

  .front-menu-copy {
    font-size: 0.88rem;
  }

  .menu-action {
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
  }

  .online-setup.show,
  .admin-editor.show {
    padding: 14px 14px 12px;
  }
}

@media (max-height: 720px) and (min-width: 700px) {
  .front-menu-hero {
    width: min(58vw, 420px);
    gap: 10px;
  }

  .front-menu-logo {
    max-height: 190px;
    object-fit: contain;
  }

  .front-menu-card {
    margin-top: 12px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .front-menu-card > .front-menu-actions,
  .online-setup .front-menu-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .front-menu-card > .front-menu-actions .menu-action,
  .online-setup .front-menu-actions .menu-action {
    width: auto;
    flex: 1 1 220px;
    min-width: 0;
  }
}
