/* Photo Playground — styles (Phase 2) */

:root {
  --cream: #FFF6E9;
  --sky: #7EC8E3;
  --leaf: #6BBF59;
  --sunshine: #FFD93D;
  --tomato: #FF6B57;
  --ink: #33302B;
  --ink-soft: #5C554B;
  --card: #FFFFFF;
  --charcoal: #394049;
  --charcoal-deep: #2A3038;
  --screen-green: #DFF7D8;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(70, 55, 30, 0.12);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

button { font-family: inherit; }

/* ---------- Header ---------- */

.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 6px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0.3px;
  color: var(--ink);
}

.tagline {
  margin: 2px 0 12px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--tomato);
}

/* Main nav pills */

.main-nav { display: flex; gap: 10px; }

.nav-pill {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--card);
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.nav-pill:hover { transform: translateY(-2px); }

.nav-pill.is-active {
  background: var(--charcoal);
  color: #FFFFFF;
}

/* Level switch */

.level-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.level-switch {
  display: inline-flex;
  gap: 4px;
  background: #F2E7D3;
  border-radius: 999px;
  padding: 5px;
}

.level-option {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.level-option.is-active {
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(70, 55, 30, 0.18);
}

.level-note {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
  min-height: 1.4em;
}

/* ---------- Views ---------- */

.view[hidden] { display: none; }

.view-inner {
  max-width: 1180px;
  margin: 10px auto 40px;
  padding: 0 20px;
}

.view-title {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 900;
  margin: 8px 0 4px;
}

.view-lede {
  margin: 0 0 20px;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ---------- Scene picker ---------- */

.scene-picker-wrap {
  max-width: 1180px;
  margin: 6px auto 0;
  padding: 0 20px;
}

.scene-picker {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 2px 12px;
  scrollbar-width: thin;
}

/* With twelve scenes the picker wraps into tidy rows on desktop
   (and keeps its horizontal scroll on small screens). */
@media (min-width: 800px) {
  .scene-picker {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: flex-start;
  }
}

.scene-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 108px;
  min-height: 44px;
  background: var(--card);
  border: 3px solid transparent;
  border-radius: 18px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.scene-thumb:hover { transform: translateY(-3px); }

.scene-thumb.is-active {
  border-color: var(--sunshine);
  background: #FFFBEF;
}

.scene-thumb-emoji { font-size: 1.7rem; line-height: 1.2; }

.scene-thumb-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

.scene-thumb.is-active .scene-thumb-name { color: var(--ink); }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  grid-template-areas:
    "photo camera"
    "photo explain"
    "photo tip"
    "controls controls";
  gap: 20px;
  max-width: 1180px;
  margin: 8px auto 40px;
  padding: 0 20px;
  align-items: start;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.photo-card { grid-area: photo; }
.camera-card { grid-area: camera; }
.explain-card { grid-area: explain; }
.tip-card { grid-area: tip; }
.controls-card { grid-area: controls; }

/* ---------- Photo preview ---------- */

.photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 36px;
}

.photo-scene-name {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--ink);
}

.chip-button {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink);
  background: #F2E7D3;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.chip-button:hover { transform: translateY(-1px); background: #EBDCC0; }

.chip-button.is-active {
  background: var(--charcoal);
  color: #FFFFFF;
}

.chip-quiet { background: transparent; color: var(--ink-soft); }

.photo-frame {
  position: relative;
  background: #FFFFFF;
  border: 10px solid #FFFFFF;
  outline: 1px solid rgba(70, 55, 30, 0.15);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(70, 55, 30, 0.18);
}

.scene-container {
  line-height: 0;
  background: var(--charcoal-deep);
  transition: opacity 0.18s ease;
}

.scene-container.scene-fade { opacity: 0; }

.scene-container svg {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  display: block;
  transition: filter 0.25s ease;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shutter-flash {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.shutter-flash.blink { animation: shutter-blink 0.15s ease-out; }

@keyframes shutter-blink {
  0% { opacity: 0; }
  30% { opacity: 0.5; }
  100% { opacity: 0; }
}

.photo-caption {
  margin: 12px 4px 0;
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  min-height: 1.5em;
}

.compo-note {
  margin: 6px 4px 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #3E7B33;
}

/* ---------- Scene idle animations ---------- */

#wave-arm-inner {
  transform-box: fill-box;
  transform-origin: 20% 90%;
  animation: wave 1.4s ease-in-out infinite alternate;
}

@keyframes wave {
  from { transform: rotate(-7deg); }
  to   { transform: rotate(9deg); }
}

#runner-body {
  transform-box: fill-box;
  transform-origin: center;
  animation: runner-bob 0.45s ease-in-out infinite alternate;
}

