* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --blue-1: #0ea5e9;
  --blue-2: #0284c7;
  --blue-deep: #075985;
  --gold: #f59e0b;
  --green: #4ade80;
  --pink: #f472b6;
  --bg-1: #0c4a6e;
  --bg-2: #0369a1;
  --card: #ffffff;
  --text: #0f172a;
  --text-soft: #64748b;
  --shadow: 0 4px 20px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.25);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Nunito", system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background: #0c4a6e;
}

/* Background scene */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.scene svg {
  width: 100%;
  height: 100%;
  display: block;
}
.custom-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  pointer-events: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0));
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  padding: 16px 16px 8px;
  color: white;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-spacer { width: 40px; flex-shrink: 0; }
.header-titles { flex: 1; text-align: center; }
.app-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1.1;
}
.header-sub {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.header-gear {
  width: 40px; height: 40px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.header-gear:active { transform: scale(0.92); }

/* Level card */
.level-card {
  margin: 12px 16px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 20px;
  padding: 20px;
  color: white;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.level-card::before {
  content: '🎣';
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 120px;
  opacity: 0.15;
  transform: rotate(15deg);
}
.level-row { display: flex; justify-content: space-between; align-items: baseline; }
.level-num { font-size: 36px; font-weight: 900; line-height: 1; }
.level-title { font-size: 14px; opacity: 0.9; font-weight: 600; }
.angler-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.xp-bar {
  margin-top: 12px;
  height: 12px;
  background: rgba(255,255,255,0.3);
  border-radius: 6px;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: white;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.xp-text { font-size: 12px; opacity: 0.9; margin-top: 6px; font-weight: 600; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px;
  margin-top: 12px;
}
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}
.stat-card:active { transform: scale(0.97); }
.stat-num { font-size: 24px; font-weight: 800; color: var(--blue-2); }
.stat-label { font-size: 11px; color: var(--text-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* Section */
.section {
  margin: 24px 16px 8px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.section-link { font-size: 13px; opacity: 0.9; font-weight: 600; cursor: pointer; }
.section-link:active { opacity: 0.7; }

/* Home Challenges preview card */
.challenge-card {
  margin: 16px 16px 0;
  background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
  border-radius: 20px;
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.15s;
}
.challenge-card:active { transform: scale(0.98); }
.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #78350f;
  margin-bottom: 8px;
}
.challenge-card-title { font-size: 16px; font-weight: 800; }
.challenge-card-count { font-size: 18px; font-weight: 900; }
.challenge-progress-bar {
  height: 10px;
  background: rgba(120, 53, 15, 0.2);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}
.challenge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  border-radius: 5px;
  transition: width 0.5s ease;
}
.challenge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  margin-bottom: 8px;
}
.challenge-row-icon {
  font-size: 28px;
  width: 40px; height: 40px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.challenge-row-icon.locked { opacity: 0.5; filter: grayscale(0.4); }
.challenge-row-info { flex: 1; min-width: 0; }
.challenge-row-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #92400e;
}
.challenge-row-unlocked .challenge-row-label { color: #15803d; }
.challenge-row-name { font-weight: 800; font-size: 14px; color: #1e293b; margin-top: 2px; }
.challenge-row-desc { font-size: 11px; color: #64748b; margin-top: 2px; }
.challenge-row-xp {
  font-size: 12px;
  font-weight: 800;
  color: #ea580c;
  background: white;
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.challenge-complete {
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 8px;
  color: #78350f;
}
.challenge-card-link {
  font-size: 12px;
  font-weight: 800;
  color: #78350f;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Catch card */
.catch-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.catch-card {
  background: white;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow);
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.catch-card:active { transform: scale(0.97); }
.catch-photo {
  width: 64px; height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.catch-photo-placeholder {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, #bae6fd, #7dd3fc);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.catch-photo-placeholder svg, .catch-photo-placeholder .fish-svg {
  width: 100%; height: auto; padding: 4px;
}
.fish-icon-wrap, .dex-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.fish-svg { display: block; }

.catch-info { flex: 1; min-width: 0; }
.catch-species { font-weight: 700; font-size: 15px; }
.catch-stats { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.catch-date { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.rarity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.empty-state {
  text-align: center;
  padding: 30px 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  margin: 16px;
  color: white;
}
.empty-state .emoji { font-size: 48px; margin-bottom: 8px; }
.empty-state .msg { font-size: 14px; opacity: 0.95; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: white;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  max-width: 480px;
  margin: 0 auto;
  z-index: 1000;
  isolation: isolate;
  pointer-events: auto;
  touch-action: manipulation;
}
.nav-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 12px 4px;
  color: var(--text-soft);
  transition: color 0.2s;
  font-family: inherit;
  flex: 1;
  min-width: 0;
  min-height: 60px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn .nav-icon { font-size: 20px; }
.nav-btn .nav-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.nav-btn.active { color: var(--blue-2); }
.nav-btn-catch {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: white !important;
  width: 60px; height: 60px;
  border-radius: 30px;
  margin-top: -22px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  font-size: 30px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.nav-btn-catch:active { transform: scale(0.92); }

/* Mode toggle (Catches / Trips) */
.mode-toggle {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 8px;
}
.mode-btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mode-btn.active { background: white; color: var(--blue-2); }

/* Log controls */
.log-controls {
  padding: 0 16px 8px;
}
.search-input {
  width: 100%;
  margin-bottom: 8px;
}

/* Log pagination sentinel */
.log-sentinel {
  padding: 16px;
  display: flex;
  justify-content: center;
}
.log-sentinel button {
  padding: 14px 18px;
  font-size: 14px;
  width: 100%;
}

/* Trips */
.trips-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 14px; }
.trip-card {
  background: white;
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.trip-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.trip-date { font-weight: 800; font-size: 16px; color: var(--text); }
.trip-location { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.trip-stats { display: flex; gap: 10px; }
.trip-stat { text-align: center; min-width: 44px; }
.trip-stat .num { font-size: 18px; font-weight: 800; color: var(--blue-2); line-height: 1; }
.trip-stat .lbl { font-size: 10px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; font-weight: 600; }
.trip-catches { display: flex; flex-direction: column; gap: 8px; }
.trip-catches .catch-card {
  box-shadow: none;
  background: #f8fafc;
}

/* Dex / Guide */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 16px;
}
.dex-card {
  background: white;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
  overflow: hidden;
}
.dex-card:active { transform: scale(0.96); }
.dex-card.locked {
  background: rgba(255,255,255,0.55);
  color: rgba(15, 23, 42, 0.4);
}
.dex-icon {
  height: 70px;
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}
.dex-icon.has-photo {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
}
.dex-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.dex-card.locked .dex-icon { opacity: 0.55; }
.dex-name { font-size: 11px; font-weight: 700; line-height: 1.2; min-height: 26px; display: flex; align-items: center; justify-content: center; }
.dex-rarity-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 6px;
}
.dex-count {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--gold);
  color: white;
  font-size: 10px;
  font-weight: 800;
  border-radius: 8px;
  padding: 2px 6px;
  min-width: 18px;
}

/* Filters */
.dex-filters {
  display: flex;
  gap: 6px;
  padding: 0 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dex-filter {
  background: rgba(255,255,255,0.25);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dex-filter.active {
  background: white;
  color: var(--blue-2);
}

/* Tips */
.tips-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 16px 12px;
}
.tips-cat {
  background: rgba(255,255,255,0.92);
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 12px 6px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s;
  --cat-color: #3b82f6;
}
.tips-cat:active { transform: scale(0.97); }
.tips-cat.active {
  border-color: var(--cat-color);
  background: white;
}
.tips-cat-icon { font-size: 24px; }
.tips-cat-name { font-size: 11px; font-weight: 700; color: var(--text); text-align: center; }

/* Tips hub — landing view when no category selected */
.tips-hub { padding: 0 16px 16px; }
.tips-hub-intro {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.tips-hub-intro-emoji { font-size: 36px; line-height: 1; margin-bottom: 6px; }
.tips-hub-intro-title { font-size: 17px; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.tips-hub-intro-text { font-size: 13px; color: var(--text-soft); line-height: 1.4; }
.tips-hub-section { margin-bottom: 18px; }
.tips-hub-section-title {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.tips-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.tips-hub-card {
  background: white;
  border: none;
  border-left: 4px solid var(--cat-color, #3b82f6);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-align: left;
  font-family: inherit;
  transition: transform 0.15s;
}
.tips-hub-card:active { transform: scale(0.97); }
.tips-hub-card-icon {
  width: 40px; height: 40px;
  background: var(--cat-color, #3b82f6);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tips-hub-card-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

/* Back-to-hub button shown above category content */
.tips-back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
}
.tips-back-btn {
  background: white;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tips-back-btn:active { transform: scale(0.97); }

.tips-list { padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.tip-card {
  background: white;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.tip-card:active { transform: scale(0.98); }
.tip-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.tip-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}
.tip-card-info { flex: 1; min-width: 0; }
.tip-card-title { font-weight: 800; font-size: 15px; }
.tip-card-level { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.tip-card-level-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.wt-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}
.wt-salt {
  background: linear-gradient(135deg, #bae6fd, #7dd3fc);
  color: #075985;
}
.wt-fresh {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}
.tip-card-arrow { font-size: 24px; color: var(--text-soft); font-weight: 800; }
.tip-card-summary { font-size: 13px; color: var(--text-soft); line-height: 1.4; }

/* Tip detail modal */
.tip-hero {
  padding: 30px 20px;
  text-align: center;
  color: white;
}
.tip-hero-icon { font-size: 56px; margin-bottom: 6px; }
.tip-hero-level { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; }
.tip-detail { padding: 20px; }
.tip-summary {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}
.tip-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}
.tip-steps li {
  counter-increment: step;
  background: #f8fafc;
  padding: 14px 14px 14px 50px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
}
.tip-steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  background: var(--blue-2);
  color: white;
  width: 26px; height: 26px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.knot-diagram {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.knot-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}
.tip-steps .step-text {
  font-size: 14px;
  line-height: 1.45;
}

/* Badges — medal grid */
.badge-tier-legend {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px 4px;
}
.tier-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}
.tier-chip-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.tier-chip-silver { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); color: #1e293b; }
.tier-chip-bronze { background: linear-gradient(135deg, #d97706, #92400e); color: white; }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 16px 16px;
}
.badge-tile {
  background: white;
  border: none;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s;
}
.badge-tile:active { transform: scale(0.95); }
.badge-medal {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
  border: 4px solid white;
}
.badge-medal::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  z-index: -1;
}
.badge-icon {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}
.medal-tier-gold {
  background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 50%, #ea580c 100%);
  background-size: 200% 200%;
  animation: medalShimmer 3s ease-in-out infinite;
  box-shadow:
    0 0 0 3px #f59e0b,
    0 6px 20px rgba(245, 158, 11, 0.5),
    inset 0 2px 8px rgba(255, 255, 255, 0.6);
}
.medal-tier-silver {
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 50%, #94a3b8 100%);
  box-shadow:
    0 0 0 3px #94a3b8,
    0 6px 16px rgba(148, 163, 184, 0.45),
    inset 0 2px 8px rgba(255, 255, 255, 0.7);
}
.medal-tier-bronze {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #92400e 100%);
  box-shadow:
    0 0 0 3px #b45309,
    0 6px 16px rgba(180, 83, 9, 0.4),
    inset 0 2px 8px rgba(255, 255, 255, 0.4);
}
.medal-locked {
  background: #e2e8f0 !important;
  box-shadow: 0 0 0 3px #cbd5e1, inset 0 2px 6px rgba(0,0,0,0.05) !important;
  animation: none !important;
}
.medal-locked .badge-icon {
  filter: grayscale(1) opacity(0.5);
}
@keyframes medalShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.badge-name {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.badge-tile .medal-locked + .badge-name { color: var(--text-soft); }
.badge-xp {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
  margin-top: 2px;
}
.badge-tile .medal-locked ~ .badge-xp { color: var(--text-soft); }

/* Badge detail modal */
.badge-detail-hero {
  padding: 32px 20px;
  text-align: center;
  background: linear-gradient(180deg, #fef3c7 0%, white 100%);
}
.badge-large-medal {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  border: 6px solid white;
}
.badge-large-icon { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25)); }
.badge-detail-tier {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.badge-detail-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.badge-detail-desc {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.4;
  margin-bottom: 12px;
  padding: 0 20px;
}
.badge-detail-xp {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 12px;
}
.badge-detail-status {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
}
.badge-status-unlocked {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}
.badge-status-locked {
  background: #f1f5f9;
  color: var(--text-soft);
}

/* Legacy ach-list (no longer used but kept for safety) */
.ach-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ach-card {
  background: white;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}
.ach-card.locked {
  opacity: 0.7;
  background: rgba(255,255,255,0.7);
}
.ach-icon {
  font-size: 36px;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ach-card.locked .ach-icon {
  background: #e2e8f0;
  filter: grayscale(1);
}
.ach-info { flex: 1; }
.ach-name { font-weight: 700; font-size: 15px; }
.ach-desc { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.ach-xp { font-size: 11px; font-weight: 800; color: var(--gold); margin-top: 4px; }
.ach-check { font-size: 24px; color: var(--green); }

/* New-version-available banner (auto-shown when SW has update) */
.update-banner {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0; right: 0;
  z-index: 600;
  margin: 8px auto;
  max-width: 460px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  animation: bannerSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.update-banner:active { transform: scale(0.97); }
.update-banner-icon { font-size: 22px; }
.update-banner-text { flex: 1; }
.update-banner-arrow { font-size: 22px; font-weight: 900; }
@keyframes bannerSlide {
  from { transform: translateY(-150%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Install prompt banner (top of Home when not installed) */
.install-banner {
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  animation: subtlePulse 2.4s ease-in-out infinite;
}
.install-banner:active { transform: scale(0.98); }
.install-banner-icon { font-size: 20px; flex-shrink: 0; }
.install-banner-text { flex: 1; line-height: 1.3; }
.install-banner-arrow {
  font-size: 24px;
  color: #b45309;
  font-weight: 900;
  flex-shrink: 0;
}
@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.45); }
}

/* Install instructions modal */
.install-modal { padding-bottom: 0; }
.install-hero {
  padding: 28px 20px 16px;
  text-align: center;
  background: linear-gradient(135deg, #fbbf24, #ea580c);
  color: white;
}
.install-hero-emoji { font-size: 64px; margin-bottom: 6px; }
.install-hero-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.install-hero-text {
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.95;
}
.install-warning {
  margin: 14px 16px 0;
  padding: 12px 14px;
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.install-warning-icon { font-size: 22px; flex-shrink: 0; }
.install-warning-text {
  font-size: 13px;
  line-height: 1.45;
  color: #7f1d1d;
}

.install-body { padding: 16px 20px 0; }
.install-platform-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}
.install-steps {
  list-style: none;
  counter-reset: instep;
  padding: 0;
  margin: 0 0 16px;
}
.install-steps li {
  counter-increment: instep;
  position: relative;
  padding: 12px 12px 12px 50px;
  margin-bottom: 8px;
  background: #fef3c7;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  border-left: 4px solid #f59e0b;
}
.install-steps li::before {
  content: counter(instep);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #ea580c;
  color: white;
  width: 28px; height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
}

/* Welcome modal — first-time setup */
.welcome-modal { padding-bottom: 30px; }
.welcome-hero {
  padding: 40px 20px 24px;
  text-align: center;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: white;
}
.welcome-emoji { font-size: 80px; margin-bottom: 8px; }
.welcome-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.welcome-tagline {
  font-size: 16px;
  font-weight: 700;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}
.welcome-text {
  font-size: 15px;
  opacity: 0.95;
  line-height: 1.4;
}
.welcome-form {
  padding: 24px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Fish ID upsell modal */
.upsell-overlay { z-index: 260; }
.upsell-modal { padding-bottom: 0; }
.upsell-hero {
  padding: 28px 20px 16px;
  text-align: center;
  background: linear-gradient(135deg, #ede9fe, #c4b5fd);
}
.upsell-hero-icon { font-size: 56px; margin-bottom: 6px; }
.upsell-hero-title {
  font-size: 22px;
  font-weight: 900;
  color: #4c1d95;
  margin-bottom: 6px;
}
.upsell-hero-text {
  font-size: 15px;
  color: #5b21b6;
  line-height: 1.4;
}
.upsell-features {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upsell-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
}
.upsell-feature-icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.upsell-feature-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

/* Parent setup card (when no API key) */
.parent-setup-card {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 14px;
  border: 2px dashed #f59e0b;
  text-align: left;
}
.parent-setup-title {
  font-weight: 800;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.parent-setup-steps {
  font-size: 14px;
  line-height: 1.5;
  color: #78350f;
  padding-left: 22px;
  margin: 0;
}
.parent-setup-steps li { margin: 6px 0; }
.parent-setup-steps a {
  color: #b45309;
  font-weight: 700;
  text-decoration: underline;
}
.parent-setup-note {
  margin-top: 10px;
  font-size: 12px;
  color: #92400e;
  font-style: italic;
}

/* Starter mode hint */
.starter-hint {
  margin: 4px 16px 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
  text-align: center;
}

/* Games landing — list of game cards */
.games-landing {
  padding: 0 16px 16px;
}
.games-intro {
  background: linear-gradient(135deg, #e0f2fe 0%, #ede9fe 100%);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.games-intro-emoji {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 6px;
}
.games-intro-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.games-intro-text {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
}
.games-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.games-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.game-card {
  background: white;
  border: none;
  border-left: 4px solid var(--card-color, #a855f7);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-align: left;
  font-family: inherit;
  transition: transform 0.15s;
}
.game-card:active { transform: scale(0.98); }
.game-card-icon {
  width: 50px; height: 50px;
  background: var(--card-color, #a855f7);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.game-card-info { flex: 1; min-width: 0; }
.game-card-name { font-weight: 800; font-size: 15px; color: var(--text); }
.game-card-desc { font-size: 12px; color: var(--text-soft); margin-top: 2px; line-height: 1.3; }
.game-card-best { font-size: 11px; color: var(--card-color, #a855f7); font-weight: 700; margin-top: 4px; }
.game-card-arrow {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-soft);
  flex-shrink: 0;
}

/* Generic game modal + result screen */
.game-modal { padding-bottom: 30px; }
.game-result {
  padding: 30px 20px;
  text-align: center;
}
.game-result-emoji { font-size: 72px; margin-bottom: 8px; }
.game-result-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
}
.game-result-stats {
  font-size: 16px;
  color: var(--text-soft);
  font-weight: 700;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}
.game-result-xp {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
  margin-top: 8px;
}

/* Memory Match game */
.memory-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: 14px;
  margin: 12px 16px;
}
.memory-stat { text-align: center; }
.memory-stat-label {
  font-size: 11px;
  font-weight: 800;
  color: #6b21a8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.memory-stat-num {
  font-size: 20px;
  font-weight: 900;
  color: #4c1d95;
  margin-top: 2px;
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px 20px;
}
.memory-card {
  aspect-ratio: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  perspective: 600px;
  font-family: inherit;
}
.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}
.memory-card.flipped .memory-card-inner { transform: rotateY(180deg); }
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
  animation: matchPop 0.5s ease;
}
.memory-card-back, .memory-card-front {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.memory-card-back {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}
.memory-card-front {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  transform: rotateY(180deg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 4px;
}
.memory-card-front svg { width: 100%; height: auto; }
.memory-card.matched .memory-card-front {
  background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
}
@keyframes matchPop {
  0%, 100% { scale: 1; }
  50% { scale: 1.1; }
}

/* Bait Match game */
.bait-fish-card {
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0 14px;
  text-align: center;
}
.bait-fish-svg {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.bait-fish-svg svg { width: auto; max-width: 200px; height: 100px; }
.bait-fish-name {
  font-size: 22px;
  font-weight: 900;
  color: #78350f;
}
.bait-fish-family {
  font-size: 12px;
  color: #92400e;
  font-weight: 700;
  margin-top: 2px;
}
.bait-prompt {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 12px;
}

/* Cast & Catch game */
.cast-modal {
  height: 90dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  overflow: hidden;
}
.cast-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0c4a6e, #075985);
  color: white;
  flex-shrink: 0;
}
.cast-stat {
  text-align: center;
  flex: 1;
}
.cast-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  opacity: 0.8;
}
.cast-stat-num {
  font-size: 22px;
  font-weight: 900;
  margin-top: 2px;
}
.cast-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 36px; height: 36px;
  border-radius: 18px;
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.cast-arena {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 50%, #0369a1 100%);
}
.cast-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 40px, rgba(255,255,255,0.04) 40px, rgba(255,255,255,0.04) 42px);
  pointer-events: none;
}
.cast-fish {
  position: absolute;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
  transition: scale 0.1s;
}
.cast-fish:active { scale: 0.85; }
.cast-fish-rare {
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8)) drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}
.cast-fish-legendary {
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.9)) drop-shadow(0 4px 8px rgba(0,0,0,0.25));
  animation: legendaryPulse 1s ease-in-out infinite;
}
@keyframes legendaryPulse {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.9)) drop-shadow(0 4px 8px rgba(0,0,0,0.25)); }
  50% { filter: drop-shadow(0 0 24px rgba(251, 191, 36, 1)) drop-shadow(0 4px 8px rgba(0,0,0,0.25)); }
}
.cast-fish svg { width: 100%; height: auto; pointer-events: none; }
@keyframes castSwimRight {
  from { transform: translateX(0) scaleX(1); }
  to { transform: translateX(calc(100vw + 200px)) scaleX(1); }
}
@keyframes castSwimLeft {
  from { transform: translateX(0) scaleX(-1); }
  to { transform: translateX(calc(-100vw - 200px)) scaleX(-1); }
}
.cast-popup {
  position: absolute;
  font-size: 22px;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  pointer-events: none;
  animation: castPopupRise 0.8s ease-out forwards;
  z-index: 5;
}
.cast-popup-legendary {
  color: #fbbf24;
  font-size: 28px;
}
.cast-popup-bad {
  color: #fca5a5;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(127, 29, 29, 0.8);
}

/* Bad creatures (pufferfish / shark / etc) */
.cast-bad {
  width: 64px;
  height: 64px;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.8)) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  animation-name: castSwimRight, badPulse;
  animation-iteration-count: 1, infinite;
}
.cast-bad-emoji { line-height: 1; pointer-events: none; }
@keyframes badPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.8)) drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(239, 68, 68, 1)) drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
}

/* Hearts row in header */
.cast-hearts {
  display: flex;
  gap: 2px;
  justify-content: center;
  font-size: 18px;
  margin-top: 4px;
}
.cast-heart-lost {
  opacity: 0.4;
  animation: heartLose 0.4s ease;
}
@keyframes heartLose {
  0% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Arena shake when bad creature is hit */
.cast-arena-hit {
  animation: arenaShake 0.3s ease;
}
@keyframes arenaShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}
.cast-arena-hit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.2);
  pointer-events: none;
  animation: hitFlash 0.3s ease;
}
@keyframes hitFlash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
@keyframes castPopupRise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-60px) scale(0.9); opacity: 0; }
}
.cast-tip {
  text-align: center;
  padding: 8px;
  background: rgba(12, 74, 110, 0.8);
  color: white;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Flappy Fish */
.flappy-modal {
  height: 90dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  overflow: hidden;
}
.flappy-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #047857, #065f46);
  color: white;
  flex-shrink: 0;
}
.flappy-header-stats {
  flex: 1;
  display: flex;
  gap: 24px;
}
.flappy-score {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.flappy-best {
  font-size: 22px;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1;
}
.flappy-arena {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #67e8f9 0%, #06b6d4 30%, #0891b2 70%, #0e7490 100%);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.flappy-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 1px, transparent 2px) 0 0/40px 40px,
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.12) 1px, transparent 2px) 0 0/55px 55px;
  pointer-events: none;
  animation: flappyBubbles 12s linear infinite;
}
@keyframes flappyBubbles {
  from { background-position: 0 0, 0 0; }
  to { background-position: -200px -200px, -300px -300px; }
}

.flappy-fish {
  position: absolute;
  width: 50px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform 0.1s ease;
  z-index: 5;
}
.flappy-fish svg { width: 100%; height: auto; }

.flappy-obstacle {
  position: absolute;
  background: linear-gradient(180deg, #14532d 0%, #166534 50%, #15803d 100%);
  border: 3px solid #052e16;
  box-shadow: inset 4px 0 0 rgba(255,255,255,0.15), inset -4px 0 0 rgba(0,0,0,0.3);
}
.flappy-obstacle-top {
  border-radius: 0 0 8px 8px;
  border-top: none;
}
.flappy-obstacle-bottom {
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}
.flappy-obstacle-cap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 36px;
  line-height: 1;
}
.flappy-cap-top {
  top: 0;
  transform: translate(-50%, -50%);
}
.flappy-cap-bottom {
  bottom: 0;
  transform: translate(-50%, 50%);
}

.flappy-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: white;
  text-shadow: 0 4px 12px rgba(0,0,0,0.6);
  background: rgba(12, 74, 110, 0.4);
  pointer-events: none;
  animation: flappyHintPulse 1.5s ease-in-out infinite;
}
.flappy-hint-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
}
.flappy-hint-sub {
  font-size: 14px;
  opacity: 0.95;
  margin-top: 4px;
}
@keyframes flappyHintPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Quiz */
.quiz-landing {
  padding: 0 16px 16px;
}
.quiz-hero {
  background: linear-gradient(135deg, #ede9fe, #c4b5fd);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 12px;
}
.quiz-hero-emoji { font-size: 56px; }
.quiz-hero-title {
  font-size: 22px;
  font-weight: 900;
  color: #4c1d95;
  margin: 6px 0 8px;
}
.quiz-hero-text {
  font-size: 14px;
  color: #5b21b6;
  line-height: 1.4;
}
.quiz-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.quiz-stat {
  background: white;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}
.quiz-stat-num {
  font-size: 22px;
  font-weight: 900;
  color: #7c3aed;
}
.quiz-stat-label {
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  margin-top: 2px;
}
.quiz-start-btn {
  width: 100%;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  font-size: 16px;
  padding: 16px;
}

.quiz-modal { padding-bottom: 30px; }
.quiz-modal-content { padding: 20px; }
.quiz-progress {
  margin-bottom: 16px;
}
.quiz-progress-text {
  font-size: 12px;
  font-weight: 800;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.quiz-progress-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.quiz-question {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  margin: 16px 0 20px;
  color: var(--text);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-option {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.quiz-option:active:not(:disabled) { transform: scale(0.98); }
.quiz-option:hover:not(:disabled) { border-color: #a855f7; }
.quiz-option:disabled { cursor: default; opacity: 0.7; }
.quiz-option.correct {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: #10b981;
  color: #064e3b;
  font-weight: 700;
  opacity: 1;
}
.quiz-option.wrong {
  background: linear-gradient(135deg, #fee2e2, #fca5a5);
  border-color: #ef4444;
  color: #7f1d1d;
  font-weight: 700;
  opacity: 1;
}
.quiz-feedback:empty { display: none; }
.quiz-explain {
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: 12px;
}
.quiz-explain-title {
  font-weight: 800;
  font-size: 14px;
  color: #4c1d95;
  margin-bottom: 4px;
}
.quiz-explain-text {
  font-size: 14px;
  color: #5b21b6;
  line-height: 1.4;
}
.quiz-results { text-align: center; }
.quiz-results-emoji { font-size: 72px; margin-bottom: 8px; }
.quiz-results-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.quiz-results-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.quiz-results-xp {
  font-size: 24px;
  font-weight: 900;
  color: #f59e0b;
  margin-top: 8px;
}

/* Coach (chat) */
.coach-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0;
}
.coach-header {
  flex-shrink: 0;
}
.coach-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.coach-avatar {
  font-size: 32px;
  background: white;
  width: 50px; height: 50px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.coach-no-key {
  margin: 30px 16px;
  padding: 30px 20px;
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.coach-no-key-icon { font-size: 56px; margin-bottom: 10px; }
.coach-no-key-title { font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.coach-no-key-text { font-size: 14px; color: var(--text-soft); line-height: 1.4; }

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 200px);
  padding-bottom: 90px;
}
.chat-messages {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.coach-welcome {
  background: white;
  padding: 24px 20px;
  border-radius: 18px;
  text-align: center;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.coach-welcome-icon { font-size: 48px; margin-bottom: 8px; }
.coach-welcome-title { font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.coach-welcome-text { font-size: 14px; color: var(--text-soft); line-height: 1.45; }

.chat-message {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 95%;
}
.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-message.assistant {
  align-self: flex-start;
}
.chat-avatar {
  font-size: 18px;
  background: white;
  width: 32px; height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.chat-bubble {
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 280px;
  white-space: normal;
  word-wrap: break-word;
}
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  color: white;
  border-bottom-right-radius: 6px;
}
.chat-message.assistant .chat-bubble {
  background: white;
  color: var(--text);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow);
}
.chat-paragraph + .chat-paragraph { margin-top: 8px; }

.typing-bubble {
  padding: 14px 18px !important;
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dot {
  width: 8px; height: 8px;
  border-radius: 4px;
  background: var(--text-soft);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

.quick-prompts {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-prompt {
  background: rgba(255,255,255,0.92);
  border: 2px solid rgba(255,255,255,0.5);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: transform 0.15s;
}
.quick-prompt:active {
  transform: scale(0.98);
  background: white;
}

.chat-input-bar {
  position: fixed;
  bottom: 80px;
  left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent, rgba(12,74,110,0.85) 30%);
  display: flex;
  gap: 8px;
  z-index: 50;
}
.chat-input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 22px;
  border: none;
  font-size: 15px;
  font-family: inherit;
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.chat-input:focus { outline: 2px solid var(--blue-1); }
.chat-send {
  width: 44px; height: 44px;
  border-radius: 22px;
  border: none;
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  color: white;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.5);
  font-family: inherit;
}
.chat-send:active { transform: scale(0.92); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-clear {
  align-self: center;
  margin: 8px 16px 12px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.25);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}
.modal {
  background: white;
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: 20px;
}
.modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-close {
  background: #f1f5f9;
  border: none;
  width: 32px; height: 32px;
  border-radius: 16px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

/* Form */
.form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select {
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  font-family: inherit;
  background: white;
  color: var(--text);
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--blue-1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  color: white;
  border: none;
  padding: 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Photo input */
.photo-input-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 4/3;
  border: 2px dashed #cbd5e1;
}
.photo-input-wrap.has-photo { border: none; }
.photo-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.photo-input-wrap:not(.has-photo) .photo-stage { cursor: pointer; }
.photo-stage.dragging { cursor: grabbing; }
.photo-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.photo-input-wrap.has-photo .photo-file-input { display: none; }
.crop-img {
  position: absolute;
  -webkit-user-drag: none;
  pointer-events: none;
}
.photo-placeholder { text-align: center; color: var(--text-soft); padding: 20px; }
.photo-placeholder .emoji { font-size: 48px; margin-bottom: 6px; }
.photo-placeholder .text { font-size: 14px; font-weight: 600; }
.photo-hint-ai {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #7c3aed;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-block;
}
.photo-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
}
.photo-change-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
.photo-change-btn:active { transform: scale(0.95); background: rgba(15, 23, 42, 0.9); }
.photo-crop-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.crop-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
  font-weight: 600;
}

/* Catch detail */
.catch-detail-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: linear-gradient(135deg, #bae6fd, #7dd3fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}
.catch-detail-photo-svg {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #bae6fd, #7dd3fc);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.catch-detail-photo-svg svg, .catch-detail-photo-svg .fish-svg { max-width: 100%; height: auto; }
.species-hero {
  width: 100%;
  padding: 30px 20px;
  background: linear-gradient(135deg, #bae6fd, #7dd3fc);
  display: flex;
  align-items: center;
  justify-content: center;
}
.species-hero svg, .species-hero .fish-svg { max-width: 100%; height: auto; }
.species-hero.has-photo {
  padding: 0;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.species-hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catch-detail-info { padding: 20px; }
.catch-detail-info h2 { font-size: 24px; margin-bottom: 4px; }
.fact-card {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
}
.fact-card .label { font-size: 11px; font-weight: 800; color: var(--blue-deep); text-transform: uppercase; letter-spacing: 0.5px; }
.fact-card .text { font-size: 14px; margin-top: 4px; line-height: 1.4; }
.bait-list { margin-top: 6px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.bait-list li { margin: 2px 0; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.detail-stat { background: #f8fafc; border-radius: 12px; padding: 12px; text-align: center; }
.detail-stat .num { font-size: 20px; font-weight: 800; color: var(--blue-2); }
.detail-stat .label { font-size: 10px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* Per-species catch gallery (shown when 2+ catches of the same species) */
.species-gallery { margin-top: 18px; }
.species-gallery-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.species-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.species-gallery-item {
  background: #f8fafc;
  border: none;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s;
}
.species-gallery-item:active { transform: scale(0.96); }
.species-gallery-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.species-gallery-noimg {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, #e0f2fe, #ede9fe);
}
.species-gallery-meta {
  padding: 6px 8px 8px;
  text-align: center;
}
.species-gallery-date {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 600;
}
.species-gallery-size {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-2);
  margin-top: 2px;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
  width: 100%;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-secondary:active { transform: scale(0.97); background: #e2e8f0; }

/* Provider pills (AI provider selector) */
.provider-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.provider-pill {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  color: var(--text-soft);
}
.provider-pill.active {
  border-color: var(--blue-1);
  background: #eff6ff;
  color: var(--blue-deep);
}

/* Multi-line notes */
.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.4;
}

/* API key row + status */
.apikey-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
}
.apikey-status { font-weight: 600; }
.btn-link {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 4px;
}
.btn-link:active { opacity: 0.6; }

/* Weather card on catch detail */
.weather-card {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 12px;
}
.weather-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.weather-pill {
  background: white;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #1e40af;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Personal Bests strip on home */
.pb-strip {
  margin: 16px 16px 0;
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.pb-strip-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.pb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pb-tile {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}
.pb-icon { font-size: 22px; line-height: 1; }
.pb-num { font-size: 22px; font-weight: 900; color: #78350f; line-height: 1.1; margin-top: 2px; }
.pb-label { font-size: 10px; color: #92400e; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* Notes block in catch detail */
.notes-block {
  margin-top: 12px;
  padding: 12px;
  background: #fefce8;
  border-left: 3px solid #fbbf24;
  border-radius: 8px;
}
.notes-label {
  font-size: 10px;
  font-weight: 800;
  color: #92400e;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.notes-text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* Species picker */
.species-picker-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: white;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  color: var(--text);
}
.species-picker-btn:active { transform: scale(0.99); }
.picker-label-empty { color: #94a3b8; }
.picker-label-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.picker-tag {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.picker-chevron {
  font-size: 22px;
  color: #94a3b8;
  font-weight: 800;
  flex-shrink: 0;
}

.picker-overlay { z-index: 250; }
.picker-modal {
  display: flex;
  flex-direction: column;
  height: 90vh;
  height: 90dvh;
  overflow: hidden;
  padding-bottom: 0;
}
.picker-modal > .modal-header {
  position: relative;
  flex-shrink: 0;
}
.picker-search-wrap {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
  flex-shrink: 0;
}
.picker-modal .picker-custom-btn { flex-shrink: 0; }
.picker-search { width: 100%; }
.picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 2px solid transparent;
  border-radius: 14px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.picker-item:active { transform: scale(0.98); background: #f8fafc; }
.picker-item.selected {
  border-color: var(--blue-1);
  background: #eff6ff;
}
.picker-icon {
  width: 60px; height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-radius: 8px;
  overflow: hidden;
}
.picker-info { flex: 1; min-width: 0; }
.picker-name { font-weight: 700; font-size: 15px; }
.picker-family { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.picker-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}
.picker-custom-btn {
  margin: 0 16px 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.4px;
  display: flex;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  flex-shrink: 0;
}
.picker-custom-btn:active { transform: scale(0.98); }
.picker-custom-btn.picker-custom-empty {
  background: #f1f5f9;
  color: var(--text-soft);
  font-weight: 700;
  text-transform: none;
  box-shadow: none;
  border: 2px dashed #cbd5e1;
}

/* Cook button */
.btn-cook {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.4);
}
.btn-cook:active { transform: scale(0.98); }

/* Release card */
.release-card {
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #cffafe, #67e8f9);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 2px solid #06b6d4;
}
.release-icon { font-size: 32px; flex-shrink: 0; }
.release-content { flex: 1; }
.release-title {
  font-weight: 800;
  font-size: 15px;
  color: #155e75;
  margin-bottom: 4px;
}
.release-text {
  font-size: 13px;
  color: #164e63;
  line-height: 1.45;
}

/* Recipes browser (in Tips tab) */
.recipes-grid {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recipe-browse-card {
  background: white;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.recipe-browse-card:active { transform: scale(0.98); }
.recipe-browse-emoji {
  width: 56px; height: 56px;
  font-size: 36px;
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.recipe-browse-info { flex: 1; min-width: 0; }
.recipe-browse-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.recipe-browse-meta {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.recipe-browse-pill {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
}
.recipe-browse-species {
  font-size: 11px;
  color: var(--text-soft);
  font-style: italic;
}
.recipe-browse-arrow {
  font-size: 24px;
  color: var(--text-soft);
  font-weight: 800;
}

/* Recipe modal */
.recipe-modal { padding-bottom: 30px; }
.recipe-hero {
  padding: 30px 20px 20px;
  text-align: center;
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
}
.recipe-emoji { font-size: 60px; margin-bottom: 8px; }
.recipe-name {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #7c2d12;
  margin-bottom: 4px;
}
.recipe-species {
  font-size: 13px;
  font-weight: 700;
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.recipe-tagline {
  font-size: 15px;
  font-style: italic;
  color: #7c2d12;
  line-height: 1.4;
}
.recipe-meta {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.recipe-meta-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fef3c7;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
}
.recipe-meta-icon { font-size: 16px; }
.recipe-warning {
  margin: 0 16px 12px;
  padding: 12px 14px;
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  font-size: 13px;
  color: #991b1b;
  font-weight: 600;
}
.recipe-section {
  padding: 12px 16px 0;
}
.recipe-section-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.recipe-ingredients {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recipe-ingredients li {
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  position: relative;
  padding-left: 36px;
}
.recipe-ingredients li::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 14px; height: 14px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
}
.recipe-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recipe-steps li {
  counter-increment: step;
  background: #fff7ed;
  padding: 14px 14px 14px 50px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  border-left: 4px solid #fb923c;
}
.recipe-steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  background: #ea580c;
  color: white;
  width: 28px; height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
}
.recipe-tip {
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  color: #78350f;
}
.recipe-sustain {
  margin: 16px 16px 0;
  padding: 14px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 14px;
  border: 2px solid #10b981;
}
.recipe-sustain-title {
  font-size: 11px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.recipe-sustain-text {
  font-size: 13px;
  line-height: 1.45;
  color: #064e3b;
}

/* Share button */
.btn-share {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-share:active { transform: scale(0.98); }

/* Share modal — sticky footer so share buttons are always reachable */
.share-modal {
  display: flex;
  flex-direction: column;
  height: 90dvh;
  overflow: hidden;
  padding-bottom: 0;
}
.share-modal > .modal-header { flex-shrink: 0; position: relative; }
.share-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.share-footer {
  flex-shrink: 0;
  padding: 14px 16px;
  background: white;
  border-top: 1px solid #f1f5f9;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
}
.share-footer .btn-primary,
.share-footer .btn-secondary { padding: 14px; font-size: 15px; }
.share-preview {
  padding: 16px 16px 0;
  background: linear-gradient(180deg, #f1f5f9, #ffffff);
}
.share-card-preview {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  display: block;
}
.share-card-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.share-card-draggable.dragging { cursor: grabbing; }
.share-drag-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 8px;
  font-weight: 600;
}
.share-zoom-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 0;
}
.zoom-btn {
  background: #f1f5f9;
  border: none;
  width: 56px; height: 44px;
  border-radius: 22px;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  color: var(--blue-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.zoom-btn:active { transform: scale(0.92); background: #e2e8f0; }
.zoom-btn.zoom-reset {
  width: auto;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.share-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.share-actions .btn-primary,
.share-actions .btn-secondary {
  padding: 14px;
  font-size: 15px;
}
.share-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.4;
}
.share-loading {
  padding: 60px 20px;
  text-align: center;
}
.share-spinner {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border: 5px solid #e2e8f0;
  border-top-color: var(--blue-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.share-loading-text {
  font-weight: 600;
  color: var(--text-soft);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Photo tips card */
.photo-tips-card {
  margin-top: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-radius: 12px;
  border-left: 3px solid var(--blue-1);
}
.photo-tips-title {
  font-size: 12px;
  font-weight: 800;
  color: #075985;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.photo-tips-list {
  margin: 0;
  padding-left: 22px;
  font-size: 12px;
  line-height: 1.5;
  color: #0c4a6e;
}
.photo-tips-list li { margin: 1px 0; }

/* Alternates UI when AI confidence is medium/low */
.id-alternates {
  margin-top: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-radius: 12px;
  border: 2px solid #fbbf24;
}
.id-alt-header {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #78350f;
  margin-bottom: 6px;
}
.id-alt-reasoning {
  font-size: 12px;
  color: #92400e;
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.4;
}
.id-alt-primary {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}
.id-alt-primary:active { transform: scale(0.98); }
.id-alt-icon {
  width: 60px; height: 36px;
  background: rgba(255,255,255,0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.id-alt-icon svg { width: 100%; height: auto; padding: 2px; }
.id-alt-or {
  font-size: 12px;
  color: #92400e;
  font-weight: 700;
  margin: 4px 0 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.id-alt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.id-alt-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: white;
  border: 2px solid #fde68a;
  border-radius: 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
}
.id-alt-chip:active { transform: scale(0.97); border-color: var(--blue-1); }
.id-chip-icon {
  width: 32px; height: 22px;
  flex-shrink: 0;
}
.id-chip-icon svg { width: 100%; height: auto; }
.id-alt-chip span {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}
.id-alt-manual {
  width: 100%;
  background: none;
  border: none;
  padding: 10px;
  margin-top: 10px;
  font-family: inherit;
  font-size: 13px;
  color: #92400e;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Identify button & status */
.btn-id {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}
.btn-id:active { transform: scale(0.98); }
.btn-id:disabled { opacity: 0.6; cursor: wait; }
.id-status:empty { display: none; }
.id-result {
  margin-top: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 10px;
  font-size: 14px;
}
.id-error {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 10px;
  font-size: 13px;
}
.id-nofish {
  margin-top: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #e0f2fe, #fef3c7);
  color: #0c4a6e;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--blue-2);
}

/* Toast / level up */
.toast-wrap {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 300;
}
.toast {
  background: white;
  padding: 12px 20px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.4s 2.6s forwards;
  max-width: 90%;
}
.toast.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.toast.blue { background: linear-gradient(135deg, var(--blue-1), var(--blue-2)); color: white; }
.toast .icon { font-size: 24px; }

/* Tier banners (LEGENDARY, RARE, LUNKER, TROPHY) */
.tier-banner {
  position: fixed;
  top: 30%;
  left: 0;
  right: 0;
  z-index: 500;
  text-align: center;
  pointer-events: none;
  animation: bannerFly 3.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.tier-banner-text {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 28px;
  font-weight: 900;
  color: white;
  text-shadow: 0 4px 12px rgba(0,0,0,0.4);
  letter-spacing: 1.5px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.tier-legendary .tier-banner-text {
  background: linear-gradient(135deg, #fbbf24 0%, #ea580c 50%, #fbbf24 100%);
  background-size: 200% 200%;
  animation: shimmer 1.4s ease-in-out infinite;
  border: 3px solid #fef3c7;
}
.tier-rare .tier-banner-text {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  border: 3px solid #bae6fd;
}
.tier-lunker .tier-banner-text {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  border: 3px solid #fde68a;
}
.tier-trophy .tier-banner-text {
  background: linear-gradient(135deg, #fbbf24, #dc2626);
  background-size: 200% 200%;
  animation: shimmer 1.4s ease-in-out infinite;
  border: 3px solid #fef3c7;
  font-size: 24px;
}
.tier-pb .tier-banner-text {
  background: linear-gradient(135deg, #fde047, #f59e0b, #ea580c);
  border: 3px solid #fff7ed;
  font-size: 18px;
  padding: 11px 22px;
  letter-spacing: 0.8px;
  max-width: calc(100vw - 32px);
}
@keyframes bannerFly {
  0% { transform: translateX(-150%) rotate(-15deg) scale(0.6); opacity: 0; }
  18% { transform: translateX(8%) rotate(4deg) scale(1.08); opacity: 1; }
  28% { transform: translateX(0) rotate(0) scale(1); }
  82% { transform: translateX(0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translateX(150%) rotate(15deg) scale(0.6); opacity: 0; }
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Confetti / celebration */
.celebration-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  overflow: hidden;
}
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 2s ease-in forwards;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes toastIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-30px); opacity: 0; } }
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ====================================================================== */
/* ===== Video / Highlight Reels ======================================== */
/* ====================================================================== */

/* Catch form: video block */
.video-block { margin-top: 6px; }
.video-stage {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #f1f5f9;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder {
  text-align: center;
  padding: 24px 16px;
  width: 100%;
}

/* Persistent processing card shown while a clip is being read/encoded.
   Replaces the placeholder so kids see real progress, not silence. */
.video-processing {
  width: 100%;
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(135deg, #e0f2fe, #ede9fe);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.video-processing-emoji {
  font-size: 36px;
  animation: bobble 1.2s ease-in-out infinite;
  margin-bottom: 4px;
}
@keyframes bobble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.video-processing-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.video-processing-bar {
  width: 100%;
  max-width: 280px;
  height: 12px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.video-processing-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light, #fbbf24), var(--gold, #f59e0b));
  border-radius: 999px;
  transition: width 0.18s ease-out;
}
.video-processing-percent {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-2);
  margin-top: 6px;
}
.video-placeholder .emoji { font-size: 36px; margin-bottom: 6px; }
.video-placeholder .text { font-weight: 800; color: var(--text); font-size: 14px; }
.video-sub { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.video-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.video-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2,132,199,0.25);
}
.video-btn:active { transform: scale(0.97); }
.video-btn-soft {
  background: white;
  color: var(--blue-2);
  border: 2px solid var(--blue-2);
  box-shadow: none;
}
.video-file-input { display: none; }
.video-preview-poster {
  width: 100%;
  height: auto;
  display: block;
  max-height: 360px;
  object-fit: cover;
  background: black;
}
.video-preview-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--blue-deep);
  font-size: 26px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px; /* visual centering of the ▶ glyph */
}
.video-remove-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15,23,42,0.85);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

/* Log card: 🎬 badge on thumb */
.catch-thumb-wrap { position: relative; flex-shrink: 0; }
.catch-video-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(15,23,42,0.85);
  color: white;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 6px;
  pointer-events: none;
}

/* Catch detail: play overlay */
.catch-detail-photo-wrap {
  position: relative;
  width: 100%;
}
.catch-detail-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  color: var(--blue-deep);
  font-size: 30px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
}
.catch-detail-play-btn:active { transform: translate(-50%, -50%) scale(0.95); }

/* ===== Highlight Reels page ===== */
.reels-page {
  background: #000;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}
.reels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0) + 12px) 14px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.reels-back-btn {
  background: rgba(255,255,255,0.18);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(12px);
}
.reels-title {
  color: white;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.reels-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 30px;
  color: white;
}
.reels-empty-emoji { font-size: 64px; margin-bottom: 12px; }
.reels-empty-title { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.reels-empty-text { font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.5; max-width: 320px; }

/* Vertical scroll-snap feed (TikTok-style) */
.reels-feed {
  flex: 1;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.reel-slide {
  position: relative;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.reel-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}
.reel-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.reel-overlay-top, .reel-overlay-bottom {
  pointer-events: auto;
}
.reel-overlay-top {
  display: flex;
  justify-content: flex-end;
  padding: calc(env(safe-area-inset-top, 0) + 64px) 16px 0;
}
.reel-mute-btn {
  background: rgba(0,0,0,0.5);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.reel-overlay-bottom {
  padding: 24px 18px calc(env(safe-area-inset-bottom, 0) + 30px);
  background: linear-gradient(transparent, rgba(0,0,0,0.78));
  color: white;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reel-rarity {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.reel-species {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.reel-meta {
  font-size: 14px;
  color: rgba(255,255,255,0.92);
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.reel-location {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.reel-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.reel-action-btn {
  flex: 1;
  background: white;
  color: var(--blue-deep);
  border: none;
  border-radius: 12px;
  padding: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.reel-action-btn-soft {
  background: rgba(255,255,255,0.18);
  color: white;
  border: 1px solid rgba(255,255,255,0.32);
  backdrop-filter: blur(8px);
}

/* ===== Regulations card on the species detail ===== */
.reg-card {
  margin-top: 12px;
  background: linear-gradient(135deg, #ecfeff, #cffafe);
  border: 1px solid #67e8f9;
  border-radius: 14px;
  padding: 14px 16px;
}
.reg-card-generic {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-color: #cbd5e1;
}
.reg-card-row, .reg-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.reg-card-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.reg-card-body { flex: 1; min-width: 0; }
.reg-card-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0e7490;
  margin-bottom: 4px;
}
.reg-card-generic .reg-card-title { color: var(--text-soft); }
.reg-card-stats {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.reg-stat { white-space: nowrap; }
.reg-stat-divider { color: var(--text-soft); font-weight: 400; }
.reg-card-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  background: rgba(255,255,255,0.55);
  border-radius: 10px;
  padding: 8px 10px;
}
.reg-card-disclaimer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.4;
}
.reg-card-disclaimer a, .reg-card-link {
  color: var(--blue-2);
  font-weight: 700;
  text-decoration: underline;
}
.reg-card-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
}

/* ===== "Still growing" undersized release nudge ===== */
.undersized-nudge {
  margin-top: 14px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 1px solid #6ee7b7;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.undersized-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}
.undersized-body { flex: 1; min-width: 0; }
.undersized-title {
  font-weight: 900;
  color: #065f46;
  font-size: 15px;
  margin-bottom: 4px;
}
.undersized-text {
  font-size: 13px;
  color: #064e3b;
  line-height: 1.45;
}

/* Signature font for the Captain Splash signature on certificates.
   Loaded from Google Fonts. Browser caches after first load so it works
   offline on subsequent visits. */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap');

/* ===== Legal modals + Settings footer ===== */
.legal-modal { padding-bottom: 30px; }
.legal-body { padding: 8px 22px 20px; }
.legal-updated {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 12px;
}
.legal-intro {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}
.legal-h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 16px 0 6px;
}
.legal-p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
  white-space: pre-line;
}
.legal-numbered {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}
.legal-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-2);
  color: white;
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.legal-contact {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: var(--text-soft);
  white-space: pre-line;
  line-height: 1.5;
}

/* Legal links + footer at bottom of Settings */
.legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.legal-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--blue-2);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 6px;
  font-weight: 600;
}
.legal-dot { color: var(--text-soft); }
.legal-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 6px;
  padding: 4px 0 8px;
}

/* ===== Beta feedback ===== */
.home-feedback-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 18px 16px 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.home-feedback-link:active { transform: scale(0.98); background: white; }
.home-feedback-arrow { color: var(--blue-2); font-size: 16px; }

.feedback-modal { padding-bottom: 24px; }
.feedback-body { padding: 8px 18px 12px; }
.feedback-intro {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #422006;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.feedback-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.feedback-chip {
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  text-align: center;
  --chip-color: #0ea5e9;
}
.feedback-chip:active { transform: scale(0.97); }
.feedback-chip.active {
  background: white;
  border-color: var(--chip-color);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.feedback-note {
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
  margin-top: 12px;
  line-height: 1.45;
  padding: 0 8px;
}

/* ===== Certificates collection page ===== */
.cert-entry-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 32px);
  margin: 4px 16px 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.22);
}
.cert-entry-card:active { transform: scale(0.98); }
.cert-entry-icon { font-size: 32px; flex-shrink: 0; }
.cert-entry-text { flex: 1; min-width: 0; }
.cert-entry-title {
  font-weight: 900;
  font-size: 16px;
  color: #422006;
  letter-spacing: -0.01em;
}
.cert-entry-sub {
  font-size: 12px;
  color: #78350f;
  margin-top: 2px;
  font-weight: 600;
  line-height: 1.35;
}
.cert-entry-arrow {
  font-size: 28px;
  color: #92400e;
  font-weight: 800;
}

.cert-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 16px 16px;
}
.cert-card {
  display: block;
  width: 100%;
  background: white;
  border: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cert-card:active { transform: scale(0.98); }
.cert-card-preview {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  display: block;
  object-fit: cover;
  background: linear-gradient(135deg, #f0f9ff, #fffbeb);
}
.cert-card-body {
  padding: 14px 16px;
  border-top: 1px solid #f1f5f9;
}
.cert-card-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.cert-card-meta {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 8px;
}
.cert-card-dot { margin: 0 6px; }
.cert-card-cta {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-2);
}

.cert-footer-tip {
  margin: 8px 16px 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
  text-align: center;
}

/* Mystery teaser card — hints at more certificates to discover */
.cert-mystery-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 16px 4px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1e293b, #312e81);
  color: white;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(30, 41, 59, 0.25);
}
.cert-mystery-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 35%, rgba(168, 85, 247, 0.35), transparent 50%),
    radial-gradient(circle at 15% 75%, rgba(245, 158, 11, 0.18), transparent 50%);
  pointer-events: none;
}
.cert-mystery-icon {
  font-size: 32px;
  flex-shrink: 0;
  position: relative;
  filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.5));
}
.cert-mystery-text { flex: 1; min-width: 0; position: relative; }
.cert-mystery-title {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.cert-mystery-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  margin-top: 3px;
  line-height: 1.4;
}

.cert-empty {
  padding: 40px 30px;
  text-align: center;
}
.cert-empty-emoji { font-size: 64px; margin-bottom: 12px; }
.cert-empty-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--text);
}
.cert-empty-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* ===== Monthly Trophies section on the Badges page ===== */
.trophies-section {
  margin: 4px 16px 18px;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.22);
}
.trophies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.trophies-title {
  font-weight: 900;
  font-size: 15px;
  color: #422006;
  letter-spacing: -0.01em;
}
.trophies-count {
  font-size: 11px;
  font-weight: 800;
  color: #78350f;
  background: rgba(255,255,255,0.55);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.trophies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.trophy-tile {
  background: white;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  border-top: 4px solid var(--trophy-color, #f59e0b);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.18);
}
.trophy-medal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fef9c3 0%, #fbbf24 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.7),
    0 4px 10px rgba(245, 158, 11, 0.32);
}
.trophy-icon { font-size: 26px; line-height: 1; }
.trophy-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.trophy-edition {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: #92400e;
}

/* ===== Featured monthly challenge card on Home ===== */
.challenge-card {
  margin: 14px 16px 0;
  background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
  color: white;
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.28);
  position: relative;
  overflow: hidden;
}
.challenge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 15%, rgba(245, 158, 11, 0.20), transparent 50%),
    radial-gradient(circle at 12% 95%, rgba(34, 211, 238, 0.18), transparent 50%);
  pointer-events: none;
}
.challenge-card > * { position: relative; }
.challenge-completed {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}
.challenge-completed::before {
  background: radial-gradient(circle at 90% 20%, rgba(250, 204, 21, 0.30), transparent 50%);
}
.challenge-card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.challenge-card-icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.challenge-card-meta { flex: 1; min-width: 0; }
.challenge-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: rgba(255,255,255,0.78);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.challenge-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
  animation: pulse-dot 1.8s ease-in-out infinite;
  display: inline-block;
}
.challenge-completed .challenge-pulse {
  background: #fde68a;
  box-shadow: 0 0 0 3px rgba(253, 230, 138, 0.30);
}
.challenge-title {
  font-size: 17px;
  font-weight: 900;
  color: white;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.challenge-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  margin-top: 3px;
  line-height: 1.4;
}
.challenge-progress-wrap {
  margin: 12px 0 12px;
}
.challenge-progress-bar {
  height: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.challenge-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease-out;
}
.challenge-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.challenge-progress-text strong { color: white; font-weight: 900; font-size: 14px; }
.challenge-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  font-weight: 600;
  line-height: 1.4;
}
.challenge-reward-icon { font-size: 16px; }

/* ===== Catch celebration modal — fires after every saved catch ===== */
.celebrate-modal {
  padding-bottom: 24px;
}
.celebrate-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 18px 4px;
  background: linear-gradient(180deg, #fef3c7 0%, transparent 100%);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}
.celebrate-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 4px;
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebrate-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}
.celebrate-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.celebrate-body {
  padding: 8px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.celebrate-hero {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  background: #f0f9ff;
  display: block;
}
.celebrate-hero-svg {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  min-height: 160px;
}
.celebrate-species-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.celebrate-species {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}
.celebrate-stats {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}
.celebrate-card {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* 💪 Personal Best callout — gold/orange so it pops above other cards */
.celebrate-pb {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 60%, #ea580c 100%);
  color: #422006;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32);
  position: relative;
  overflow: hidden;
}
.celebrate-pb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 30%, rgba(255,255,255,0.45), transparent 55%);
  pointer-events: none;
}
.celebrate-pb-emoji {
  font-size: 36px;
  flex-shrink: 0;
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  animation: pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebrate-pb-text { flex: 1; min-width: 0; position: relative; }
.celebrate-pb-title {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.celebrate-pb-sub {
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.4;
  color: #5c2400;
}
.celebrate-card-fact {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}
.celebrate-card-custom {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.celebrate-card-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #78350f;
  margin-bottom: 5px;
}
.celebrate-card-custom .celebrate-card-label { color: var(--text-soft); }
.celebrate-card-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

/* Cert teaser block (only when a milestone fired) */
.celebrate-cert-tease {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1e293b, #312e81);
  color: white;
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(30,41,59,0.22);
}
.celebrate-cert-tease::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 30%, rgba(245,158,11,0.30), transparent 60%);
  pointer-events: none;
}
.celebrate-cert-icon { font-size: 26px; position: relative; }
.celebrate-cert-title { font-weight: 900; font-size: 14px; position: relative; }
.celebrate-cert-sub { font-size: 12px; color: rgba(255,255,255,0.78); margin-top: 2px; position: relative; }

.celebrate-btn {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  font-size: 16px;
}

/* ===== Printable Certificate modal ===== */
.cert-modal { padding-bottom: 30px; }
.cert-body {
  padding: 8px 18px 12px;
}
.cert-celebrate {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.cert-preview-wrap {
  background: linear-gradient(135deg, #f0f9ff, #fffbeb);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.cert-preview {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.cert-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.cert-skip {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}

/* Share clip intro modal — kid-friendly, framed for messaging not socials */
.share-clip-intro { padding-bottom: 24px; }
.share-clip-body {
  padding: 8px 24px 12px;
  text-align: center;
}
.share-clip-emoji {
  font-size: 56px;
  margin: 8px 0 4px;
  line-height: 1;
}
.share-clip-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.share-clip-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.share-clip-tip {
  font-size: 12px;
  color: var(--text-soft);
  background: #fef3c7;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  line-height: 1.4;
  text-align: left;
}
.share-clip-btn {
  width: 100%;
  font-size: 16px;
  padding: 14px;
}

/* Featured "Highlight Reels" card on the Learn hub */
.reels-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  margin: 0 0 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
  position: relative;
  overflow: hidden;
}
.reels-feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 30%, rgba(14, 165, 233, 0.35), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(245, 158, 11, 0.18), transparent 50%);
  pointer-events: none;
}
.reels-feature-card:active { transform: scale(0.98); }
.reels-feature-icon {
  font-size: 32px;
  flex-shrink: 0;
  position: relative;
}
.reels-feature-text { flex: 1; min-width: 0; position: relative; }
.reels-feature-title { font-weight: 900; font-size: 16px; }
.reels-feature-sub { font-size: 12px; color: rgba(255,255,255,0.78); margin-top: 2px; line-height: 1.35; }
.reels-feature-arrow { font-size: 28px; color: rgba(255,255,255,0.85); position: relative; }
