/* ==========================================================================
   opensubmit.no — design system (open-base)
   Ultra-minimal: light neutral background, white borderless surfaces, pills,
   near-monochrome. Geist for content, Geist Mono for numbers and micro labels.
   The accent color is reserved for alarm/critical states only.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-var-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1EFF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-var-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1EFF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --surface-3: #e9e9e6;
  --text: #171717;
  --text-2: #666666;
  --text-3: #6f6f6f;
  --border: rgba(0, 0, 0, 0.05);
  --border-strong: rgba(0, 0, 0, 0.1);

  --accent: #d92d20;
  --accent-soft: rgba(217, 45, 32, 0.08);

  --ok: #157f3d;

  --inverse-bg: #171717;
  --inverse-text: #fafafa;

  --ring: rgba(0, 0, 0, 0.1);
  --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.04), 0 24px 60px rgba(0, 0, 0, 0.1);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #191919;
  --surface-2: #0e0e0e;
  --surface-3: #262626;
  --text: #ededed;
  --text-2: #a3a3a3;
  --text-3: #9a9a9a;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  --accent: #f4645a;
  --accent-soft: rgba(244, 100, 90, 0.12);

  --ok: #6ccb8b;

  --inverse-bg: #fafafa;
  --inverse-text: #171717;

  --ring: rgba(255, 255, 255, 0.16);
  --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);

  --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* System dark mode applies unless the user explicitly chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --surface: #191919;
    --surface-2: #0e0e0e;
    --surface-3: #262626;
    --text: #ededed;
    --text-2: #a3a3a3;
    --text-3: #9a9a9a;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);

    --accent: #f4645a;
    --accent-soft: rgba(244, 100, 90, 0.12);

    --ok: #6ccb8b;

    --inverse-bg: #fafafa;
    --inverse-text: #171717;

    --ring: rgba(255, 255, 255, 0.16);
    --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);

    --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Numbers and data: mono with tabular digits so nothing jumps */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

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

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--surface-3); }

/* UI chrome must not be text-selectable (iOS long-press etc.).
   Real content/data the user may want to copy stays selectable. */
button, .site-header, .site-footer, .menu, .toast {
  -webkit-user-select: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header { background: transparent; }

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-tld { color: var(--text-3); font-weight: 500; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(0.94); }

.icon-btn.open { background: var(--inverse-bg); color: var(--inverse-text); }

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
              transform 0.15s ease, opacity 0.15s ease;
}

.pill-btn:active { transform: scale(0.97); }

.pill-btn.primary { background: var(--inverse-bg); color: var(--inverse-text); }
.pill-btn.primary:hover { opacity: 0.85; }

.pill-btn.ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}

.pill-btn.ghost:hover { background: var(--surface-2); }
.pill-btn[disabled] { opacity: 0.4; pointer-events: none; }

.pill-btn.big { height: 52px; padding: 0 30px; font-size: 16px; }
.pill-btn.sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.pill-btn.wide { width: 100%; }

/* --------------------------------------------------------------------------
   Settings menu
   -------------------------------------------------------------------------- */

.settings-wrap { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 296px;
  max-height: min(560px, calc(100dvh - 90px));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-overlay);
  padding: 20px;
  z-index: 60;
  transform-origin: top right;
  animation: menu-in 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes menu-in {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* Options share the row evenly when they fit; locales with long words
   wrap to their own row rather than wrapping inside the button */
.menu-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-grid .opt-btn { flex: 1 1 auto; white-space: nowrap; }

.menu-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background-color: var(--surface-2);
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 15px;
  border: none;
  border-radius: 12px;
  padding: 11px 44px 11px 14px;
  cursor: pointer;
}

.opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  color: var(--text-2);
  transition: background-color 0.13s ease, color 0.13s ease, transform 0.13s ease;
}

.opt-btn .icon { width: 14px; height: 14px; }

.opt-btn:hover { background: var(--surface-3); color: var(--text); }
.opt-btn:active { transform: scale(0.97); }

.opt-btn.active {
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-weight: 600;
}

.opt-btn.wide { width: 100%; }
.opt-btn.wide + .opt-btn.wide { margin-top: 8px; }
.opt-btn.copied { background: var(--ok); color: #fff; }
.opt-btn.armed { background: var(--accent-soft); color: var(--accent); }

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 18px -20px;
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s ease;
  margin: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s ease;
}

