/* ============ Bump Bets ============ */
:root {
  color-scheme: light;
  --bg: #f7f5ff;
  --ink: #211d35;
  --muted: #6f6a8a;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.9);
  /* near-white surfaces, tokenised so dark mode can flip them */
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: rgba(255, 255, 255, 0.7);
  --drawer-bg: rgba(255, 255, 255, 0.92);
  --footer-bg: rgba(255, 255, 255, 0.45);
  --topbar-bg: rgba(247, 245, 255, 0.7);
  --primary: #7c5cff;
  --primary-dark: #5f3fe6;
  --pink: #ff7ab6;
  --blue: #59b6f2;
  --mint: #4fd8b8;
  --gold: #ffc24b;
  --danger: #e8506b;
  --success: #0c8d6e;
  --toast-bg: #211d35;
  --toast-fg: #fff;
  --blob-opacity: 0.55;
  --radius: 22px;
  --shadow: 0 18px 50px -18px rgba(72, 50, 160, 0.25);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14121d;
  --ink: #ece9f6;
  --muted: #a39dbe;
  --card: rgba(38, 34, 54, 0.72);
  --card-border: rgba(255, 255, 255, 0.09);
  --surface: rgba(42, 38, 60, 0.85);
  --surface-2: rgba(40, 36, 56, 0.6);
  --drawer-bg: rgba(26, 23, 38, 0.95);
  --footer-bg: rgba(26, 23, 38, 0.5);
  --topbar-bg: rgba(20, 18, 29, 0.75);
  --primary-dark: #b6a5ff;
  --success: #4fd8b8;
  --toast-bg: #2e2a44;
  --blob-opacity: 0.28;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.6);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- animated background blobs ---- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob-opacity);
  animation: float 18s ease-in-out infinite alternate;
}
.b1 { width: 48vmax; height: 48vmax; background: #d9c8ff; top: -18vmax; left: -12vmax; }
.b2 { width: 42vmax; height: 42vmax; background: #ffd1e6; bottom: -16vmax; right: -10vmax; animation-delay: -6s; }
.b3 { width: 34vmax; height: 34vmax; background: #c8ecff; top: 30%; left: 55%; animation-delay: -12s; }
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(5vmax, -4vmax) scale(1.12); }
}

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---- layout ---- */
.container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 16px clamp(14px, 4vw, 28px) 80px;
  flex: 1;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(14px, 4vw, 28px);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(124, 92, 255, 0.08);
}
.topbar .logo {
  font-weight: 900; font-size: 1.25rem; letter-spacing: -0.02em;
  text-decoration: none; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.logo .grad {
  background: linear-gradient(90deg, var(--primary), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--muted); }

/* ---- hamburger + slide-in menu ---- */
.hamburger {
  width: 42px; height: 42px;
  border: none; border-radius: 12px; cursor: pointer;
  background: rgba(124, 92, 255, 0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: background 0.15s;
}
.hamburger:hover { background: rgba(124, 92, 255, 0.18); }
.hamburger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--primary-dark); }

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(33, 29, 53, 0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(320px, 86vw);
  display: flex; flex-direction: column;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--drawer-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--card-border);
  box-shadow: -18px 0 50px rgba(72, 50, 160, 0.22);
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-title { font-weight: 900; font-size: 1.1rem; letter-spacing: -0.02em; }
.drawer-close {
  width: 34px; height: 34px;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(124, 92, 255, 0.1); color: var(--primary-dark);
  font-weight: 800; font-size: 0.9rem; line-height: 1;
  transition: background 0.15s;
}
.drawer-close:hover { background: rgba(124, 92, 255, 0.18); }
.drawer-section { margin-top: 26px; }
.drawer-section.drawer-foot { margin-top: auto; }
.drawer-label {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px;
}
.drawer-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.drawer-user-info { min-width: 0; }
.drawer-user .name-btn {
  max-width: 100%; white-space: normal; word-break: break-word;
  padding: 4px 8px; margin-left: -8px; text-align: left;
  color: var(--ink); font-size: 0.98rem;
}
.drawer-email {
  color: var(--muted); font-size: 0.78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lang-switch { display: flex; gap: 8px; }
.lang-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 14px;
  border: 2px solid rgba(124, 92, 255, 0.14);
  background: var(--surface-2);
  cursor: pointer; font: inherit; font-weight: 700; font-size: 0.9rem;
  color: var(--ink);
  transition: all 0.15s ease;
}
.lang-btn:hover { border-color: rgba(124, 92, 255, 0.4); }
.lang-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.14), rgba(255, 122, 182, 0.14));
}

