/* ================================================================
   Number Nest — Design System
   ================================================================ */

:root {
  --sky-top: #7ec8e3;
  --sky-bot: #f6e8b1;
  --grass: #6abf69;
  --surface: #ffffff;
  --glass: rgba(255,255,255,0.88);
  --ink: #2b2d42;
  --ink-soft: #555b7a;
  --ink-muted: #8d93ab;
  --brand: #6c5ce7;
  --brand-light: #a29bfe;
  --coral: #ff6b6b;
  --teal: #00cec9;
  --gold: #fdcb6e;
  --green: #00b894;
  --pink: #e84393;
  --purple: #a78bfa;
  --orange: #e17055;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);
  --r-sm: .75rem;
  --r-md: 1.25rem;
  --r-lg: 1.75rem;
  --r-pill: 999px;
  --ease: .2s cubic-bezier(.4,0,.2,1);
  --bounce: .4s cubic-bezier(.34,1.56,.64,1);
}

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

html { font-size: 16px; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: linear-gradient(170deg, var(--sky-top), var(--sky-bot) 60%, var(--grass));
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Topbar ───────────────────────────────────────────────── */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.5);
  position: sticky; top: 0; z-index: 100;
}
.brand { cursor: pointer; }
.brand h1 { font-size: 1.15rem; font-weight: 900; color: var(--brand); line-height: 1; }
.brand p { font-size: .7rem; color: var(--ink-muted); font-weight: 600; }
.wallet {
  display: flex; align-items: center; gap: .35rem;
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  padding: .35rem .75rem; border-radius: var(--r-pill);
  font-weight: 800; font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.wallet-icon { font-size: 1.1rem; }

/* ── Nav ──────────────────────────────────────────────────── */
#mainNav {
  display: flex; justify-content: center; gap: .5rem;
  padding: .5rem 1rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.3);
  position: sticky; top: 52px; z-index: 99;
}
.nav-btn {
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .82rem;
  color: var(--ink-muted); padding: .4rem .9rem;
  border-radius: var(--r-pill); transition: var(--ease);
  display: inline-flex; align-items: center; gap: .2rem;
  text-decoration: none;
}
.nav-btn:hover { background: rgba(108,92,231,.08); color: var(--ink); }
.nav-btn--active {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 10px rgba(108,92,231,.3);
}
.nav-btn--active:hover { background: var(--brand); color: #fff; }

/* ── Main ─────────────────────────────────────────────────── */
#app {
  max-width: 520px; margin: 0 auto;
  padding: .75rem .75rem 6rem;
}

/* ── Panels ───────────────────────────────────────────────── */
.panel {
  background: var(--glass);
  backdrop-filter: blur(8px);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: .75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,.5);
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── World Map (map selector) ─────────────────────────────── */
.world-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .65rem;
}
.world-card {
  position: relative; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--card-c1), var(--card-c2));
  border-radius: var(--r-md); padding: 1rem .85rem;
  text-align: left; font-family: inherit;
  color: #fff; overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 100px;
}
.world-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.world-card--locked {
  filter: grayscale(.7) brightness(.85);
  cursor: default; pointer-events: none;
}
.world-card--done { border: 3px solid var(--gold); }
.world-card .card-map-num {
  font-weight: 900; font-size: .7rem; opacity: .8; text-transform: uppercase; letter-spacing: .5px;
}
.world-card .card-title {
  font-weight: 800; font-size: .95rem; margin-top: .15rem; line-height: 1.15;
}
.world-card .card-progress {
  font-size: .7rem; font-weight: 600; opacity: .85; margin-top: .3rem;
}
.world-card .card-emoji {
  position: absolute; right: .5rem; bottom: .35rem;
  font-size: 2rem; opacity: .3;
}
.world-card .card-lock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: rgba(0,0,0,.25);
  border-radius: var(--r-md);
}

/* ── Practice games launcher ─────────────────────────────── */
.practice-panel { padding: 1rem; }
.practice-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .7rem;
}
.practice-header h3 {
  font-size: 1rem; font-weight: 900; color: var(--ink);
}
.practice-all {
  color: var(--brand); font-size: .78rem; font-weight: 800;
  text-decoration: none; white-space: nowrap;
}
.practice-all:hover { text-decoration: underline; }
.practice-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.practice-card {
  min-height: 82px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem; text-decoration: none; color: var(--ink);
  background: rgba(255,255,255,.9);
  border: 2px solid rgba(255,255,255,.85);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.practice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108,92,231,.25);
}
.practice-emoji { font-size: 1.8rem; line-height: 1; }
.practice-title {
  font-size: .72rem; font-weight: 900; text-align: center;
  line-height: 1.1; padding: 0 .25rem;
}

/* ── Lesson Path (inside a map) ───────────────────────────── */
.map-header { text-align: center; }
.map-header h2 { font-size: 1.2rem; font-weight: 900; }
.map-header .subtitle { font-size: .78rem; color: var(--ink-soft); }

