/* ═══════════════════════════════════════════════════════════════
   Tara-dactyl's Hen Bingo — Styles
   Sage-and-cream wedding aesthetic with dinosaur motifs
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Backgrounds (cream) */
  --bg: #f5f0e1;
  --bg-soft: #ede5d0;
  --bg-deep: #e2d8bd;

  /* Surfaces (cards) */
  --surface: #ede5d0;
  --surface-warm: #e2d8bd;
  --surface-border: #d4c8a8;

  /* Accent (sage green) */
  --accent: #5a7a5a;
  --accent-deep: #3f5b40;
  --accent-soft: #9eb39e;

  /* Highlight */
  --mint: #cfd9c7;

  /* Text */
  --ink: #2f352d;
  --ink-soft: #5b6258;
  --muted: #a39d8c;

  /* Celebration */
  --champagne: #b8954b;
  --champagne-soft: #d8b878;

  /* Typography */
  --font-display: 'The Seasons', 'Cormorant Garamond', 'Didot', 'Bodoni 72', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;

  /* Shadows */
  --shadow-soft: 0 1px 2px rgba(20,30,15,.10), 0 6px 18px rgba(20,30,15,.12);
  --shadow-card: 0 1px 2px rgba(20,30,15,.08), 0 12px 32px rgba(20,30,15,.16);
  --shadow-lift: 0 2px 4px rgba(20,30,15,.10), 0 20px 48px rgba(20,30,15,.24);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  position: relative;
  height: 100%;
  overflow: hidden;
  max-width: 430px;
  margin: 0 auto;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

input {
  font-family: inherit;
}

/* ─── Typography ─────────────────────────────────────────────── */
.font-display {
  font-family: var(--font-display);
  font-weight: 500;
}

