@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@500;700;800;900&display=swap");

:root {
  --ink: #0b0b0b;
  --ink-soft: #554d44;
  --paper: #f6e7cf;
  --paper-strong: #f1dcc1;
  --paper-glass: rgba(246, 231, 207, 0.9);
  --line: rgba(11, 11, 11, 0.18);
  --accent: #2f8d5d;
  --accent-soft: #d8472f;
  --accent-alt: #3674c9;
  --button-bg: #0b0b0b;
  --button-alt-bg: #2f8d5d;
  --button-text: #ffffff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  --radius: 28px;
  --pill: 999px;
}

* {
  box-sizing: border-box;
}


body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: "Archivo", "Arial Narrow", Arial, sans-serif;
  color: white;
  background: #111;
}

.slide {
  position: relative;
  width: min(calc(100vw - 28px), calc((100vh - 28px) * 16 / 9));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.66), rgba(10, 10, 10, 0.3)),
    url("https://images.squarespace-cdn.com/content/v1/68077851cd2459106319f003/78346ec3-e2d8-4435-be82-61ed059e7857/DSC03460-min.jpg") center / cover no-repeat;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.5);
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 32%);
  pointer-events: none;
}

.glow {
  position: absolute;
  inset: -14%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1), transparent 20%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 24%);
}

nav {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 22px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

nav::before {
  content: "";
  margin-right: auto;
  width: min(240px, 20vw);
  height: 88px;
  background: url("https://images.squarespace-cdn.com/content/v1/68077851cd2459106319f003/d28a0954-6348-4834-857a-8e38ae0ae201/CAGEOT_LOGO_SOURCE_BEIGE_POCHOIR.png") left center / contain no-repeat;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--pill);
  color: #f6e7cf;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(11, 11, 11, 0.74);
  backdrop-filter: blur(8px);
}

nav a.active {
  color: var(--button-text);
  background: var(--button-alt-bg);
}

.title,
.score,
.side,
.final-list {
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.title {
  position: absolute;
  left: 40px;
  top: 110px;
  z-index: 2;
  width: 360px;
  padding: 24px;
  background: var(--paper-glass);
  color: var(--ink);
}

h1 {
  margin: 0;
  font-family: "Archivo", "Arial Narrow", Arial, sans-serif;
  font-size: 52px;
  line-height: 0.92;
  text-transform: uppercase;
}

.title p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 14px;
  width: 430px;
  padding: 24px;
  background: var(--paper-glass);
  color: var(--ink);
}

.score-top {
  left: 40px;
  top: 274px;
}

.score-bottom {
  left: 40px;
  bottom: 34px;
}

