/* MathNest stylesheet — visual language carried over from PhonicQuest:
   rounded glass panels, sage/teal palette, big tappable buttons, a floating
   bubble background. Maths-specific activity classes added below the shared
   base rules. */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", "Helvetica Neue",
               Arial, sans-serif;
  background: linear-gradient(135deg, #f6fafd 0%, #e2f0ff 100%);
  color: #2b2d42;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0 0 .4em 0;
  font-weight: 700;
}

button {
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

input[type="text"] {
  font-family: inherit;
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid #cfd8dc;
  outline: none;
}

input[type="text"]:focus {
  border-color: #4cc9f0;
}

/* ---------- layout ---------- */

#app-viewport {
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 48px 16px;
}

.screen { display: none; }
.screen.active { display: block; }

.bubble-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(76,201,240,0.18), rgba(67,97,238,0.05) 60%);
  filter: blur(2px);
  opacity: .9;
}
.bg-bubble:nth-child(1) { width: 260px; height: 260px; top: -60px; left: -40px; }
.bg-bubble:nth-child(2) { width: 200px; height: 200px; top: 30%; right: -40px; background: radial-gradient(circle at 30% 30%, rgba(255,193,204,0.5), rgba(255,193,204,0.05) 60%); }
.bg-bubble:nth-child(3) { width: 320px; height: 320px; bottom: -80px; left: 30%; background: radial-gradient(circle at 30% 30%, rgba(168,230,164,0.4), rgba(168,230,164,0.05) 60%); }
.bg-bubble:nth-child(4) { width: 180px; height: 180px; top: 60%; left: 8%; background: radial-gradient(circle at 30% 30%, rgba(255,217,160,0.55), rgba(255,217,160,0.05) 60%); }

.glass-panel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(43, 45, 66, 0.12);
  backdrop-filter: blur(8px);
}

/* ---------- splash ---------- */

#screen-splash .logo-title {
  font-size: 2.6rem;
  margin: 8px 0 0 0;
  letter-spacing: -0.02em;
  text-align: center;
}
#screen-splash .logo-title span { color: #4361ee; }
#screen-splash .logo-subtitle {
  text-align: center;
  color: #5b6478;
  margin: 0 0 24px 0;
}

.parent-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  background: rgba(43, 45, 66, 0.06);
  border-radius: 14px;
  margin-bottom: 16px;
}
.parent-controls-label {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: #7c8599;
  letter-spacing: 0.06em;
  padding: 0 6px;
}
.parent-control-btn {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(43,45,66,0.08);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: #2b2d42;
}
.parent-control-btn:hover { background: rgba(255,255,255,1); }
.parent-control-btn svg { display: block; }