.font-body {
  font-family: var(--font-body);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.caption {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  appearance: none;
  border: none;
  padding: 14px 28px;
  background: var(--accent);
  color: var(--surface);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 9999px;
  box-shadow: var(--shadow-soft);
  transition: transform .12s, background .12s, box-shadow .12s;
  cursor: pointer;
  width: 100%;
}

.btn-primary:active {
  background: var(--accent-deep);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
  transform: translateY(1px);
}

.btn-primary:disabled {
  background: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  appearance: none;
  padding: 13px 26px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 9999px;
  transition: background .12s;
  cursor: pointer;
  width: 100%;
}

.btn-ghost:active {
  background: var(--mint);
}

.btn-ghost:disabled {
  color: var(--muted);
  border-color: var(--muted);
  cursor: not-allowed;
}

/* ─── Screen Container ───────────────────────────────────────── */
.screen {
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen--overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  animation: slideUp .3s ease-out;
}

/* ─── Welcome Screen ─────────────────────────────────────────── */
.welcome-header {
  padding: 54px 24px 22px;
  text-align: center;
  position: relative;
}

.welcome-ptero {
  position: absolute;
  color: var(--bg-deep);
}

.welcome-ptero--right {
  top: 28px;
  right: 26px;
}

.welcome-ptero--left {
  top: 70px;
  left: 34px;
  opacity: 0.75;
}

.welcome-tagline {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.welcome-hero {
  background: var(--surface);
  border-radius: 18px;
  padding: 26px 22px;
  margin: 0 4px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.welcome-hero__inner-rule {
  position: absolute;
  inset: 8px;
  border: 0.5px solid var(--surface-border);
  border-radius: 12px;
  pointer-events: none;
}

.welcome-hero__diamond {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
}

.welcome-hero__eyebrow {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.welcome-hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.05;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.welcome-hero__subtitle {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 32px;
  line-height: 1.05;
  color: var(--accent);
  margin-top: 2px;
}

.welcome-ribbon {
  display: inline-block;
  margin-top: 18px;
  background: var(--mint);
  color: var(--accent);
  padding: 10px 32px;
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.welcome-subtext {
  margin: 14px 12px 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

.welcome-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 12px;
}

.welcome-divider__line {
  flex: 1;
  height: 1px;
  background: var(--bg-deep);
}

.welcome-divider__text {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
}

.welcome-body {
  flex: 1;
  overflow: auto;
  padding: 6px 22px 24px;
}

.welcome-sticky-cta {
  padding: 16px 24px 30px;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, rgba(245,240,225,0));
  position: sticky;
  bottom: 0;
}

/* ─── Hen Picker (searchable 2-col grid) ─────────────────────── */
.hen-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hen-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.hen-picker-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
}

.hen-picker-search__input::placeholder {
  color: var(--muted);
}

.hen-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hen-tile {
  appearance: none;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  text-align: left;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--surface-border);
  cursor: pointer;
  transition: background .12s, color .12s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
  position: relative;
}

.hen-tile:active:not(:disabled):not(.hen-tile--selected) {
  background: var(--mint);
}

.hen-tile--selected {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent-deep);
  box-shadow: var(--shadow-soft);
}

.hen-tile--taken {
  color: var(--muted);
  cursor: not-allowed;
}

.hen-tile__taken-label {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-left: auto;
}

/* ─── Grid Screen ────────────────────────────────────────────── */
.grid-header {
  padding: 54px 22px 14px;
  border-bottom: 1px solid var(--bg-deep);
  background: var(--bg);
}

.grid-header__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.grid-header__name-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-header__pencil {
  margin-top: 4px;
}

.grid-body {
  flex: 1;
  overflow: auto;
  padding: 14px 14px 90px;
}

.bingo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.grid-status {
  margin-top: 28px;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.grid-status__dot {
  width: 4px;
  height: 4px;
  border-radius: 4px;
  background: var(--bg-deep);
}

.grid-rules {
  padding: 8px 22px;
  background: var(--mint);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-style: italic;
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ─── Bingo Cell ─────────────────────────────────────────────── */
.bingo-cell {
  appearance: none;
  aspect-ratio: 1 / 1.05;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .12s;
}

.bingo-cell:active:not(:disabled) {
  transform: scale(0.97);
}

.bingo-cell__number {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-style: italic;
  opacity: 0.45;
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.bingo-cell__text {
  text-wrap: pretty;
}

/* Corner diamonds on open cells */
.bingo-cell__diamond {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-soft);
  transform: rotate(45deg);
}

.bingo-cell__diamond--tl { top: 5px; left: 5px; }
.bingo-cell__diamond--tr { top: 5px; right: 5px; }
.bingo-cell__diamond--bl { bottom: 5px; left: 5px; }
.bingo-cell__diamond--br { bottom: 5px; right: 5px; }

/* Correct state */
.bingo-cell--correct {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent-deep);
  cursor: default;
  box-shadow: inset 0 0 0 2px rgba(243,236,213,0.25), 0 4px 14px rgba(60,80,60,.22);
}

.bingo-cell--correct .bingo-cell__number {
  opacity: 0.75;
}

.bingo-cell__footprint {
  position: absolute;
  bottom: 6px;
  right: 6px;
  opacity: 0.9;
  color: var(--surface);
}

/* In-progress state */
.bingo-cell__remaining {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  background: var(--champagne);
  color: var(--surface);
  letter-spacing: 0.04em;
}

/* Locked state */
.bingo-cell--locked {
  background: var(--surface-warm);
  border: 1px dashed var(--muted);
  color: var(--muted);
  cursor: default;
  box-shadow: none;
}

.bingo-cell--locked .bingo-cell__text {
  text-decoration: line-through;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 0.5px;
}

.bingo-cell__revealed {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  font-family: var(--font-body);
  font-size: 9.5px;
  font-style: italic;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
}

/* ─── Progress Badge ─────────────────────────────────────────── */
.progress-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 9999px;
  box-shadow: var(--shadow-soft);
}

.progress-badge__text {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.progress-badge__count {
  font-weight: 600;
}

.progress-badge__total {
  color: var(--ink-soft);
}

/* ─── Tab Bar ────────────────────────────────────────────────── */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--bg-deep);
  background: rgba(245,240,225,0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  flex: 1;
  padding: 8px 0 6px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background .15s;
}

.tab-btn--active {
  background: var(--mint);
}

.tab-btn__label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tab-btn--active .tab-btn__icon,
.tab-btn--active .tab-btn__label {
  color: var(--accent-deep);
}

.tab-btn:not(.tab-btn--active) .tab-btn__icon,
.tab-btn:not(.tab-btn--active) .tab-btn__label {
  color: var(--ink-soft);
}

/* ─── Guess Screen ───────────────────────────────────────────── */
.guess-header {
  padding: 50px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guess-back-btn {
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.guess-number {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.guess-fact-card {
  margin: 4px 22px 14px;
  padding: 28px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-card);
}

.guess-fact-card--shake {
  animation: shake .42s;
}

.guess-fact-card__fern {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-soft);
}

.guess-fact-card__eyebrow {
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 10px;
}

.guess-fact-card__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  padding: 0 4px;
  text-wrap: balance;
}

.guess-pips {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

.guess-pip {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
}

.guess-pip--available {
  background: var(--accent);
}

.guess-pip--used {
  background: var(--muted);
  opacity: 0.4;
}

.guess-pips__text {
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 10.5px;
}

/* Search combobox card */
.guess-search-card {
  margin: 0 22px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.guess-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-border);
}

.guess-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
}

.guess-search-input::placeholder {
  color: var(--muted);
}

.guess-search-clear {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.guess-list {
  flex: 1;
  overflow: auto;
}

.guess-list-empty {
  padding: 32px 20px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
}

.guess-row {
  appearance: none;
  border: none;
  width: 100%;
  padding: 13px 18px;
  background: transparent;
  border-bottom: 0.5px solid var(--surface-border);
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .12s;
}

.guess-row:active:not(:disabled) {
  background: var(--mint);
}

.guess-row--disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.guess-row--tried {
  text-decoration: line-through;
  text-decoration-thickness: 0.5px;
  color: var(--muted);
  cursor: not-allowed;
}

.guess-row__you-label {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 12.5px;
  margin-left: 8px;
}

.guess-row__tried-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-style: italic;
}

.guess-row__dash {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Wrong-guess toast */
.guess-toast {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--champagne-soft);
  border-left: 4px solid var(--champagne);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 6;
  animation: fadeIn .15s ease-out;
}

