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

:root {
  --green:      #00443C;
  --green-dark: #002e28;
  --green-mid:  #005c52;
  --green-lt:   #006e62;
  --orange:     #FF4D00;
  --orange-lt:  #ff6a26;
  --pink:       #FFD4E6;
  --pink-dk:    #ffb8d5;
  --yellow:     #f5f36a;
  --black:      #000000;
  --white:      #ffffff;
  --off-white:  #faf9f7;
  --gray-lt:    #f2f2f0;
  --gray-mid:   #e0deda;
  --gray:       #b0aca6;
  --text:       #0a0a0a;
  --text-mid:   #444;
  --text-lt:    #888;

  --font-head:  'Montserrat', sans-serif;
  --font-body:  'Manrope', sans-serif;

  --radius:     14px;
  --radius-sm:  8px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:  0 8px 28px rgba(0,0,0,0.11);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.16);
}

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--green);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#root { min-height: 100vh; }

/* ── Confetti ── */
#confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ── Auth Screen ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dark);
  position: relative;
  overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 85%, rgba(255,77,0,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(245,243,106,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0,68,60,0.6) 0%, transparent 80%);
}
.auth-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 24px,
    rgba(255,255,255,0.015) 24px,
    rgba(255,255,255,0.015) 25px
  );
}
.auth-card {
  position: relative;
  background: var(--white);
  border-radius: 24px;
  padding: clamp(32px, 8vw, 52px) clamp(20px, 8vw, 44px) clamp(28px, 7vw, 44px);
  width: min(460px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both;
}
.auth-wordmark {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
}
.auth-title {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 6px;
}
.auth-title span { color: var(--orange); }
.auth-rule {
  width: 40px; height: 3px;
  background: var(--orange);
  border-radius: 2px;
  margin: 20px auto;
}
.auth-intro {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 32px;
  font-weight: 400;
}
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  min-height: 48px;
  background: var(--green);
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,68,60,0.25);
  touch-action: manipulation;
}
.google-btn:hover:not(:disabled) {
  background: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,68,60,0.35);
}
.google-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-footer { margin-top: 16px; font-size: 12px; color: var(--text-lt); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-mid);
}
.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  border: 1.5px solid var(--gray-mid);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
  touch-action: manipulation;
}
.auth-input:focus { border-color: var(--green); }
.auth-input:disabled { opacity: 0.6; }
.auth-input::placeholder { color: var(--gray); }
.auth-email-btn {
  width: 100%;
  padding: 13px 24px;
  min-height: 48px;
  background: var(--off-white);
  border: 1.5px solid var(--gray-mid);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  cursor: pointer;
  transition: all 0.18s;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-email-btn:hover:not(:disabled) { background: var(--gray-lt); border-color: var(--green); }
.auth-email-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.auth-error {
  margin-top: 10px;
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  text-align: center;
}

/* ── App Shell ── */
.app {
  min-height: 100vh;
  background: var(--off-white);
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.header {
  background: var(--green);
  min-height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-emblem {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.header-brand-name {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.01em;
  line-height: 1;
}
.header-brand-sub {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.header-center {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 6px;
}
@media (min-width: 480px) {
  .header-center--dots { display: flex; }
}
.progress-dots-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}
@media (min-width: 480px) {
  .progress-dots-mobile { display: none; }
}
.progress-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s;
}
.progress-dot.done { background: var(--yellow); }
.progress-dot.active { background: var(--white); width: 20px; border-radius: 4px; }
/* Dots in main content area (mobile) use dark palette */
.progress-dots-mobile .progress-dot { background: var(--gray-mid); }
.progress-dots-mobile .progress-dot.done { background: var(--green); }
.progress-dots-mobile .progress-dot.active { background: var(--orange); width: 20px; border-radius: 4px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-user-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  display: none;
}
@media (min-width: 500px) { .header-user-name { display: block; } }
.header-signout {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.header-signout:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* ── Tab Bar ── */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  min-height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--white);
  border-top: 1px solid var(--gray-mid);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px;
  min-height: 60px;
  transition: all 0.15s;
  position: relative;
  touch-action: manipulation;
}
.tab-btn.locked { cursor: default; opacity: 0.4; }
.tab-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  background: var(--green);
  border-radius: 0 0 2px 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.tab-btn.active::after { opacity: 1; }
.tab-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gray);
  transition: color 0.15s;
}
.tab-btn.active .tab-label { color: var(--green); }
.tab-btn.active .tab-icon-el { color: var(--green); }
.tab-icon-el { color: var(--gray); transition: color 0.15s; }
.tab-btn.admin-tab .tab-label { color: var(--orange); opacity: 0.7; }
.tab-btn.admin-tab.active .tab-label { color: var(--orange); opacity: 1; }
.tab-btn.admin-tab.active::after { background: var(--orange); }
.tab-btn.admin-tab .tab-icon-el { color: var(--orange); opacity: 0.7; }
.tab-btn.admin-tab.active .tab-icon-el { opacity: 1; }