.toggle-row {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid rgba(124, 92, 255, 0.14);
  background: var(--surface-2);
}
.toggle-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.toggle-text { display: flex; flex-direction: column; gap: 3px; }
.toggle-title { font-weight: 700; font-size: 0.92rem; }
.toggle-hint { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

.btn-text-danger {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--danger); font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 8px; border-radius: 10px;
  transition: background 0.15s;
}
.btn-text-danger:hover { background: rgba(232, 80, 107, 0.1); }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(18px, 3.5vw, 30px);
  margin-top: 20px;
  animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card + .card { animation-delay: 0.07s; }

h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: clamp(1.25rem, 4vw, 1.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
h3 { font-size: 1.05rem; font-weight: 700; }
.sub { color: var(--muted); font-size: 1.02rem; margin-top: 8px; line-height: 1.5; }

/* ---- hero ---- */
.hero { text-align: center; padding: clamp(28px, 7vw, 64px) 8px 8px; }
.hero .emoji-row { font-size: clamp(2rem, 7vw, 3rem); display: flex; gap: 14px; justify-content: center; margin-bottom: 14px; }
.hero .emoji-row span { display: inline-block; animation: bounce 2.6s ease-in-out infinite; }
.hero .emoji-row span:nth-child(2) { animation-delay: 0.25s; }
.hero .emoji-row span:nth-child(3) { animation-delay: 0.5s; }
.hero .emoji-row span:nth-child(4) { animation-delay: 0.75s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---- buttons & inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer;
  border-radius: 999px;
  padding: 14px 26px;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(124, 92, 255, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -8px rgba(124, 92, 255, 0.6); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: rgba(124, 92, 255, 0.1); color: var(--primary-dark); box-shadow: none;
}
.btn.ghost:hover { background: rgba(124, 92, 255, 0.16); }
.btn.small { padding: 9px 18px; font-size: 0.88rem; }
.btn.block { width: 100%; }

.field { margin-top: 16px; text-align: left; }
.field label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-weight: 500; color: var(--muted); font-size: 0.8rem; margin-left: 6px; }
input[type="text"], input[type="email"], input[type="date"], input[type="number"] {
  width: 100%; font: inherit; font-size: 1.05rem;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(124, 92, 255, 0.18);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14); }

/* iOS Safari gives date inputs an intrinsic width that overflows narrow
   screens; stripping the native appearance lets width:100% win. */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 53px;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.field { min-width: 0; }

.code-input {
  text-align: center; font-size: 2rem !important; font-weight: 800;
  letter-spacing: 0.5em; text-indent: 0.5em;
  font-variant-numeric: tabular-nums;
}

/* ---- segmented choices / swatches ---- */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  flex: 1 1 auto; min-width: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  border-radius: 18px;
  border: 2px solid rgba(124, 92, 255, 0.14);
  background: var(--surface-2);
  cursor: pointer; font: inherit; font-weight: 700; font-size: 0.9rem;
  color: var(--ink);
  transition: all 0.15s ease;
}
.choice .big { font-size: 1.7rem; line-height: 1; }
.choice:hover { transform: translateY(-2px); border-color: rgba(124, 92, 255, 0.4); }
.choice.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.14), rgba(255, 122, 182, 0.14));
  box-shadow: 0 8px 20px -10px rgba(124, 92, 255, 0.5);
}
.choice.boy.selected { border-color: var(--blue); }
.choice.girl.selected { border-color: var(--pink); }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(0,0,0,0.08); }