.guess-toast__bold {
  font-weight: 600;
  margin-bottom: 2px;
}

.guess-toast__sub {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 12.5px;
}

/* ─── Result Overlay ─────────────────────────────────────────── */
.result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow: hidden;
  animation: fadeIn .25s ease-out;
}

.result-overlay--correct {
  background: var(--accent);
}

.result-overlay--locked {
  background: rgba(47,53,45,0.86);
}

.result-correct {
  text-align: center;
  color: var(--surface);
  padding: 0 28px;
  position: relative;
  max-width: 320px;
  animation: popIn .35s ease-out;
}

.result-correct__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--surface);
  opacity: 0.7;
  margin-bottom: 10px;
}

.result-correct__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 46px;
  line-height: 1;
  color: var(--surface);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.result-correct__subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--surface);
  opacity: 0.85;
  margin-bottom: 4px;
  line-height: 1.4;
}

.result-correct__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 38px;
  line-height: 1.05;
  color: var(--surface);
  margin-bottom: 28px;
}

.result-correct__btn {
  appearance: none;
  border: 1px solid var(--surface);
  background: var(--surface);
  color: var(--accent);
  padding: 14px 32px;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.result-correct__btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.result-locked {
  margin: 28px;
  padding: 36px 28px 28px;
  background: var(--surface);
  border-radius: 18px;
  text-align: center;
  max-width: 320px;
  box-shadow: var(--shadow-lift);
  position: relative;
  animation: popIn .35s ease-out;
}

.result-locked__egg {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  color: var(--muted);
}

.result-locked__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 8px;
  font-style: italic;
}

.result-locked__text {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.45;
}

.result-locked__name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
}

/* ─── Confetti ───────────────────────────────────────────────── */
.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* ─── Leaderboard ────────────────────────────────────────────── */
.lb-header {
  padding: 54px 22px 14px;
  text-align: center;
  position: relative;
}

.lb-fern {
  position: absolute;
  top: 60px;
  color: var(--bg-deep);
}

.lb-fern--left {
  left: 28px;
}

.lb-fern--right {
  right: 28px;
  transform: scaleX(-1);
}

.lb-caption {
  margin-top: 10px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}

.lb-body {
  flex: 1;
  overflow: auto;
  padding: 8px 18px 100px;
}

.lb-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--surface-border);
  position: relative;
}

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

.lb-row--you {
  background: var(--mint);
}

.lb-row__place {
  width: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-row__place-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.lb-row__place-top {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  margin-top: -23px;
  position: relative;
  z-index: 1;
}

.lb-row__name {
  flex: 1;
}

.lb-row__name-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}

.lb-row__you-label {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

.lb-row__score {
  text-align: right;
}

.lb-row__score-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lb-row__score-total {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Leaderboard loading/error states */
.lb-loading, .lb-error {
  padding: 40px 20px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
}

.lb-error__retry {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Cartouche Pill (leaderboard header) ────────────────────── */
.cartouche-pill {
  position: relative;
  padding: 14px 32px;
  display: inline-block;
  border-radius: 9999px;
  border: 1px solid var(--accent);
}

.cartouche-pill__inner {
  position: absolute;
  inset: 4px;
  border-radius: 9999px;
  border: 0.5px solid var(--accent);
  opacity: 0.5;
  pointer-events: none;
}

.cartouche-pill__flourish {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cartouche-pill__diamond {
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

.cartouche-pill__content {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 26px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ─── Change Name Screen ─────────────────────────────────────── */
.cn-header {
  padding: 50px 22px 8px;
}

.cn-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.cn-cancel-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.cn-header__title {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.cn-info-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 18px 16px;
  text-align: center;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.cn-info-card__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  color: var(--accent);
  line-height: 1.15;
}

.cn-info-card__text {
  margin: 8px 4px 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

.cn-body {
  flex: 1;
  overflow: auto;
  padding: 14px 22px 16px;
}

.cn-sticky-bar {
  padding: 16px 22px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  background: linear-gradient(to top, var(--bg) 60%, rgba(245,240,225,0));
  position: sticky;
  bottom: 0;
}

/* ─── Offline / Error Banner ─────────────────────────────────── */
.offline-note {
  padding: 8px 14px;
  margin: 0 4px 8px;
  background: var(--champagne-soft);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink);
  text-align: center;
  font-style: italic;
}

/* ─── Keyframe Animations ────────────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%      { transform: translateX(-6px) rotate(-1deg); }
  20%      { transform: translateX(5px) rotate(0.5deg); }
  30%      { transform: translateX(-4px) rotate(-0.3deg); }
  40%      { transform: translateX(3px) rotate(0.2deg); }
  50%      { transform: translateX(-2px); }
  60%      { transform: translateX(1px); }
}

@keyframes fall {
  0%   { transform: translateY(0) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: translateY(110vh) rotate(calc(var(--rot, 0deg) + 360deg)); opacity: 0.7; }
}

@keyframes slideUp {
  0%   { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes popIn {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Scrollbar Styling ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: 4px;
}