/* ── Main content ── */
.main {
  flex: 1;
  padding: 24px 16px calc(80px + env(safe-area-inset-bottom));
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ── Horse thumb strip ── */
.horse-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.horse-strip::-webkit-scrollbar { display: none; }
.horse-thumb {
  flex-shrink: 0;
  width: 60px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--green);
  overflow: hidden;
  transition: all 0.2s;
  position: relative;
  touch-action: manipulation;
}
.horse-thumb.active {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255,77,0,0.2);
}
.horse-thumb-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--green-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}
.horse-thumb-team-num {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.02em;
  line-height: 1;
  font-feature-settings: "tnum";
}
.horse-thumb.active .horse-thumb-team-num { color: var(--yellow); }
.horse-thumb-label {
  padding: 4px 4px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  background: rgba(0,0,0,0.3);
}
.horse-thumb.active .horse-thumb-label { color: var(--yellow); }
.horse-thumb-check {
  position: absolute;
  top: 3px; right: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid white;
  display: flex; align-items: center; justify-content: center;
}

/* ── Section header ── */
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-lt);
  margin-bottom: 6px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 4px;
}
.section-title em { font-style: italic; color: var(--orange); }

/* ── Horse Card ── */
.horse-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.horse-hero {
  height: clamp(180px, 40vw, 260px);
  background: var(--green);
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.horse-hero-bg {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.025) 20px,
    rgba(255,255,255,0.025) 21px
  );
}
.horse-hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(0,68,60,0.3) 0%, rgba(0,0,0,0.5) 100%);
}
.horse-photo-placeholder {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1;
}
.horse-photo-ph-icon {
  width: 64px; height: 64px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1.5px dashed rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
}
.horse-photo-ph-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
}
/* Big team plaque in the hero — the team is the headline identifier */
.horse-team-plaque {
  position: absolute;
  top: 14px; left: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px 10px;
  border-radius: 14px;
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.08) inset;
  z-index: 2;
  line-height: 1;
}
.horse-team-plaque-eyebrow {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2px;
}
.horse-team-plaque-number {
  font-family: var(--font-head);
  font-size: clamp(38px, 9vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 4px;
  font-feature-settings: "tnum";
}
.horse-team-plaque-name {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.95;
}
.horse-hero-info {
  position: relative;
  z-index: 2;
  padding: 16px;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.1) 100%);
}

/* ── SIRE × DAM headline ── */
.horse-lineage { margin-bottom: 8px; }
.horse-lineage-headline {
  font-family: var(--font-head);
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.horse-lineage-headline .x-sep {
  color: var(--orange);
  margin: 0 6px;
  font-style: normal;
}
.horse-lineage-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}
.horse-meta-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.horse-meta-chip {
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}

/* ── Fun Fact ── */
.fun-fact {
  margin: 14px 16px 0;
  background: var(--yellow);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.fun-fact-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.fun-fact-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--green-dark);
  line-height: 1.5;
}
.fun-fact-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 2px;
}

/* ── Reactions ── */
.reactions-row {
  position: relative;
  padding: 14px 16px 4px;
  display: flex;
  gap: 10px;
  overflow: visible;
}
.reaction-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 64px;
  background: #f5f1e8;
  border: 1.5px solid #e8e3d6;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 800;
  color: #6b6862;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.reaction-pill:hover {
  border-color: var(--orange);
  background: #fff5ed;
  color: var(--orange);
  transform: translateY(-1px);
}
.reaction-pill.active {
  background: #fff0e3;
  border-color: var(--orange);
  color: var(--orange);
}
.reaction-pill:active { transform: scale(0.94); transition: transform 0.05s; }
.reaction-pill.kick { animation: pill-kick 0.36s cubic-bezier(0.34,1.56,0.64,1); }
.reaction-pill-emoji {
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  animation: emoji-bop 0.36s cubic-bezier(0.34,1.56,0.64,1);
}
.reaction-pill-count {
  font-variant-numeric: tabular-nums;
  min-width: 12px;
  text-align: left;
}
.reaction-pill-count:empty { display: none; }