.map-stats {
  display: flex; justify-content: center; gap: 1.5rem; margin-top: .6rem;
}
.map-stat { text-align: center; }
.map-stat-value { display: block; font-weight: 900; font-size: 1.1rem; }
.map-stat-label { font-size: .65rem; color: var(--ink-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

.lesson-path { display: flex; flex-direction: column; gap: 0; }

.path-connector {
  width: 3px; height: 28px; margin: 0 auto;
  background: #ddd; border-radius: 2px;
}
.path-connector--done { background: var(--green); }

.path-node {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem .85rem; border-radius: var(--r-md);
  cursor: pointer; transition: var(--ease);
  border: 2px solid transparent;
  background: var(--surface);
}
.path-node:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.path-node--done { border-color: var(--green); background: #f0fdf4; }
.path-node--current { border-color: var(--brand); background: #f5f3ff; animation: pulse 2s infinite; }
.path-node--locked { opacity: .5; cursor: default; pointer-events: none; }
.path-node--quiz { border-color: var(--gold); background: #fffde7; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,92,231,.3); }
  50% { box-shadow: 0 0 0 8px rgba(108,92,231,0); }
}

.path-emoji { font-size: 1.6rem; flex-shrink: 0; }
.path-info { flex: 1; min-width: 0; }
.path-title { font-weight: 800; font-size: .85rem; }
.path-strand { font-size: .7rem; color: var(--ink-muted); font-weight: 600; }
.path-badge {
  font-size: .65rem; font-weight: 800; padding: .2rem .6rem;
  border-radius: var(--r-pill); color: #fff; flex-shrink: 0;
}
.badge--done { background: var(--green); }
.badge--play { background: var(--brand); }
.badge--locked { background: #bbb; }
.badge--quiz { background: var(--gold); color: var(--ink); }

.stars-row { display: flex; gap: 2px; margin-top: 2px; }
.star { font-size: .7rem; opacity: .25; }
.star--on { opacity: 1; }

.back-btn {
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .85rem;
  color: var(--brand); padding: .4rem 0; margin-bottom: .25rem;
}
.back-btn:hover { text-decoration: underline; }

/* ── Activity Screen ──────────────────────────────────────── */
.activity-header {
  text-align: center; margin-bottom: .5rem;
}
.activity-header h3 { font-size: .95rem; font-weight: 800; }
.activity-progress {
  display: flex; gap: 4px; justify-content: center; margin: .5rem 0;
}
.progress-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ddd; transition: var(--ease);
}
.progress-dot--done { background: var(--green); }
.progress-dot--current { background: var(--brand); transform: scale(1.3); }

.activity-prompt {
  font-size: 1rem; font-weight: 700; text-align: center;
  padding: .75rem .5rem; line-height: 1.4;
}

.activity-visual {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem; padding: .5rem; min-height: 80px;
}

/* MCQ Choices */
.choice-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  margin-top: .5rem;
}
.choice-btn {
  border: 2px solid #e0e0e0; background: var(--surface);
  border-radius: var(--r-md); padding: .75rem;
  font-family: inherit; font-weight: 800; font-size: 1.1rem;
  cursor: pointer; transition: var(--ease);
}
.choice-btn:hover { border-color: var(--brand); background: #f5f3ff; }
.choice-btn--correct {
  border-color: var(--green) !important; background: #d4edda !important;
  animation: correctPop .4s ease;
}
.choice-btn--wrong {
  border-color: var(--coral) !important; background: #fde8e8 !important;
  animation: shake .4s ease;
}
@keyframes correctPop {
  0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Bubble Pop mechanic */
.bubble-arena {
  position: relative; width: 100%; height: 220px;
  background: linear-gradient(180deg, #e8f4fd, #d0ecf9);
  border-radius: var(--r-md); overflow: hidden;
}
.bubble {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--brand-light));
  font-weight: 900; font-size: 1.2rem; color: var(--ink);
  cursor: pointer; box-shadow: var(--shadow-md);
  animation: floatBubble 3s ease-in-out infinite;
  transition: transform .15s ease;
  user-select: none;
}
.bubble:hover { transform: scale(1.15); }
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Number Line mechanic */
.numberline-track {
  position: relative; width: 100%; height: 80px;
  margin: 1rem 0;
}
.numberline-bar {
  position: absolute; top: 35px; left: 5%; right: 5%;
  height: 4px; background: #ccc; border-radius: 2px;
}
.numberline-tick {
  position: absolute; top: 22px;
  display: flex; flex-direction: column; align-items: center;
  transform: translateX(-50%); cursor: pointer;
  transition: var(--ease);
}
.numberline-tick:hover .tick-num { color: var(--brand); transform: scale(1.2); }
.tick-mark { width: 2px; height: 14px; background: #aaa; }
.tick-num { font-weight: 800; font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.numberline-frog {
  position: absolute; top: 2px; font-size: 1.5rem;
  transition: left .4s cubic-bezier(.34,1.56,.64,1);
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}

/* Ten Frame mechanic */
.tenframe-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  max-width: 280px; margin: .75rem auto;
}
.tenframe-cell {
  aspect-ratio: 1; border: 2px solid #ddd; border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; transition: var(--ease);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.tenframe-cell:hover { border-color: var(--brand); }
.tenframe-cell--filled { background: var(--brand-light); border-color: var(--brand); }

/* Drag Sort mechanic */
.sort-zone {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
  min-height: 50px; padding: .5rem;
  border: 2px dashed #ddd; border-radius: var(--r-md);
  margin: .4rem 0;
}
.sort-zone-label { font-size: .7rem; font-weight: 700; color: var(--ink-muted); text-align: center; width: 100%; }
.sort-item {
  padding: .5rem .9rem; border-radius: var(--r-pill);
  background: var(--surface); border: 2px solid #e0e0e0;
  font-weight: 800; font-size: 1rem; cursor: pointer;
  transition: var(--ease); user-select: none;
}
.sort-item:hover { border-color: var(--brand); background: #f5f3ff; }
.sort-item--selected { border-color: var(--brand); background: var(--brand-light); color: #fff; }

/* Hint bar */
.hint-bar {
  text-align: center; margin-top: .6rem;
}
.hint-btn {
  border: none; background: rgba(108,92,231,.08); color: var(--brand);
  font-family: inherit; font-weight: 700; font-size: .78rem;
  padding: .35rem .9rem; border-radius: var(--r-pill); cursor: pointer;
}
.hint-text {
  font-size: .82rem; color: var(--ink-soft); font-weight: 600;
  background: #fffde7; padding: .5rem .75rem; border-radius: var(--r-sm);
  margin-top: .35rem; display: inline-block;
}

/* Feedback flash */
.feedback-correct {
  text-align: center; font-weight: 800; font-size: 1.1rem;
  color: var(--green); padding: .6rem;
  animation: fadeUp .3s ease;
}
.feedback-wrong {
  text-align: center; font-weight: 800; font-size: 1.1rem;
  color: var(--coral); padding: .6rem;
  animation: shake .4s ease;
}

/* ── Quiz Screen ──────────────────────────────────────────── */
.quiz-counter {
  text-align: center; font-weight: 700; font-size: .8rem;
  color: var(--ink-muted); margin-bottom: .5rem;
}
.quiz-question {
  font-size: 1rem; font-weight: 700; text-align: center;
  padding: .5rem; line-height: 1.4;
}

/* ── Result Screen ────────────────────────────────────────── */
.result-panel { text-align: center; }
.result-emoji { font-size: 3.5rem; margin-bottom: .5rem; }
.result-title { font-size: 1.3rem; font-weight: 900; }
.result-subtitle { font-size: .85rem; color: var(--ink-soft); margin: .25rem 0; }
.result-stars { font-size: 2rem; letter-spacing: 4px; margin: .5rem 0; }
.result-acorns {
  display: inline-flex; align-items: center; gap: .3rem;
  font-weight: 800; font-size: 1.1rem; color: var(--gold);
  background: #fffde7; padding: .4rem .9rem; border-radius: var(--r-pill);
}
.result-pet {
  margin: .75rem auto; padding: .75rem; background: #f5f3ff;
  border-radius: var(--r-md); max-width: 220px;
}
.result-pet-emoji { font-size: 2.5rem; }
.result-pet-name { font-weight: 800; font-size: .9rem; color: var(--brand); }

.btn-primary {
  border: none; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff;
  font-weight: 800; font-size: .95rem;
  padding: .7rem 1.8rem; border-radius: var(--r-pill);
  box-shadow: 0 4px 15px rgba(108,92,231,.3);
  transition: var(--ease); margin-top: .75rem;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,92,231,.4); }
.btn-secondary {
  border: 2px solid var(--brand); background: transparent; color: var(--brand);
  cursor: pointer; font-family: inherit; font-weight: 700; font-size: .85rem;
  padding: .5rem 1.4rem; border-radius: var(--r-pill); transition: var(--ease);
  margin-top: .5rem;
}
.btn-secondary:hover { background: rgba(108,92,231,.06); }

/* ── Pets Screen ──────────────────────────────────────────── */
.pets-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.pet-card {
  text-align: center; padding: .75rem .5rem;
  background: var(--surface); border-radius: var(--r-md);
  border: 2px solid #eee; transition: var(--ease);
}
.pet-card--empty { opacity: .35; }
.pet-emoji { font-size: 2rem; }
.pet-name { font-size: .72rem; font-weight: 700; color: var(--ink-soft); margin-top: .15rem; }
.pet-source { font-size: .6rem; color: var(--ink-muted); }

/* ── Store Screen ─────────────────────────────────────────── */
.store-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
}
.store-item {
  text-align: center; padding: .85rem .5rem;
  background: var(--surface); border-radius: var(--r-md);
  border: 2px solid #eee;
}
.store-item-emoji { font-size: 2rem; }
.store-item-name { font-weight: 700; font-size: .8rem; margin: .2rem 0; }
.store-item-price { font-size: .75rem; color: var(--ink-muted); font-weight: 600; }
.store-buy-btn {
  border: none; cursor: pointer; font-family: inherit;
  background: var(--gold); color: var(--ink);
  font-weight: 800; font-size: .75rem;
  padding: .3rem .8rem; border-radius: var(--r-pill);
  margin-top: .3rem; transition: var(--ease);
}
.store-buy-btn:hover { transform: scale(1.05); }
.store-buy-btn:disabled { opacity: .4; cursor: default; transform: none; }
.store-owned-badge {
  font-size: .7rem; font-weight: 700; color: var(--green);
}

/* ── Overlay ──────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }
.overlay-content {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 1.5rem; max-width: 340px; width: 90%;
  text-align: center; box-shadow: var(--shadow-lg);
  animation: fadeUp .3s ease;
}

/* ── Confetti ─────────────────────────────────────────────── */
.confetti-piece {
  position: fixed; width: 8px; height: 8px;
  border-radius: 2px; z-index: 300;
  animation: confettiFall 1.8s ease-out forwards;
  pointer-events: none;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ── Wallet pulse ─────────────────────────────────────────── */
@keyframes walletPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   FISHING GAME
   ═══════════════════════════════════════════════════════════ */

/* ── Scene ────────────────────────────────────────────────── */
.fishing-scene {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(180deg, #e8f6fc 0%, #b3dff5 8%, #5bb8e8 18%, #2d8bc9 35%, #1b5e8a 60%, #0e3d5c 100%);
  height: 340px;
  user-select: none;
  box-shadow: var(--shadow-lg);
}

/* Light rays */
.fishing-rays {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.fishing-ray {
  position: absolute; top: -20%; width: 60px; height: 140%;
  background: linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(15deg); border-radius: 50%;
  animation: rayDrift 12s ease-in-out infinite alternate;
}
.fishing-ray:nth-child(1) { left: 10%; animation-delay: 0s; width: 50px; }
.fishing-ray:nth-child(2) { left: 35%; animation-delay: -3s; width: 70px; opacity: .6; }
.fishing-ray:nth-child(3) { left: 65%; animation-delay: -7s; width: 45px; }
.fishing-ray:nth-child(4) { left: 85%; animation-delay: -5s; width: 55px; opacity: .5; }
@keyframes rayDrift {
  0% { transform: rotate(12deg) translateX(-10px); }
  100% { transform: rotate(18deg) translateX(10px); }
}

/* Water surface */
.fishing-surface {
  position: absolute; top: 0; left: -5%; right: -5%; height: 32px;
  background: linear-gradient(180deg, #e8f6fc, rgba(91,184,232,.4));
  z-index: 3; pointer-events: none;
}
.fishing-surface::after {
  content: ''; position: absolute; bottom: -6px; left: 0; right: 0; height: 12px;
  background: repeating-linear-gradient(90deg,
    transparent, transparent 20px,
    rgba(255,255,255,.2) 20px, rgba(255,255,255,.2) 40px);
  animation: waveDrift 4s linear infinite;
}
@keyframes waveDrift { 0% { transform: translateX(0); } 100% { transform: translateX(40px); } }

/* Bubbles */
.fishing-bubble {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.5), rgba(255,255,255,.1));
  border: 1px solid rgba(255,255,255,.2);
  pointer-events: none; z-index: 1;
  animation: bubbleRise linear forwards;
}
@keyframes bubbleRise {
  0% { opacity: .6; transform: translateX(0) scale(1); }
  50% { opacity: .4; transform: translateX(8px) scale(1.05); }
  100% { opacity: 0; transform: translateX(-4px) scale(.8); top: 10%; }
}

/* ── HUD ──────────────────────────────────────────────────── */
.fishing-hud {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10; padding: .6rem .75rem;
  display: flex; flex-direction: column; gap: .35rem;
  pointer-events: none;
}
.fishing-hud > * { pointer-events: auto; }

.fishing-prompt-row {
  display: flex; justify-content: center;
}
.fishing-prompt {
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  padding: .4rem 1rem; border-radius: var(--r-pill);
  font-weight: 800; font-size: 1.05rem; color: var(--ink);
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  text-align: center;
}

.fishing-stats-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; font-weight: 700;
}
.fishing-stat {
  background: rgba(255,255,255,.8); backdrop-filter: blur(4px);
  padding: .25rem .6rem; border-radius: var(--r-pill);
  color: var(--ink-soft);
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.fishing-stat--streak {
  background: linear-gradient(135deg, #ff6b6b, #ffa502);
  color: #fff; font-weight: 900;
  animation: streakPulse .6s ease infinite;
}
@keyframes streakPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ── Fish ─────────────────────────────────────────────────── */
.fish-container {
  position: absolute; inset: 0; z-index: 5;
  overflow: hidden;
}

.fish {
  position: absolute;
  width: var(--fish-w, 98px);
  height: var(--fish-h, 76px);
  cursor: pointer; z-index: 5;
  transition: transform .1s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 30, 60, .28));
  overflow: visible;
}
.fish:active { transform: scale(.9); }

.fish-sprite-wrap {
  width: 100%;
  height: 100%;
  display: block;
  transform: scaleX(var(--fish-facing, -1));
  transform-origin: center;
}

.fish-sprite {
  width: 100%;
  height: 100%;
  display: block;
  background-image: var(--fish-sheet);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: var(--fish-sheet-w) var(--fish-h);
  animation: fishSpriteSwim var(--fish-duration, 735ms) steps(var(--fish-frames, 7)) infinite;
}

@keyframes fishSpriteSwim {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--fish-sheet-w) * -1); }
}

.fish-number-badge {
  position: absolute;
  left: var(--badge-x, 34%);
  top: var(--badge-y, 26%);
  transform: translate(-50%, -50%);
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #fff5d6;
  background: linear-gradient(180deg, #fffdf4 0%, #ffe59f 100%);
  color: #16354e;
  font-weight: 900;
  font-size: .9rem;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255,255,255,.75);
  box-shadow:
    0 2px 0 rgba(138, 93, 28, .36),
    0 4px 10px rgba(0, 29, 56, .28),
    inset 0 -2px 0 rgba(217, 156, 45, .24);
  pointer-events: none;
}

/* Catch animation */
.fish--caught {
  transition: all .5s cubic-bezier(.34,1.56,.64,1) !important;
  transform: scale(1.3) rotate(-15deg) !important;
  opacity: 0;
  pointer-events: none;
}

/* Miss animation */
.fish--miss .fish-sprite-wrap {
  animation: fishMiss .4s ease;
}
@keyframes fishMiss {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(.8) rotate(10deg); }
  60% { transform: scale(1.05) rotate(-5deg); }
}

/* ── Splash ───────────────────────────────────────────────── */
.fishing-splash {
  position: absolute; z-index: 8; pointer-events: none;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.8);
  animation: splashRing .6s ease-out forwards;
  transform: translate(-50%, -50%);
}
@keyframes splashRing {
  0% { width: 20px; height: 20px; opacity: 1; border-width: 4px; }
  100% { width: 80px; height: 80px; opacity: 0; border-width: 1px; }
}
.fishing-splash-drop {
  position: absolute; z-index: 8; pointer-events: none;
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,.7);
  animation: splashDrop .5s ease-out forwards;
}
@keyframes splashDrop {
  0% { opacity: 1; transform: translate(0, 0); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
}

/* ── Bucket ───────────────────────────────────────────────── */
.fishing-bucket {
  position: absolute; bottom: 8px; right: 10px;
  z-index: 10;
  display: flex; align-items: center; gap: .3rem;
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
  padding: .3rem .6rem; border-radius: var(--r-pill);
  font-weight: 800; font-size: .8rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.bucket-fish {
  display: inline-block; font-size: .9rem;
  animation: bucketBounce .3s ease;
}
@keyframes bucketBounce {
  0% { transform: scale(0) translateY(-10px); }
  60% { transform: scale(1.2) translateY(0); }
  100% { transform: scale(1); }
}
.bucket-empty { opacity: .3; }

/* ── Miss X ───────────────────────────────────────────────── */
.fishing-miss-x {
  position: absolute; z-index: 8; pointer-events: none;
  font-size: 1.5rem; font-weight: 900; color: var(--coral);
  animation: missFloat .7s ease-out forwards;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
@keyframes missFloat {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(.6); }
}

/* ═══════════════════════════════════════════════════════════
   FISHING RESULT / PERFORMANCE
   ═══════════════════════════════════════════════════════════ */
.fish-result-panel { text-align: center; }

.perf-section {
  margin-top: 1rem; padding: .75rem;
  background: #f8f9ff; border-radius: var(--r-md);
}
.perf-section h4 {
  font-size: .75rem; font-weight: 800; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: .5rem;
}

.perf-bars {
  display: flex; flex-direction: column; gap: .4rem;
}
.perf-bar-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 700;
}
.perf-bar-label {
  width: 55px; text-align: right; color: var(--ink-muted);
  flex-shrink: 0;
}
.perf-bar-track {
  flex: 1; height: 14px; background: #e8ecf1;
  border-radius: 7px; overflow: hidden;
  position: relative;
}
.perf-bar-fill {
  height: 100%; border-radius: 7px;
  transition: width .8s cubic-bezier(.34,1.56,.64,1);
  min-width: 2px;
}
.perf-bar-fill--current { background: linear-gradient(90deg, var(--brand), var(--brand-light)); }
.perf-bar-fill--prev { background: linear-gradient(90deg, #bbb, #ddd); }
.perf-bar-fill--best { background: linear-gradient(90deg, var(--gold), #fda085); }
.perf-bar-value {
  font-size: .65rem; color: var(--ink-soft); margin-left: .3rem; flex-shrink: 0;
  width: 36px;
}

.perf-improvement {
  margin-top: .6rem; padding: .4rem .75rem;
  border-radius: var(--r-pill);
  font-weight: 800; font-size: .8rem;
  display: inline-block;
}
.perf-improvement--better {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
}
.perf-improvement--new-best {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  animation: streakPulse 1s ease infinite;
}
.perf-improvement--first {
  background: linear-gradient(135deg, #e8f4fd, #bee5eb);
  color: #0c5460;
}

/* ═══════════════════════════════════════════════════════════
   BALANCE SCALE GAME
   ═══════════════════════════════════════════════════════════ */
.bal-scene {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(180deg, #fef9ef 0%, #fdf0d5 30%, #f5e6c8 60%, #e8d5b0 100%);
  min-height: 440px;
  user-select: none;
  box-shadow: var(--shadow-lg);
  padding-bottom: .5rem;
}

/* ── HUD ──────────────────────────────────────────────────── */
.bal-hud {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: .5rem .65rem; z-index: 10; position: relative;
}
.bal-hud-left { display: flex; flex-direction: column; gap: .25rem; }
.bal-hud-right { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.bal-round-label {
  font-weight: 800; font-size: .85rem; color: var(--ink);
  background: rgba(255,255,255,.8); backdrop-filter: blur(4px);
  padding: .2rem .6rem; border-radius: var(--r-pill);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.bal-dots { display: flex; gap: .3rem; padding-left: .2rem; }
.bal-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #d4c5a9; transition: background .3s;
}
.bal-dot--done { background: var(--green); }
.bal-dot--current { background: var(--brand); animation: streakPulse .8s ease infinite; }

/* ── Scale assembly ──────────────────────────────────────── */
.bal-scale-area {
  position: relative;
  height: 220px;
  margin: 0 auto;
  max-width: 380px;
}

.bal-post {
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 14px; height: 110px;
  background: linear-gradient(90deg, #b8860b, #daa520, #b8860b);
  border-radius: 4px 4px 8px 8px;
  box-shadow: 2px 2px 8px rgba(0,0,0,.15);
  z-index: 1;
}
.bal-post::after {
  content: '';
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 50px; height: 10px;
  background: linear-gradient(90deg, #8B6914, #b8860b, #8B6914);
  border-radius: 6px;
}

.bal-pivot {
  position: absolute;
  top: 88px; left: 50%; transform: translateX(-50%);
  font-size: 1rem; color: #b8860b; z-index: 5;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
  line-height: 1;
}

.bal-beam {
  position: absolute;
  top: 82px; left: 50%; transform: translateX(-50%);
  width: 260px; height: 10px;
  background: linear-gradient(180deg, #daa520, #b8860b);
  border-radius: 5px;
  transform-origin: center center;
  transition: none;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  margin-left: -130px;
  left: 50%;
}

/* Chains */
.bal-chain {
  position: absolute;
  top: 10px;
  width: 2px; height: 28px;
  background: repeating-linear-gradient(180deg, #b8860b 0px, #b8860b 3px, #daa520 3px, #daa520 6px);
}
.bal-chain--left { left: 18px; }
.bal-chain--right { right: 18px; }

/* Pans */
.bal-pan {
  position: absolute;
  top: 118px;
  width: 100px;
  display: flex; flex-direction: column; align-items: center;
  transition: transform .05s linear;
  z-index: 4;
}
.bal-pan--left { left: calc(50% - 170px); }
.bal-pan--right { left: calc(50% + 70px); }

.bal-pan-tray {
  width: 90px; height: 10px;
  background: linear-gradient(180deg, #cd9b1d, #b8860b);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

.bal-pan-blocks {
  display: flex; flex-direction: column-reverse; align-items: center;
  min-height: 10px;
}

.bal-pan-number {
  font-weight: 900; font-size: 1.1rem; color: var(--ink);
  margin-top: .2rem;
  background: rgba(255,255,255,.7);
  padding: .1rem .5rem; border-radius: var(--r-pill);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Blocks ──────────────────────────────────────────────── */
.bal-unit {
  width: 38px;
  border: 1px solid rgba(255,255,255,.3);
  border-bottom: 1px solid rgba(0,0,0,.1);
  margin-bottom: 1px;
  position: relative;
}
.bal-unit--target {
  background: linear-gradient(135deg, #74b9ff, #a29bfe);
  border-radius: 3px;
}
.bal-unit--player {
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.bal-unit--player:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}
.bal-unit-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 900; color: rgba(255,255,255,.9);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  pointer-events: none;
}

/* ── Shelf ────────────────────────────────────────────────── */
.bal-shelf {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: .6rem;
  padding: .5rem .75rem;
  margin: .3rem .5rem 0;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(4px);
  border-radius: var(--r-md);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.04);
  min-height: 70px;
}

.bal-shelf-block {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  cursor: grab;
  padding: 4px;
  border-radius: 6px;
  transition: transform var(--ease), box-shadow var(--ease);
  position: relative;
}
.bal-shelf-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.bal-shelf-block:active {
  cursor: grabbing;
  transform: scale(.95);
}

.bal-block-stack {
  display: flex; flex-direction: column-reverse;
}

.bal-block-label {
  font-weight: 900; font-size: .75rem; color: var(--ink);
  margin-top: 2px;
}

/* ── Drag clone ──────────────────────────────────────────── */
.bal-drag-clone {
  pointer-events: none;
  z-index: 100;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.25));
}

/* ── Feedback ────────────────────────────────────────────── */
.bal-feedback {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  font-weight: 900; font-size: 1.2rem;
  padding: .5rem 1.2rem;
  border-radius: var(--r-pill);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 50;
  white-space: nowrap;
}
.bal-feedback--over {
  background: linear-gradient(135deg, #ffcccc, #ff9999);
  color: #c0392b;
  box-shadow: 0 4px 20px rgba(192,57,43,.2);
}
.bal-feedback--balanced {
  background: linear-gradient(135deg, #d4edda, #a8e6cf);
  color: #155724;
  box-shadow: 0 4px 20px rgba(21,87,36,.2);
  animation: balancePop .5s ease;
}
@keyframes balancePop {
  0% { transform: translate(-50%, -50%) scale(.5); }
  60% { transform: translate(-50%, -50%) scale(1.15); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   CATAPULT AIMING GAME
   ═══════════════════════════════════════════════════════════ */
.cat-scene {
  position: relative;
  width: 100%; max-width: 500px; margin: 0 auto;
  min-height: 420px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(180deg, #87ceeb 0%, #b8e6ff 40%, #90d890 40%, #5a9f5a 100%);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  touch-action: none;
  user-select: none;
}

.cat-sky {
  position: relative;
  height: 40%; min-height: 120px;
  overflow: hidden;
}

.cat-cloud {
  position: absolute;
  font-size: 2rem;
  top: 15%;
  opacity: .6;
  transition: left 0.05s linear;
}
.cat-cloud--1 { top: 10%; font-size: 2.4rem; }
.cat-cloud--2 { top: 35%; font-size: 1.6rem; }

.cat-wind-indicator {
  position: absolute;
  top: .5rem; right: .5rem;
  background: rgba(255,255,255,.7);
  padding: .15rem .5rem;
  border-radius: var(--r-pill);
  font-size: .65rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.cat-ground {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 1rem 2rem;
}

.cat-slingshot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.cat-sling-base {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}

.cat-sling-arm {
  width: 4px; height: 30px;
  background: #8B4513;
  border-radius: 2px;
  transform-origin: bottom center;
  transform: rotate(-15deg);
  transition: transform .1s ease;
  margin-top: -10px;
}

.cat-projectile {
  position: absolute;
  font-size: 1.5rem;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  transition: none;
}

.cat-target-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px; height: 80px;
}

.cat-target {
  position: relative;
  width: 70px; height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s var(--bounce);
}

.cat-target-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #ff6b6b 20%, #ff9999 40%, #fff 42%, #fff 50%, #ff6b6b 52%, #ff6b6b 60%, #fff 62%, #fff 70%, #ff6b6b 72%);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.cat-target-label {
  position: relative;
  z-index: 2;
  font-weight: 900;
  font-size: .85rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  text-align: center;
  line-height: 1.1;
}

.cat-target--hit {
  animation: catTargetHit .6s ease;
}
@keyframes catTargetHit {
  0% { transform: scale(1); }
  30% { transform: scale(1.3) rotate(10deg); }
  60% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── HUD ───────────────────────────────────────────────── */
.cat-hud {
  position: absolute;
  top: .5rem; left: .5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  z-index: 15;
}

.cat-prompt {
  background: rgba(255,255,255,.9);
  padding: .3rem .7rem;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 1rem;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.cat-pips {
  display: flex;
  gap: .25rem;
}

.cat-pip {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 800;
}
.cat-pip--hit { background: var(--gold); color: #fff; }
.cat-pip--miss { background: var(--coral); color: #fff; }
.cat-pip--pending { background: rgba(255,255,255,.5); color: var(--ink-muted); }

/* ── Number line ──────────────────────────────────────────── */
.cat-number-line {
  position: relative;
  padding: .8rem 1.2rem;
  background: rgba(255,255,255,.92);
  touch-action: none;
  cursor: pointer;
}

.cat-nl-track {
  position: relative;
  height: 36px;
  background: #e8e8e8;
  border-radius: var(--r-pill);
  overflow: visible;
}

.cat-nl-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
  border-radius: var(--r-pill);
  transition: width .05s ease;
}

.cat-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-tick::before {
  content: "";
  position: absolute;
  top: 0;
  width: 2px; height: 100%;
  background: rgba(0,0,0,.1);
}

.cat-tick-label {
  position: absolute;
  bottom: -16px;
  font-size: .6rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.cat-nl-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: var(--brand);
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(108,92,231,.4);
  z-index: 10;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: grab;
}

.cat-nl-thumb--active {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 16px rgba(108,92,231,.6);
  cursor: grabbing;
}

.cat-nl-thumb-val {
  font-weight: 900;
  font-size: .8rem;
  color: #fff;
}

/* ── Fire button ──────────────────────────────────────────── */
.cat-fire-row {
  padding: .4rem 1rem .8rem;
  display: flex;
  justify-content: center;
  background: rgba(255,255,255,.92);
}

.cat-fire-btn {
  padding: .5rem 2rem;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--coral), var(--orange));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,107,107,.3);
  transition: transform .15s ease, opacity .15s ease;
}
.cat-fire-btn:active:not(:disabled) {
  transform: scale(.95);
}
.cat-fire-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* ── Feedback overlay ─────────────────────────────────────── */
.cat-feedback {
  position: absolute;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%) scale(.5);
  font-weight: 900;
  font-size: 1.8rem;
  padding: .4rem 1rem;
  border-radius: var(--r-md);
  pointer-events: none;
  opacity: 0;
  z-index: 50;
  transition: opacity .2s ease, transform .3s var(--bounce);
}
.cat-feedback--show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.cat-feedback--correct {
  color: #155724;
  background: linear-gradient(135deg, #d4edda, #a8e6cf);
  box-shadow: 0 4px 20px rgba(21,87,36,.2);
}
.cat-feedback--wrong {
  color: #c0392b;
  background: linear-gradient(135deg, #ffcccc, #ff9999);
  box-shadow: 0 4px 20px rgba(192,57,43,.2);
}

/* ── Burst particles ──────────────────────────────────────── */
.cat-burst-particle {
  position: absolute;
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 40;
  animation: catBurst .6s ease-out forwards;
}
@keyframes catBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); }
}

/* ── Result panel ─────────────────────────────────────────── */
.cat-result-panel {
  text-align: center;
  padding: 1.5rem 1rem;
}

/* ── Profile chip + picker ─────────────────────────────────── */
.topbar-right {
  display: flex; align-items: center; gap: .5rem;
}
.nn-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--glass);
  border: 1px solid rgba(108,92,231,.15);
  padding: .3rem .65rem .3rem .35rem;
  border-radius: var(--r-pill);
  font-family: inherit; font-weight: 800; font-size: .9rem;
  color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}
.nn-chip:hover { background: #fff; transform: translateY(-1px); }
.nn-chip-avatar { font-size: 1.1rem; }
.nn-chip--unset { color: var(--ink-muted); }

.nn-picker-host {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
}
.nn-picker-host[hidden] { display: none; }
.nn-picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 26, 56, 0.55);
  backdrop-filter: blur(6px);
  animation: fadeUp .25s ease both;
}
.nn-picker-modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-lg);
  max-width: 420px; width: calc(100% - 2rem);
  animation: fadeUp .35s cubic-bezier(.34,1.56,.64,1) both;
}
.nn-picker-title {
  font-size: 1.4rem; font-weight: 900; color: var(--ink);
  text-align: center; margin-bottom: 1.25rem;
}
.nn-picker-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
}
.nn-picker-grid[hidden],
.nn-picker-add[hidden] { display: none; }
.nn-picker-card {
  display: flex; flex-direction: column; align-items: center;
  gap: .5rem; padding: 1.25rem .5rem;
  background: linear-gradient(135deg, #fff, #f4f0ff);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  font-family: inherit; cursor: pointer;
  transition: var(--bounce);
}
.nn-picker-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}
.nn-picker-avatar { font-size: 3rem; line-height: 1; }
.nn-picker-name {
  font-size: 1.1rem; font-weight: 800; color: var(--ink);
}
.nn-picker-close {
  position: absolute; top: .5rem; right: .5rem;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--ink-muted); padding: .35rem .55rem;
  border-radius: var(--r-pill);
}
.nn-picker-close:hover { background: rgba(0,0,0,.05); color: var(--ink); }

/* "+ New player" tile and the name-entry form panel */
.nn-picker-card--add {
  background: linear-gradient(135deg, #f7faff, #ecfff1);
  border: 2px dashed rgba(108,92,231,.35);
}
.nn-picker-card--add .nn-picker-avatar {
  font-size: 2.6rem; color: var(--brand); font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem;
}
.nn-picker-card--add .nn-picker-name { color: var(--brand); }

.nn-picker-add { padding: .25rem .15rem 0; }
.nn-picker-add-title {
  font-size: 1rem; font-weight: 800; color: var(--ink-soft);
  text-align: center; margin-bottom: 1rem;
}
.nn-picker-add-form { display: flex; flex-direction: column; gap: .75rem; }
.nn-picker-add-input {
  font-family: inherit; font-size: 1.1rem; font-weight: 700;
  color: var(--ink); text-align: center;
  padding: .8rem 1rem;
  border: 2px solid #d4dae5;
  border-radius: var(--r-md);
  outline: none;
}
.nn-picker-add-input:focus { border-color: var(--brand); }
.nn-picker-add-buttons {
  display: flex; gap: .5rem; justify-content: center;
}
.nn-picker-add-cancel,
.nn-picker-add-submit {
  font-family: inherit; font-weight: 800; font-size: 1rem;
  padding: .65rem 1.4rem; border-radius: var(--r-pill);
  cursor: pointer; border: none;
}
.nn-picker-add-cancel {
  background: rgba(0,0,0,.05); color: var(--ink-soft);
}
.nn-picker-add-cancel:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.nn-picker-add-submit {
  background: var(--brand); color: #fff;
  box-shadow: 0 3px 0 #4a3fc8;
}
.nn-picker-add-submit:hover { background: var(--brand-light); }
.nn-picker-add-submit:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.nn-picker-add-error {
  text-align: center; font-size: .85rem; color: var(--coral); font-weight: 700;
  margin-top: .25rem;
}

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
