:root {
  --accent: #e4477f;
  --accent-2: #38c8ff;
  --deep: #111722;
  --paper: #f4fbff;
  --ink: #101828;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Arial, sans-serif;
  color: white;
  background:
    radial-gradient(circle at 78% 18%, rgba(228, 71, 127, .34), transparent 24%),
    radial-gradient(circle at 22% 78%, rgba(56, 200, 255, .28), transparent 27%),
    linear-gradient(115deg, rgba(10, 15, 25, .92), rgba(30, 42, 58, .72)),
    url("assets/stade-france.png") center / cover no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, .16) calc(50% - 1px), rgba(255, 255, 255, .16) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(circle at 50% 50%, transparent 0 108px, rgba(255, 255, 255, .15) 109px 111px, transparent 112px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 88px);
  opacity: .78;
}

body::after {
  content: "";
  position: fixed;
  left: 50%;
  bottom: -16vh;
  z-index: 0;
  width: 88vw;
  height: 36vh;
  border: 2px solid rgba(255, 255, 255, .14);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.stadium-vibe {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.light {
  position: absolute;
  top: -18vh;
  width: 28vw;
  height: 78vh;
  opacity: .26;
  filter: blur(2px);
  background: linear-gradient(180deg, rgba(255, 246, 189, .72), rgba(255, 246, 189, 0));
  transform-origin: top center;
  animation: stadiumLight 7s ease-in-out infinite alternate;
}

.light-left {
  left: 5vw;
  transform: rotate(-18deg);
}

.light-right {
  right: 5vw;
  transform: rotate(18deg);
  animation-delay: -2.5s;
}

.ball {
  position: absolute;
  top: 16vh;
  left: -90px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  opacity: .42;
  background:
    radial-gradient(circle at 50% 50%, #17130f 0 12%, transparent 13%),
    radial-gradient(circle at 32% 28%, #17130f 0 8%, transparent 9%),
    radial-gradient(circle at 68% 30%, #17130f 0 8%, transparent 9%),
    radial-gradient(circle at 35% 72%, #17130f 0 8%, transparent 9%),
    radial-gradient(circle at 68% 70%, #17130f 0 8%, transparent 9%),
    #f8f8f8;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .25);
  animation: ballFloat 18s linear infinite;
}

.crowd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 13vh;
  opacity: .24;
  background:
    radial-gradient(circle at 4% 72%, rgba(0, 0, 0, .85) 0 9px, transparent 10px),
    radial-gradient(circle at 11% 54%, rgba(0, 0, 0, .85) 0 12px, transparent 13px),
    radial-gradient(circle at 20% 70%, rgba(0, 0, 0, .85) 0 10px, transparent 11px),
    radial-gradient(circle at 31% 50%, rgba(0, 0, 0, .85) 0 12px, transparent 13px),
    radial-gradient(circle at 43% 68%, rgba(0, 0, 0, .85) 0 10px, transparent 11px),
    radial-gradient(circle at 54% 52%, rgba(0, 0, 0, .85) 0 12px, transparent 13px),
    radial-gradient(circle at 66% 69%, rgba(0, 0, 0, .85) 0 10px, transparent 11px),
    radial-gradient(circle at 78% 49%, rgba(0, 0, 0, .85) 0 12px, transparent 13px),
    radial-gradient(circle at 89% 67%, rgba(0, 0, 0, .85) 0 10px, transparent 11px),
    radial-gradient(circle at 96% 56%, rgba(0, 0, 0, .85) 0 12px, transparent 13px);
}

.page {
  position: relative;
  z-index: 2;
}

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

.hero {
  width: min(calc(100vw - 48px), calc((100vh - 48px) * 16 / 9));
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: stretch;
  overflow: visible;
}

.hero > * {
  min-width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.brand span {
  display: block;
  min-width: 0;
  width: min(420px, 100%);
  padding: 12px 22px;
  border-radius: 8px;
  color: white;
  text-align: center;
  font-size: clamp(22px, 1.75vw, 30px);
  letter-spacing: 0;
  background: var(--accent);
}

.screen {
  display: contents;
}

.intro {
  grid-column: 1;
  align-self: center;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  margin-top: 0;
  padding: 24px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .22);
  animation: cardEntrance .7s ease both;
}

.qr-panel {
  grid-column: 2;
  align-self: center;
  justify-self: center;
}

.label {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(48px, 3.8vw, 70px);
  line-height: .95;
  white-space: nowrap;
}

.rule {
  max-width: 760px;
  margin: 12px 0 0;
  font-size: clamp(18px, 1.45vw, 24px);
  font-weight: 800;
}

.match-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 221, 128, .55);
  border-radius: 8px;
  color: #fff6ce;
  background:
    linear-gradient(90deg, rgba(255, 221, 128, .18), rgba(255, 255, 255, .05)),
    rgba(0, 0, 0, .2);
  box-shadow: inset 0 0 30px rgba(255, 221, 128, .08);
}

.match-day > span {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-day strong {
  font-size: clamp(16px, 1.2vw, 22px);
  text-align: right;
  text-transform: uppercase;
}

.match {
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  border-left: 8px solid var(--accent);
  background: rgba(244, 251, 255, .16);
}

.match p,
.match span {
  display: block;
  margin: 0;
  color: #d8f3ff;
  font-weight: 700;
}

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

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

.team strong {
  overflow-wrap: anywhere;
}

.versus {
  color: white !important;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.flag-france {
  background: linear-gradient(90deg, #1746a2 0 33.3%, #fff 33.3% 66.6%, #e3273f 66.6%);
}

.flag-cote-ivoire {
  background: linear-gradient(90deg, #f77f00 0 33.3%, #fff 33.3% 66.6%, #169b62 66.6%);
}

.flag-irlande-nord {
  background: linear-gradient(#fff 0 40%, #c8102e 40% 60%, #fff 60%);
}

.flag-default {
  background: #ddd;
}

.team strong {
  display: block;
  margin: 4px 0;
  font-size: clamp(22px, 2vw, 34px);
}

.qr-panel {
  display: grid;
  gap: 18px;
  justify-items: center;
  align-content: center;
  width: min(520px, 86%);
  aspect-ratio: 4 / 3;
  padding: 28px;
  border-radius: 8px;
  color: var(--ink);
  text-align: center;
  background: var(--paper);
  box-shadow: 0 22px 80px rgba(0, 0, 0, .32);
}

.qr-panel img {
  width: 100%;
  max-width: 360px;
}

.qr-panel strong {
  font-size: clamp(22px, 1.65vw, 30px);
  text-transform: uppercase;
}

.card {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(0, 0, 0, .32);
  backdrop-filter: blur(14px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card:focus-within {
  border-color: rgba(255, 221, 128, .65);
  box-shadow: 0 0 0 3px rgba(255, 221, 128, .12);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
}

.field-grid,
.score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.score {
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}

.score label {
  min-width: 0;
  margin-bottom: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.score > span {
  padding-bottom: 26px;
  font-size: 30px;
  font-weight: 900;
}

.score input {
  min-height: 54px;
  padding: 8px;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  background: white;
}

button {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 6px;
  color: white;
  font: inherit;
  font-weight: 900;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}

button:hover {
  background: #ff619b;
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .3);
}

button:active {
  transform: translateY(1px) scale(.99);
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  font-weight: 800;
}

.message.ok {
  color: #a4f7c8;
  animation: successPop .5s ease both;
}

.message.error {
  color: #ffd0d6;
}

.card.vote-success {
  animation: votePulse .7s ease both;
}

.confetti-piece {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  background: var(--accent-2);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: confettiBurst .9s ease-out forwards;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stadiumLight {
  from {
    opacity: .16;
    transform: rotate(-16deg) translateX(-8px);
  }
  to {
    opacity: .33;
    transform: rotate(16deg) translateX(8px);
  }
}

@keyframes ballFloat {
  from {
    transform: translateX(0) rotate(0deg);
  }
  to {
    transform: translateX(calc(100vw + 180px)) rotate(680deg);
  }
}

@keyframes votePulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.015);
    box-shadow: 0 0 0 4px rgba(255, 221, 128, .18), 0 22px 58px rgba(0, 0, 0, .3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes successPop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes confettiBurst {
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r));
  }
}

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(228, 71, 127, .25), transparent 32%),
      linear-gradient(180deg, rgba(17, 23, 34, .94), rgba(17, 23, 34, .72)),
      url("assets/stade-france.png") center / cover no-repeat;
  }

  .page {
    min-height: 100svh;
    padding: 16px;
    align-items: start;
  }

  .hero {
    width: 100%;
    max-width: 520px;
    aspect-ratio: auto;
    display: block;
    overflow: visible;
    margin: 0 auto;
  }

  .brand {
    align-items: stretch;
    width: 100%;
    margin-bottom: 14px;
  }

  .brand span {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    font-size: 22px;
  }

  .screen {
    display: grid;
    gap: 14px;
  }

  .intro {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, .34);
  }

  .light {
    width: 52vw;
    opacity: .2;
  }

  .ball {
    width: 38px;
    height: 38px;
    opacity: .28;
  }

  .label {
    margin-bottom: 8px;
    font-size: 13px;
  }

  h1 {
    white-space: normal;
    font-size: 42px;
    line-height: .95;
  }

  .rule {
    margin-top: 10px;
    font-size: 18px;
  }

  .match-day {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
  }

  .match-day strong {
    text-align: left;
  }

  .match {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
  }

  .teams {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .team {
    width: 100%;
  }

  .team strong {
    font-size: 26px;
  }

  .versus {
    font-size: 18px;
  }

  .qr-panel {
    display: none;
  }

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

  .card {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
  }

  .score > span {
    display: none;
  }

  input,
  button {
    min-height: 48px;
    font-size: 16px;
  }

  .message {
    margin-bottom: 0;
  }
}