@keyframes runner-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-7px); }
}

#kite-inner {
  transform-box: fill-box;
  transform-origin: center;
  animation: kite-sway 1.8s ease-in-out infinite alternate;
}

@keyframes kite-sway {
  from { transform: rotate(-4deg) translateY(0); }
  to   { transform: rotate(5deg) translateY(-8px); }
}

.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flame-flicker 0.75s ease-in-out infinite alternate;
}

.flame:nth-child(2) { animation-delay: 0.18s; }
.flame:nth-child(3) { animation-delay: 0.35s; }
.flame:nth-child(4) { animation-delay: 0.5s; }

@keyframes flame-flicker {
  from { transform: scale(1, 0.86) rotate(-2deg); opacity: 0.9; }
  to   { transform: scale(1, 1.1) rotate(3deg); opacity: 1; }
}

#cat-tail-inner {
  transform-box: fill-box;
  transform-origin: 0% 100%;
  animation: tail-swish 2.4s ease-in-out infinite alternate;
}

@keyframes tail-swish {
  from { transform: rotate(-2deg); }
  to   { transform: rotate(9deg); }
}

#rain-inner {
  animation: rain-fall 0.9s linear infinite;
}

@keyframes rain-fall {
  from { transform: translateY(0); }
  to   { transform: translateY(540px); }
}

/* ---------- Camera back ---------- */

.camera-body {
  background: var(--charcoal);
  border-radius: 18px;
  padding: 14px 16px 18px;
  color: #F4F1EA;
}

.camera-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mode-dial {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4A5563, var(--charcoal-deep));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-dial-letter {
  font-size: 1rem;
  font-weight: 900;
  color: var(--sunshine);
}

.mode-dial-tick {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 3px;
  height: 7px;
  background: #B9C0C9;
  border-radius: 2px;
  transform: translateX(-50%);
}

.camera-brand {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #B9C0C9;
}

.camera-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--charcoal-deep);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.5);
}

.camera-screen {
  background: var(--charcoal-deep);
  border: 3px solid #1F242B;
  border-radius: 12px;
  padding: 12px;
  transition: box-shadow 0.3s ease;
}

.camera-screen.glow-good {
  box-shadow: 0 0 0 2px rgba(107, 191, 89, 0.65), 0 0 16px rgba(107, 191, 89, 0.45);
}

.lcd-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.lcd-row-secondary { margin-top: 8px; }
.lcd-row-secondary:not(:has(.readout:not([hidden]))) { display: none; }

.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.readout-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8FDF7F;
}

.readout-value {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--screen-green);
  white-space: nowrap;
}

.readout-small { font-size: clamp(1rem, 1.8vw, 1.2rem); }

/* Exposure meter */

.meter { margin-top: 14px; }

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  color: #B9C0C9;
  margin-bottom: 6px;
}

.meter-track {
  position: relative;
  display: flex;
  height: 18px;
  border-radius: 9px;
  overflow: visible;
}

.meter-zone { height: 100%; }

.zone-dark { flex: 3.25; background: #4A5563; border-radius: 9px 0 0 9px; }
.zone-good { flex: 3.5; background: var(--leaf); }
.zone-bright { flex: 3.25; background: #F4E3A1; border-radius: 0 9px 9px 0; }

.meter-needle {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 6px;
  height: 28px;
  border-radius: 3px;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.25s ease;
}

.meter-needle.needle-warn { background: var(--tomato); }

.meter-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  color: #8A929C;
  font-variant-numeric: tabular-nums;
}

.exposure-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #C9D4A8;
  text-align: center;
}

.meter-bias-note {
  margin: 10px 0 0;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF6E9;
  background: rgba(126, 200, 227, 0.18);
  border: 2px dashed rgba(126, 200, 227, 0.55);
  border-radius: 12px;
  text-align: center;
}

/* ---------- Explanation + tip panels ---------- */

.explain-card h2,
.tip-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ink);
}

.explain-headline {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--ink);
  min-height: 2.6em;
}

