/* ==========================================================================
   Fortune Wheel — Editorial Luxury theme
   Fonts: Fraunces (display), Geist (UI). Palette: cream + ink + wine.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..800;1,9..144,300..800&family=Geist:wght@300..700&family=Geist+Mono:wght@400..600&display=swap');

:root {
  /* Palette */
  --bg: #f7f3ec;
  --bg-tint: #efe7d6;
  --surface: #ffffff;
  --surface-2: #faf6ed;
  --surface-3: #efe7d6;
  --ink: #16161a;
  --ink-soft: #2e2e34;
  --ink-tertiary: #565359;
  --muted: #76706a;
  --muted-soft: #a8a094;
  --line: #e4dccb;
  --line-strong: #c9bfa9;
  --accent: #8a1f3d;
  --accent-soft: #a32e51;
  --accent-bg: rgba(138, 31, 61, 0.08);
  --accent-fg: #ffffff;
  --gold: #b08c3e;
  --ok: #2f6a3c;
  --ok-bg: rgba(47, 106, 60, 0.1);
  --warn: #a76b1c;
  --warn-bg: rgba(167, 107, 28, 0.12);
  --bad: #a83232;
  --bad-bg: rgba(168, 50, 50, 0.1);

  /* Typography */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Sizing */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(22, 22, 26, 0.04);
  --shadow-sm: 0 1px 2px rgba(22, 22, 26, 0.04), 0 2px 6px rgba(22, 22, 26, 0.05);
  --shadow-md: 0 2px 4px rgba(22, 22, 26, 0.04), 0 12px 28px rgba(22, 22, 26, 0.06);
  --shadow-lg: 0 8px 24px rgba(22, 22, 26, 0.08), 0 32px 64px rgba(22, 22, 26, 0.1);

  /* Transitions */
  --t-fast: 120ms ease;
  --t: 180ms ease;
  --t-slow: 280ms cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: light;
}

/* ============== Reset ============== */

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

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01";
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* ============== Typography ============== */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Landing page (registration)
   ========================================================================== */

body.landing {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(138, 31, 61, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(176, 140, 62, 0.12), transparent 60%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem);
}

.landing-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.landing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4rem);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 1.75rem;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.landing-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.75rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

.landing-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin: 1.25rem auto 0;
}

.landing-subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink-tertiary);
  line-height: 1.55;
}

.landing-subtitle span {
  color: var(--accent);
  font-weight: 500;
}

.landing-form {
  display: grid;
  gap: 0.85rem;
  text-align: left;
}

.landing-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: -0.25rem;
}

.landing-form input[type="text"],
.landing-form input[type="tel"],
.landing-form input[type="email"] {
  width: 100%;
  padding: 0.95rem 1.1rem;
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.landing-form input::placeholder {
  color: var(--muted-soft);
}

.landing-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.landing-form button[type="submit"] {
  margin-top: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius);
  transition: background var(--t), transform var(--t);
}

.landing-form button[type="submit"]:hover:not(:disabled) {
  background: var(--accent);
}

.landing-form button[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
}

.landing-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.2em;
  text-align: center;
  color: var(--muted);
}

.form-status--error { color: var(--bad); }
.form-status--success { color: var(--ok); }

.landing-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-soft);
  text-align: center;
}

.landing-closed {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  display: grid;
  gap: 0.5rem;
}

.landing-closed__title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
}

.landing-closed__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Admin layout
   ========================================================================== */

body.admin-body {
  background:
    radial-gradient(1400px 700px at 100% 0%, rgba(138, 31, 61, 0.06), transparent 55%),
    radial-gradient(900px 500px at 0% 100%, rgba(176, 140, 62, 0.08), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1rem 1.5rem;
}

@media (max-width: 1024px) {
  .admin-layout {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }
}

/* ---- Wheel column ---- */

.wheel-column {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

/* ---- Topbar (slim header) ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(176, 140, 62, 0.08) 0%, transparent 30%, transparent 70%, rgba(138, 31, 61, 0.06) 100%);
}

.topbar > * { position: relative; z-index: 1; }

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.brand-mark {
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.topbar__stats {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.topbar-stat {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}

.topbar-stat strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1;
}

.topbar-stat--accent strong { color: var(--accent); }

.topbar__actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: border-color var(--t), color var(--t), background var(--t), transform var(--t);
}

.topbar-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-1px);
}

.topbar-link__icon { font-size: 0.95rem; line-height: 1; }

.topbar-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.95rem;
  transition: border-color var(--t), background var(--t);
}

.topbar-btn:hover {
  border-color: var(--gold);
  background: var(--surface);
}

.topbar-round {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.topbar-round span {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-round strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--gold);
}

/* ---- Wheel stage ---- */

.wheel-stage {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem clamp(0.85rem, 2vw, 1.5rem) 1rem;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  position: relative;
  overflow: hidden;
}

.wheel-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(176, 140, 62, 0.06), transparent 60%);
}

