:root {
  --ink: #143026;
  --surface: #ffffff;
  --bg: #f0fdf4;
  --panel: #dcfce7;
  --line: #bbf7d0;
  --forest: #166534;
  --lime: #84cc16;
  --gold: #f59e0b;
  --egg: #fef08a;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Lexend", system-ui, sans-serif;
}

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

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #22c55e, #15803d);
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--forest);
}

.brand p {
  font-size: 0.8rem;
  color: #4b5563;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.controls-bar select {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--forest);
  cursor: pointer;
  outline: none;
}

.btn-header {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--forest);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header:hover {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

main {
  flex: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Dino Speech Banner */
.infant-banner {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  box-shadow: 0 8px 24px rgba(22, 101, 52, 0.08);
}

.dino-avatar-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: 1;
}

.dino-face {
  font-size: 3.4rem;
  background: #f0fdf4;
  border: 3px solid #86efac;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  animation: dinoBounce 2s ease-in-out infinite;
}

@keyframes dinoBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.dino-speech {
  display: flex;
  flex-direction: column;
}

.speech-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lime);
  text-transform: uppercase;
}

.speech-main {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--forest);
}

.score-stars {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fefce8;
  border: 2px solid #fef08a;
  border-radius: 14px;
  padding: 0.5rem 1rem;
}

.star-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ca8a04;
  text-transform: uppercase;
}

.stars-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #ca8a04;
}

/* Arena Card */
.arena-card {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.frame-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.frame-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #4b5563;
}

/* Ten-Frame Grid: 2 rows of 5 columns */
.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 4px solid var(--forest);
  border-radius: 16px;
  padding: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.06);
}

.frame-slot {
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 3px dashed #94a3b8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.frame-slot:hover {
  background: #f0fdf4;
  border-color: var(--lime);
}

.frame-slot.filled {
  border: 3px solid #16a34a;
  background: #dcfce7;
  animation: eggPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes eggPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Action Controls & Number Choices */
.action-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.number-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 640px;
}

.btn-choice {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  border: 3px solid var(--forest);
  background: #ffffff;
  color: var(--forest);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(22, 101, 52, 0.15);
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-choice:hover {
  transform: translateY(-4px) scale(1.08);
  background: #dcfce7;
}

.btn-choice:active {
  transform: translateY(2px) scale(0.95);
}

.btn-feed {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transition: all 0.2s;
}

.btn-feed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 48, 38, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 4px solid var(--lime);
  border-radius: 24px;
  padding: 2.2rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--forest);
}

.modal-card p {
  color: #4b5563;
  margin: 0.6rem 0 1.2rem;
  font-size: 1.05rem;
}

.star-badge {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.modal-btn {
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #84cc16, #65a30d);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(132, 204, 22, 0.4);
}