.explain-tradeoff {
  margin: 0 0 14px;
  color: var(--ink-soft);
  min-height: 2.6em;
}

.reset-button {
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--tomato);
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 3px 0 #D94F3D;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reset-button:hover { transform: translateY(-1px); }
.reset-button:active { transform: translateY(1px); box-shadow: 0 1px 0 #D94F3D; }

.reset-button:focus-visible,
.nav-pill:focus-visible,
.level-option:focus-visible,
.chip-button:focus-visible,
.scene-thumb:focus-visible,
.controls-tab:focus-visible,
.segmented button:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tip-topic {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #C86A28;
}

.tip-text {
  margin: 6px 0 14px;
  color: var(--ink-soft);
  min-height: 3.9em;
}

/* ---------- Challenge strip (Play view) ---------- */

.challenge-strip {
  position: relative;
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 14px 20px;
  overflow: hidden;
}

.challenge-strip[hidden] { display: none; }

.challenge-strip {
  background: var(--card);
  border-radius: var(--radius);
  border-left: 8px solid var(--sunshine);
  box-shadow: var(--shadow);
  margin-left: 20px;
  margin-right: 20px;
}

@media (min-width: 1220px) {
  .challenge-strip { margin-left: auto; margin-right: auto; }
}

.challenge-strip.is-complete { border-left-color: var(--leaf); }

.challenge-strip-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.challenge-flag {
  font-weight: 900;
  color: #C86A28;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.challenge-strip-head strong { font-size: 1.1rem; }
.challenge-strip-head .chip-button { margin-left: auto; }
.challenge-strip-head .chip-quiet { margin-left: 0; }

.challenge-brief { margin: 8px 0 6px; color: var(--ink-soft); }

.challenge-hint {
  margin: 4px 0 8px;
  font-weight: 700;
  color: #3E6FA8;
  background: #EBF3FB;
  border-radius: 12px;
  padding: 10px 14px;
}

.challenge-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.check-chip {
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 14px;
  background: #F2E7D3;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease;
}

.check-chip.is-pass { background: #DFF3D8; color: #2F6B24; }

.challenge-success { margin-top: 10px; }

.challenge-success-line {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 900;
  color: #2F6B24;
}

.challenge-why { margin: 0; color: var(--ink-soft); }

/* Confetti */

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-bit {
  position: absolute;
  top: -14px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  opacity: 0.95;
  animation: confetti-fall 1.25s ease-in forwards;
}

.confetti-star { width: 12px; height: 12px; border-radius: 50%; }

@keyframes confetti-fall {
  to {
    transform: translateY(230px) translateX(var(--drift, 0px)) rotate(var(--spin, 200deg));
    opacity: 0;
  }
}

/* ---------- Controls ---------- */

.controls-tabs { display: none; }

.controls-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px 26px;
}

.control-group { display: contents; }
.control-group.is-locked { display: none !important; }

.control-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.control-name {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
}

.control-value {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.control-value.pop { animation: chip-pop 0.28s ease; }

@keyframes chip-pop {
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

#control-iso .control-value { color: #C86A28; }
#control-aperture .control-value { color: #3E8FB8; }
#control-shutter .control-value { color: #4E9640; }
#control-comp .control-value { color: #A05FB8; }
#control-focal .control-value { color: #B8574E; }

.control-caption {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Big friendly range sliders (44px+ touch target) */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--sunshine), var(--tomato));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  margin-top: -9px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 4px solid var(--charcoal);
  box-shadow: 0 2px 6px rgba(70, 55, 30, 0.3);
  transition: transform 0.15s ease;
}

input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }

input[type="range"]::-moz-range-track {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--sunshine), var(--tomato));
}

input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 4px solid var(--charcoal);
  box-shadow: 0 2px 6px rgba(70, 55, 30, 0.3);
}

#slider-comp::-webkit-slider-runnable-track { background: linear-gradient(90deg, #4A5563, #F2E7D3, #F4E3A1); }
#slider-comp::-moz-range-track { background: linear-gradient(90deg, #4A5563, #F2E7D3, #F4E3A1); }
#slider-focal::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--sky), #3E8FB8); }
#slider-focal::-moz-range-track { background: linear-gradient(90deg, var(--sky), #3E8FB8); }

/* Segmented buttons (distance, white balance) */