@keyframes pill-kick {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.14) translateY(-2px); }
  70%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}
@keyframes emoji-bop {
  0%   { transform: scale(1) rotate(0); }
  40%  { transform: scale(1.55) rotate(-8deg); }
  70%  { transform: scale(0.95) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Floating particle layer — sits above the row, emoji rise and fade out */
.reaction-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.reaction-particle {
  position: absolute;
  bottom: 12px;
  left: 50%;
  font-size: 26px;
  line-height: 1;
  pointer-events: none;
  animation: particle-rise 1.2s cubic-bezier(0.22,0.7,0.36,1) forwards;
  animation-delay: var(--delay, 0ms);
  transform-origin: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
  will-change: transform, opacity;
}
@keyframes particle-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6) rotate(0);
  }
  15% {
    opacity: 1;
    transform: translate(calc(-50% + (var(--drift-x) * 0.2)), -20px) scale(1.25) rotate(calc(var(--rot) * 0.2));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift-x)), -120px) scale(1.0) rotate(var(--rot));
  }
}

/* ── Card Body ── */
.card-body { padding: 20px 16px 16px; }
.vote-heading {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.voted-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  color: #166534;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Name Options ── */
.name-options { display: flex; flex-direction: column; gap: 9px; }
.name-opt {
  position: relative;
  border: 2px solid var(--gray-mid);
  border-radius: 10px;
  padding: 13px 14px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
  background: var(--white);
  touch-action: manipulation;
}
.name-opt:hover:not(.name-opt--voted) {
  border-color: var(--green);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}
.name-opt.name-opt--selected { border-color: var(--green); background: #f0faf8; }
.name-opt.name-opt--my-vote  { border-color: var(--green); background: #f0faf8; }
.name-opt.name-opt--voted    { cursor: default; }
.name-opt.name-opt--flash    { animation: vote-flash 0.6s ease-out; }
@keyframes vote-flash {
  0%   { background: rgba(255,77,0,0.12); }
  100% { background: transparent; }
}
.name-opt.name-opt--winner   { border-color: var(--orange); background: #fff5f0; }

/* Preview: names hidden until voting opens */
.name-opt.name-opt--hidden {
  cursor: default;
  background: repeating-linear-gradient(
    45deg,
    #f7f5f0,
    #f7f5f0 6px,
    #efece5 6px,
    #efece5 12px
  );
  border-color: #e5e1d8;
}
.name-opt.name-opt--hidden:hover { border-color: #e5e1d8; background: repeating-linear-gradient(45deg, #f7f5f0, #f7f5f0 6px, #efece5 6px, #efece5 12px); }
.name-opt-redacted {
  display: inline-block;
  font-family: var(--font-head);
  letter-spacing: 0.04em;
  color: rgba(0,68,60,0.35);
  user-select: none;
  filter: blur(2px);
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.name-opt-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(0,68,60,0.07);
  border-radius: 8px 0 0 8px;
  transition: width 0.9s cubic-bezier(0.22,1,0.36,1);
  z-index: 0;
}
.name-opt--winner .name-opt-bar { background: rgba(255,77,0,0.09); }
.name-opt-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.name-opt-radio {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-mid);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  background: var(--white);
}
.name-opt--selected .name-opt-radio,
.name-opt--my-vote .name-opt-radio {
  border-color: var(--green);
  background: var(--green);
}
.name-opt--winner .name-opt-radio { border-color: var(--orange); background: var(--orange); }
.name-opt-radio-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transform: scale(0);
  transition: all 0.18s;
}
.name-opt--selected .name-opt-radio-dot,
.name-opt--my-vote .name-opt-radio-dot,
.name-opt--winner .name-opt-radio-dot { opacity: 1; transform: scale(1); }
.name-opt-text {
  flex: 1;
  font-family: var(--font-head);
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.name-opt-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.name-opt-votes {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
}
.name-opt-pct {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-lt);
  min-width: 34px;
  text-align: right;
}
.my-vote-tag {
  background: var(--green);
  color: white;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ── Waiting Banner ── */
.waiting-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  background: #f0faf8;
  border: 1.5px solid rgba(0,68,60,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  animation: fadeUp 0.3s cubic-bezier(0.22,1,0.36,1) both;
}
.waiting-spinner { flex-shrink: 0; display: flex; align-items: center; }
.waiting-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 2px;
}
.waiting-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
}

/* ── Vote Locked Notice ── */
.vote-locked-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 16px;
  padding: 11px 14px;
  background: var(--gray-lt);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-lt);
}