.wheel-stage > * { position: relative; z-index: 1; }

.wheel-frame {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 1 / 1;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(22, 22, 26, 0.12));
  transition: transform 60ms linear;
}

.wheel-frame--spinning #wheelCanvas {
  filter: drop-shadow(0 16px 36px rgba(138, 31, 61, 0.25));
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid var(--accent);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  z-index: 2;
}

.wheel-tooltip {
  position: absolute;
  background: var(--ink);
  color: var(--surface);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -110%);
  transition: opacity var(--t-fast);
  z-index: 5;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.wheel-tooltip--visible {
  opacity: 1;
}

.wheel-tooltip__name {
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.wheel-tooltip__contact {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}

.winner-highlight {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 2.2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  line-height: 1.2;
}

.winner-highlight strong {
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  display: block;
  font-size: 1.55rem;
  margin-top: 0.1rem;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1.1;
}

.winner-highlight .meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-soft);
  letter-spacing: 0;
  text-transform: none;
}

.action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 540px;
}

.action-row button {
  padding: 0.7rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}

#spinButton {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 50%, var(--accent) 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: var(--accent-fg);
  flex: 1 1 220px;
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  border: 1px solid rgba(176, 140, 62, 0.45);
  box-shadow: 0 4px 14px rgba(138, 31, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
}

#spinButton:hover:not(:disabled) {
  background-position: 100% 50%;
  box-shadow: 0 6px 20px rgba(138, 31, 61, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#spinButton:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(138, 31, 61, 0.25);
}

#spinButton.pulse-ready {
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(138, 31, 61, 0.22), 0 0 0 0 rgba(138, 31, 61, 0.5); }
  50% { box-shadow: 0 4px 14px rgba(138, 31, 61, 0.22), 0 0 0 12px rgba(138, 31, 61, 0); }
}

#spinButton:disabled {
  background: var(--surface-3);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
  text-shadow: none;
}

.button-ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  flex: 0 1 auto;
}

.button-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

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

.demo-button {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.demo-button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.status-chip {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-block;
}

.info-banner {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted-soft);
  text-align: center;
  padding: 0.4rem;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* ==========================================================================
   Sidebar + panels
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.panel.compact { padding: 0.65rem 0.8rem; gap: 0.5rem; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 22px;
}

.panel-header--clickable {
  cursor: pointer;
  user-select: none;
}

.panel-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.panel-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  min-width: 26px;
  text-align: center;
}

.panel-meta {
  font-size: 0.7rem;
  color: var(--muted);
}

.panel-meta.prizes-status--success { color: var(--ok); }
.panel-meta.prizes-status--error { color: var(--bad); }

.panel-toggle {
  font-size: 0.6rem;
  color: var(--muted);
  transition: transform var(--t);
}

.collapsible[data-collapsed="true"] .panel-content { display: none; }
.collapsible[data-collapsed="true"] .panel-toggle { transform: rotate(-90deg); }

.panel-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* ---- Registration toggle ---- */

.registration-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.registration-toggle input {
  opacity: 0; width: 0; height: 0;
}

.registration-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background var(--t), border-color var(--t);
}

.registration-toggle__slider::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform var(--t);
  box-shadow: var(--shadow-sm);
}

.registration-toggle input:checked + .registration-toggle__slider {
  background: var(--ok);
  border-color: var(--ok);
}

.registration-toggle input:checked + .registration-toggle__slider::before {
  transform: translateX(18px);
}

.registration-toggle input:disabled + .registration-toggle__slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.registration-status {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.registration-status--open { color: var(--ok); }
.registration-status--closed { color: var(--bad); }

/* ---- Lists (participants/winners) ---- */

.list-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.list-box--small { max-height: 160px; }

.list-box::-webkit-scrollbar { width: 6px; }
.list-box::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.list-row:last-child { border-bottom: none; }

.list-row__index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 28px;
}

.list-row__name {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__contacts {
  display: grid;
  gap: 0.1rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  justify-items: end;
}

.list-row__contact {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.empty-state {
  padding: 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-soft);
  font-style: italic;
}

.export-button {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t), color var(--t), background var(--t);
}

.export-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.export-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- CSV panel ---- */

.csv-upload-area {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.csv-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.csv-file-input { display: none; }

.csv-file-label-inline {
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--t), color var(--t);
}

.csv-file-label-inline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.csv-filename {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csv-upload-button-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  transition: background var(--t);
}

.csv-upload-button-small:hover:not(:disabled) { background: var(--accent); }
.csv-upload-button-small:disabled { opacity: 0.4; cursor: not-allowed; }

.csv-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}

.csv-checkbox input[type="checkbox"],
.prizes-checkbox input[type="checkbox"],
.history-public-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.csv-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre-line;
  line-height: 1.4;
}