/* ---- sliders ---- */
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--primary); height: 34px; cursor: grab; }
.slider-val {
  min-width: 96px;
  display: flex; align-items: baseline; justify-content: center; gap: 3px;
  font-weight: 800; font-size: 1.15rem;
  background: rgba(124, 92, 255, 0.1);
  border-radius: 14px; padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  cursor: text;
  transition: box-shadow 0.15s;
}
.slider-val:focus-within { box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.3); }
.slider-val .unit { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.val-input {
  font: inherit; font-weight: 800; color: inherit;
  background: transparent; border: none; outline: none;
  width: 5ch; min-width: 0; padding: 0; text-align: right;
  font-variant-numeric: tabular-nums;
}
.val-input::-webkit-outer-spin-button,
.val-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.val-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* editable display name in the topbar */
.name-btn {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--muted); background: none; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: 10px;
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.name-btn:hover { background: rgba(124, 92, 255, 0.1); color: var(--primary-dark); }
.name-edit {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  width: min(170px, 40vw); padding: 6px 10px;
  border: 2px solid var(--primary); border-radius: 10px; outline: none;
}

/* ---- countdown ---- */
.countdown { display: flex; gap: 10px; justify-content: center; margin: 18px 0 6px; flex-wrap: wrap; }
.count-unit {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 12px 8px;
  min-width: 76px; text-align: center;
  box-shadow: var(--shadow);
}
.count-unit .num { font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.count-unit .lbl { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

@media (max-width: 480px) {
  .countdown { flex-wrap: nowrap; gap: 6px; }
  .count-unit { flex: 1 1 0; min-width: 0; padding: 10px 4px; }
  .count-unit .num { font-size: 1.5rem; }
}

/* ---- group cards on dashboard ---- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.group-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 20px; padding: 18px;
  box-shadow: var(--shadow);
  transition: all 0.18s ease;
}
.group-card:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, 0.4); }
.group-card .gname { font-weight: 800; font-size: 1.15rem; }
.group-card .gmeta { color: var(--muted); font-size: 0.86rem; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(124, 92, 255, 0.12); color: var(--primary-dark);
}
.badge.born { background: rgba(79, 216, 184, 0.18); color: var(--success); }
.badge.private { background: rgba(111, 106, 138, 0.12); color: var(--muted); margin-left: 6px; text-transform: none; }

/* ---- share box ---- */
.share-box {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(124, 92, 255, 0.08);
  border: 2px dashed rgba(124, 92, 255, 0.35);
  border-radius: 18px; padding: 14px 16px; margin-top: 12px;
}
.share-box code { font-family: inherit; font-weight: 800; font-size: 1.05rem; word-break: break-all; flex: 1; min-width: 180px; }

/* ---- guess cards ---- */
.guess-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; margin-top: 14px; }
.guess-card {
  position: relative;
  background: var(--surface);
  border-radius: 20px; padding: 16px;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}
.members-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(124, 92, 255, 0.18); }
.member-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.member-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid rgba(124, 92, 255, 0.18); border-radius: 12px;
}
.member-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-tag { font-size: 0.78rem; color: var(--muted); }
.kick-btn-row { flex-shrink: 0; color: var(--danger); border-color: rgba(232, 80, 107, 0.35); }
.kick-btn-row:hover { background: rgba(232, 80, 107, 0.12); }
.guess-card.you { border-color: rgba(124, 92, 255, 0.5); }
.guess-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 0.95rem;
  flex-shrink: 0;
}
.guess-head .who { font-weight: 800; }
.guess-head .you-tag { font-size: 0.7rem; color: var(--primary-dark); font-weight: 800; }
.guess-rows { display: grid; gap: 5px; font-size: 0.9rem; }
.guess-rows .row { display: flex; justify-content: space-between; gap: 8px; }
.guess-rows .row .k { color: var(--muted); }
.guess-rows .row .v { font-weight: 700; text-align: right; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,0.12); }