/* ── Vote Button ── */
.vote-btn-area {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-lt);
}
.vote-btn {
  width: 100%;
  padding: 15px;
  min-height: 48px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.01em;
  touch-action: manipulation;
}
.vote-btn:hover:not(:disabled) {
  background: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,68,60,0.3);
}
.vote-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Navigation ── */
.horse-nav {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.nav-btn {
  flex: 1;
  padding: 12px;
  min-height: 44px;
  border: 2px solid var(--gray-mid);
  border-radius: 10px;
  background: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.18s;
  touch-action: manipulation;
}
.nav-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.nav-btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.nav-btn.primary:hover:not(:disabled) { background: var(--orange-lt); border-color: var(--orange-lt); color: var(--white); }

/* ── Done Screen ── */
.done-screen {
  text-align: center;
  padding: 32px 0;
  animation: fadeUp 0.55s cubic-bezier(0.22,1,0.36,1) both;
}
.done-trophy {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--yellow);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(245,243,106,0.5);
  font-size: 40px;
}
.done-title {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.done-subtitle {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.6;
  max-width: min(300px, 100%);
  margin: 0 auto 28px;
}
.picks-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  margin-bottom: 20px;
}
.picks-heading {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-lt);
  margin-bottom: 14px;
}
.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-lt);
}
.pick-row:last-child { border-bottom: none; padding-bottom: 0; }
.pick-horse { font-size: 13px; color: var(--text-mid); font-weight: 500; }
.pick-lineage {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  margin-top: 2px;
}
.pick-name {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 800;
  color: var(--green);
}

/* ── Results locked state ── */
.results-locked {
  text-align: center;
  padding: 48px 24px;
  animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
.results-locked-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--gray-lt);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}
.results-locked-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.results-locked-sub {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto 24px;
}
.results-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border-radius: 20px;
  padding: 10px 20px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
}

/* ── Leaderboard ── */
.leaderboard-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.lb-horse-header {
  background: var(--green);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lb-horse-name {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
}
.lb-horse-lineage {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin-top: 2px;
}
.lb-vote-count {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
}
.lb-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.lb-row { display: flex; align-items: center; gap: 10px; }
.lb-rank {
  width: 22px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-lt);
  flex-shrink: 0;
  text-align: center;
}
.lb-rank.first { color: var(--orange); }
.lb-name {
  flex: 1;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-bar-track {
  width: 80px;
  height: 7px;
  background: var(--gray-lt);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.lb-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--green-lt);
  transition: width 1s cubic-bezier(0.22,1,0.36,1);
}
.lb-bar-fill.first { background: var(--orange); }
.lb-pct {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  min-width: 34px;
  text-align: right;
  flex-shrink: 0;
}
.lb-votes-small {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-lt);
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Admin Override ── */
.admin-override-card {
  background: var(--white);
  border: 1.5px solid var(--orange);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.admin-override-header {
  background: var(--orange);
  color: var(--white);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}
.admin-override-body {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-override-status { display: flex; align-items: center; gap: 10px; }
.admin-override-horse {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.admin-override-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-lt);
  background: var(--gray-lt);
  border-radius: 20px;
  padding: 2px 10px;
}
.admin-override-btns { display: flex; gap: 8px; }
.admin-override-btn {
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-mid);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
}
.admin-override-btn:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.admin-override-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.admin-override-btn--next {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.admin-override-btn--next:hover:not(:disabled) { background: var(--orange-lt); border-color: var(--orange-lt); color: var(--white); }

/* ── Admin results-reveal toggle ── */
.admin-reveal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid #e7e3dc;
  border-radius: 12px;
  border-left: 4px solid #94a3b8;
  margin-top: 16px;
}
.admin-reveal-card--open {
  border-left-color: var(--orange);
  background: #fff7f1;
}
.admin-reveal-info { min-width: 0; flex: 1; }
.admin-reveal-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--green-dark);
  margin-bottom: 2px;
}
.admin-reveal-sub {
  font-size: 12px;
  color: #6b6862;
}
.admin-reveal-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: var(--white);
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  transition: all 0.15s;
}
.admin-reveal-btn:hover { background: var(--orange-lt); border-color: var(--orange-lt); }
.admin-reveal-btn--on {
  background: var(--white);
  color: var(--green-dark);
  border-color: #d8d4cc;
}
.admin-reveal-btn--on:hover { border-color: var(--green); color: var(--green); background: var(--white); }

