/* ============================================================
   MIST — web build stylesheet
   Cozy misty-meadow palette, big readable UI, fully offline.
   ============================================================ */

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

html, body { height: 100%; }

body {
  font-family: "Trebuchet MS", "Segoe UI", Verdana, system-ui, sans-serif;
  background: #1a472a;
  color: #fff;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app { height: 100vh; display: flex; flex-direction: column; }

button { font-family: inherit; }

/* ---------- boot ---------- */
.boot-screen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #1a472a, #2d5a3f);
  text-align: center;
}
.boot-dog { font-size: 4rem; }
.boot-screen h1 { font-size: 2.5rem; letter-spacing: 0.3em; }
.boot-screen p { color: #a7d7b5; margin-top: 0.5rem; font-style: italic; }

/* ---------- generic screens ---------- */
.screen { flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; }

.screen-menu { overflow-y: auto; padding: 1rem; }
.screen-levels    { background: linear-gradient(180deg, #1a472a 0%, #2d5a3f 100%); }
.screen-skills    { background: linear-gradient(180deg, #1a3a2a 0%, #2d4a3f 100%); }
.screen-collection{ background: linear-gradient(180deg, #2a1a3a 0%, #3f2d4a 100%); }
.screen-settings  { background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%); }
.screen-farm      { background: linear-gradient(180deg, #2d1b00 0%, #4a3000 50%, #2d1b00 100%); }
.screen-sandbox   { background: linear-gradient(180deg, #1a2a3a 0%, #2d3f4a 100%); }
.screen-teachings { background: linear-gradient(180deg, #20303a 0%, #2d4a4a 100%); }
.screen-daily {
  background: linear-gradient(180deg, #4a3000 0%, #6b4c00 50%, #4a3000 100%);
  align-items: center; justify-content: center; padding: 1rem;
}
.screen-complete {
  background: linear-gradient(180deg, #1a472a 0%, #2d5a3f 50%, #1a472a 100%);
  align-items: center; justify-content: center; padding: 1rem;
}

.panel { max-width: 42rem; margin: 0 auto; width: 100%; }
.panel-wide { max-width: 52rem; }
.panel-narrow { max-width: 30rem; }
.panel-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.panel-header h2 { flex: 1; font-size: 1.5rem; }
.panel-blurb { color: rgba(255,255,255,0.6); font-size: 0.875rem; margin-bottom: 1rem; line-height: 1.5; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 0.75rem;
  padding: 0.6rem 1rem; font-size: 1rem; cursor: pointer; color: #fff;
  background: rgba(255,255,255,0.08); transition: transform 0.06s, background 0.15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: #059669; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.btn-amber { background: #f59e0b; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.25); }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-ghost { background: transparent; }
.btn-dim { color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.12); }
.btn-big { padding: 0.9rem 1.25rem; font-size: 1.1rem; }
.btn-small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-danger { border-color: rgba(239,68,68,0.5); color: #f87171; background: transparent; width: 100%; }
.btn-danger:hover { background: rgba(239,68,68,0.12); }

/* ---------- cards ---------- */
.card {
  border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.08); padding: 0.75rem;
}
.clickable { cursor: pointer; }
.clickable:hover { box-shadow: 0 4px 16px rgba(110,231,183,0.15); background: rgba(255,255,255,0.13); }

/* ---------- title screen ---------- */
.screen-title {
  background: linear-gradient(180deg, #1a472a 0%, #2d5a3f 30%, #4a7c59 60%, #7CB342 100%);
  align-items: center; justify-content: center; padding: 1rem; overflow-y: auto;
}
.mist-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mist-puff {
  position: absolute; border-radius: 9999px; background: rgba(255,255,255,0.1);
  animation: mist-drift 10s ease-in-out infinite;
}
@keyframes mist-drift {
  0%, 100% { transform: translateX(0); opacity: 0.1; }
  25% { transform: translateX(30px); opacity: 0.3; }
  50% { transform: translateX(-20px); opacity: 0.15; }
  75% { transform: translateX(10px); opacity: 0.25; }
}
.title-hero { text-align: center; position: relative; z-index: 1; }
.title-dog { font-size: 4.5rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
.title-word {
  font-size: 3.5rem; letter-spacing: 0.3em; color: #fff;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}
.title-sub { color: #a7d7b5; font-size: 1.15rem; font-style: italic; font-weight: 300; margin-top: 0.25rem; }
.rank-badge {
  margin-top: 1.25rem; padding: 0.3rem 1rem; border-radius: 9999px;
  font-size: 0.875rem; color: #fff; position: relative; z-index: 1;
}
.panel-header .rank-badge { margin-top: 0; }
.badge-gold { background: #eab308; }
.badge-amber { background: #b45309; }
.menu {
  margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem;
  width: 100%; max-width: 20rem; position: relative; z-index: 1;
}
.title-stats { margin-top: 1.5rem; color: rgba(167,215,181,0.7); font-size: 0.75rem; position: relative; z-index: 1; }
.title-credits { margin-top: 0.4rem; color: rgba(255,255,255,0.35); font-size: 0.7rem; font-style: italic; position: relative; z-index: 1; }

/* ---------- level select ---------- */
.rank-section { margin-bottom: 1.5rem; }
.rank-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.rank-header h3 { font-size: 1.1rem; text-transform: capitalize; }
.rank-dot { width: 0.75rem; height: 0.75rem; border-radius: 9999px; }
.rank-progress { color: rgba(167,215,181,0.6); font-size: 0.85rem; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; }
.level-card.locked { opacity: 0.5; background: rgba(0,0,0,0.2); }
.level-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.level-name { font-weight: 600; font-size: 0.9rem; }
.level-sub { color: rgba(167,215,181,0.6); font-size: 0.75rem; margin-top: 0.15rem; }
.level-lock { font-size: 1.4rem; }
.level-card-bottom { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.level-time { color: rgba(167,215,181,0.5); font-size: 0.75rem; margin-left: auto; }
.level-disc { color: rgba(167,215,181,0.4); font-size: 0.75rem; margin-top: 0.25rem; }
.star { color: rgba(255,255,255,0.2); font-size: 0.95rem; }
.star.lit { color: #facc15; }
.star.big { font-size: 2rem; margin: 0 0.25rem; }

/* ---------- level complete ---------- */
.complete-wrap { width: 100%; max-width: 28rem; position: relative; }
.complete-card {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border-color: #fcd34d; color: #78350f; text-align: center; padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.complete-dog { font-size: 3rem; animation: dog-wiggle 0.6s ease-in-out 0.3s; }
@keyframes dog-wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
.complete-card h2 { color: #78350f; margin-top: 0.5rem; }
.complete-level-name { color: #b45309; font-size: 0.9rem; margin-top: 0.25rem; }
.complete-stars { margin-top: 0.75rem; }
.complete-card .star { color: #d6d3d1; }
.complete-card .star.lit { color: #facc15; }
.complete-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 1rem; }
.stat-box { background: rgba(255,255,255,0.55); border-radius: 0.5rem; padding: 0.5rem; }
.stat-val { font-weight: 700; color: #78350f; }
.stat-label { font-size: 0.7rem; color: #b45309; }
.concept-box {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 0.5rem;
  padding: 0.75rem; margin-top: 1rem; text-align: left;
}
.concept-title { color: #1e3a8a; font-weight: 600; font-size: 0.875rem; }
.concept-text { color: #1d4ed8; font-size: 0.8rem; margin-top: 0.25rem; line-height: 1.45; }
.parent-hint { color: #3b82f6; font-size: 0.75rem; text-align: left; margin-top: 0.5rem; }
.complete-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.complete-actions .btn { flex: 1; color: #78350f; }
.complete-actions .btn-outline { border-color: #fcd34d; }
.complete-actions .btn-primary { color: #fff; }

/* ---------- dialog ---------- */
.dialog-backdrop {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.4); padding: 1rem; cursor: pointer;
}
@media (min-width: 640px) { .dialog-backdrop { align-items: center; } }
.dialog-box {
  width: 100%; max-width: 32rem; cursor: default;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border: 1px solid #fcd34d; border-radius: 0.75rem;
  padding: 1.1rem; box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  color: #451a03; animation: dialog-in 0.25s ease-out;
}
@keyframes dialog-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-speaker { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.dialog-speaker-icon { font-size: 1.6rem; }
.dialog-speaker-name { font-weight: 700; color: #78350f; font-size: 0.9rem; }
.dialog-emotion { font-size: 0.75rem; color: #d97706; }
.dialog-text { color: #451a03; font-size: 0.95rem; line-height: 1.6; margin-bottom: 0.75rem; }
.dialog-choices { display: flex; flex-direction: column; gap: 0.4rem; }
.dialog-choice { border-color: #fcd34d; color: #78350f; text-align: left; background: transparent; }
.dialog-choice:hover { background: #fef3c7; }
.dialog-hint { color: #fbbf24; font-size: 0.75rem; text-align: right; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- skill tree ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.6rem; }
.skill-card { display: flex; gap: 0.75rem; align-items: flex-start; }
.skill-card.unlocked { background: rgba(76,175,80,0.2); }
.skill-card.available { background: rgba(255,215,0,0.13); }
.skill-card.locked { background: rgba(0,0,0,0.2); }
.skill-icon { font-size: 1.6rem; }
.skill-body { flex: 1; min-width: 0; }
.skill-name { font-weight: 600; font-size: 0.9rem; color: rgba(255,255,255,0.45); }
.skill-card.available .skill-name { color: #fde047; }
.skill-card.unlocked .skill-name { color: #86efac; }
.skill-check { color: #4ade80; font-size: 0.75rem; }
.skill-desc { color: rgba(255,255,255,0.5); font-size: 0.75rem; margin-top: 0.15rem; line-height: 1.4; }
.skill-cost { color: rgba(255,255,255,0.3); font-size: 0.75rem; margin-top: 0.3rem; }
.skill-card.available .skill-cost { color: #facc15; }
.skill-effect { color: rgba(74,222,128,0.7); font-size: 0.75rem; margin-top: 0.3rem; }

/* ---------- collection ---------- */
.collection-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.overview-card { text-align: center; }
.overview-card .stat-val { color: #fff; }
.overview-card .stat-label { color: rgba(255,255,255,0.5); }
.mini-progress { height: 4px; background: rgba(0,0,0,0.3); border-radius: 9999px; margin-top: 0.4rem; overflow: hidden; }
.mini-progress-fill { height: 100%; background: #a78bfa; border-radius: 9999px; }
.tab-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.5rem; }
.sticker-card { text-align: center; padding: 0.5rem; }
.sticker-card.missing { background: rgba(0,0,0,0.2); }
.sticker-icon { font-size: 1.6rem; }
.sticker-card.missing .sticker-icon { filter: grayscale(1); opacity: 0.3; }
.sticker-name { font-size: 0.7rem; margin-top: 0.25rem; }
.sticker-card.missing .sticker-name { color: rgba(255,255,255,0.2); }
.sticker-rarity {
  display: inline-block; font-size: 0.6rem; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 9999px; padding: 0 0.4rem; margin-top: 0.2rem; color: rgba(255,255,255,0.4);
}
.rarity-legendary { border-color: #facc15; color: #facc15; }
.rarity-rare { border-color: #c084fc; color: #c084fc; }
.rarity-uncommon { border-color: #60a5fa; color: #60a5fa; }
.disc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.5rem; }
.disc-card { display: flex; gap: 0.6rem; }
.disc-card.missing { background: rgba(0,0,0,0.2); }
.disc-icon { font-size: 1.4rem; }
.disc-card.missing .disc-icon { filter: grayscale(1); opacity: 0.3; }
.disc-name { font-weight: 600; font-size: 0.85rem; }
.disc-card.missing .disc-name { color: rgba(255,255,255,0.2); }
.disc-desc { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin-top: 0.15rem; line-height: 1.4; }
.disc-card.missing .disc-desc { color: rgba(255,255,255,0.12); }
.breed-dot { width: 2.5rem; height: 2.5rem; border-radius: 9999px; flex-shrink: 0; }
.disc-card.missing .breed-dot { filter: grayscale(1); opacity: 0.3; }
.breed-concept { color: #d8b4fe; font-size: 0.65rem; margin-top: 0.25rem; }

/* ---------- daily ---------- */
.daily-card {
  width: 100%; max-width: 26rem; text-align: center; padding: 1.5rem;
  background: linear-gradient(135deg, #fffbeb, #fefce8); border-color: #fcd34d;
  color: #78350f; box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; gap: 0.6rem; align-items: center;
}
.daily-icon { font-size: 2.5rem; }
.daily-card h2 { color: #78350f; }
.daily-name { color: #b45309; font-size: 0.9rem; }
.daily-desc { color: #92400e; font-size: 0.875rem; line-height: 1.5; }
.daily-rules { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.daily-rule {
  border: 1px solid #fbbf24; color: #92400e; font-size: 0.75rem;
  border-radius: 9999px; padding: 0.15rem 0.6rem;
}
.daily-rewards { background: #fef3c7; border-radius: 0.5rem; padding: 0.6rem; width: 100%; }
.daily-rewards .concept-title { color: #78350f; }
.daily-done { color: #16a34a; font-weight: 600; }
.daily-streak { color: #b45309; font-size: 0.8rem; }
.daily-card .btn-ghost { color: #b45309; }
.daily-card .btn-big { width: 100%; }

/* ---------- settings ---------- */
.settings-card { margin-bottom: 1rem; }
.settings-card h3 { margin-bottom: 0.75rem; }
.slider-row { display: block; color: rgba(255,255,255,0.7); font-size: 0.875rem; margin-bottom: 0.75rem; }
.slider-row input[type="range"] { width: 100%; margin-top: 0.3rem; accent-color: #34d399; }
.check-row {
  display: flex; align-items: center; justify-content: space-between;
  color: rgba(255,255,255,0.7); font-size: 0.875rem; cursor: pointer; margin-bottom: 0.6rem;
}
.check-row input { width: 1.25rem; height: 1.25rem; accent-color: #34d399; }
.stats-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; font-size: 0.875rem;
}
.stats-grid span { color: rgba(255,255,255,0.5); }
.stats-grid b { text-align: right; }

/* ---------- farm ---------- */
.farm-card.owned { background: rgba(120,53,15,0.35); border-color: rgba(245,158,11,0.3); }
.farm-card.missing { background: rgba(0,0,0,0.2); }
.farm-card.missing .skill-icon { filter: grayscale(1); opacity: 0.3; }
.farm-card.owned .skill-name { color: #fcd34d; }
.farm-card.missing .skill-name { color: rgba(255,255,255,0.3); }
.farm-card.missing .skill-desc { color: rgba(255,255,255,0.15); }
.farm-card .breed-concept { color: rgba(251,191,36,0.5); }

/* ---------- teachings codex ---------- */
.teaching-card { margin-bottom: 0.5rem; padding: 0; overflow: hidden; }
.teaching-card summary {
  cursor: pointer; padding: 0.7rem 0.9rem; display: flex; gap: 0.6rem;
  align-items: baseline; list-style: none;
}
.teaching-card summary::-webkit-details-marker { display: none; }
.teaching-card summary::after { content: '▸'; margin-left: auto; color: rgba(255,255,255,0.4); }
.teaching-card[open] summary::after { content: '▾'; }
.teaching-card summary:hover { background: rgba(255,255,255,0.06); }
.teaching-insight { font-weight: 600; font-size: 0.9rem; color: #a7f3d0; }
.teaching-concept { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.teaching-major { font-size: 0.7rem; color: #facc15; }
.teaching-body { padding: 0 0.9rem 0.9rem; border-top: 1px solid rgba(255,255,255,0.08); }
.teaching-text { margin-top: 0.7rem; font-size: 0.9rem; line-height: 1.6; color: rgba(255,255,255,0.9); }
.teaching-ai {
  margin-top: 0.6rem; font-size: 0.8rem; line-height: 1.5; color: #93c5fd;
  background: rgba(59,130,246,0.1); border-radius: 0.5rem; padding: 0.6rem;
}
.teaching-steps { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.teaching-step { font-size: 0.8rem; color: rgba(255,255,255,0.65); line-height: 1.45; }
.teaching-discoveries { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.teaching-discovery {
  font-size: 0.75rem; color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.25); border-radius: 9999px; padding: 0.2rem 0.6rem;
}
.teaching-discovery i { color: rgba(147,197,253,0.7); }

/* ============================================================
   GAME SCREEN
   ============================================================ */
.screen-game { background: linear-gradient(180deg, #7dd3fc, #e0f2fe); }

.hud { position: absolute; z-index: 20; }
.hud-top {
  top: 0; left: 0; right: 0; padding: 0.5rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  color: #fff; font-size: 0.85rem;
}
.hud-left { display: flex; align-items: center; gap: 0.6rem; }
.hud-quit { padding: 0.2rem 0.5rem; }
.hud-level-name { font-weight: 700; }
.hud-right { display: flex; align-items: center; gap: 0.7rem; font-size: 0.78rem; flex-wrap: wrap; justify-content: flex-end; }
.hud-urgent { color: #f87171; animation: pulse 1s infinite; }
.hud-warn { color: #fbbf24; }
.hud-gold { color: #facc15; }

.hud-stamina {
  bottom: 5rem; left: 0.75rem;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  border-radius: 0.5rem; padding: 0.4rem 0.5rem; width: 7rem;
  display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
}
.hud-zap { font-size: 0.75rem; color: rgba(255,255,255,0.7); }
.stamina-track { flex: 1; height: 0.5rem; background: rgba(0,0,0,0.3); border-radius: 9999px; overflow: hidden; }
.stamina-fill { height: 100%; background: #34d399; border-radius: 9999px; transition: width 0.15s linear; }
.hud-ability { width: 100%; font-size: 0.62rem; color: #fde047; min-height: 0.8em; }

.hud-ability-box {
  bottom: 5rem; right: 0.75rem;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  border-radius: 0.5rem; padding: 0.4rem 0.5rem;
}
.hud-ability-hint { font-size: 0.62rem; color: rgba(255,255,255,0.5); }
.hud-ability-name { font-size: 0.75rem; color: #fde047; }
@media (min-width: 640px) {
  .hud-stamina, .hud-ability-box { bottom: 1rem; }
}

.game-canvas { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.world { position: relative; transform-origin: center center; flex-shrink: 0; }
.tiles, .entities, .particles, .weather-overlay { position: absolute; inset: 0; }
.weather-overlay { pointer-events: none; z-index: 50; overflow: hidden; }

.tile { position: absolute; border: 1px solid rgba(0,0,0,0.05); }
.tile-deco {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem;
}
.tile-deco-sm { font-size: 0.85rem; }
.tile-deco-xs { font-size: 0.7rem; }
.water-wave { animation: pulse 1.6s infinite; color: rgba(255,255,255,0.8); }
.tile-fence { position: absolute; inset: 0; border: 2px solid rgba(120,53,15,0.6); border-radius: 2px; }
.tile-gate {
  position: absolute; inset: 0; border: 2px solid #d97706; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #92400e; font-weight: 700;
}
.tile-fog { position: absolute; inset: 0; background: rgba(255,255,255,0.35); border-radius: 4px; animation: pulse 2.5s infinite; }
.tile-ice { position: absolute; inset: 0; background: rgba(191,219,254,0.4); border-radius: 4px; }

.entity { position: absolute; left: 0; top: 0; width: 48px; height: 48px; will-change: transform; }

.dog { z-index: 30; }
.dog-body {
  width: 40px; height: 40px; margin: 4px; border-radius: 9999px;
  background: #d97706; box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.dog-emoji { font-size: 1.25rem; display: inline-block; }
.dog.barking .dog-body { animation: bark-pop 0.2s ease-out; }
@keyframes bark-pop { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.bark-ring {
  display: none; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.5); border-radius: 9999px;
}
.dog.barking .bark-ring { display: block; animation: bark-ring 0.4s ease-out; }
@keyframes bark-ring {
  from { transform: translate(-50%, -50%) scale(0.2); opacity: 0.8; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.sheep { z-index: 20; width: 40px; height: 40px; }
.sheep-body {
  width: 100%; height: 100%; border-radius: 9999px; position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.sheep-eye { position: absolute; font-size: 10px; }
.eye-down { bottom: 0; left: 50%; transform: translateX(-50%); }
.eye-up { top: 0; left: 50%; transform: translateX(-50%); }
.eye-left { left: 0; top: 50%; transform: translateY(-50%); }
.eye-right { right: 0; top: 50%; transform: translateY(-50%); }
.sheep-mood { position: absolute; display: none; }
.sheep-sad { top: -10px; right: 0; font-size: 12px; animation: bob 1s ease-in-out infinite; }
.sheep-stubborn { top: -6px; left: 0; font-size: 9px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.collectible { z-index: 10; }
.collectible-bob {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  animation: collectible-bob 2s ease-in-out infinite; position: relative;
}
@keyframes collectible-bob {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.1); }
}
.collectible-sparkle {
  position: absolute; color: #fde047; font-size: 0.7rem;
  animation: sparkle 1.5s ease-in-out infinite;
}
@keyframes sparkle { 0%,100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.particle { position: absolute; border-radius: 9999px; pointer-events: none; z-index: 40; }

/* weather overlays */
.weather-foggy { background: rgba(255,255,255,0.2); }
.weather-starry { background: linear-gradient(180deg, rgba(30,27,75,0.45), rgba(88,28,135,0.45)); }
.weather-cloudy { background: rgba(100,116,139,0.18); }
.weather-golden { background: rgba(251,191,36,0.12); }
.rain-drop {
  position: absolute; top: -20px; width: 2px; height: 12px;
  background: rgba(147,197,253,0.5); animation: rain-fall 0.8s linear infinite;
}
@keyframes rain-fall { to { transform: translateY(1100px); } }
.snow-flake {
  position: absolute; top: -10px; width: 8px; height: 8px; border-radius: 9999px;
  background: rgba(255,255,255,0.7); animation: snow-fall 3s linear infinite;
}
@keyframes snow-fall {
  0% { transform: translate(0, 0); }
  50% { transform: translate(10px, 450px); }
  100% { transform: translate(-10px, 900px); }
}

/* overlays */
.overlay-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.overlay-layer .dialog-backdrop { pointer-events: auto; }
.tutorial-toast {
  position: absolute; bottom: 6.5rem; left: 50%; transform: translateX(-50%);
  max-width: 22rem; width: calc(100% - 2rem);
}
.tutorial-card {
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  color: #fff; text-align: center; font-size: 0.875rem; padding: 0.75rem;
}
.discovery-toast {
  position: absolute; top: 3.5rem; left: 50%; transform: translateX(-50%);
  background: #eab308; color: #fff; font-size: 0.75rem; font-weight: 600;
  border-radius: 9999px; padding: 0.3rem 0.9rem; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pause-layer {
  position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.pause-card {
  background: rgba(17,24,39,0.95); width: 16rem; text-align: center;
  padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.pause-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* mobile controls */
.mobile-controls {
  position: absolute; bottom: 0.5rem; left: 0; right: 0; z-index: 25;
  padding: 0 1rem; display: flex; justify-content: space-between; align-items: flex-end;
}
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; width: 8rem; }
.dpad-btn {
  background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); border: none;
  border-radius: 0.5rem; padding: 0.6rem; color: #fff; font-size: 1.1rem; cursor: pointer;
  touch-action: none;
}
.dpad-btn:active { background: rgba(0,0,0,0.55); }
.mobile-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.btn-ability { background: rgba(59,130,246,0.8); border-radius: 0.75rem; }
.btn-bark {
  background: rgba(245,158,11,0.85); border-radius: 0.75rem;
  padding: 0.8rem 1.1rem; font-size: 1.15rem; font-weight: 700; border: none;
}
@media (hover: hover) and (pointer: fine) and (min-width: 800px) {
  .mobile-controls { opacity: 0.35; }
  .mobile-controls:hover { opacity: 1; }
}

/* ---------- sandbox ---------- */
.sandbox-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.sandbox-slider label { font-size: 0.875rem; font-weight: 600; }
.sandbox-slider input[type="range"] { width: 100%; margin-top: 0.35rem; accent-color: #60a5fa; }
.sandbox-slider select {
  width: 100%; margin-top: 0.35rem; padding: 0.35rem; border-radius: 0.4rem;
  background: #0f172a; color: #fff; border: 1px solid rgba(255,255,255,0.2);
}
.sandbox-hint { color: rgba(255,255,255,0.4); font-size: 0.72rem; margin-top: 0.3rem; }
.sandbox-canvas {
  position: relative; width: 100%; aspect-ratio: 16/12; margin-top: 1rem;
  background: #7CB342; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem; overflow: hidden;
}
.sandbox-sheep {
  position: absolute; width: 20px; height: 20px; border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3); transform: translate(-50%, -50%);
  transition: left 0.05s linear, top 0.05s linear;
}