/* ---- reactions ---- */
.reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.react-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font: inherit; font-size: 0.85rem; line-height: 1; cursor: pointer;
  padding: 5px 9px; border-radius: 999px;
  border: 1.5px solid rgba(124, 92, 255, 0.18);
  background: var(--surface-2);
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.react-pill:hover { transform: translateY(-1px); }
.react-pill .rc { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.react-pill.mine { border-color: var(--primary); background: rgba(124, 92, 255, 0.12); }
.react-pill.mine .rc { color: var(--primary-dark); }
.react-addwrap { position: relative; }
.react-add {
  font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer;
  padding: 5px 9px; border-radius: 999px; color: var(--muted);
  border: 1.5px dashed rgba(124, 92, 255, 0.3); background: transparent;
  transition: border-color 0.12s, color 0.12s;
}
.react-add:hover { border-color: var(--primary); color: var(--primary-dark); }
.react-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30;
  display: flex; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--card-border);
  border-radius: 14px; box-shadow: var(--shadow);
}
/* an explicit display: above overrides the hidden attribute's UA display:none,
   so restore it — the picker must stay hidden until the ＋ button opens it */
.react-picker[hidden] { display: none; }
.react-opt {
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  border: none; background: none; padding: 5px; border-radius: 10px;
  transition: background 0.12s, transform 0.12s;
}
.react-opt:hover { background: rgba(124, 92, 255, 0.12); transform: scale(1.15); }

/* ---- leaderboard ---- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 22px 0 10px; }
.podium .spot { text-align: center; flex: 1; max-width: 150px; }
.podium .stand {
  border-radius: 16px 16px 0 0; margin-top: 8px;
  display: flex; align-items: flex-start; justify-content: center;
  font-weight: 900; font-size: 1.3rem; color: #fff; padding-top: 8px;
}
.podium .s1 .stand { height: 96px; background: linear-gradient(180deg, var(--gold), #f0a82e); }
.podium .s2 .stand { height: 70px; background: linear-gradient(180deg, #c5cee0, #9aa8c4); }
.podium .s3 .stand { height: 52px; background: linear-gradient(180deg, #e8aa7c, #cf8553); }
.podium .medal { font-size: 1.9rem; }
.podium .pname { font-weight: 800; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pscore { color: var(--muted); font-size: 0.85rem; font-weight: 700; }

.lb-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.92rem; }
.lb-table th { text-align: left; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; padding: 8px 10px; }
.lb-table td { padding: 11px 10px; border-top: 1px solid rgba(124, 92, 255, 0.1); font-weight: 600; }
.lb-table th:nth-child(n+3), .lb-table td:nth-child(n+3) { text-align: center; }
.lb-table tr.you td { background: rgba(124, 92, 255, 0.07); }
.lb-table .total { font-weight: 900; color: var(--primary-dark); }
.lb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* compact leaderboard on phones — whole table fits, no side-scroll */
@media (max-width: 560px) {
  .lb-table { font-size: 0.74rem; }
  .lb-table th { padding: 6px 3px; font-size: 0.58rem; letter-spacing: 0.02em; }
  .lb-table td { padding: 8px 3px; }
  .lb-table .lb-name {
    max-width: 74px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .lb-table .total { font-size: 0.82rem; }
}

/* ---- results banner ---- */
.born-banner {
  text-align: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(255, 122, 182, 0.16));
  border-radius: var(--radius);
  padding: 26px 18px;
}
.born-banner .big-emoji { font-size: 3rem; animation: bounce 2.4s infinite; display: inline-block; }
.stat-pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.stat-pill {
  background: var(--surface); border-radius: 999px; padding: 10px 18px;
  font-weight: 800; box-shadow: var(--shadow); font-size: 0.95rem;
}
.stat-pill .k { color: var(--muted); font-weight: 600; font-size: 0.8rem; margin-right: 6px; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(120px);
  background: var(--toast-bg); color: var(--toast-fg);
  padding: 13px 24px; border-radius: 999px;
  font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  z-index: 100; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ---- skeleton loaders ---- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(124, 92, 255, 0.14), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 14px; margin: 9px 0; }
.sk-title { height: 28px; width: 55%; margin: 4px auto 16px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; margin-top: 14px; }
.sk-card { height: 156px; border-radius: 20px; }

