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

:root {
  --ink: #131313;
  --paper: rgba(8, 12, 20, 0.64);
  --paper-soft: rgba(246, 240, 232, 0.16);
  --paper-card: rgba(8, 12, 20, 0.76);
  --line: rgba(255, 255, 255, 0.16);
  --accent: #14706a;
  --accent-soft: #d8745d;
  --danger: #bf2e3a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --radius: 28px;
  --pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", "Avenir Next", Arial, sans-serif;
  color: white;
  background:
    linear-gradient(180deg, rgba(8, 14, 28, 0.82), rgba(8, 14, 28, 0.58)),
    linear-gradient(90deg, rgba(8, 14, 28, 0.4), rgba(8, 14, 28, 0.14)),
    url("https://images.squarespace-cdn.com/content/v1/609e9b334e21fc304759e644/ae9293df-4092-4796-be81-70db0592faa4/Terrasse+la+Friche+Montaudran+-+LA+FRICHE+GOURMANDE.webp") center / cover no-repeat fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 100%, rgba(47, 131, 63, 0.18), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.04));
}

.vote-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.vote-stage {
  width: min(calc(100vw - 36px), calc((100vh - 36px) * 16 / 9));
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.stage-head {
  display: flex;
  align-items: flex-start;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
}

.stage-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
}

.stage-body::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-0.5px);
}

.vote-panel {
  min-height: 0;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.vote-panel-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.vote-panel-qr {
  display: grid;
  place-items: center;
}

.intro-block {
  display: grid;
  gap: 10px;
}

.label {
  margin: 0;
  color: #4fb2f8;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 4.5vw, 76px);
  line-height: 0.94;
}

.rule {
  margin: 0;
  max-width: 760px;
  font-size: clamp(17px, 1.3vw, 22px);
  font-weight: 700;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-pill,
.status-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 800;
}

.status-pill {
  background: rgba(20, 112, 106, 0.22);
  color: #b8f2eb;
  text-transform: uppercase;
}

.status-pill.closed {
  background: rgba(191, 46, 58, 0.22);
  color: #ffd5d9;
}

.status-note {
  background: rgba(255, 255, 255, 0.08);
}

.match-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-left: 8px solid var(--accent);
  background: rgba(140, 150, 170, 0.28);
}

.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-head span,
.match-head strong,
.match-details {
  margin: 0;
  font-weight: 800;
}

.match-head span {
  font-size: 16px;
}

.match-head strong {
  font-size: 14px;
  text-transform: uppercase;
}

.match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-right {
  justify-content: flex-end;
}

.team strong {
  font-size: clamp(22px, 1.9vw, 34px);
  line-height: 1;
}

.versus {
  font-size: 24px;
  font-weight: 800;
}

.match-details {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.team-flag {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(90deg, #d9d9d9, #f5f5f5);
  flex: 0 0 auto;
}

.flag-france {
  background: linear-gradient(90deg, #2753a5 0 33.33%, white 33.33% 66.66%, #e33a47 66.66%);
}

.flag-cote-ivoire {
  background: linear-gradient(90deg, #f08a24 0 33.33%, white 33.33% 66.66%, #2aa54b 66.66%);
}

.flag-irlande-nord {
  background:
    linear-gradient(90deg, #ffffff 0 100%),
    linear-gradient(45deg, transparent 46%, #d72027 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #d72027 46% 54%, transparent 54%);
}

.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));
}

.vote-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-card);
}

.field-grid,
.score-grid {
  display: grid;
  gap: 14px;
}

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

.score-grid {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 0 16px;
  color: var(--ink);
  font: inherit;
  background: white;
}

.score-grid input {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.score-separator {
  align-self: center;
  padding-bottom: 10px;
  font-size: 22px;
  font-weight: 800;
}

button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: white;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  background: var(--accent);
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.message {
  min-height: 24px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.message.ok {
  color: #b8f2eb;
}

.message.error {
  color: #ffd5d9;
}

.vote-success {
  animation: votePulse 0.7s ease;
}

@keyframes votePulse {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.01);
  }
}

.qr-card {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.qr-card img {
  width: min(360px, 100%);
  height: auto;
  padding: 18px;
  background: white;
}

.qr-card strong {
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
}

.qr-card p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.vote-closed .vote-card {
  opacity: 0.8;
}

@media (max-width: 980px) {
  .vote-page {
    padding: 14px;
  }

  .vote-stage {
    width: 100%;
    aspect-ratio: auto;
    gap: 14px;
  }

  .stage-body {
    grid-template-columns: 1fr;
  }

  .stage-body::after,
  .vote-panel-qr {
    display: none;
  }

  .vote-panel-main,
  .vote-panel {
    padding: 18px;
  }

  h1 {
    font-size: clamp(36px, 10vw, 54px);
  }

  .rule {
    font-size: 17px;
  }

  .field-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .score-separator {
    display: none;
  }
}