.score span:first-child,
.match-choice {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.match-choice {
  display: grid;
  gap: 10px;
}

.match-choice select,
.score input {
  width: 100%;
  min-height: 62px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  padding: 0 18px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  background: white;
}

.match-choice select {
  font-size: 18px;
  font-weight: 800;
}

.score strong {
  font-size: 18px;
  line-height: 1.2;
}

.score input {
  width: 72px;
  min-height: 72px;
  padding: 0;
  border-radius: 22px;
  text-align: center;
  font-size: 38px;
  font-weight: 800;
}

.selected-match {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.selected-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.selected-team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.selected-team strong {
  font-size: 24px;
  line-height: 1.1;
}

.selected-versus {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.team-flag {
  display: inline-block;
  width: 36px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

.flag-france {
  background: linear-gradient(90deg, #1f4aa8 0 33.33%, white 33.33% 66.66%, #d83445 66.66%);
}

.flag-cote-divoire {
  background: linear-gradient(90deg, #ef8a28 0 33.33%, white 33.33% 66.66%, #2e9b47 66.66%);
}

.flag-irlande-du-nord {
  background: linear-gradient(180deg, white 0 100%);
}

.flag-senegal {
  background: linear-gradient(90deg, #118c4f 0 33.33%, #f5d24b 33.33% 66.66%, #cf2d37 66.66%);
}

.flag-irak {
  background: linear-gradient(180deg, #cf2d37 0 33.33%, white 33.33% 66.66%, #111111 66.66%);
}

.flag-norvege {
  background:
    linear-gradient(90deg, #ba2f3b 0 100%),
    linear-gradient(90deg, transparent 0 28%, white 28% 38%, #234b9e 38% 44%, white 44% 54%, transparent 54%),
    linear-gradient(180deg, transparent 0 38%, white 38% 48%, #234b9e 48% 54%, white 54% 64%, transparent 64%);
  background-blend-mode: normal;
}

.flag-default {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

#selectedMatchTitle {
  margin: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
}

#selectedMatchDetails,
#matchBottomDetails {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
}

.score-top > strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.score-top > strong > span {
  font-size: 24px;
  font-weight: 800;
}

.score-top > strong > span:first-child {
  color: var(--accent);
}

.score-bottom strong {
  display: block;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
}

.selected-teams-bottom .selected-team strong {
  font-size: 20px;
}

.selected-teams-bottom .team-flag {
  width: 30px;
  height: 20px;
}

.center {
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
}

.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(
      #d8472f 0 17%,
      #3674c9 17% 34%,
      #2f8d5d 34% 51%,
      #f6e7cf 51% 68%,
      #d8472f 68% 84%,
      #3674c9 84% 100%
    );
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.18), 0 24px 80px rgba(0, 0, 0, 0.45);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 80px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.94);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.16);
}

.drawing .wheel {
  animation: wheelSpin 0.35s linear infinite;
}

@keyframes wheelSpin {
  to {
    transform: rotate(360deg);
  }
}

.center button {
  position: relative;
  z-index: 2;
  width: 168px;
  height: 168px;
  border: 0;
  border-radius: 50%;
  color: var(--button-text);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--button-alt-bg);
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.center button:disabled {
  opacity: 0.72;
}

.side {
  position: absolute;
  right: 40px;
  top: 128px;
  z-index: 2;
  width: 310px;
  padding: 22px;
  background: var(--paper-glass);
  color: var(--ink);
}

.side h2 {
  margin: 0 0 14px;
  font-size: 18px;
  text-transform: uppercase;
}

.people {
  display: grid;
  gap: 10px;
}

.person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  font-weight: 700;
}

.empty {
  margin: 0;
  color: var(--ink-soft);
}

.name-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.name-rain span {
  position: absolute;
  min-width: 124px;
  padding: 10px 14px;
  border-radius: var(--pill);
  color: white;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  background: rgba(17, 17, 17, 0.64);
  opacity: 0;
}

.drawing .name-rain span {
  animation: nameRain 1.4s ease-in-out infinite;
}

.drawing .name-rain span:nth-child(1) { left: 8%; top: 14%; animation-delay: 0s; }
.drawing .name-rain span:nth-child(2) { left: 68%; top: 16%; animation-delay: 0.08s; }
.drawing .name-rain span:nth-child(3) { left: 13%; top: 74%; animation-delay: 0.16s; }
.drawing .name-rain span:nth-child(4) { left: 70%; top: 76%; animation-delay: 0.24s; }
.drawing .name-rain span:nth-child(5) { left: 52%; top: 22%; animation-delay: 0.32s; }
.drawing .name-rain span:nth-child(6) { left: 56%; top: 70%; animation-delay: 0.4s; }
.drawing .name-rain span:nth-child(7) { left: 30%; top: 18%; animation-delay: 0.48s; }
.drawing .name-rain span:nth-child(8) { left: 26%; top: 78%; animation-delay: 0.56s; }
.drawing .name-rain span:nth-child(9) { left: 77%; top: 45%; animation-delay: 0.64s; }
.drawing .name-rain span:nth-child(10) { left: 12%; top: 46%; animation-delay: 0.72s; }

@keyframes nameRain {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-12px);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.02) translateY(18px);
  }
}

.winners {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.winner {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.winner strong {
  display: block;
  color: white;
  font-size: 64px;
  line-height: 1;
}

.winner span {
  display: inline-flex;
  align-items: center;
  min-height: 60px;
  padding: 0 22px;
  border-radius: var(--pill);
  background: rgba(17, 17, 17, 0.78);
  color: white;
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
}

.winner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.final-list {
  position: absolute;
  left: 24px;
  bottom: 22px;
  z-index: 2;
  display: none;
  gap: 8px;
  width: 280px;
  padding: 12px;
  background: var(--paper-glass);
  color: var(--ink);
}

.finished .final-list {
  display: grid;
}

.final-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.final-card b {
  color: var(--accent);
  font-size: 18px;
}

.final-card span {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.title {
  left: auto;
  right: 40px;
  top: 86px;
  width: 260px;
  padding: 16px 18px;
}

.title h1 {
  font-size: 34px;
}

.title p {
  margin-top: 8px;
  font-size: 13px;
}

.score {
  width: 300px;
}

.score-top {
  top: 118px;
}

.score-bottom {
  display: none;
}

.side {
  top: 208px;
}

.selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.selection-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.selection-dates {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.date-short {
  min-width: 58px;
}

.match-choice {
  gap: 0;
}

.match-choice select {
  min-height: 44px;
  font-size: 15px;
  font-weight: 800;
}

.selected-match {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.selected-match strong {
  display: block;
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.05;
}

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

.selected-flags .team-flag {
  width: 32px;
  height: 22px;
}

.score-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: center;
}

.score-line > span {
  font-size: 15px;
  font-weight: 800;
}

.score-line > span:first-child {
  color: var(--accent);
}

@media (max-width: 900px) {
  .title,
  .score,
  .side,
  .final-list {
    position: static;
    width: auto;
  }

  .slide {
    display: grid;
    gap: 14px;
    padding: 14px;
  }

  nav {
    position: static;
  }

  .title {
    order: 1;
  }

  .score-top {
    order: 2;
  }

  .center {
    position: static;
    order: 3;
    transform: none;
    margin: 0 auto;
  }

  .side {
    order: 4;
  }

  .selection-head {
    flex-direction: column;
  }

  .selection-dates {
    justify-content: flex-start;
  }
}