.switch:checked { background: var(--inverse-bg); }
.switch:checked::after { transform: translateX(17px); background: var(--inverse-text); }

.menu-info {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--text-3);
}

.menu-info a { color: var(--text-2); text-decoration: none; }
.menu-info a:hover { text-decoration: underline; }

.menu-year { margin-top: 6px; }

/* --------------------------------------------------------------------------
   Layout + shared product atoms
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
}

.container.narrow { max-width: 600px; }

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
}

.muted { color: var(--text-2); }
.tiny { font-size: 12.5px; line-height: 1.6; }
.center { text-align: center; }

.state-view { padding: 56px 0; text-align: center; }
.state-view h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.01em; }
.state-view p { margin: 0 0 20px; }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.field-err {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.text-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* ≥16px: iOS must not zoom on focus */
}

.text-input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.text-input::placeholder { color: var(--text-3); opacity: 0.7; }

.ev-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin: 26px 0 2px;
}

.ev-name {
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

@keyframes rise {
  /* opacity starts at 0.01, never 0: an element at exactly 0 is never
     painted and Lighthouse charges the whole fade to LCP as render delay */
  from { opacity: 0.01; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Landing
   -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 36px 0 26px;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.hero-title {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 12px;
}

.lead {
  color: var(--text-2);
  font-size: 16.5px;
  max-width: 480px;
  margin: 0 auto;
}

.create-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: 24px;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.06s both;
}

.slug-row {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: 14px;
  height: 54px;
  padding: 0 16px;
}

.slug-row:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }

.slug-prefix {
  color: var(--text-3);
  font-size: 15px;
  white-space: nowrap;
  user-select: none;
}

.slug-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 16px;
  outline: none;
  padding: 0;
}

.slug-input::placeholder { color: var(--text-3); opacity: 0.6; }

.create-card .pill-btn { margin-top: 4px; }

.mine {
  margin-top: 28px;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.1s both;
}

.mine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mine-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.mine-link:hover { background: var(--surface-3); }
.mine-link .icon { width: 17px; height: 17px; color: var(--text-3); }

.how {
  margin: 44px 0 24px;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) 0.14s both;
}

.how-title {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 14px;
}

.how-list {
  list-style: none;
  counter-reset: how;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-list li {
  counter-increment: how;
  position: relative;
  padding-left: 38px;
  color: var(--text-2);
  font-size: 14.5px;
}

.how-list li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Participant page
   -------------------------------------------------------------------------- */

.lead-sm { color: var(--text-2); margin: 0 0 18px; }

.form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 24px;
}

.field { display: flex; flex-direction: column; gap: 8px; }

.form-card .pill-btn.primary { margin-top: 4px; }

.ticket-card {
  position: relative;
  text-align: center;
  padding: 36px 24px 30px;
  border-radius: 24px;
  margin: 10px 0 14px;
}

.ticket-card.pop { animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); }

@keyframes pop {
  from { transform: scale(0.94); }
  60% { transform: scale(1.015); }
  to { transform: scale(1); }
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  margin: 0 auto 16px;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

.sent-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.ticket-card .muted { margin: 0 auto; max-width: 340px; font-size: 14.5px; }

.ticket-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin: 0;
}

.ticket-num {
  font-size: 76px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 6px 0 2px;
}

.ticket-name { font-size: 16px; color: var(--text-2); margin: 0 0 14px; }

.won-title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.won-emoji { font-size: 42px; margin: 8px 0 6px; }
.ticket-num-sm { font-size: 15px; color: var(--text-2); margin: 0; }

.winner-note { font-size: 14px; color: var(--text-2); margin: 0 0 14px; }

.recap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.recap-text { min-width: 0; }
.recap .menu-label { margin-bottom: 4px; }

