/* ============================================================
   Sia & the Mix-Up Mob — styles
   Bright, chunky, kid-friendly. Built for iPad touch.
   ============================================================ */

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

:root {
  --bg: #1a1a40;
  --bg2: #24245c;
  --card: #ffffff;
  --ink: #2d2a45;
  --ink-soft: #6b678a;
  --accent: #ff6b6b;
  --accent2: #4ecdc4;
  --gold: #ffd166;
  --good: #2ec27e;
  --bad: #e05f5f;
  --radius: 20px;
  --shadow: 0 6px 0 rgba(0,0,0,.18);
}

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 60%, #2d2d6e 100%);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

/* twinkling starfield behind every screen */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff8, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff6, transparent),
    radial-gradient(2px 2px at 55% 15%, #fff7, transparent),
    radial-gradient(1px 1px at 75% 45%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 88% 80%, #fff7, transparent),
    radial-gradient(1px 1px at 20% 90%, #fff5, transparent),
    radial-gradient(2px 2px at 92% 12%, #fff6, transparent),
    radial-gradient(1px 1px at 45% 50%, #fff5, transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes twinkle { from { opacity: .5; } to { opacity: 1; } }

body {
  background: none; /* html paints the gradient so the starfield shows through */
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

/* ---------- top bar ---------- */

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  color: #fff;
  flex: 0 0 auto;
}
.topbar-name { font-weight: 800; font-size: 17px; white-space: nowrap; }
.topbar-counts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.count {
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.count.stars { background: rgba(255,209,102,.25); }
.count.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.35); background: rgba(255,209,102,.6); } }
.btn.btn-mute { background: rgba(255,255,255,.12); box-shadow: none; font-size: 20px; padding: 6px 10px; border-radius: 999px; }

/* ---------- main screen area ---------- */

#screen {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px 20px;
}
.screen-region { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 8px; }

/* ---------- bottom nav ---------- */

#navbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-around;
  background: rgba(0,0,0,.25);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
body.in-region #navbar { display: none; }
.nav-btn {
  background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: rgba(255,255,255,.55);
  font-weight: 700; font-size: 11px;
  padding: 4px 12px;
  border-radius: 14px;
}
.nav-btn.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-emoji { font-size: 22px; }

/* ---------- buttons ---------- */

.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  background: #eceafe;
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-soft { background: #efedf7; color: var(--ink-soft); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-big { font-size: 19px; padding: 16px 26px; }
.btn-tiny { font-size: 12px; padding: 6px 12px; box-shadow: none; background: rgba(255,255,255,.12); color: rgba(255,255,255,.6); }
.btn-back { font-size: 20px; padding: 8px 14px; background: rgba(255,255,255,.9); }
.btn-chip { font-size: 14px; padding: 8px 12px; background: rgba(255,255,255,.9); }
.btn-travel { background: var(--gold); animation: bounce 1s infinite; }
.btn-hint { background: var(--accent2); color: #fff; }

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

/* ---------- generic cards ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.screen-header { color: #fff; text-align: center; margin: 6px 0 14px; }
.screen-header h2 { margin: 0; font-size: 24px; }
.screen-sub { margin: 4px 0 0; opacity: .75; font-size: 14px; }

/* ---------- home ---------- */

.home { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.home-title { text-align: center; color: #fff; margin-top: 8px; }
.home-logo { font-size: 46px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.home-title h1 { margin: 4px 0 0; font-size: 26px; letter-spacing: .5px; }
.home-subtitle { opacity: .7; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 2px; }

.case-card { text-align: center; }
.case-emoji { font-size: 44px; animation: float 2.4s ease-in-out infinite; }
.case-card { border-top: 6px solid var(--accent); }
.case-label { color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.case-card h2 { margin: 4px 0 6px; }
.case-card p { margin: 0 0 14px; color: var(--ink-soft); }

.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.home-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 6px; font-size: 13px;
  background: linear-gradient(180deg, hsl(var(--hue) 80% 96%), hsl(var(--hue) 70% 88%)); color: hsl(var(--hue) 50% 25%); }
.home-btn-emoji { font-size: 32px; transition: transform .2s; }
.home-btn:active .home-btn-emoji { transform: scale(1.2) rotate(-8deg); }

/* case trail tracker */
.trail { display: flex; justify-content: center; align-items: flex-start; margin: 0 0 14px; }
.trail-stop { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; position: relative; }
.trail-stop + .trail-stop::before {
  content: ''; position: absolute; top: 21px; right: 50%; width: 100%; height: 4px;
  background: repeating-linear-gradient(90deg, #d9d6ee 0 8px, transparent 8px 14px); z-index: 0;
}
.trail-stop.done::before, .trail-stop.here::before { background: var(--good); }
.trail-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  background: #efedf7; position: relative; z-index: 1; }
.trail-stop.done .trail-dot { background: #e3f7ec; box-shadow: 0 0 0 3px var(--good); }
.trail-stop.here .trail-dot { background: #fff3cd; box-shadow: 0 0 0 3px var(--gold); animation: pulse 1.6s infinite; }
.trail-stop.villain .trail-dot { background: #fdeaea; filter: grayscale(.3); }
.trail-name { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255,209,102,.35); } }
.btn-settings { align-self: center; margin-top: 6px; }

/* ---------- world map ---------- */

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}
.map-card {
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: var(--shadow);
  padding: 18px 10px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .08s;
}
.map-card:active { transform: scale(.96); }
.map-card.active { outline: 4px solid var(--gold); }
.map-card.locked { opacity: .55; background: #3b3b6e; }
.map-card.active { animation: bounce 1.2s infinite; }
.map-emoji { font-size: 48px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.3)); }
.map-name { font-weight: 800; font-size: 15px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.map-place { font-size: 12px; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.map-flag {
  margin-top: 6px;
  background: var(--gold);
  border-radius: 999px;
  font-size: 12px; font-weight: 800;
  padding: 4px 10px;
}

/* ---------- region explorer ---------- */

.region-hud {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 8px;
  color: #fff;
  flex: 0 0 auto;
}
.region-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.region-title-emoji { font-size: 30px; }
.region-name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-place { font-size: 12px; opacity: .7; }
.region-hud-right { display: flex; gap: 8px; align-items: center; }

.board-wrap {
  flex: 1 1 auto;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--glow) 35%, transparent), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.board {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 0 4px rgba(255,255,255,.15);
}
/* soft vignette so the board feels like a little world */
.board::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  box-shadow: inset 0 0 60px rgba(0,0,0,.35);
  border-radius: inherit;
}
/* emoji sizes scale from the board's JS-computed font-size (one cell ≈ 1em) */
.board .tile-emoji { font-size: 1em; }
.board .tile-decor { font-size: .72em; }
.board .sprite-emoji { font-size: 1.05em; }
.board .sprite.player .sprite-emoji { font-size: 1.2em; }
.board .sprite.villain .sprite-emoji { font-size: 1.25em; }
.board .sprite-badge { font-size: .55em; }
.board .sprite-label { font-size: .24em; }
.sprite-label {
  position: absolute; bottom: -2%; left: 50%; transform: translateX(-50%); z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; font-weight: 800;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}
.sprite.landmark .sprite-emoji { filter: drop-shadow(0 0 8px rgba(255,255,255,.45)); }

.tile {
  position: absolute;
  width: calc(100% / var(--cols) + 1px); /* +1px hides sub-pixel seams */
  height: calc(100% / var(--rows) + 1px);
  display: flex; align-items: center; justify-content: center;
}
.tile-emoji, .tile-decor { line-height: 1; pointer-events: none; }
.tile-decor { opacity: .55; }
.tile.scenery .tile-emoji { font-size: 1.15em; transform: translateY(-8%); filter: drop-shadow(0 5px 2px rgba(0,0,0,.35)); }
.tile:not(.scenery)::before { /* subtle texture so the floor isn't flat */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.10), transparent 60%);
}

.sprite {
  position: absolute;
  width: calc(100% / var(--cols));
  height: calc(100% / var(--rows));
  display: flex; align-items: center; justify-content: center;
  transition: left .15s linear, top .15s linear;
  z-index: 2;
}
.sprite-emoji { line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); position: relative; z-index: 1; }
.sprite { transition: left .15s linear, top .15s linear; }
.sprite.entity:not(.resource) { transition: left .5s ease-in-out, top .5s ease-in-out; }
/* ground shadow under everything that stands on the board */
.sprite::before {
  content: ''; position: absolute; left: 25%; right: 25%; bottom: 10%; height: 14%;
  background: rgba(0,0,0,.25); border-radius: 50%;
}
.sprite.player { z-index: 5; }
.sprite.player::before { background: radial-gradient(rgba(255,240,150,.9), rgba(255,209,102,0) 70%); left: 10%; right: 10%; height: 24%; bottom: 4%; animation: pulse-ring 1.6s infinite; }
@keyframes pulse-ring { 50% { opacity: .5; transform: scale(1.15); } }
.sprite.flip .sprite-emoji { scale: -1 1; }
.sprite.player.walking .sprite-emoji { animation: hop .3s infinite; }
@keyframes hop { 50% { translate: 0 -10%; } }

.target-marker {
  position: absolute; width: calc(100% / var(--cols)); height: calc(100% / var(--rows));
  pointer-events: none; z-index: 1; opacity: 0;
}
.target-marker::after {
  content: ''; position: absolute; inset: 22%;
  border: 3px solid rgba(255,255,255,.9); border-radius: 50%;
}
.target-marker.show { opacity: 1; animation: marker .6s ease-out; }
@keyframes marker { from { transform: scale(1.6); opacity: 0; } }

.ambient {
  position: absolute; top: -10%; font-size: .4em; opacity: .55;
  pointer-events: none; z-index: 4;
  animation: drift linear infinite;
}
@keyframes drift {
  0%   { top: -8%;  transform: translateX(0) rotate(0); }
  50%  { top: 50%;  transform: translateX(1.5em) rotate(180deg); }
  100% { top: 105%; transform: translateX(-1em) rotate(360deg); }
}
.sprite-badge {
  position: absolute;
  top: -4%; right: 8%;
  animation: bob 1s infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.sprite.clue .sprite-emoji, .sprite.quizzer .sprite-emoji { animation: bob 1.4s infinite; }
.sprite.villain .sprite-emoji { animation: villainShake .6s infinite; filter: drop-shadow(0 0 6px rgba(255,60,60,.8)); }
@keyframes villainShake {
  0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); }
}
.sprite.resource .sprite-emoji { animation: sparklePulse 2s infinite; }
@keyframes sparklePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.pop-out { animation: popOut .3s forwards; }
@keyframes popOut { to { transform: scale(0); opacity: 0; } }
.wiggle { animation: wiggle .3s; }
@keyframes wiggle {
  0%,100% { margin-left: 0; } 25% { margin-left: -4px; } 75% { margin-left: 4px; }
}

/* ---------- modals ---------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(12,12,40,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  opacity: 0;
  transition: opacity .2s;
  z-index: 50;
}
.modal-overlay.show { opacity: 1; }
.modal-card {
  position: relative;
  background: var(--card);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transform: scale(.85) translateY(20px);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.speak-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  border: none; background: #efedf7; border-radius: 50%;
  width: 40px; height: 40px; font-size: 20px; cursor: pointer;
}
.modal-overlay.show .modal-card { transform: scale(1); }

.story-card { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.story-card h3 { margin: 0; font-size: 21px; }
.story-card p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.45; }
.story-emoji { font-size: 46px; animation: popIn .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes popIn { from { transform: scale(0) rotate(-20deg); } }
.story-emoji.big { font-size: 64px; }
.critter-line { font-size: 18px !important; color: var(--ink) !important; }
.reward-line { font-weight: 800; color: var(--good); font-size: 15px; }
.fun-fact { background: #fff8e1; border-radius: 14px; padding: 10px; font-size: 14px !important; }
.clue-text { font-size: 17px !important; color: var(--ink) !important; font-weight: 600; }
.notebook-clue { text-align: left; background: #fffde7; border-radius: 12px; padding: 10px 12px; margin: 6px 0 !important; font-size: 14px !important; }
.notebook-case { font-weight: 800; color: var(--accent) !important; }
.all-done { background: #fff3cd; border-radius: 14px; padding: 12px; color: #7a5c00 !important; font-weight: 600; }
.showdown-rules { font-weight: 800; color: var(--accent) !important; }
.grownup-q { font-weight: 700; color: var(--ink) !important; }

/* wanted poster */
.wanted-poster {
  background: #fdf6e3;
  border: 3px dashed #b5651d;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 4px;
}
.wanted-header { font-weight: 900; letter-spacing: 6px; color: #b5651d; font-size: 20px; }
.wanted-emoji { font-size: 54px; }
.wanted-name { font-weight: 900; font-size: 19px; }
.wanted-desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.intro-p { text-align: left; }
.intro-p.crime { font-weight: 700; color: var(--ink) !important; }

/* travel */
.travel-choices { display: flex; flex-direction: column; gap: 10px; }
.travel-choice {
  display: flex; align-items: center; gap: 12px;
  text-align: left; padding: 12px 16px;
  background: #f2f0fb;
}
.travel-emoji { font-size: 32px; }
.travel-name { font-weight: 800; flex: 1; }
.travel-place { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.travel-hint { font-size: 14px !important; }

/* ---------- quiz ---------- */

.quiz-modal { max-width: 560px; }
.quiz-body { display: flex; flex-direction: column; gap: 12px; }
.quiz-banner { background: linear-gradient(90deg, #ff6b6b, #ff9a6b); color: #fff; font-weight: 900; text-align: center;
  border-radius: 12px; padding: 8px; margin-right: 44px; }
.quiz-streak { font-weight: 900; color: #c2410c; margin-bottom: 4px; animation: popIn .4s; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { translate: -6px 0; } 40%,80% { translate: 6px 0; } }
.quiz-asker { padding-right: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-soft); font-size: 14px; }
.quiz-asker-emoji { font-size: 30px; }
.quiz-question { font-size: 19px; font-weight: 800; line-height: 1.35; }
.quiz-answers { display: flex; flex-direction: column; gap: 10px; }
.quiz-answer { text-align: left; font-weight: 700; font-size: 16px; line-height: 1.3; background: #f2f0fb; }
.quiz-answer.crossed { text-decoration: line-through; opacity: .4; }
.quiz-answer { transition: background .2s, transform .1s; }
.quiz-answer.picked-correct, .quiz-answer.reveal-correct { background: var(--good); color: #fff; }
.quiz-answer.picked-correct { animation: popIn .35s; }
.quiz-answer.picked-correct, .quiz-answer.reveal-correct, .quiz-answer.picked-wrong { opacity: 1; }
.quiz-answer.picked-wrong { background: var(--bad); color: #fff; }
.quiz-feedback { font-size: 14px; line-height: 1.4; border-radius: 14px; }
.quiz-feedback.good, .quiz-feedback.bad, .quiz-feedback.retry { padding: 12px; }
.quiz-feedback.good { background: #e3f7ec; color: #17663f; }
.quiz-feedback.bad { background: #fdeaea; color: #8c2f2f; }
.quiz-feedback.retry { background: #e8f4fd; color: #1a5b8a; font-weight: 700; }
.quiz-verdict { font-weight: 900; font-size: 16px; margin-bottom: 4px; }
.quiz-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- lab ---------- */

.lab-shelf {
  background: rgba(255,255,255,.1);
  border-radius: var(--radius);
  min-height: 64px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 38px;
  margin: 0 auto 14px;
  max-width: 700px;
  padding: 8px 16px;
}
.shelf-empty { font-size: 13px; color: rgba(255,255,255,.65); font-weight: 600; text-align: center; }

.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
.build-card.built { background: #eafaf2; }
.build-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.build-emoji { font-size: 36px; }
.build-name { font-weight: 800; font-size: 16px; }
.build-perk { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.build-cost { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cost-chip { border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; }
.cost-chip.ok { background: #e3f7ec; color: #17663f; }
.cost-chip.missing { background: #fdeaea; color: #8c2f2f; }
.build-done { font-weight: 800; color: var(--good); }
.build-perk-line { font-weight: 700; color: var(--ink) !important; }

/* ---------- badges ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}
.badge {
  background: rgba(255,255,255,.10);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  color: rgba(255,255,255,.5);
}
.badge.earned { background: var(--card); color: var(--ink); }
.badge-emoji { font-size: 34px; }
.badge.earned .badge-emoji { animation: sparklePulse 3s infinite; }
.badge-name { font-weight: 800; font-size: 13px; }
.badge-desc { font-size: 11px; opacity: .75; }

/* ---------- experiments ---------- */

.exp-list { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }
.exp-card {
  display: flex; align-items: center; gap: 14px;
  border: none; text-align: left; cursor: pointer; font-family: inherit;
}
.exp-card.locked { opacity: .6; background: #cfd0e4; }
.exp-card.done { background: #eafaf2; }
.exp-emoji { font-size: 36px; }
.exp-info { flex: 1; }
.exp-name { font-weight: 800; font-size: 16px; color: var(--ink); }
.exp-tag { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.exp-check { font-size: 22px; }

.exp-detail { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin: 0 auto; padding-bottom: 30px; }
.exp-tagline { color: #fff; text-align: center; font-weight: 700; margin: 0; }
.exp-detail h3 { margin: 0 0 8px; font-size: 16px; }
.exp-materials, .exp-steps { margin: 0; padding-left: 22px; font-size: 15px; line-height: 1.7; color: var(--ink); }
.card.safety { background: #fff3cd; }
.card.safety p { margin: 0; font-size: 14px; }
.card.done-note { background: #eafaf2; text-align: center; }
.card.done-note p { margin: 0 0 10px; }
.exp-start { align-self: center; }

/* ---------- settings ---------- */

.name-input {
  font-size: 20px; font-weight: 800; font-family: inherit;
  text-align: center;
  border: 3px solid #d9d6ee; border-radius: 14px;
  padding: 10px;
  width: 100%;
}
.settings-label { font-weight: 700; color: var(--ink-soft); font-size: 14px; }

/* ---------- toast & effects ---------- */

.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 54px);
  left: 50%;
  transform: translate(-50%, -20px);
  background: rgba(20,20,50,.92);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  padding: 10px 20px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 90;
  max-width: 86vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.float-reward {
  position: fixed;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
  animation: floatUp 1.2s forwards;
  pointer-events: none;
  z-index: 80;
  transform: translate(-50%, -50%);
}
@keyframes floatUp {
  from { opacity: 1; margin-top: 0; }
  to { opacity: 0; margin-top: -60px; }
}

.confetti {
  position: fixed;
  top: -30px;
  animation: confettiFall linear forwards;
  pointer-events: none;
  z-index: 100;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(360deg); }
}

/* ---------- small phones / narrow portrait ---------- */

@media (max-width: 520px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-name { display: none; }
  .region-place { display: none; }
}