.profile-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 16px 0;
  min-height: 60px;
}
.profile-card {
  background: rgba(255,255,255,0.95);
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 12px 16px;
  display: flex; flex-direction: column; align-items: center;
  min-width: 84px;
  box-shadow: 0 4px 10px rgba(43,45,66,0.08);
}
.profile-card:hover { border-color: #4cc9f0; }
.profile-card-avatar { font-size: 28px; }
.profile-card-name { font-weight: 700; font-size: 14px; }

.avatar-selector { margin-top: 12px; }
.avatar-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.avatar-option {
  background: rgba(255,255,255,0.9);
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 8px 12px;
  display: flex; flex-direction: column; align-items: center;
  min-width: 72px;
}
.avatar-option.active { border-color: #4361ee; background: white; }
.avatar-emoji { font-size: 24px; }
.avatar-name { font-size: 12px; color: #5b6478; }
.avatar-hint { font-size: 12px; color: #5b6478; margin: 8px 0 0 0; }

.profile-setup h3 { margin: 16px 0 8px 0; font-size: 14px; color: #5b6478; }

.primary-btn {
  background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
  margin-top: 16px;
  width: 100%;
}
.primary-btn:hover { transform: translateY(-1px); }
.primary-btn:disabled,
.primary-btn[disabled] {
  background: linear-gradient(135deg, #cfd8dc, #b0bec5);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
}

.track-link-row {
  display: flex; gap: 8px; justify-content: center; margin-top: 12px;
  flex-wrap: wrap;
}
.track-link-btn {
  background: rgba(43,45,66,0.06);
  color: #5b6478;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.track-link-btn:hover { background: rgba(43,45,66,0.12); }

/* ---------- map screen ---------- */
#screen-map .map-hud {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 8px 14px;
}
.map-hud-avatar { font-size: 28px; }
.map-hud-name { font-weight: 700; }

.island {
  width: 100%;
  background: rgba(255,255,255,0.95);
  border: 3px solid transparent;
  border-radius: 24px;
  padding: 18px 16px;
  margin-bottom: 12px;
  display: flex; gap: 16px; align-items: center;
  box-shadow: 0 4px 12px rgba(43,45,66,0.08);
  position: relative;
}
.island:hover:not(:disabled) { transform: translateY(-2px); }
.island:disabled { opacity: .55; }
.island-emoji {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #f6fafd, #e2f0ff);
  border-radius: 20px;
}
.island-title { font-size: 1.2rem; font-weight: 700; }
.island-stars { font-size: 18px; margin-top: 4px; }
.island-lock {
  position: absolute; top: 12px; right: 12px;
  font-size: 22px;
}

/* ---------- lesson screen ---------- */
.lesson-part {
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(43,45,66,0.12);
  margin-top: 16px;
  position: relative;
  animation: popIn .35s ease;
}
@keyframes popIn {
  0% { transform: scale(.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lesson-instruction { text-align: center; }
.lesson-instruction-mascot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 120px; height: 120px;
  font-size: 72px;
  border-radius: 50%;
  margin-bottom: 12px;
  animation: bobbing 3s ease-in-out infinite;
}
@keyframes bobbing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.lesson-instruction-bubble {
  background: white;
  border: 2px solid #e2f0ff;
  border-radius: 18px;
  padding: 16px;
  margin: 12px auto;
  max-width: 480px;
  font-size: 1.05rem;
}
.lesson-instruction-visual { margin: 16px 0; }

.number-walk, .number-line-recap, .equation-walk {
  display: flex; gap: 4px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.number-walk-cell, .number-line-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #4cc9f0, #4361ee);
  color: white; border-radius: 12px;
  font-weight: 700; font-size: 1.2rem;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.number-walk-cell-active {
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  color: white;
  transform: scale(1.18);
  box-shadow: 0 8px 20px rgba(255, 159, 28, 0.45);
  animation: walkPulse 0.7s ease-in-out infinite alternate;
}
@keyframes walkPulse {
  0%   { box-shadow: 0 8px 20px rgba(255, 159, 28, 0.45); }
  100% { box-shadow: 0 12px 28px rgba(255, 159, 28, 0.75); }
}
.number-walk-arrow, .number-line-arrow {
  font-size: 1.2rem;
  color: #4cc9f0;
}

.plenary-ppw, .equation-walk-piece {
  display: inline-block;
  background: rgba(76,201,240,0.16);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  margin: 4px;
}

.lesson-plenary-cap {
  text-align: center;
  font-style: italic;
  color: #5b6478;
  margin: 12px 0;
}

.lesson-reward {
  text-align: center;
}
.lesson-sticker {
  font-size: 96px;
  display: inline-block;
  animation: stickerPop .8s ease;
}
@keyframes stickerPop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.lesson-skip { text-align: center; padding: 32px 16px; }
.lesson-skip h2 { color: #4361ee; }

.lesson-activity-frame { }
.lesson-activity-header h2 { color: #2b2d42; }
.lesson-activity-header p { color: #5b6478; margin: 0 0 16px 0; }
.lesson-activity-container { margin-top: 12px; }

/* ---------- activity shared ---------- */
.activity-container { padding: 8px; }
.activity-header h2 { font-size: 1.4rem; }
.activity-counter {
  text-align: center;
  margin-top: 16px;
  color: #5b6478;
  font-size: 13px;
}
.animate-pop { animation: popIn .35s ease; }

/* count_objects */
.count-objects-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, #f6fafd, #e2f0ff);
  border-radius: 18px;
  margin-bottom: 16px;
  min-height: 100px;
}
.count-objects-item { font-size: 48px; }
.count-objects-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.count-objects-option-btn,
.ten-frame-option-btn,
.compare-option-btn,
.order-number-btn,
.ppw-option-btn,
.make-option-btn,
.missing-option-btn,
.story-option-btn {
  border: 3px solid #e2f0ff;
  background: white;
  border-radius: 18px;
  font-size: 1.6rem;
  font-weight: 700;
  padding: 18px;
  color: #2b2d42;
  transition: transform .12s ease;
}
.count-objects-option-btn:hover,
.ten-frame-option-btn:hover,
.compare-option-btn:hover,
.order-number-btn:hover,
.ppw-option-btn:hover,
.make-option-btn:hover,
.missing-option-btn:hover,
.story-option-btn:hover { transform: scale(1.04); }
.count-objects-option-btn.correct,
.ten-frame-option-btn.correct,
.compare-option-btn.correct,
.order-number-btn.correct,
.ppw-option-btn.correct,
.make-option-btn.correct,
.missing-option-btn.correct,
.story-option-btn.correct {
  background: linear-gradient(135deg, #a8e6a3, #4cd97b);
  border-color: #4cd97b;
  color: white;
}
.count-objects-option-btn.incorrect,
.ten-frame-option-btn.incorrect,
.compare-option-btn.incorrect,
.order-number-btn.incorrect,
.ppw-option-btn.incorrect,
.make-option-btn.incorrect,
.missing-option-btn.incorrect,
.story-option-btn.incorrect {
  background: linear-gradient(135deg, #ffb4b4, #ff5a5f);
  border-color: #ff5a5f;
  color: white;
}

/* ten_frame */
.ten-frame-grid {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: white;
  border-radius: 12px;
  border: 2px solid #cfd8dc;
  margin: 0 auto 16px auto;
  width: max-content;
}
.ten-frame-cell {
  width: 56px; height: 56px;
  background: #f6fafd;
  border: 2px solid #e2f0ff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.ten-frame-dot {
  width: 36px; height: 36px;
  background: radial-gradient(circle at 30% 30%, #ff7b7b, #d6404b);
  border-radius: 50%;
}
.ten-frame-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* compare_groups */
.compare-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.compare-group {
  padding: 16px;
  background: linear-gradient(135deg, #fff8d1, #ffe896);
  border-radius: 16px;
  text-align: center;
}
.compare-group-b { background: linear-gradient(135deg, #d1f0ff, #9ed5ff); }
.compare-dots { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 60px; }
.compare-dot { font-size: 28px; color: #2b2d42; }
.compare-label { font-weight: 700; margin-top: 8px; }
.compare-vs { font-size: 28px; font-weight: 700; color: #5b6478; }
.compare-options { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* order_numbers */
.order-numbers-stage { margin: 12px 0; }
.order-numbers-choices {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.order-number-btn:disabled, .order-number-btn.picked {
  background: rgba(43,45,66,0.06);
  color: #5b6478;
  border-color: rgba(43,45,66,0.06);
  transform: none;
}
.order-numbers-preview {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin-top: 12px;
}
.order-slot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  background: white;
  border: 2px dashed #cfd8dc;
  color: #5b6478;
}
.order-slot.filled { background: linear-gradient(135deg, #a8e6a3, #4cd97b); color: white; border: none; }
.order-arrow { color: #4cc9f0; font-size: 1.4rem; }

/* part-part-whole */
.ppw-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f6fafd;
  border-radius: 16px;
  margin-bottom: 12px;
}
.ppw-half { background: white; border-radius: 12px; padding: 8px; text-align: center; }
.ppw-half-title { font-weight: 700; margin-bottom: 6px; }
.ppw-grid {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 4px;
  justify-content: center;
}
.ppw-cell {
  width: 28px; height: 28px;
  background: #f0f4f8;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.ppw-dot { width: 18px; height: 18px; border-radius: 50%; }
.ppw-dot-red { background: radial-gradient(circle at 30% 30%, #ff7b7b, #d6404b); }
.ppw-dot-blue { background: radial-gradient(circle at 30% 30%, #7bb5ff, #406ad6); }
.ppw-total {
  font-size: 2.2rem;
  font-weight: 700;
  color: #5b6478;
  text-align: center;
}
.ppw-question { text-align: center; font-size: 1.1rem; font-weight: 700; margin: 12px 0; }
.ppw-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* pattern_builder */
.pat-strip {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.pat-cell {
  width: 44px; height: 44px;
  background: #f0f4f8;
  border-radius: 10px;
  border: 2px dashed #c9d4e0;
  display: flex; align-items: center; justify-content: center;
}
.pat-cell.pat-q {
  border-color: #f0a833;
  background: #fff7e8;
  font-size: 1.4rem;
  font-weight: 700;
  color: #8a6d1f;
}
.pat-dot { width: 24px; height: 24px; border-radius: 50%; display: inline-block; }
.pat-dot-c0 { background: radial-gradient(circle at 30% 30%, #ff7b7b, #d6404b); }
.pat-dot-c1 { background: radial-gradient(circle at 30% 30%, #7bb5ff, #406ad6); }
.pat-dot-c2 { background: radial-gradient(circle at 30% 30%, #8fdc8f, #2f9e44); }
.pat-dot-c3 { background: radial-gradient(circle at 30% 30%, #ffe066, #e8b931); }
.pat-hint { text-align: center; color: #5b6478; font-size: 0.95rem; margin: 6px 0 12px; }
.pat-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.pat-option-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px;
  border-radius: 14px;
  font-size: 1rem;
}
.pat-option-word { text-transform: capitalize; }

/* shape_picker */
.shp-svg { width: 64px; height: 64px; }
.shp-stage { text-align: center; margin: 8px 0 12px; }
.shp-stage .shp-svg { width: 96px; height: 96px; }
.shp-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}
.shp-option-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px;
  border-radius: 14px;
  font-size: 0.95rem;
}
.shp-option-btn .shp-svg { width: 52px; height: 52px; }
.shp-option-word { text-transform: capitalize; }
.shp-scene {
  position: relative;
  height: 150px;
  margin: 10px auto 12px;
  max-width: 260px;
  background: linear-gradient(#eaf3fb 70%, #dceadf 70%);
  border-radius: 12px;
  border: 2px solid #c9d4e0;
}
.shp-table {
  position: absolute;
  left: 50%; bottom: 40px;
  transform: translateX(-50%);
  width: 180px; height: 14px;
  background: #b07d4f;
  border-radius: 4px;
  text-align: center;
  font-size: 0.65rem;
  color: #fff;
  line-height: 14px;
}
.shp-toy { position: absolute; font-size: 34px; line-height: 1; }
.shp-toy-on { left: 66px; bottom: 58px; }
.shp-toy-under { left: 110px; bottom: 12px; }
.shp-toy-beside { right: 12px; bottom: 60px; }
.shp-option-toy .shp-toy-emoji { font-size: 30px; }

/* skip_count */
.skip-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.skip-chip {
  min-width: 44px; height: 44px;
  padding: 0 8px;
  background: #eef3fb;
  border-radius: 10px;
  border: 2px solid #c9d4e0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #2b2d42;
}
.skip-chip-q {
  border-color: #f0a833;
  background: #fff7e8;
  color: #8a6d1f;
}
.skip-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 14px auto 0;
}
.skip-option-btn {
  padding: 12px;
  border-radius: 14px;
  font-size: 1.15rem;
}

/* make_number */
.make-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f6fafd;
  border-radius: 16px;
  margin-bottom: 12px;
}
.make-half {
  background: white; border-radius: 12px; padding: 18px;
  text-align: center; font-size: 1.6rem; font-weight: 700;
}
.make-half-unknown { background: rgba(76,201,240,0.16); }
.make-plus, .make-equals {
  font-size: 1.6rem; font-weight: 700; color: #5b6478; text-align: center;
}
.make-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* missing_number */
.missing-line {
  display: flex; justify-content: center; gap: 6px;
  padding: 16px;
  background: #f6fafd; border-radius: 16px;
  margin-bottom: 16px;
}
.missing-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: white; border-radius: 12px;
  font-size: 1.4rem; font-weight: 700;
}
.missing-slot {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
  border: none;
}
.missing-slot.revealed {
  background: linear-gradient(135deg, #a8e6a3, #4cd97b);
}
.missing-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* story_problem */
.story-scene {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  font-size: 36px;
  margin: 12px 0;
  padding: 12px;
  background: #f6fafd;
  border-radius: 16px;
}
.story-item.story-taken { opacity: 0.3; text-decoration: line-through; }
.story-question {
  text-align: center; font-size: 1.05rem; font-weight: 700; margin: 12px 0;
}
.story-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ---------- victory modal ---------- */
.victory-modal {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(43,45,66,0.55);
  z-index: 1000;
}
.victory-modal.active { display: flex; }
.victory-content {
  width: min(520px, 92vw);
  text-align: center;
}
.victory-crown { font-size: 56px; }
.victory-title { font-size: 1.6rem; }
.victory-stars { margin: 12px 0; }
.victory-star { font-size: 36px; }
.victory-star.earned { filter: none; }
.victory-star.empty { filter: grayscale(0.7); opacity: 0.55; }

/* unlock gate modal */
.unlock-gate-question {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0;
}
.unlock-gate-input { width: 80px; text-align: center; font-size: 1.2rem; }
.unlock-gate-error { color: #d6404b; min-height: 20px; margin: 4px 0; }
.unlock-gate-actions { display: flex; gap: 8px; justify-content: center; }

/* parents' options panel */
.parents-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
}
.parents-actions .primary-btn,
.parents-actions .track-link-btn { width: 100%; }
.status-line {
  margin: 10px 0 0;
  min-height: 20px;
  font-size: 0.95rem;
  color: #3c7a4e;
  text-align: center;
}

/* manage profiles */
.manage-profiles-list { margin: 12px 0; }
.manage-profile-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.9);
  border-radius: 12px; padding: 8px 12px; margin-bottom: 8px;
}
.manage-profile-avatar { font-size: 28px; }
.manage-profile-name { flex: 1; font-weight: 700; }
.manage-profile-delete-btn {
  background: rgba(255,90,95,0.15);
  color: #d6404b; border: none; border-radius: 10px;
  padding: 6px 12px; font-weight: 700;
}

.backup-panel {
  margin-top: 16px;
  text-align: left;
}
.backup-title { font-size: 14px; }
.backup-hint { font-size: 12px; color: #5b6478; }
.profile-transfer-text { width: 100%; min-height: 60px; font-family: monospace; }
.backup-actions { display: flex; gap: 8px; }

/* ---------- sticker book ---------- */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.sticker-cell {
  background: rgba(255,255,255,0.85);
  border-radius: 16px; padding: 12px;
  text-align: center;
}
.sticker-cell.earned { background: linear-gradient(135deg, #fff3c4, #ffd166); }
.sticker-art { font-size: 48px; }
.sticker-label { font-weight: 700; margin-top: 4px; }

/* ---------- report ---------- */
.report-section { padding: 10px 0; border-bottom: 1px solid rgba(43,45,66,0.08); }
.report-section:last-child { border-bottom: none; }
.report-section h3 { font-size: 14px; color: #5b6478; text-transform: uppercase; letter-spacing: 0.04em; }

.legal-body { background: rgba(255,255,255,0.9); border-radius: 16px; padding: 18px; margin-top: 12px; }
.legal-body h1 { font-size: 1.4rem; }
.legal-body h2 { font-size: 1.05rem; color: #4361ee; margin-top: 18px; }

.hud-header {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.9);
  border-radius: 14px; padding: 8px 12px; margin-bottom: 12px;
}
.circle-btn {
  background: rgba(43,45,66,0.08);
  color: #2b2d42;
  border: none; border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 16px;
}
.hud-level-info h2 { font-size: 1.1rem; margin: 0; }
.hud-controls { flex: 1; }

@media (max-width: 600px) {
  #app-viewport { padding: 12px; }
  .count-objects-options { grid-template-columns: repeat(2, 1fr); }
  .ppw-options, .make-options, .missing-options, .story-options, .ten-frame-options {
    grid-template-columns: repeat(4, 1fr);
  }
  .compare-stage { grid-template-columns: 1fr; }
  .ppw-stage, .make-stage { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  .ppw-total, .make-plus, .make-equals { grid-column: span 2; }
}

/* place_value_builder */
.pv-stage { text-align: center; margin: 8px 0 12px; }
.pv-picture {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 6px; flex-wrap: wrap;
  padding: 12px;
  background: #f6fafd;
  border-radius: 12px;
  border: 2px solid #c9d4e0;
}
.pv-ten-block {
  width: 44px; height: 34px;
  background: #406ad6;
  color: #fff;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.pv-ones { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; max-width: 90px; }
.pv-one-dot { width: 16px; height: 16px; border-radius: 50%; background: #d6404b; }
.pv-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 12px auto 0;
}
.pv-option-btn { padding: 12px; border-radius: 14px; font-size: 1.2rem; }
.pv-build-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 340px;
  margin: 12px auto 0;
}
.pv-build-option { padding: 10px; border-radius: 14px; }
.pv-build-option .pv-picture { background: transparent; border: none; padding: 0; }

/* clock_face */
.clock-stage { text-align: center; margin: 6px 0 12px; }
.clock-face { width: 150px; height: 150px; }
.clock-question { text-align: center; font-size: 1.15rem; font-weight: 700; margin: 10px 0; }
.clock-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.clock-option-btn { padding: 12px 8px; border-radius: 14px; font-size: 1rem; text-transform: capitalize; }

/* measure */
.ms-compare { display: flex; gap: 14px; justify-content: center; margin: 10px 0 14px; }
.ms-card {
  flex: 1; max-width: 150px;
  background: #f6fafd;
  border-radius: 12px;
  border: 2px solid #c9d4e0;
  padding: 10px;
  text-align: center;
}
.ms-card-visual { min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.ms-card-label { margin-top: 6px; font-size: 0.9rem; color: #5b6478; }
.ms-bar { display: flex; align-items: flex-end; gap: 2px; }
.ms-block { width: 18px; height: 18px; border-radius: 3px; }
.ms-bar-a .ms-block { background: #406ad6; }
.ms-bar-b .ms-block { background: #2f9e44; }
.ms-emoji { font-size: 40px; }
.ms-jug {
  width: 56px; height: 90px;
  border: 3px solid #2b2d42;
  border-top: none;
  border-radius: 0 0 12px 12px;
  position: relative;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: #fff;
}
.ms-jug-fill { width: 100%; }
.ms-jug-a { background: #7bb5ff; }
.ms-jug-b { background: #8fdc8f; }
.ms-units-stage { text-align: center; margin: 12px 0; min-height: 40px; }
.ms-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 12px auto 0;
}
.ms-option-btn { padding: 12px; border-radius: 14px; font-size: 1.1rem; }

/* coins */
.coins-stage { text-align: center; margin: 8px 0 12px; }
.coins-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.coin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  color: #2b2d42;
  border: 4px solid #2b2d42;
  box-shadow: inset 0 0 0 3px #fff;
  background: #e7c55e;
}
.coin-c5 { background: #c9b27e; }
.coin-c10 { background: #d4c48f; }
.coin-c20 { background: #c9b27e; }
.coin-c50 { background: #d7d7d7; }
.coin-c100 { background: #f4d478; }
.coin-c200 { background: #d4d0e8; }
.coin.picked { opacity: 0.45; }
.coins-question { text-align: center; font-size: 1.05rem; font-weight: 600; margin: 10px 0; }
.coins-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
}
.coin-option-btn { padding: 12px; border-radius: 14px; font-size: 1.05rem; }

/* fraction_slicer */
.fr-stage { text-align: center; margin: 8px 0 12px; }
.fr-shape { width: 120px; height: 120px; }
.fr-set-stage { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; max-width: 280px; margin: 10px auto; }
.fr-set-item { font-size: 30px; }
.fr-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.fr-option-btn { padding: 12px 8px; border-radius: 14px; font-size: 1rem; text-transform: capitalize; }

/* hundred_chart */
.hc-chart {
  display: grid;
  gap: 2px;
  margin: 10px auto;
  max-width: 480px;
  padding: 8px;
  background: #eef3fb;
  border-radius: 10px;
}
.hc-cell {
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #2b2d42;
  display: flex; align-items: center; justify-content: center;
  min-height: 22px;
  cursor: pointer;
  user-select: none;
}
.hc-blank {
  border-color: #f0a833;
  background: #fff7e8;
  color: #8a6d1f;
  font-weight: 700;
  cursor: default;
}
.hc-cell.hc-found { background: #c9efc9; outline: 2px solid #2f9e44; }
.hc-cell.incorrect { background: #ffd9d9; }
.hc-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 10px auto 0;
}
.hc-option-btn { padding: 12px; border-radius: 14px; font-size: 1.1rem; }

/* equal_groups */
.eg-stage { text-align: center; margin: 10px 0 12px; }
.eg-groups-visual {
  display: grid;
  gap: 12px;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 12px;
  background: #f6fafd;
}
.eg-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 6px;
  border: 2px solid #c9d4e0;
  border-radius: 10px;
  background: #fff;
  align-content: center;
}
.eg-share {
  display: grid;
  gap: 12px;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 12px;
  background: #f6fafd;
}
.eg-share-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 6px;
  border: 2px dashed #c9d4e0;
  border-radius: 10px;
  background: #fff;
}
.eg-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7bb5ff, #406ad6);
}
.eg-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 10px auto 0;
}
.eg-option-btn { padding: 12px; border-radius: 14px; font-size: 1.1rem; }

/* direction_maze */
.dm-grid {
  display: grid;
  gap: 4px;
  max-width: 300px;
  margin: 10px auto;
}
.dm-cell {
  aspect-ratio: 1;
  background: #f0f4f8;
  border: 2px solid #c9d4e0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
}
.dm-start { background: #fff7e8; border-color: #f0a833; }
.dm-star { background: #fffbe6; }
.dm-moves { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.dm-move-chip {
  background: #eef3fb;
  border: 2px solid #c9d4e0;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.95rem;
  text-transform: capitalize;
}
.dm-arrow { color: #5b6478; font-weight: 700; }
.dm-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 10px auto 0;
}
.dm-option-btn { padding: 12px; border-radius: 14px; font-size: 1.05rem; text-transform: capitalize; }

/* data_pictograph */
.dp-graph {
  max-width: 380px;
  margin: 10px auto;
  background: #f6fafd;
  border-radius: 12px;
  border: 2px solid #c9d4e0;
  padding: 10px;
}
.dp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
}
.dp-row-btn { cursor: pointer; }
.dp-row-btn:hover { background: #eaf3fb; }
.dp-label { min-width: 90px; font-size: 0.95rem; font-weight: 600; text-transform: capitalize; }
.dp-pics { display: flex; gap: 4px; flex-wrap: wrap; }
.dp-pic { font-size: 26px; }
.dp-question { text-align: center; font-size: 1.1rem; font-weight: 700; margin: 10px 0; }
.dp-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 10px auto 0;
}
.dp-option-btn { padding: 12px; border-radius: 14px; font-size: 1.1rem; }
