:root {
  --grass: #2e8b3d;
  --grass-dark: #246d31;
  --line: rgba(255, 255, 255, 0.5);
  --card: #ffffff;
  --ink: #14241a;
  --muted: #5b6f60;
  --gold: #f5c542;
  --norway: #ba0c2f;
  --hit: #1f9d4d;
  --miss: #c33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    sans-serif;
  color: var(--ink);
}

/* Football pitch backdrop: mown stripes + faint centre markings */
.pitch {
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.5rem);
  background-color: var(--grass);
  background-image:
    radial-gradient(
      circle at 50% 18%,
      transparent 78px,
      var(--line) 79px,
      var(--line) 81px,
      transparent 82px
    ),
    linear-gradient(var(--line), var(--line)),
    repeating-linear-gradient(
      90deg,
      var(--grass) 0,
      var(--grass) 60px,
      var(--grass-dark) 60px,
      var(--grass-dark) 120px
    );
  background-size:
    160px 160px,
    100% 2px,
    auto;
  background-position:
    center 60px,
    center 138px,
    0 0;
  background-repeat: no-repeat, no-repeat, repeat;
}

.hero-mascot {
  height: clamp(96px, 15vw, 150px);
  width: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
  align-self: flex-end;
}
.hero-mascot.flip {
  transform: scaleX(-1);
}
/* Keep the header tidy on phones: show one mascot. */
@media (max-width: 680px) {
  .hero-mascot.flip {
    display: none;
  }
}

.podium-flag {
  margin-bottom: -100px;
  margin-left: 170px;
  pointer-events: none;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 2.5vw, 1.75rem);
  margin-bottom: 1.5rem;
}

.title {
  text-align: center;
  max-width: 380px;
}

.title h1 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 0.4rem 0 0;
  color: #f1fff2;
  font-weight: 600;
}

.status {
  margin: 0.4rem 0 0;
  color: #d7ffe0;
  font-size: 0.9rem;
}

.source {
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.source.live {
  background: var(--hit);
  color: #fff;
}
.source.fallback {
  background: var(--gold);
  color: #3a2c00;
}

main {
  max-width: 760px;
  margin: 0 auto;
}

/* Topp 3-pall */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.4rem, 2vw, 1.2rem);
  margin: 0.5rem auto 1.75rem;
  max-width: 640px;
}

.podium-spot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  max-width: 200px;
}

.podium-spot .medal {
  font-size: 1.8rem;
  line-height: 1;
}

.podium-spot .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #14241a;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  margin: 0.3rem 0;
  border: 3px solid var(--gold);
}
.podium-spot.second .avatar {
  border-color: #c7cdd4;
}
.podium-spot.third .avatar {
  border-color: #d39158;
}

.podium-spot .p-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  line-height: 1.15;
}
.podium-spot .p-points {
  color: #eafff0;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.podium-spot .p-points strong {
  font-size: 1.1rem;
  color: #fff;
}