/* ── Admin phase controls ── */
.admin-phase-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.admin-phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid #e7e3dc;
  border-radius: 10px;
  border-left: 4px solid #d8d4cc;
}
.admin-phase-row--open   { border-left-color: #22c55e; background: #f4fbf6; }
.admin-phase-row--closed { border-left-color: #94a3b8; background: #f4f5f7; opacity: 0.85; }
.admin-phase-info { min-width: 0; flex: 1; }
.admin-phase-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--green-dark);
  margin-bottom: 2px;
}
.admin-phase-sub {
  font-size: 11px;
  color: #6b6862;
  letter-spacing: 0.02em;
}
.admin-phase-buttons { display: flex; gap: 6px; flex-shrink: 0; }
.admin-phase-btn {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d8d4cc;
  background: var(--white);
  color: var(--green-dark);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s;
}
.admin-phase-btn:hover { border-color: var(--green); color: var(--green); }
.admin-phase-btn.active { background: var(--green); border-color: var(--green); color: var(--white); }
.admin-phase-btn--open.active { background: #22c55e; border-color: #22c55e; }
.admin-phase-btn--open:hover:not(.active) { border-color: #22c55e; color: #16a34a; }
@media (max-width: 480px) {
  .admin-phase-row { flex-direction: column; align-items: stretch; }
  .admin-phase-buttons { justify-content: space-between; }
  .admin-phase-btn { flex: 1; }
}

/* Horse strip — highlight horses currently open for voting */
.horse-thumb.phase-open::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* ── Admin ── */
/* Admin page header — eyebrow + title + phase summary chips */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ece8df;
}
.admin-page-heading { min-width: 0; flex: 1; }
.admin-page-title {
  font-family: var(--font-head);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.admin-page-title em {
  font-style: italic;
  color: var(--orange);
  font-weight: 700;
}
.admin-page-summary {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-page-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6862;
  background: #f4f1ea;
  border: 1px solid #e7e3dc;
  white-space: nowrap;
}
.admin-page-chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.admin-page-chip--open {
  color: #16a34a;
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.admin-page-chip--closed {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* Header pill that flags the signed-in user as an admin */
.header-admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-right: 4px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .header-admin-pill { font-size: 9px; padding: 2px 7px; }
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-family: var(--font-head);
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  color: var(--green);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-lt);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* ── Responsive: tablet (600px+) ── */
@media (min-width: 600px) {
  .main {
    padding-left: 24px;
    padding-right: 24px;
    max-width: 680px;
  }
  .horse-thumb { width: 72px; }
  .lb-bar-track { width: 120px; }
  .card-body { padding: 24px 20px 20px; }
  .reactions-row { padding: 14px 20px 0; }
  .fun-fact { margin: 16px 20px 0; }
  .name-opt-text { font-size: 16px; white-space: normal; }
}

/* ── Responsive: large tablet / small desktop (900px+) ── */
@media (min-width: 900px) {
  .main {
    max-width: 720px;
    padding-left: 32px;
    padding-right: 32px;
  }
  .horse-hero { height: 280px; }
  .horse-lineage-headline { font-size: 24px; }
  .stats-row { gap: 14px; }
  .stat-num { font-size: 30px; }
  .lb-bar-track { width: 160px; }
  .tab-bar { height: calc(64px + env(safe-area-inset-bottom)); }
  .tab-btn { gap: 5px; }
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-30px); }
}
.anim-in  { animation: cardIn  0.3s cubic-bezier(0.22,1,0.36,1) both; }
.anim-out { animation: cardOut 0.22s cubic-bezier(0.22,1,0.36,1) both; }