.segmented {
  display: flex;
  gap: 6px;
  background: #F2E7D3;
  border-radius: 999px;
  padding: 5px;
  flex-wrap: wrap;
}

.segmented button {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 9px 10px;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.segmented button[aria-pressed="true"] {
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(70, 55, 30, 0.18);
}

/* ---------- Challenges view ---------- */

.challenge-level-heading {
  font-size: 1.2rem;
  font-weight: 900;
  margin: 26px 0 12px;
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.challenge-card.is-done { outline: 3px solid #BFE3B4; }

.challenge-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.challenge-card-head h4 { margin: 0; font-size: 1.1rem; font-weight: 900; flex: 1; }

.challenge-emoji { font-size: 1.5rem; }

.challenge-tick {
  font-size: 1.1rem;
  font-weight: 900;
  color: #2F6B24;
  background: #DFF3D8;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.challenge-card-brief { margin: 0; color: var(--ink-soft); flex: 1; }

.challenge-card-scene {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #C86A28;
}

.challenge-start { align-self: flex-start; }

/* ---------- About view ---------- */

.about-inner { max-width: 760px; }

.about-card p { margin: 0 0 14px; }
.about-card p:last-child { margin-bottom: 0; }

.about-list {
  margin: 0 0 14px;
  padding-left: 6px;
  list-style: none;
}

.about-list li { margin-bottom: 8px; }

.about-credit {
  border-top: 2px dashed #F2E7D3;
  padding-top: 14px;
  color: var(--ink-soft);
}

.about-card a,
.site-footer a {
  color: #B8574E;
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 4px 16px 34px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.at-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--sunshine);
  color: var(--ink);
  font-size: 0.85em;
  font-weight: 900;
  margin-right: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #wave-arm-inner, #runner-body, #kite-inner, .flame, #cat-tail-inner, #rain-inner { animation: none; }
  .scene-container, .scene-container svg, .meter-needle, .control-value,
  .nav-pill, .scene-thumb, .chip-button, .reset-button, .camera-screen { transition: none; animation: none; }
  .shutter-flash.blink, .confetti-bit, .control-value.pop { animation: none; }
}

/* ---------- Mobile (<800px) ---------- */

@media (max-width: 799px) {
  body { font-size: 16px; }

  .site-header { padding: 14px 14px 4px; }
  .header-top { justify-content: center; text-align: center; }
  .main-nav { width: 100%; justify-content: center; }
  .nav-pill { padding: 9px 16px; }
  .tagline { text-align: center; margin-bottom: 8px; }
  .level-row { justify-content: center; }
  .level-note { text-align: center; width: 100%; }
  .level-option { padding: 8px 12px; font-size: 0.85rem; }

  .scene-picker-wrap { padding: 0 12px; }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "camera"
      "explain"
      "tip"
      "controls";
    gap: 14px;
    margin-top: 6px;
    padding: 0 12px 8px;
  }

  .card { padding: 14px; }

  .challenge-strip { margin-left: 12px; margin-right: 12px; }

  /* Camera back becomes a compact strip */
  .camera-card { padding: 10px; }
  .camera-body { padding: 10px 12px 12px; }
  .camera-screen { padding: 10px 8px; }
  .readout-value { font-size: 1.15rem; }
  .meter { margin-top: 10px; }
  .meter-labels { font-size: 0.68rem; }

  /* Controls in a sticky bottom drawer with tabs */
  .controls-card {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: block;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -6px 18px rgba(70, 55, 30, 0.18);
    max-height: 48vh;
    overflow-y: auto;
    padding: 10px 16px 14px;
  }

  .controls-tabs {
    display: flex;
    gap: 6px;
    position: sticky;
    top: 0;
    background: var(--card);
    padding: 4px 0 8px;
    z-index: 2;
  }

  .controls-tab {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--ink-soft);
    background: #F2E7D3;
    border: none;
    border-radius: 999px;
    padding: 9px 10px;
    min-height: 44px;
    cursor: pointer;
  }

  .controls-tab.is-active {
    background: var(--charcoal);
    color: #FFFFFF;
  }

  .control-group { display: none; }
  .control-group.is-on { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .control-group.is-locked { display: none !important; }

  .control-value { font-size: 1.3rem; }
  .control-label { margin-bottom: 2px; }
  .control-caption { margin-top: 2px; font-size: 0.8rem; }
  .segmented button { font-size: 0.8rem; padding: 8px 6px; }
}
