@font-face {
  font-family: "Hurme Geometric Sans 4";
  src: url("/brand/fonts/HurmeGeometricSans4-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hurme Geometric Sans 4";
  src: url("/brand/fonts/HurmeGeometricSans4-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hurme Geometric Sans 4";
  src: url("/brand/fonts/HurmeGeometricSans4-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hurme Geometric Sans 4";
  src: url("/brand/fonts/HurmeGeometricSans4-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hurme FIN Mono 1a";
  src: url("/brand/fonts/HurmeFINMono1a-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hurme FIN Mono 1a";
  src: url("/brand/fonts/HurmeFINMono1a-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand-sunrise: #eb5d0b;
  --brand-sunrise-dark: #b84202;
  --brand-sunrise-soft: #ffe3d1;
  --brand-ink: #17120f;
  --brand-ink-soft: #2e2722;
  --brand-paper: #fffaf7;
  --brand-peach: #fff0e7;
  --brand-lavender: #ece8ff;
  --brand-plum: #4a3279;
  --bg: #fff7f2;
  --surface: rgba(255, 255, 255, .92);
  --surface-2: #fff0e7;
  --border: rgba(46, 39, 34, .15);
  --text: var(--brand-ink);
  --muted: #685d55;
  --accent: var(--brand-sunrise);
  --accent-strong: var(--brand-sunrise-dark);
  --success: #13865c;
  --warning: #c76700;
  --danger: #b83243;
  --shadow: 0 20px 54px rgba(46, 31, 20, .13);
  --radius: 8px;
  font-family: "Hurme Geometric Sans 4", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 247, .9), rgba(255, 244, 237, .96)),
    url("/brand/images/criteo-background-sunrise-gradient.png") center / cover no-repeat fixed;
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; }
a { color: var(--accent-strong); }
:focus-visible { outline: 3px solid rgba(235, 93, 11, .75); outline-offset: 3px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .72rem 1rem;
  background: var(--accent);
  color: var(--brand-ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); background: #f1732c; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button.secondary { background: rgba(255, 255, 255, .82); border-color: var(--border); color: var(--text); }
.button.secondary:hover { background: #fff; }
.button.danger { background: #ffdfe5; border-color: rgba(184, 50, 67, .36); color: #7e1223; }
.button.warning { background: #ffe4cc; border-color: rgba(199, 103, 0, .36); color: #673300; }
.button.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.button.small { min-height: 36px; padding: .42rem .7rem; font-size: .88rem; }

.field { display: grid; gap: .42rem; }
.field label, .label { color: var(--muted); font-size: .88rem; font-weight: 700; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  color: var(--text);
  padding: .8rem .9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #8c8179; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .34rem .68rem;
  color: var(--muted);
  background: rgba(255, 255, 255, .74);
  font-size: .84rem;
  font-weight: 700;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.connected::before { background: var(--success); box-shadow: 0 0 0 4px rgba(19, 134, 92, .14); }
.pill.reconnecting::before { background: var(--warning); }
.pill.error::before { background: var(--danger); }

.brand-lockup {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
}
.brand-logo {
  display: block;
  width: auto;
  height: clamp(1.25rem, 2.6vw, 1.85rem);
  flex: none;
}
.brand-event {
  display: grid;
  gap: .1rem;
  min-width: 0;
}
.brand-event-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 800;
  line-height: 1.08;
}
.brand-event-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.2;
}
.brand { font-weight: 900; letter-spacing: 0; }

.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 .45rem;
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.title { margin: 0; line-height: 1.04; letter-spacing: 0; }
.subtitle { margin: .65rem 0 0; color: var(--muted); line-height: 1.55; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.error-banner, .notice-banner {
  border-radius: 8px;
  padding: .8rem 1rem;
  line-height: 1.45;
}
.error-banner { background: #ffe3e8; border: 1px solid rgba(184, 50, 67, .38); color: #7e1223; }
.notice-banner { background: var(--brand-sunrise-soft); border: 1px solid rgba(235, 93, 11, .34); color: #6c3104; }

.tally { display: grid; gap: .72rem; }
.tally-row { display: grid; grid-template-columns: minmax(84px, auto) 1fr auto; align-items: center; gap: .8rem; }
.tally-label { color: var(--muted); font-size: .9rem; font-weight: 700; }
.tally-track { height: 18px; background: rgba(46, 39, 34, .08); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.tally-fill { height: 100%; min-width: 4px; border-radius: inherit; background: linear-gradient(90deg, var(--brand-sunrise), #ffb199, var(--brand-plum)); transform-origin: left; animation: fill-in .45s ease both; }
.tally-count { min-width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.tally-progress {
  width: 100%;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(46, 39, 34, .08);
}
.tally-progress::-webkit-progress-bar { background: rgba(46, 39, 34, .08); }
.tally-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brand-sunrise), #ffb199, var(--brand-plum)); border-radius: 999px; }
.tally-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--brand-sunrise), #ffb199, var(--brand-plum)); border-radius: 999px; }

code,
.code-input,
.code-large,
.manual-code {
  font-family: "Hurme FIN Mono 1a", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.winner-burst {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.reveal-content {
  position: relative;
  z-index: 1;
}
.confetti-burst {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: var(--piece-color);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.3) rotate(0deg);
  animation: confetti-burst 2.6s cubic-bezier(.16, .82, .28, 1) forwards;
}
.confetti-piece.round {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}
.winner-chip, .display-winner-card {
  animation: winner-name-burst .72s cubic-bezier(.18, .9, .2, 1.1) both;
}
.winner-chip:nth-child(2), .display-winner-card:nth-child(2) { animation-delay: .08s; }
.winner-chip:nth-child(3), .display-winner-card:nth-child(3) { animation-delay: .16s; }
.winner-chip:nth-child(4), .display-winner-card:nth-child(4) { animation-delay: .24s; }

@keyframes fill-in { from { transform: scaleX(.05); opacity: .3; } to { transform: scaleX(1); opacity: 1; } }
@keyframes reveal-pop { 0% { transform: scale(.92); opacity: 0; } 65% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }
@keyframes confetti-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.25) rotate(0deg); }
  14% { opacity: 1; }
  62% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + var(--fall))) scale(1) rotate(calc(var(--rot) + 260deg)); }
}
@keyframes winner-name-burst {
  0% { opacity: 0; transform: scale(.72); filter: blur(8px); }
  64% { opacity: 1; transform: scale(1.06); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes reduced-reveal { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
@keyframes countdown-pulse {
  0% { transform: scale(.86); opacity: .72; }
  45% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.96); opacity: .88; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
  .confetti-burst { display: none !important; }
  .winner-burst, .winner-chip, .display-winner-card { animation: reduced-reveal .28s ease-out both !important; }
}

.round-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: max-content;
  max-width: 100%;
  padding: .55rem .72rem;
  border: 1px solid rgba(235, 93, 11, .32);
  border-radius: 8px;
  background: rgba(255, 250, 247, .72);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.round-timer-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}
.round-timer-value {
  color: var(--accent-strong);
  font-size: 1.2rem;
  line-height: 1;
}
.round-timer.expired {
  border-color: rgba(208, 74, 92, .42);
  background: rgba(255, 226, 230, .78);
}
.round-timer.expired .round-timer-value { color: var(--danger); }