.podium-spot .block {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 2rem;
  font-weight: 800;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.25),
    0 -2px 6px rgba(0, 0, 0, 0.15);
}
.podium-spot.first .block {
  height: 130px;
  background: linear-gradient(#f5c542, #d6a316);
}
.podium-spot.second .block {
  height: 96px;
  background: linear-gradient(#cdd3da, #aab1ba);
}
.podium-spot.third .block {
  height: 70px;
  background: linear-gradient(#dba06a, #b97a44);
}

@media (max-width: 420px) {
  .podium-spot .avatar {
    width: 44px;
    height: 44px;
  }
  .podium-spot .p-name {
    font-size: 0.8rem;
  }
}

.board-head,
.row-head {
  display: grid;
  grid-template-columns: 64px 1fr auto auto 28px;
  align-items: center;
  gap: 0.75rem;
}

.board-head {
  padding: 0.5rem 1.1rem;
  color: #eafff0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.board-head .bh-correct,
.board-head .bh-points {
  text-align: right;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.row {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  border-left: 6px solid transparent;
}
.row.leader {
  border-left-color: var(--gold);
}

.row-head {
  width: 100%;
  background: none;
  border: 0;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: left;
}
.row-head:hover {
  background: #f4faf5;
}

.rank {
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
}
.name {
  font-weight: 700;
  font-size: 1.05rem;
}
.correct {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
  white-space: nowrap;
}
.points {
  text-align: right;
  font-size: 1.05rem;
  white-space: nowrap;
}
.points strong {
  font-size: 1.35rem;
  color: var(--grass-dark);
}
.chevron {
  text-align: center;
  color: var(--muted);
  transition: transform 0.2s;
}
.row-head.open .chevron {
  transform: rotate(180deg);
}

.row-detail {
  padding: 0.5rem 1.1rem 1.1rem;
  border-top: 1px dashed #d6e6da;
}

.matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.match {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "teams verdict" "score pred";
  gap: 0.15rem 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 9px;
  background: #f3f6f4;
  font-size: 0.82rem;
  border-left: 4px solid #cdd9d0;
}
.match.hit {
  border-left-color: var(--hit);
  background: #eafaf0;
}
.match.miss {
  border-left-color: var(--miss);
  background: #fbeeee;
}
.match.norway {
  box-shadow: inset 0 0 0 1px rgba(186, 12, 47, 0.35);
}

.m-teams {
  grid-area: teams;
  font-weight: 600;
}
.m-score {
  grid-area: score;
  font-weight: 700;
}
.m-pending {
  grid-area: score;
  color: var(--muted);
  font-style: italic;
}
.m-pred {
  grid-area: pred;
  color: var(--muted);
  text-align: right;
}
.m-verdict {
  grid-area: verdict;
  font-weight: 800;
  text-align: right;
}
.match.hit .m-verdict {
  color: var(--hit);
}
.match.miss .m-verdict {
  color: var(--miss);
}

.bonus {
  margin-top: 1.1rem;
}
.bonus h4 {
  margin: 0 0 0.4rem;
}
.bonus-note {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}
.bonus dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0;
  font-size: 0.85rem;
}
.bonus dt {
  color: var(--muted);
}
.bonus dd {
  margin: 0;
  font-weight: 600;
}

.hint {
  text-align: center;
  color: #eafff0;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Norge-nedtelling */
.countdown {
  max-width: 760px;
  margin: 0 auto 1.25rem;
  text-align: center;
  background: linear-gradient(
    90deg,
    rgba(186, 12, 47, 0.25),
    rgba(0, 32, 91, 0.25)
  );
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.55rem 1rem;
  color: #fff;
  font-size: 0.98rem;
}
.countdown .cd-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.5px;
}

/* Rank-bevegelse (dag til dag) */
.rank {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.mv {
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mv.up {
  color: #1f9d4d;
}
.mv.down {
  color: #d2433a;
}
.mv.flat {
  color: #b9c4bc;
}

/* Kampsenter */
.kampsenter {
  max-width: 760px;
  margin: 2rem auto 0;
}
.ks-title {
  color: #fff;
  text-align: center;
  margin: 0 0 1rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.ks-empty {
  text-align: center;
  color: #eafff0;
}
.ks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.7rem;
}
.ks-match {
  background: var(--card);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
  border-left: 5px solid #cdd9d0;
}
.ks-match.done {
  border-left-color: var(--grass-dark);
}
.ks-match.norway {
  border-left-color: var(--norway);
}
.ks-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.ks-teams {
  font-weight: 700;
  font-size: 0.92rem;
}
.ks-score {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--grass-dark);
}
.ks-time {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}
.ks-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}
.ks-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #eef2ef;
  color: #44544a;
}
.ks-pick i {
  font-style: normal;
  opacity: 0.7;
  font-size: 0.66rem;
}
.ks-pick.hit {
  background: #d8f5e3;
  color: #11703c;
}
.ks-pick.miss {
  background: #fbe0e0;
  color: #b1322b;
}

/* Straffespark-minispill */
.game-wrap {
  max-width: 760px;
  margin: 2rem auto 0;
  display: flex;
  justify-content: center;
}

.game {
  width: 100%;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.25rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.game-title {
  margin: 0 0 0.25rem;
  color: #fff;
  font-size: 1.25rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.game-score {
  margin: 0 0 0.75rem;
  color: #eafff0;
  font-size: 0.95rem;
}
.game-score strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.game-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: grab;
}
.game-canvas:active {
  cursor: grabbing;
}

.game-hint {
  margin: 0.7rem 0 0;
  color: #d7ffe0;
  font-size: 0.85rem;
}
