:root {
  color-scheme: light;
  --ink: #101418;
  --muted: #5f6b63;
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(16, 20, 24, 0.14);
  --grass: #167246;
  --grass-dark: #0d4c31;
  --white: #fffaf1;
  --gold: #f3bf3c;
  --red: #d64235;
  --blue: #1f6fb2;
  --shadow: 0 22px 60px rgba(3, 12, 9, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, rgba(109, 176, 222, 0.95) 0 34%, transparent 34%),
    linear-gradient(180deg, #dff4ff 0, #c7e5c0 42%, #0b5935 42%, #06351f 100%);
}

button {
  border: 0;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px);
}

.screen {
  min-height: calc(100vh - clamp(32px, 6vw, 68px));
}

.hub-screen {
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(4, 22, 14, 0.88), rgba(4, 22, 14, 0.24)),
    url("Fodbold.jpg") center / cover;
  box-shadow: var(--shadow);
}

.hub-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 76% 22%, rgba(243, 191, 60, 0.32), transparent 28%),
    linear-gradient(180deg, transparent 0 44%, rgba(1, 18, 11, 0.68));
  pointer-events: none;
}

.hub-content {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - clamp(24px, 7vw, 76px)));
  margin: clamp(16px, 4vw, 42px);
  color: #fffaf1;
}

.hub-content .eyebrow {
  color: var(--gold);
}

.hub-content h1 {
  max-width: 10ch;
  text-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

.hub-content .lead {
  color: rgba(255, 250, 241, 0.9);
  font-weight: 760;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(20px, 4vw, 34px);
}

.hub-card {
  position: relative;
  display: grid;
  align-content: end;
  isolation: isolate;
  min-height: clamp(180px, 26vw, 270px);
  gap: 8px;
  overflow: hidden;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: #fffaf1;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    filter 160ms ease;
}

.hub-card::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background: center / cover;
  transform: scale(1.04);
}

.hub-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, rgba(4, 22, 14, 0.06), rgba(4, 22, 14, 0.88));
}

.hub-card:hover,
.hub-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--gold);
  filter: brightness(1.05);
  outline: 0;
}

.football-card::before {
  background-image: url("MAds fodbold.jpg");
}

.nose-card::before {
  background-image: url("Palle ansigt.jpg");
  background-position: center 34%;
}

.quiz-card::before {
  background-image: url("20250913_112743.jpg");
}

.hub-card-label {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  color: #151a20;
  background: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.hub-card strong {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 0.95;
}

.hub-card span:last-child {
  max-width: 22ch;
  color: rgba(255, 250, 241, 0.88);
  font-weight: 760;
  line-height: 1.28;
}

.hero-screen,
.keeper-screen {
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(3, 16, 11, 0.78), rgba(3, 16, 11, 0.18)),
    url("MAds fodbold.jpg") center / cover;
  box-shadow: var(--shadow);
}

.keeper-screen {
  background:
    linear-gradient(90deg, rgba(6, 36, 24, 0.84), rgba(6, 36, 24, 0.2)),
    url("20250913_112743.jpg") center / cover;
}

.screen-panel {
  width: min(720px, 100%);
  margin: clamp(16px, 4vw, 42px);
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.hero-screen .screen-panel {
  width: min(980px, calc(100% - clamp(24px, 8vw, 84px)));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-screen h1 {
  max-width: none;
}

.lead {
  max-width: 58ch;
  margin: 18px 0 24px;
  color: #263229;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.5;
}

.selection-row,
.keeper-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.selection-row + .primary-action {
  margin-top: 24px;
}

.menu-return {
  margin-top: 12px;
}

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

.choice {
  position: relative;
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  min-height: 104px;
  gap: 14px;
  width: 100%;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 178, 0.55);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(18, 35, 26, 0.16);
  outline: 0;
}

.choice.is-selected,
.keeper-choice[aria-pressed="true"] {
  border-color: var(--gold);
  background: #fff8df;
}

.choice-photo {
  width: 82px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d7e2d5;
  box-shadow: 0 8px 18px rgba(10, 26, 17, 0.2);
}

.choice-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.choice-player .choice-photo img {
  object-position: 50% 18%;
}

.choice-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.choice-text strong {
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  line-height: 1.05;
}

.choice-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #1f1700;
  background: var(--gold);
  font-weight: 900;
}

.primary-action,
.secondary-action,
.shoot-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--red);
  box-shadow: 0 12px 22px rgba(143, 34, 27, 0.25);
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.shoot-action:hover,
.shoot-action:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.03);
  outline: 3px solid rgba(243, 191, 60, 0.55);
  outline-offset: 2px;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  filter: grayscale(0.4);
}

.secondary-action {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(8, 24, 16, 0.12);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.compact {
  margin-top: 0;
}

.game-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.nose-game-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.match-header,
.match-footer,
.nose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(8, 24, 16, 0.15);
}

.match-header h1 {
  max-width: none;
  font-size: clamp(1.45rem, 4vw, 3rem);
  line-height: 1;
}

.nose-header h1 {
  max-width: none;
  font-size: clamp(1.45rem, 4vw, 3rem);
  line-height: 1;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  width: min(420px, 100%);
}

.scoreboard div {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.scoreboard span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.scoreboard strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

.field-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #102418;
  box-shadow: var(--shadow);
}

.nose-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 18%, rgba(243, 191, 60, 0.3), transparent 24%),
    linear-gradient(180deg, #9bd6ff 0, #f7f1dc 58%, #2e9a55 58%, #17683c 100%);
  box-shadow: var(--shadow);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 220px);
  aspect-ratio: 16 / 10;
  touch-action: none;
  cursor: crosshair;
}

#noseCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 220px);
  aspect-ratio: 16 / 9;
  cursor: pointer;
  touch-action: none;
}

.shot-controls {
  position: absolute;
  right: clamp(12px, 2.6vw, 24px);
  bottom: clamp(12px, 2.6vw, 24px);
}

.shoot-action {
  min-width: 108px;
  min-height: 56px;
  background: var(--gold);
  color: #161106;
  box-shadow: 0 12px 28px rgba(38, 25, 4, 0.22);
}

.poke-action {
  position: absolute;
  right: clamp(12px, 2.6vw, 24px);
  bottom: clamp(12px, 2.6vw, 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 8px;
  color: #161106;
  background: var(--gold);
  box-shadow: 0 12px 28px rgba(38, 25, 4, 0.22);
  cursor: pointer;
  font-weight: 900;
}

.match-message {
  min-height: 1.35em;
  margin: 0;
  color: #173222;
  font-weight: 800;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .screen {
    min-height: calc(100vh - 24px);
  }

  .screen-panel {
    margin: 12px;
  }

  .hub-grid,
  .keeper-grid {
    grid-template-columns: 1fr;
  }

  .match-header,
  .match-footer,
  .nose-header {
    align-items: stretch;
    flex-direction: column;
  }

  .game-screen {
    align-content: start;
    grid-template-rows: auto auto auto;
  }

  .scoreboard {
    width: 100%;
  }

  #gameCanvas {
    max-height: none;
  }

  #noseCanvas {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .choice {
    grid-template-columns: 64px 1fr;
    min-height: 86px;
    gap: 10px;
  }

  .choice-photo {
    width: 64px;
  }

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

  .scoreboard div {
    min-height: 58px;
    padding: 8px 4px;
  }

  .shoot-action {
    min-width: 92px;
    min-height: 48px;
  }
}