.recap-line {
  margin: 0;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recap-sep { color: var(--text-3); }

.recap-url {
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}

.recap-url:hover { text-decoration: underline; }

.recap .pill-btn { flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Host panel
   -------------------------------------------------------------------------- */

.key-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
  border-radius: 24px;
}

.key-card h2 { margin: 0 0 6px; font-size: 20px; }
.key-card .muted { font-size: 14.5px; margin: 0 0 16px; }

.key-row { display: flex; gap: 10px; }
.key-row .text-input { flex: 1; min-width: 0; }
.key-row .pill-btn { flex-shrink: 0; height: 52px; }
.key-card .field-err { margin-top: 10px; }

.join-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 32px;
  border-radius: 24px;
  margin-top: 8px;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.join-info { min-width: 0; }
.join-card .ev-label { margin: 0; }

.join-url {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
}

.scan-hint { font-size: 13.5px; margin: 0; }

/* The QR keeps its own white card: a code needs dark-on-light with a quiet
   zone to scan reliably, also in dark mode. */
.qr-box {
  width: clamp(150px, 24vw, 208px);
  aspect-ratio: 1;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
}

.qr-box svg { display: block; width: 100%; height: 100%; }

.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 12px;
}

.stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.stat-dot { color: var(--text-3); }

.winners-line { margin: 0 0 12px; }

.sub-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: 16px;
  padding: 9px 10px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.sub-row:hover { background: var(--surface-3); }
.sub-row.pending { opacity: 0.55; pointer-events: none; }

.sub-row.flash { animation: row-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

@keyframes row-in {
  from { opacity: 0.01; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ticket-slot {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 650;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
              transform 0.15s ease;
}

.ticket-slot .icon { width: 18px; height: 18px; opacity: 0.55; }

.sub-row:hover .ticket-slot { border-color: var(--text-3); color: var(--text-2); }

.sub-row.ticketed .ticket-slot {
  background: var(--inverse-bg);
  color: var(--inverse-text);
  border: 1.5px solid var(--inverse-bg);
}

.sub-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sub-name {
  font-size: 15.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }

.icon-btn.sm { width: 38px; height: 38px; background: transparent; color: var(--text-3); }
.icon-btn.sm .icon { width: 17px; height: 17px; }
.icon-btn.sm:hover { background: var(--surface-2); color: var(--text); }

.row-remove.armed { background: var(--accent-soft); color: var(--accent); }

.empty-line { padding: 20px 0 32px; }

/* --------------------------------------------------------------------------
   Big-screen view (/:slug/display)
   -------------------------------------------------------------------------- */

.display-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 32px;
}

.display-stage { position: relative; width: 100%; }

.display-main .ev-label { margin: 0 0 2px; font-size: 13px; }

.display-url {
  font-size: clamp(32px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 4px 0 30px;
  overflow-wrap: anywhere;
}

.display-qr {
  width: min(44vh, 400px, 78vw);
  margin: 0 auto;
  border-radius: 24px;
  padding: 10px;
}

.display-scan { margin: 24px 0 0; font-size: 15.5px; }

.display-counts {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

.display-winner-name {
  font-size: clamp(44px, 10vw, 120px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-height: 1.15em;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.display-winner-name.reveal { animation: reveal-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.35); }

.display-winner-ticket { font-size: 18px; color: var(--text-2); margin: 16px 0 0; }

.display-prev { margin: 40px 0 0; }

/* --------------------------------------------------------------------------
   Draw overlay
   -------------------------------------------------------------------------- */

.no-scroll { overflow: hidden; }

.draw-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: overlay-in 0.25s ease both;
}

@keyframes overlay-in {
  from { opacity: 0.01; }
  to { opacity: 1; }
}

.draw-stage {
  position: relative;
  text-align: center;
  padding: 40px;
  max-width: min(920px, 92vw);
}

.draw-label { margin: 0 0 10px; }

.draw-name {
  font-size: clamp(40px, 9vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-height: 1.15em;
  margin: 0;
  overflow-wrap: anywhere;
}

.draw-name.reveal { animation: reveal-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.35); }

@keyframes reveal-pop {
  from { transform: scale(0.82); opacity: 0.01; }
  to { transform: scale(1); opacity: 1; }
}

.draw-ticket { font-size: 17px; color: var(--text-2); margin: 14px 0 0; }

.draw-actions {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.confetti {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  inset: auto; /* resets popover UA styling (inset: 0) */
  margin: 0;
  border: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 100;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .menu { width: min(296px, calc(100vw - 32px)); }

  .join-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 20px;
    padding: 24px;
  }

  .qr-box { margin: 0 auto; width: min(240px, 70vw); }

  .stats-row { flex-wrap: wrap; }

  .recap { flex-wrap: wrap; }

  .key-row { flex-direction: column; }
  .key-row .pill-btn { width: 100%; }
}