.error-text { color: var(--danger); font-weight: 700; font-size: 0.9rem; margin-top: 10px; min-height: 1.2em; }
.dev-note {
  margin-top: 14px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 194, 75, 0.18); border: 1px solid rgba(255, 194, 75, 0.5);
  font-size: 0.9rem; font-weight: 600;
}
.dev-note b { font-size: 1.2rem; letter-spacing: 0.18em; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.back-link { color: var(--primary-dark); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.back-link:hover { text-decoration: underline; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.muted { color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; text-align: left; }
.step { background: var(--surface-2); border-radius: 18px; padding: 18px; }
.step .num {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.step p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; line-height: 1.45; }

/* ---- crowd wisdom stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.stat-tile {
  background: var(--surface);
  border-radius: 18px; padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-tile .k { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-tile .v { font-size: 1.35rem; font-weight: 900; margin-top: 4px;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-tile .actual { font-size: 0.8rem; font-weight: 800; color: var(--success); margin-top: 4px; }
.actual-txt { color: var(--success); font-weight: 800; }

.split-wrap { margin-top: 18px; }
.split-labels { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.92rem; margin-bottom: 7px; }
.split-bar {
  height: 16px; border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, var(--pink), #ff9ccb);
}
.split-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #3da4ec, var(--blue));
  border-radius: 999px 0 0 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.dist-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 28px; margin-top: 18px; }
.dist-title { font-size: 0.85rem; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.dist-row { display: grid; grid-template-columns: 86px 1fr 22px; align-items: center; gap: 8px; margin-top: 5px; font-size: 0.86rem; font-weight: 700; }
.dist-name { display: flex; align-items: center; gap: 5px; }
.dist-bar { height: 10px; border-radius: 999px; background: rgba(124, 92, 255, 0.1); overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1); }
.dist-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(124, 92, 255, 0.1); color: var(--primary-dark);
  font-weight: 700; font-size: 0.88rem;
  padding: 7px 14px; border-radius: 999px;
}

/* ---- footer ---- */
.footer {
  margin-top: auto;
  border-top: 1px solid rgba(124, 92, 255, 0.12);
  background: var(--footer-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer-inner {
  max-width: 980px; margin: 0 auto;
  padding: 34px clamp(14px, 4vw, 28px) calc(28px + env(safe-area-inset-bottom));
  display: grid; gap: 22px;
  grid-template-columns: 1fr auto;
  align-items: start;
}
.footer-logo { font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em; }
.footer-logo .grad {
  background: linear-gradient(90deg, var(--primary), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-brand p { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.footer-scoring h4 {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px;
}
.footer-scoring ul {
  list-style: none;
  display: grid; grid-template-columns: repeat(2, auto); gap: 4px 22px;
  font-size: 0.84rem; color: var(--muted);
}
.footer-scoring b { color: var(--ink); }
.footer-scoring .pen { font-size: 0.76rem; opacity: 0.8; }
.footer-note {
  grid-column: 1 / -1;
  color: var(--muted); font-size: 0.8rem;
  border-top: 1px solid rgba(124, 92, 255, 0.1);
  padding-top: 16px; text-align: center;
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---- mobile tweaks ---- */
@media (max-width: 560px) {
  .count-unit { min-width: 66px; padding: 10px 4px; }
  .count-unit .num { font-size: 1.5rem; }
  .btn { padding: 13px 20px; }
  .podium .medal { font-size: 1.5rem; }
  /* equal-size option boxes: grid cells instead of stretchy flex rows */
  .choices { display: grid; }
  .choices.cols-2 { grid-template-columns: repeat(2, 1fr); }
  /* 5 hair colors: 3 on top, the last 2 centered beneath (6 tracks, span 2 each) */
  .choices.cols-3 { grid-template-columns: repeat(6, 1fr); }
  .choices.cols-3 .choice { grid-column: span 2; }
  .choices.cols-3 .choice:nth-child(4) { grid-column: 2 / span 2; }
  .choices.cols-3 .choice:nth-child(5) { grid-column: 4 / span 2; }
  .choices .choice { min-width: 0; }
}

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