:root {
  --color-primary: #FF6B6B;
  --color-secondary: #4ECDC4;
  --color-accent: #FFE66D;
  --color-bg: #FFF5E6;
  --color-surface: #FFFFFF;
  --color-text: #2D3436;
  --color-text-light: #636E72;
  --color-success: #00B894;
  --color-error: #FF7675;
  --color-egg: #FFD93D;
  --color-egg-blush: #FF8A8A;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50%;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: var(--color-bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===== Scene base ===== */
.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: sceneIn 0.3s ease-out;
}

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
  box-shadow: 0 4px 12px rgba(78,205,196,0.3);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: 0 4px 12px rgba(255,230,109,0.3);
}

.btn-large {
  width: 100%;
  max-width: 320px;
  padding: 18px 32px;
  font-size: 1.25rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 1.5rem;
}

/* ===== Eggy canvas ===== */
.eggy-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eggy-canvas {
  display: block;
}

/* ===== Stars display ===== */
.stars {
  display: flex;
  gap: 4px;
}

.star {
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0.2;
  transition: opacity 0.3s, transform 0.3s;
}

.star.filled {
  opacity: 1;
  animation: starPop 0.3s ease-out backwards;
}

.star.filled:nth-child(2) { animation-delay: 0.1s; }
.star.filled:nth-child(3) { animation-delay: 0.2s; }

@keyframes starPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== Card ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
}

/* ===== Progress bar ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-secondary);
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

/* ===== Feedback toast ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.toast-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.toast-text {
  font-size: 1.125rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* ===== Celebrate particles ===== */
@keyframes particleUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-120px) scale(0); opacity: 0; }
}

.particle {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  animation: particleUp 1s ease-out forwards;
}

/* ===== Recording pulse ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.recording {
  animation: pulse 0.6s ease-in-out infinite;
}

/* ===== Bounce animations ===== */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes jumpSpin {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-40px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-12 { gap: 12px; }
.flex-col { display: flex; flex-direction: column; align-items: center; }
.flex-1 { flex: 1; }

/* ===== Lock icon for locked levels ===== */
.lock-icon {
  font-size: 2rem;
  opacity: 0.4;
}

/* ===== Level node on map ===== */
.level-node {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}

.level-node:active {
  transform: scale(0.9);
}

.level-node.unlocked {
  background: var(--color-secondary);
  box-shadow: 0 4px 12px rgba(78,205,196,0.4);
}

.level-node.locked {
  background: #B2BEC3;
  cursor: not-allowed;
}

.level-node.completed {
  background: var(--color-success);
}

.level-node.current {
  animation: nodePulse 1.5s ease-in-out infinite;
}

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78,205,196,0.5); }
  50% { box-shadow: 0 0 0 12px rgba(78,205,196,0); }
}