.csv-status--success { color: var(--ok); }
.csv-status--warning { color: var(--warn); }
.csv-status--error { color: var(--bad); }

/* ---- Prizes panel ---- */

.prizes-settings {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.prizes-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.prizes-checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.prizes-input,
.prizes-textarea,
.prizes-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.prizes-input::placeholder,
.prizes-textarea::placeholder {
  color: var(--muted-soft);
}

.prizes-input:focus,
.prizes-textarea:focus,
.prizes-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.prizes-textarea {
  resize: vertical;
  min-height: 54px;
  line-height: 1.4;
}

.prizes-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
}

.prizes-icon-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}

.prizes-icon-button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.prizes-icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.prizes-save-button {
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius-sm);
  transition: background var(--t), transform var(--t);
}

.prizes-save-button:hover:not(:disabled) { background: var(--ink); }
.prizes-save-button:active:not(:disabled) { transform: translateY(1px); }
.prizes-save-button:disabled { opacity: 0.5; cursor: not-allowed; }

.prizes-status {
  font-size: 0.7rem;
  color: var(--muted);
}

.prizes-status--success { color: var(--ok); }
.prizes-status--error { color: var(--bad); }

/* ---- History panel ---- */

.history-current-round {
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.history-public-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  width: 100%;
  color: var(--ink-soft);
}

.history-public-label { font-size: 0.95rem; }

.history-current-label { color: var(--ink-soft); }

.history-actions {
  display: grid;
  gap: 0.45rem;
}

.history-public-button,
.history-export-all-button {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t), color var(--t), background var(--t);
}

.history-public-button:hover:not(:disabled),
.history-export-all-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.history-public-button:disabled,
.history-export-all-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.history-row__round {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 0.95rem;
  min-width: 30px;
}

.history-row__meta {
  flex: 1;
  display: grid;
  gap: 0.1rem;
}

.history-row__date {
  color: var(--muted);
  font-size: 0.72rem;
}

.history-row__name {
  color: var(--ink-soft);
}

.history-row__select {
  font-size: 0.95rem;
  cursor: pointer;
}

/* ==========================================================================
   Winner modal
   ========================================================================== */

.winner-modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow), visibility var(--t-slow);
  z-index: 100;
  backdrop-filter: blur(6px);
}

.winner-modal--visible {
  opacity: 1;
  visibility: visible;
}

.winner-modal__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92);
  transition: transform var(--t-slow);
}

.winner-modal--visible .winner-modal__card { transform: scale(1); }

.winner-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--muted);
  border-radius: 50%;
  transition: background var(--t), color var(--t);
}

.winner-modal__close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.winner-modal__badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.winner-modal__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.winner-modal__name {
  margin: 0.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 2.25rem;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.winner-modal__contacts {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.winner-modal__prize {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.winner-modal__copy {
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--t);
}

.winner-modal__copy:hover { background: var(--accent); }

.winner-modal__copy--success {
  background: var(--ok);
}

/* ==========================================================================
   Confetti
   ========================================================================== */

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 99;
}

.confetti-piece {
  position: absolute;
  width: 9px;
  height: 14px;
  opacity: 0.85;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-10vh) rotate(0); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.1; }
}

/* ==========================================================================
   Drag-over for CSV
   ========================================================================== */

.drag-over {
  border-color: var(--accent) !important;
  background: var(--accent-bg) !important;
}

/* ==========================================================================
   Lists rendered by JS (participants, winners)
   ========================================================================== */

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.list-item:last-child { border-bottom: none; }

.list-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.list-item-name {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.list-item-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.list-item-contact-icon {
  font-size: 0.78rem;
  opacity: 0.7;
}

.list-item-prize {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.1rem;
}

.list-item--winner {
  background: linear-gradient(90deg, var(--accent-bg), transparent 70%);
}

.list-item .meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   History items (rendered by JS)
   ========================================================================== */

.history-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.history-item-header .history-public-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  width: auto;
}

.history-round {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 1rem;
}

.history-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.history-item-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.history-item-winners {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.history-export-button {
  align-self: flex-end;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--t), color var(--t);
}

.history-export-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   Results page
   ========================================================================== */

body.results-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(138, 31, 61, 0.06), transparent 60%),
    var(--bg);
  padding: clamp(2rem, 6vw, 4rem) 1.5rem 3rem;
  color: var(--ink);
}

.results-container {
  max-width: 920px;
  margin: 0 auto;
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 720px) {
  .admin-layout { padding: 0.75rem; gap: 1rem; }
  .wheel-stage { padding: 1.25rem 1rem; }
  .wheel-title { font-size: 2.25rem; }
  .winner-modal__name { font-size: 1.75rem; }
  .landing-card { padding: 2rem 1.5rem; }
}
