:root {
  --blue: #2474ff;
  --deep: #1642b7;
  --purple: #7a55ff;
  --yellow: #ffc83d;
  --green: #37c979;
  --pink: #ff7cab;
  --ink: #163061;
  --muted: #6d7aa1;
  --line: rgba(65, 114, 210, 0.18);
  --panel: rgba(255, 255, 255, 0.86);
  --shadow: 0 18px 45px rgba(37, 99, 235, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.95), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(255, 246, 183, 0.55), transparent 20%),
    linear-gradient(180deg, #75c8ff 0%, #eaf7ff 42%, #f7fbff 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 22px 28px 30px;
  overflow: hidden;
}

.sky-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px);
  background-size: 120px 120px, 80px 80px;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  to {
    transform: translate3d(-80px, 60px, 0);
  }
}

.topbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto auto minmax(250px, 1fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.mode-btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #2455c8;
  background: transparent;
  font-weight: 900;
}

.mode-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #5f8cff, #2d63eb);
  box-shadow: 0 10px 22px rgba(45, 99, 235, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 12px 18px rgba(36, 116, 255, 0.24));
}

.brand h1 {
  margin: 0;
  color: #0758c9;
  font-size: 34px;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.8);
}

.brand p {
  margin: 4px 0 0;
  color: #3b568b;
  font-size: 16px;
}

.tabs,
.child-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tab,
.child-pill,
.ghost,
.primary,
.filter,
.form-grid button,
.scratch-actions button {
  border: 0;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tab {
  padding: 12px 18px;
  color: #243f78;
  background: transparent;
  font-weight: 800;
}

.tab.active,
.primary,
.form-grid button,
.scratch-actions button {
  color: #fff;
  background: linear-gradient(180deg, #5f8cff, #2d63eb);
  box-shadow: 0 10px 22px rgba(45, 99, 235, 0.28);
}

.child-switch {
  justify-content: flex-end;
}

.child-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid transparent;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.child-pill.active {
  border-color: #866fff;
}

.child-pill img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
}

main {
  position: relative;
  z-index: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  border: 1px solid rgba(96, 145, 236, 0.22);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 22px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-title h2 {
  margin: 0;
  color: #0758c9;
  font-size: 24px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.child-hero {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 18px 22px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 35%, rgba(255, 216, 90, 0.96), transparent 13%),
    radial-gradient(circle at 15% 40%, rgba(141, 220, 255, 0.7), transparent 20%),
    linear-gradient(105deg, #1642b7, #386dff 52%, #7a55ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.child-hero strong {
  font-size: 24px;
}

.child-hero span {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

input,
select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  padding: 0 14px;
  outline: none;
}

.ghost {
  min-height: 46px;
  padding: 0 18px;
  color: #2455c8;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-weight: 800;
}

.task-section + .task-section {
  margin-top: 18px;
}

.task-section h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  color: #1462df;
  font-size: 18px;
}

.task-section small {
  color: var(--muted);
  font-size: 13px;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.task-card {
  display: grid;
  grid-template-columns: 50px 1fr 30px;
  align-items: center;
  min-height: 86px;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 12px;
}

.task-card.done {
  background: linear-gradient(180deg, rgba(237, 255, 244, 0.94), rgba(255, 255, 255, 0.86));
  border-color: rgba(55, 201, 121, 0.45);
}

.task-card.pending {
  border-color: rgba(255, 189, 46, 0.72);
  box-shadow: 0 12px 24px rgba(255, 181, 46, 0.18);
}

.task-card.readonly {
  cursor: default;
}

.task-card.readonly:not(.done) {
  opacity: 0.82;
}

.task-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff;
  font-size: 30px;
  box-shadow: inset 0 -4px 0 rgba(36, 116, 255, 0.08);
}

.task-copy strong {
  display: block;
  font-size: 15px;
}

.task-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #fff;
  background: #dfe8ff;
  font-weight: 900;
}

.done .check {
  background: var(--green);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stats div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.stats span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.stats strong {
  display: block;
  margin-top: 12px;
  color: #143378;
  font-size: 28px;
}

.progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8ff;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc83d, #4f7cff, #7a55ff);
  transition: width 0.32s ease;
}

.focus-body {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  align-items: center;
}

.focus-body img,
.reward-card > img,
.scratch-info img {
  width: 100%;
  aspect-ratio: 1.15;
  object-fit: contain;
  border-radius: 18px;
  background: linear-gradient(180deg, #e8f3ff, #ffffff);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, var(--purple), #4f7cff);
  font-size: 13px;
  font-weight: 900;
}

.focus-body h3,
.reward-card h3 {
  margin: 8px 0;
  color: #0758c9;
  font-size: 24px;
}

.primary {
  min-height: 44px;
  padding: 0 18px;
  margin-top: 14px;
  font-weight: 900;
}

.reward-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.side-filter {
  align-self: start;
  display: grid;
  gap: 12px;
}

.filter {
  min-height: 50px;
  color: #1b3a78;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 900;
}

.filter.active {
  color: #fff;
  background: linear-gradient(180deg, #5f8cff, #2d63eb);
}

.hero-strip,
.bottom-banner {
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 40%, rgba(255, 200, 61, 0.95), transparent 12%),
    linear-gradient(110deg, #1a58de, #6a65ff 58%, #27b8ff);
  box-shadow: var(--shadow);
}

.hero-strip {
  padding: 24px 34px;
  margin-bottom: 18px;
}

.hero-strip h2,
.hero-strip p {
  margin: 0;
}

.hero-strip h2 {
  font-size: 30px;
}

.hero-strip p {
  margin-top: 8px;
}

.reward-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.reward-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 16px;
}

.reward-card.large {
  grid-column: span 2;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 200, 61, 0.3), transparent 24%),
    linear-gradient(140deg, rgba(28, 75, 210, 0.95), rgba(122, 85, 255, 0.88));
  color: #fff;
}

.reward-card.large h3,
.reward-card.large p,
.reward-card.large .reward-meta {
  color: #fff;
}

.reward-card p {
  min-height: 40px;
  color: var(--muted);
  font-size: 14px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  max-width: 190px;
}

.mini-grid i {
  aspect-ratio: 1;
  border: 1px solid #cbd9ff;
  border-radius: 4px;
  background: #f6f2ff;
}

.mini-grid i.open {
  background: linear-gradient(135deg, #8a72ff 0 50%, #fff 51%);
}

.reward-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #4e5f8d;
  font-size: 13px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-help {
  display: block;
  grid-column: 1 / -1;
  margin-top: -4px;
  color: #60719b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.form-grid button {
  min-height: 46px;
  grid-column: 1 / -1;
  font-weight: 900;
}

.manage-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.manage-list h3 {
  margin: 8px 0 4px;
  color: #1462df;
}

.manage-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.manage-row button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #2455c8;
  background: #edf4ff;
  font-weight: 800;
}

.map-panel {
  min-height: 620px;
  background:
    radial-gradient(circle at 75% 18%, rgba(255, 200, 61, 0.42), transparent 18%),
    linear-gradient(180deg, rgba(15, 55, 178, 0.9), rgba(35, 119, 255, 0.72));
}

.map-panel .panel-title h2 {
  color: #fff;
}

.map-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.map-node {
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  padding: 20px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.map-node.unlocked {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(232, 243, 255, 0.82));
  color: var(--ink);
}

.orbit {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff4b8, #8ddcff);
  font-size: 34px;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2);
}

.bottom-banner {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 22px;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
}

.modal,
.scratch-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 34, 85, 0.35);
  backdrop-filter: blur(10px);
}

.modal.show,
.scratch-modal {
  display: grid;
}

.login-card,
.scratch-card {
  width: min(1080px, 96vw);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(12, 45, 120, 0.28);
}

.login-card {
  width: min(420px, 92vw);
  display: grid;
  gap: 14px;
  padding: 30px;
  text-align: center;
}

.login-card img {
  width: 100px;
  margin: 0 auto;
}

.login-card h2,
.login-card p {
  margin: 0;
}

.login-card button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #5f8cff, #2d63eb);
  font-weight: 900;
}

.login-card .login-child-switch {
  color: #2455c8;
  background: rgba(237, 244, 255, 0.96);
  border: 1px solid rgba(96, 145, 236, 0.28);
  box-shadow: none;
}

.toast-notice {
  position: fixed;
  left: 50%;
  top: 24px;
  z-index: 50;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(520px, calc(100vw - 32px));
  min-height: 86px;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  color: #17346f;
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 232, 119, 0.58), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.96));
  box-shadow: 0 18px 44px rgba(42, 96, 201, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff4b8, #ffc83d);
  font-size: 30px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 10px 22px rgba(255, 190, 44, 0.26);
}

.toast-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.toast-copy strong {
  color: #0758c9;
  font-size: 18px;
  line-height: 1.2;
}

.toast-copy small {
  color: #53658f;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.toast-warning {
  border-color: rgba(255, 207, 73, 0.72);
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 225, 94, 0.74), transparent 24%),
    linear-gradient(180deg, #fffdf4, #fff8d9);
}

.toast-warning .toast-copy strong {
  color: #d56b00;
}

.toast-notice.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.scratch-card {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr auto;
  gap: 18px;
  padding: 24px;
}

.close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #315ed7;
  font-size: 24px;
}

.scratch-info {
  display: grid;
  align-content: start;
  gap: 12px;
}

.scratch-info h2 {
  margin: 10px 0 8px;
  color: #0758c9;
}

.scratch-grid {
  display: grid;
  gap: 5px;
  min-height: 480px;
  border: 6px solid #326fff;
  border-radius: 18px;
  padding: 8px;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #d9ecff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.scratch-grid:active {
  cursor: grabbing;
}

.scratch-grid span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(191, 142, 29, 0.38);
  border-radius: 8px;
  color: #fff2c1;
  background:
    linear-gradient(135deg, rgba(255, 247, 213, 0.96), rgba(255, 207, 99, 0.98));
  box-shadow: inset 0 -3px 0 rgba(175, 103, 22, 0.14);
  font-size: 18px;
  font-weight: 900;
}

.scratch-grid span.open {
  opacity: 0;
}

.scratch-grid span.scratching {
  animation: scratch-pop 0.18s ease forwards;
}

@keyframes scratch-pop {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.72) rotate(5deg);
    opacity: 0;
  }
}

.scratch-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.scratch-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  color: #1b3a78;
  background: linear-gradient(180deg, #fff9dc, #eaf3ff);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(65, 114, 210, 0.16);
}

.scratch-live {
  color: #2455c8;
  font-weight: 900;
}

.child-mode .tabs {
  background: rgba(255, 255, 255, 0.76);
}

.child-mode .panel {
  background: rgba(255, 255, 255, 0.9);
}

.child-mode .reward-focus,
.child-mode .map-panel {
  border-color: rgba(255, 255, 255, 0.52);
}

.parent-mode .child-hero {
  display: none;
}

.parent-mode .brand h1::after {
  content: " 家长后台";
  display: inline-block;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: #2d63eb;
  font-size: 14px;
  vertical-align: middle;
}

button:hover {
  transform: translateY(-1px);
}

@media (max-width: 1180px) {
  .topbar,
  .grid.two,
  .reward-layout {
    grid-template-columns: 1fr;
  }

  .tabs,
  .child-switch {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .reward-cards,
  .map-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .brand h1 {
    font-size: 26px;
  }

  .task-list,
  .stats,
  .reward-cards,
  .map-nodes,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .reward-card,
  .reward-card.large,
  .focus-body,
  .scratch-card {
    grid-template-columns: 1fr;
  }

  .scratch-grid {
    min-height: 360px;
  }

  .bottom-banner {
    font-size: 22px;
  }
}

/* High fidelity visual pass for the supplied 1920x1080 mockups. */
body {
  background:
    radial-gradient(circle at 4% 76%, rgba(255, 255, 255, 0.92) 0 7%, transparent 16%),
    radial-gradient(circle at 94% 15%, rgba(255, 255, 255, 0.78) 0 6%, transparent 15%),
    linear-gradient(180deg, #53b7ff 0%, #bfeaff 16%, #edf8ff 52%, #f8fcff 100%);
}

.app-shell {
  max-width: 1920px;
  margin: 0 auto;
  padding: 24px 34px 28px;
}

.sky-bg::before,
.sky-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.sky-bg::before {
  left: 0;
  right: 0;
  top: 118px;
  height: 160px;
  background:
    radial-gradient(ellipse at 7% 90%, rgba(255,255,255,.95) 0 13%, transparent 14%),
    radial-gradient(ellipse at 17% 82%, rgba(255,255,255,.75) 0 9%, transparent 10%),
    radial-gradient(ellipse at 84% 28%, rgba(255,255,255,.84) 0 7%, transparent 8%),
    radial-gradient(ellipse at 92% 24%, rgba(255,255,255,.7) 0 10%, transparent 11%);
}

.sky-bg::after {
  right: 28px;
  top: 22px;
  width: 78px;
  height: 78px;
  background: url("rewards/planet.svg") center/contain no-repeat;
  transform: rotate(38deg);
  filter: drop-shadow(0 10px 18px rgba(36, 116, 255, .26));
}

.topbar {
  grid-template-columns: 480px auto auto 1fr;
  gap: 18px;
  min-height: 92px;
  margin-bottom: 18px;
}

.brand-logo {
  width: 96px;
  height: 96px;
}

.brand h1 {
  font-size: 40px;
  font-weight: 1000;
  line-height: 1;
  color: #075bd6;
  -webkit-text-stroke: 1px rgba(255,255,255,.58);
}

.brand p {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
}

.mode-switch {
  order: 3;
}

.tabs {
  order: 2;
  min-height: 78px;
  padding: 10px 16px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 #fff, 0 14px 34px rgba(30, 104, 223, .12);
}

.tab {
  min-height: 56px;
  min-width: 132px;
  padding: 0 22px;
  font-size: 18px;
}

.tab.active {
  background: #fff;
  color: #1b66ff;
  box-shadow: 0 10px 24px rgba(39, 105, 255, .18);
}

.child-switch {
  order: 4;
  gap: 14px;
}

.child-pill {
  min-height: 76px;
  padding: 8px 28px 8px 12px;
  border-radius: 34px;
  font-size: 20px;
  background: rgba(255,255,255,.92);
  border: 3px solid rgba(139, 124, 255, .35);
}

.child-pill img {
  width: 58px;
  height: 58px;
}

.panel {
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(109, 158, 240, .24);
  box-shadow: 0 12px 32px rgba(32, 97, 192, .12), inset 0 1px 0 rgba(255,255,255,.96);
}

.panel-title h2 {
  font-size: 28px;
  font-weight: 1000;
}

.grid.two {
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
}

.kid-task-board,
.parent-task-board {
  display: grid;
  gap: 18px;
}

.task-goal {
  min-height: 44px;
  color: #1d3b78;
  font-size: 18px;
  font-weight: 900;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,246,219,.7));
}

.task-columns {
  display: grid;
  grid-template-columns: 1.05fr 1.55fr .75fr;
  gap: 16px;
}

.task-section {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.74), rgba(246,250,255,.66));
  border: 1px solid rgba(99, 145, 225, .18);
}

.task-section.choice {
  border-color: rgba(129, 86, 255, .25);
  background: linear-gradient(180deg, rgba(250,247,255,.86), rgba(255,255,255,.7));
}

.task-section.challenge {
  border-color: rgba(255, 154, 61, .32);
  background: linear-gradient(180deg, rgba(255,246,233,.86), rgba(255,255,255,.7));
}

.task-section h3 {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 8px;
  justify-content: center;
  text-align: center;
  margin-bottom: 14px;
}

.task-section h3 span,
.task-section h3 b {
  font-size: 22px;
  color: #1765ef;
}

.task-section h3 small {
  grid-column: 1 / -1;
  font-size: 14px;
}

.task-list {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.task-card {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 178px;
  padding: 14px;
  text-align: center;
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  border: 2px solid rgba(42, 127, 255, .22);
  box-shadow: inset 0 -5px 0 rgba(36, 116, 255, .04);
}

.task-section.choice .task-card {
  border-color: rgba(121, 80, 255, .3);
}

.task-section.challenge .task-card {
  border-color: rgba(255, 154, 61, .36);
}

.task-icon {
  width: 82px;
  height: 76px;
  border-radius: 20px;
  font-size: 52px;
  background: transparent;
  box-shadow: none;
}

.task-copy strong {
  font-size: 18px;
  line-height: 1.25;
}

.task-copy small {
  font-size: 15px;
  font-weight: 800;
}

.check {
  width: auto;
  min-width: 92px;
  height: 34px;
  border-radius: 999px;
  color: #59657f;
  background: #f7faff;
}

.done .check {
  color: #178d53;
  background: #dff9eb;
}

.done .check::after {
  content: " 已完成";
}

.task-card:not(.done) .check::after {
  content: " 待完成";
}

.save-record {
  justify-self: center;
  min-width: 400px;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #6f98ff, #3166ee);
  box-shadow: 0 12px 26px rgba(50, 105, 238, .28);
  font-size: 20px;
  font-weight: 1000;
}

.save-record:disabled {
  cursor: not-allowed;
  color: #7b89ad;
  background: linear-gradient(180deg, #eef3ff, #dde6fb);
  box-shadow: none;
}

.save-note {
  margin: -6px 0 0;
  text-align: center;
  color: #65739a;
  font-weight: 800;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
}

.stats div {
  border-radius: 16px;
  min-height: 116px;
  text-align: center;
}

.stats strong {
  font-size: 34px;
  color: #143378;
}

.stats em {
  display: block;
  margin-top: 8px;
  color: #627096;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.reward-focus {
  min-height: 280px;
}

.focus-body {
  grid-template-columns: 260px 1fr;
}

.reward-moon {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 35%, rgba(255, 224, 132, .82), transparent 26%),
    linear-gradient(135deg, #0c43c9, #0e7dff 54%, #6caeff);
}

.reward-moon::before {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff4c7, #ffdf86 58%, rgba(255,222,136,.55));
  opacity: .84;
  right: -36px;
  top: -20px;
}

.reward-moon img {
  position: relative;
  z-index: 1;
  width: 180px;
  background: transparent;
  filter: drop-shadow(0 18px 22px rgba(0, 43, 124, .28));
}

.reward-moon .moon-mask {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 2;
  width: 200px;
  opacity: .92;
}

.focus-copy h3 {
  font-size: 30px;
  font-weight: 1000;
}

.focus-copy p {
  font-size: 17px;
  font-weight: 800;
}

.focus-copy strong {
  color: #ffc83d;
  font-size: 40px;
}

.focus-hint {
  color: #4e6aa6;
}

.bar {
  height: 16px;
}

.reward-layout {
  grid-template-columns: 270px 1fr;
}

.side-filter {
  min-height: 775px;
  padding: 20px 14px;
  background: rgba(255,255,255,.88);
}

.filter {
  min-height: 68px;
  justify-content: flex-start;
  padding-left: 24px;
  font-size: 20px;
}

.filter::before {
  content: "⭐";
  margin-right: 12px;
}

.hero-strip {
  min-height: 142px;
  display: grid;
  align-content: center;
  padding-left: 72px;
  background:
    radial-gradient(circle at 78% 42%, rgba(255, 227, 82, .95), transparent 12%),
    radial-gradient(circle at 91% 36%, rgba(117, 178, 255, .55), transparent 18%),
    linear-gradient(110deg, #1d68ff, #4f7cff 54%, #895cff);
}

.hero-strip h2 {
  font-size: 36px;
  font-weight: 1000;
}

.reward-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.reward-card {
  grid-template-columns: 1fr;
  min-height: 292px;
  padding: 16px;
  border-radius: 20px;
}

.reward-card > img {
  height: 116px;
  aspect-ratio: auto;
  object-fit: contain;
}

.reward-card.large {
  grid-column: span 1;
  grid-row: span 2;
  min-height: 390px;
}

.mini-grid {
  grid-template-columns: repeat(5, 1fr);
  max-width: 150px;
}

.map-panel {
  min-height: 780px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(34,128,255,.16), rgba(255,255,255,.7));
}

.map-panel > .panel-title {
  display: none;
}

.adventure-map {
  display: grid;
  grid-template-columns: 330px 1fr 330px;
  gap: 16px;
  min-height: 780px;
}

.map-task-rail,
.map-progress-card {
  margin: 0;
  padding: 24px;
  background: rgba(255,255,255,.9);
}

.map-task-rail h3,
.map-progress-card h3 {
  margin: 0 0 18px;
  color: #0758c9;
  font-size: 26px;
}

.rail-task {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(78, 124, 255, .18);
  background: #fff;
}

.rail-task span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f3f8ff;
  font-size: 34px;
}

.rail-task b {
  color: #17346f;
}

.rail-task small {
  grid-column: 2 / 4;
  color: #6a77a0;
  font-weight: 800;
}

.rail-task.done {
  background: linear-gradient(180deg, #f0fff7, #fff);
}

.energy-box {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: #f7fbff;
}

.energy-box strong {
  color: #155ee7;
  font-size: 30px;
}

.energy-box i,
.level-card i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc83d, #5f76ff);
}

.planet-path {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 38% 56%, rgba(88, 192, 255, .38), transparent 18%),
    radial-gradient(circle at 72% 18%, rgba(255, 217, 98, .4), transparent 14%),
    linear-gradient(180deg, #061f95, #0c58df 48%, #3ba5ff);
}

.planet-path::before {
  content: "";
  position: absolute;
  inset: 15% 7% 10% 7%;
  border: 9px solid rgba(255, 234, 142, .7);
  border-left-color: transparent;
  border-bottom-color: rgba(255, 234, 142, .35);
  border-radius: 50%;
  transform: rotate(-15deg);
  filter: drop-shadow(0 0 16px rgba(255,225,102,.8));
}

.planet-path h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 42px;
  text-shadow: 0 4px 0 rgba(0,0,0,.12);
}

.planet-path p {
  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 20px;
  font-weight: 900;
}

.planet-stage {
  position: relative;
  height: 590px;
}

.map-node {
  position: absolute;
  width: 190px;
  min-height: 150px;
  text-align: center;
  padding: 14px;
  border-radius: 28px;
  background: rgba(255,255,255,.22);
}

.map-node .orbit {
  width: 96px;
  height: 96px;
  margin: 0 auto 8px;
  font-size: 52px;
}

.map-node strong {
  display: block;
  color: #fff;
  font-size: 17px;
}

.star-row {
  color: #ffd24d;
  font-size: 22px;
  letter-spacing: 1px;
}

.map-node.unlocked {
  color: #17346f;
  background: rgba(255,255,255,.88);
}

.map-node.unlocked strong {
  color: #155ee7;
}

.node-1 { left: 3%; bottom: 10%; }
.node-2 { left: 18%; bottom: 27%; }
.node-3 { left: 34%; bottom: 8%; }
.node-4 { left: 36%; top: 26%; }
.node-5 { left: 58%; top: 30%; }
.node-6 { left: 66%; bottom: 14%; }
.node-7 { right: 6%; bottom: 28%; }
.node-8 { right: 6%; top: 8%; }

.level-card,
.side-stat {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(99, 145, 225, .18);
}

.level-card strong {
  color: #754dff;
  font-size: 44px;
}

.side-stat strong {
  color: #155ee7;
  font-size: 28px;
}

.big-adventure {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 999px;
  color: #9a4b00;
  background: linear-gradient(180deg, #ffe979, #ffb41f);
  box-shadow: 0 12px 22px rgba(255, 174, 31, .28);
  font-size: 24px;
  font-weight: 1000;
}

.bottom-banner {
  min-height: 94px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 52%, rgba(255, 223, 84, .95), transparent 9%),
    radial-gradient(circle at 85% 50%, rgba(73, 218, 255, .75), transparent 12%),
    linear-gradient(90deg, #755eff, #447dff 52%, #8758ff);
  text-shadow: 0 3px 0 rgba(0,0,0,.1);
}

.scratch-card {
  width: min(1820px, 96vw);
  min-height: 780px;
  grid-template-columns: 520px 1fr 330px;
  background: rgba(245, 250, 255, .96);
}

.scratch-info {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.88);
}

.scratch-info img {
  height: 230px;
}

.scratch-info h2 {
  font-size: 34px;
}

.scratch-grid {
  min-height: 650px;
  gap: 4px;
  border-radius: 22px;
  border-width: 7px;
  background-size: 76%;
  background-color: #123fc2;
  box-shadow: 0 14px 32px rgba(17, 80, 220, .28);
}

.scratch-grid span {
  min-height: 58px;
  border-radius: 9px;
  font-size: 26px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.7), transparent 28%),
    linear-gradient(135deg, #fff9dc, #ffd77b);
}

.scratch-actions {
  grid-column: 2 / 3;
}

.scratch-tip {
  min-width: 560px;
}

.scratch-side {
  padding: 24px;
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 #fff;
}

.scratch-side h3 {
  margin: 0 0 18px;
  color: #0758c9;
  font-size: 26px;
}

.stage-badge {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 0 20px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #ffd04e, #8758ff);
  font-size: 22px;
  font-weight: 1000;
}

.scratch-side p {
  color: #33528f;
  font-weight: 900;
}

.stage-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.stage-line i {
  height: 12px;
  border-radius: 999px;
  background: #dfe8ff;
}

.stage-line i.active {
  background: linear-gradient(90deg, #ffc83d, #6f63ff);
}

@media (max-width: 1400px) {
  .topbar,
  .adventure-map,
  .scratch-card {
    grid-template-columns: 1fr;
  }

  .planet-stage {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .map-node {
    position: relative;
    inset: auto !important;
    width: auto;
  }
}

/* High fidelity polish pass for the BT production review. */
body.child-mode {
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.9), transparent 22%),
    radial-gradient(circle at 76% 19%, rgba(255, 218, 88, 0.42), transparent 17%),
    radial-gradient(circle at 90% 74%, rgba(67, 124, 255, 0.24), transparent 24%),
    linear-gradient(180deg, #78cfff 0%, #dff5ff 46%, #f7fbff 100%);
}

.app-shell {
  max-width: 1920px;
  margin: 0 auto;
}

.topbar::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 92px;
  height: 92px;
  pointer-events: none;
  background:
    radial-gradient(circle at 52% 18%, #fff 0 6px, transparent 7px),
    linear-gradient(140deg, transparent 18%, rgba(255, 195, 55, 0.94) 19% 34%, transparent 35%),
    linear-gradient(160deg, #fff 0 28%, #4f8dff 29% 68%, #ff9c32 69%);
  clip-path: polygon(50% 0, 73% 58%, 100% 100%, 55% 80%, 18% 100%, 34% 58%);
  filter: drop-shadow(0 14px 16px rgba(36, 116, 255, 0.22));
  transform: rotate(18deg);
}

.mode-switch {
  transform: translateY(2px);
}

.mode-btn {
  min-height: 38px;
  padding: 0 14px;
}

.tabs {
  justify-content: center;
  min-height: 70px;
  padding: 10px 18px;
}

.tab {
  min-width: 118px;
  min-height: 50px;
  padding: 0 20px;
}

.child-mode .tab[data-view="settings"] {
  display: none !important;
}

.child-mode .child-hero {
  display: none !important;
}

.child-mode .toolbar {
  max-width: 170px;
  margin: -4px 0 18px;
}

.child-mode #addChildBtn {
  display: none !important;
}

.child-mode .panel {
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84)),
    radial-gradient(circle at 90% 10%, rgba(255, 238, 147, 0.32), transparent 24%);
}

.kid-task-board {
  position: relative;
}

.kid-task-board .task-goal,
.parent-task-board .task-goal {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: -48px 0 22px 280px;
  padding: 0 18px;
  border-radius: 999px;
  color: #233e76;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.kid-task-board .task-columns,
.parent-task-board .task-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 0.58fr;
  gap: 18px;
}

.kid-task-board .task-section,
.parent-task-board .task-section {
  min-height: 292px;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(89, 143, 255, 0.22);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 205, 62, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(247, 251, 255, 0.92), rgba(255, 255, 255, 0.72));
}

.kid-task-board .task-section.choice,
.parent-task-board .task-section.choice {
  border-color: rgba(133, 95, 255, 0.3);
  background:
    radial-gradient(circle at 88% 7%, rgba(166, 121, 255, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(251, 248, 255, 0.94), rgba(255, 255, 255, 0.72));
}

.kid-task-board .task-section.challenge,
.parent-task-board .task-section.challenge {
  border-color: rgba(255, 155, 66, 0.32);
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 173, 66, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 248, 239, 0.96), rgba(255, 255, 255, 0.75));
}

.kid-task-board .task-section h3,
.parent-task-board .task-section h3 {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px 8px;
  min-height: 56px;
  margin-bottom: 14px;
}

.kid-task-board .task-section h3 span,
.parent-task-board .task-section h3 span {
  font-size: 19px;
}

.kid-task-board .task-section h3 b,
.parent-task-board .task-section h3 b {
  color: #236cff;
  font-size: 25px;
}

.kid-task-board .task-section h3 small,
.parent-task-board .task-section h3 small {
  grid-column: 1 / -1;
}

.kid-task-board .task-list,
.parent-task-board .task-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kid-task-board .task-section.choice .task-list,
.parent-task-board .task-section.choice .task-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kid-task-board .task-section.challenge .task-list,
.parent-task-board .task-section.challenge .task-list {
  grid-template-columns: 1fr;
}

.kid-task-board .task-card,
.parent-task-board .task-card {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 156px;
  padding: 14px 10px;
  text-align: center;
  border-radius: 18px;
}

.kid-task-board .task-icon,
.parent-task-board .task-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  font-size: 39px;
}

.kid-task-board .task-copy strong,
.parent-task-board .task-copy strong {
  min-height: 38px;
  font-size: 17px;
}

.kid-task-board .check,
.parent-task-board .check {
  width: auto;
  min-width: 86px;
  height: 30px;
  border-radius: 999px;
}

.kid-task-board .check::before,
.parent-task-board .check::before {
  content: "待完成";
  color: #556894;
}

.kid-task-board .done .check::before,
.parent-task-board .done .check::before {
  content: "已完成";
  color: #fff;
}

.kid-task-board .done .check,
.parent-task-board .done .check {
  font-size: 0;
}

.child-mode .stats div {
  min-height: 128px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(248,251,255,0.82));
}

.child-mode .stats strong {
  font-size: 34px;
}

.child-mode .reward-focus {
  min-height: 370px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 225, 139, 0.96) 0 64px, rgba(255, 210, 92, 0.28) 65px 150px, transparent 151px),
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.92) 0 2px, transparent 3px),
    linear-gradient(135deg, #0744bd 0%, #155ff2 48%, #1627a0 100%);
}

.child-mode .reward-focus .panel-title h2,
.child-mode .reward-focus h3,
.child-mode .reward-focus p,
.child-mode .reward-focus .focus-hint {
  color: #fff;
}

.child-mode .focus-body {
  grid-template-columns: minmax(230px, 0.9fr) 1fr;
  min-height: 270px;
}

.reward-moon {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 53% 48%, rgba(255, 247, 207, 0.95) 0 38%, rgba(246, 220, 137, 0.88) 39% 56%, transparent 57%),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
}

.reward-moon::after {
  content: "";
  position: absolute;
  width: 94%;
  height: 34%;
  border: 10px solid rgba(177, 221, 255, 0.86);
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-16deg);
  filter: blur(0.2px);
}

.reward-moon img {
  position: relative;
  z-index: 1;
  width: min(190px, 72%);
  background: transparent;
  filter: drop-shadow(0 22px 24px rgba(0, 32, 110, 0.25));
}

.reward-moon .moon-mask {
  position: absolute;
  inset: 24px;
  z-index: 2;
  opacity: 0.92;
}

.child-mode .bottom-banner {
  min-height: 96px;
  display: grid;
  place-items: center;
  font-size: 32px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 42%, #ffe87a 0 28px, transparent 29px),
    radial-gradient(circle at 90% 46%, #6de0ff 0 36px, transparent 37px),
    linear-gradient(100deg, #285be6, #7266ff 58%, #12b9ff);
}

.hero-strip {
  min-height: 150px;
  padding-left: 72px;
  background:
    radial-gradient(circle at 86% 28%, #ffe87a 0 54px, transparent 55px),
    radial-gradient(circle at 94% 62%, rgba(255,255,255,0.26) 0 76px, transparent 77px),
    linear-gradient(105deg, #0b55df, #386dff 48%, #8164ff);
}

.reward-card {
  min-height: 236px;
  border-radius: 18px;
}

.reward-card.large {
  box-shadow: 0 0 0 3px rgba(184, 111, 255, 0.38), var(--shadow);
}

.scratch-grid span {
  user-select: none;
  touch-action: none;
}

@media (max-width: 1400px) {
  .topbar {
    grid-template-columns: 390px 170px minmax(420px, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 14px 18px;
  }

  .topbar .brand {
    grid-row: 1 / 3;
  }

  .topbar .tabs {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .topbar .mode-switch {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .topbar .child-switch {
    grid-column: 3;
    grid-row: 2;
    justify-content: end;
  }

  .topbar::after {
    width: 74px;
    height: 74px;
    right: 2px;
    top: -4px;
  }

  .kid-task-board .task-goal,
  .parent-task-board .task-goal {
    margin: 0 0 18px;
  }

  .kid-task-board .task-columns,
  .parent-task-board .task-columns {
    grid-template-columns: 1fr;
  }

  .kid-task-board .task-section,
  .parent-task-board .task-section {
    min-height: auto;
  }

  .child-mode .focus-body {
    grid-template-columns: 0.7fr 1fr;
  }

  .adventure-map {
    grid-template-columns: 320px minmax(520px, 1fr) 260px;
  }

  .planet-path {
    padding: 28px;
  }

  .map-progress-card {
    padding: 22px 18px;
  }
}

.kid-task-board .check,
.parent-task-board .check {
  font-size: 0;
}

.kid-task-board .check::before,
.parent-task-board .check::before {
  font-size: 13px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar .brand,
  .topbar .tabs,
  .topbar .mode-switch,
  .topbar .child-switch {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .child-switch {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    padding: 14px 12px 22px;
    overflow: visible;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
  }

  .topbar::after {
    width: 54px;
    height: 54px;
    right: 8px;
    top: 2px;
  }

  .brand {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    width: 100%;
    gap: 10px;
    align-items: center;
  }

  .brand-logo {
    width: 68px;
    height: 68px;
  }

  .brand h1 {
    max-width: 100%;
    font-size: 30px;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .brand p {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.35;
  }

  .mode-switch,
  .tabs,
  .child-switch {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mode-switch::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .child-switch::-webkit-scrollbar {
    display: none;
  }

  .mode-switch {
    justify-content: flex-start;
    min-height: 58px;
    padding: 7px;
  }

  .mode-btn {
    flex: 0 0 auto;
    min-width: 102px;
    min-height: 42px;
    white-space: nowrap;
  }

  .tabs {
    justify-content: flex-start;
    min-height: 62px;
    padding: 7px;
  }

  .tab {
    flex: 0 0 auto;
    min-width: 102px;
    min-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .child-switch {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding-bottom: 2px;
    justify-content: flex-start !important;
    justify-self: stretch !important;
  }

  .child-pill {
    flex: 1 0 calc((100% - 20px) / 3);
    min-width: 0;
    padding: 7px 8px;
    gap: 6px;
  }

  .child-pill img {
    width: 34px;
    height: 34px;
  }

  .child-pill span {
    font-size: 16px;
    white-space: nowrap;
  }

  .grid.two,
  .reward-layout,
  .scratch-card,
  .focus-body,
  .child-mode .focus-body {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .panel-title h2 {
    font-size: 22px;
    line-height: 1.25;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  input,
  select,
  .ghost {
    width: 100%;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats div {
    min-height: 112px;
    padding: 12px;
  }

  .stats strong {
    font-size: 28px;
  }

  .progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kid-task-board .task-columns,
  .parent-task-board .task-columns {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .kid-task-board .task-section,
  .parent-task-board .task-section {
    padding: 14px;
  }

  .kid-task-board .task-list,
  .parent-task-board .task-list,
  .kid-task-board .task-section.choice .task-list,
  .parent-task-board .task-section.choice .task-list {
    grid-template-columns: 1fr;
  }

  .kid-task-board .task-card,
  .parent-task-board .task-card {
    grid-template-columns: 58px 1fr auto;
    justify-items: stretch;
    min-height: 92px;
    text-align: left;
  }

  .kid-task-board .task-icon,
  .parent-task-board .task-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 30px;
  }

  .kid-task-board .task-copy strong,
  .parent-task-board .task-copy strong {
    min-height: 0;
    font-size: 16px;
  }

  .reward-moon {
    min-height: 210px;
  }

  .child-mode .reward-focus {
    min-height: auto;
  }

  .reward-cards {
    grid-template-columns: 1fr;
  }

  .reward-card,
  .reward-card.large {
    grid-column: auto;
    grid-template-columns: 112px 1fr;
    min-height: 190px;
    padding: 12px;
  }

  .hero-strip {
    min-height: auto;
    padding: 22px;
  }

  .hero-strip h2 {
    font-size: 24px;
    line-height: 1.2;
  }

  .side-filter {
    display: flex;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    gap: 8px;
    border-radius: 18px;
    position: sticky;
    top: 0;
    z-index: 4;
    scrollbar-width: none;
  }

  .side-filter::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: 0 0 auto;
    width: auto;
    min-width: 104px;
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    white-space: nowrap;
    justify-content: center;
  }

  .adventure-map {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .map-task-rail,
  .map-progress-card {
    padding: 18px;
  }

  .planet-path {
    padding: 22px;
  }

  .planet-path h2 {
    font-size: 32px;
  }

  .planet-path p {
    font-size: 16px;
    line-height: 1.35;
  }

  .planet-stage {
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .map-node {
    position: relative;
    inset: auto !important;
    width: 100%;
    min-height: 122px;
  }

  .scratch-modal {
    padding: 10px;
    align-items: start;
    overflow-y: auto;
  }

  .scratch-card {
    width: 100%;
    max-height: none;
    padding: 16px;
    border-radius: 20px;
  }

  .scratch-info {
    grid-template-columns: 84px 1fr;
  }

  .scratch-grid {
    min-height: 360px;
  }

  .scratch-grid span {
    min-width: 28px;
    min-height: 28px;
  }

  .bottom-banner {
    min-height: 78px;
    padding: 16px;
    font-size: 22px;
    line-height: 1.25;
  }

  .form-grid,
  .manage-row {
    grid-template-columns: 1fr;
  }
}

/* Polish 14: stable responsive growth map. */
.map-panel {
  min-height: auto !important;
  padding: clamp(14px, 2vw, 22px) !important;
  overflow: visible !important;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.9), transparent 18%),
    radial-gradient(circle at 88% 10%, rgba(255, 220, 95, 0.34), transparent 16%),
    linear-gradient(180deg, rgba(234, 247, 255, 0.96), rgba(255, 255, 255, 0.88)) !important;
}

.map-panel > .panel-title {
  display: flex !important;
}

.map-v2 {
  display: grid !important;
  grid-template-columns: minmax(230px, 0.72fr) minmax(420px, 1.45fr) minmax(250px, 0.82fr) !important;
  gap: 18px !important;
  min-height: auto !important;
  align-items: stretch;
}

.map-v2 .map-task-rail,
.map-v2 .map-progress-card,
.map-v2 .planet-path {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(90, 143, 240, 0.2);
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(32, 97, 192, 0.12);
}

.map-v2 .map-task-rail,
.map-v2 .map-progress-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 224, 98, 0.24), transparent 24%),
    rgba(255, 255, 255, 0.92);
}

.map-section-title {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.map-section-title > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #eff7ff, #ffffff);
  font-size: 26px;
  box-shadow: inset 0 -4px 0 rgba(36, 116, 255, 0.08);
}

.map-section-title h3,
.map-section-title p {
  margin: 0;
}

.map-section-title h3 {
  color: #0758c9;
  font-size: 22px;
}

.map-section-title p {
  margin-top: 3px;
  color: #65739a;
  font-size: 13px;
  font-weight: 800;
}

.map-v2 .rail-task {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 72px;
  margin-bottom: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.map-v2 .rail-task span {
  width: 44px;
  height: 44px;
  font-size: 26px;
}

.map-v2 .rail-task small {
  grid-column: 2;
}

.map-v2 .energy-box {
  margin-top: 4px;
}

.map-v2 .planet-path {
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 32px);
  color: #fff;
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 226, 105, 0.72), transparent 14%),
    radial-gradient(circle at 16% 74%, rgba(82, 213, 255, 0.38), transparent 18%),
    linear-gradient(135deg, #0a44c5 0%, #1669ee 48%, #694dff 100%);
}

.map-v2 .planet-path::before {
  inset: 15% 5% 12%;
  border-width: 5px;
  opacity: 0.34;
}

.map-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: 720px;
}

.map-hero-copy > span {
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.map-hero-copy h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.map-hero-copy p {
  display: block;
  max-width: 620px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1.5;
}

.map-v2 .planet-stage {
  position: relative;
  z-index: 1;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px;
  height: auto !important;
  margin-top: 0;
}

.map-v2 .map-node {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  min-height: 142px;
  display: grid;
  grid-template-columns: auto 62px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 10px 12px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.map-v2 .map-node.unlocked {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.7);
}

.map-step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #155ee7;
  background: #fff;
  font-size: 14px;
  font-weight: 1000;
}

.map-v2 .map-node .orbit {
  width: 62px;
  height: 62px;
  margin: 0;
  font-size: 34px;
}

.map-node-copy {
  display: grid;
  gap: 6px;
}

.map-node-copy strong {
  color: #fff;
  font-size: 18px;
}

.map-node.unlocked .map-node-copy strong {
  color: #155ee7;
}

.map-node-copy small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.map-node.unlocked .map-node-copy small {
  color: #60719d;
}

.map-node-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.map-node-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc83d, #7a55ff);
}

.map-v2 .star-row {
  grid-column: 1 / -1;
  justify-self: end;
  font-size: 18px;
}

.map-v2 .map-progress-card {
  grid-template-columns: 1fr;
}

.map-v2 .level-card,
.map-v2 .side-stat {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
}

.map-v2 .level-card strong {
  font-size: 38px;
}

.map-v2 .side-stat strong {
  font-size: 24px;
}

.map-v2 .big-adventure {
  min-height: 56px;
  font-size: 20px;
}

@media (max-width: 1280px) {
  .map-v2 {
    grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr) !important;
  }

  .map-v2 .map-progress-card {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .map-v2 .map-progress-card .map-section-title,
  .map-v2 .map-progress-card .big-adventure {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .map-v2 {
    grid-template-columns: 1fr !important;
  }

  .map-v2 .map-task-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-v2 .map-task-rail .map-section-title,
  .map-v2 .map-task-rail .energy-box {
    grid-column: 1 / -1;
  }

  .map-v2 .map-progress-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-v2 .map-progress-card .map-section-title,
  .map-v2 .map-progress-card .big-adventure {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .map-panel {
    padding: 12px !important;
  }

  .map-v2 {
    gap: 12px !important;
  }

  .map-v2 .map-task-rail,
  .map-v2 .map-progress-card,
  .map-v2 .planet-path {
    padding: 14px;
    border-radius: 18px;
  }

  .map-v2 .map-task-rail,
  .map-v2 .planet-stage,
  .map-v2 .map-progress-card {
    grid-template-columns: 1fr !important;
  }

  .map-v2 .map-node {
    grid-template-columns: 26px 54px minmax(0, 1fr);
    min-height: 118px;
    padding: 12px;
  }

  .map-v2 .map-node .orbit {
    width: 54px;
    height: 54px;
    font-size: 30px;
  }

  .map-hero-copy h2 {
    font-size: 28px;
  }

  .map-hero-copy p {
    font-size: 14px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .app-shell {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar .brand,
  .topbar .tabs,
  .topbar .mode-switch,
  .topbar .child-switch {
    grid-column: 1;
    grid-row: auto;
  }

  .grid.two,
  .reward-layout,
  .adventure-map {
    grid-template-columns: 1fr;
  }

  .kid-task-board .task-list,
  .parent-task-board .task-list,
  .kid-task-board .task-section.choice .task-list,
  .parent-task-board .task-section.choice .task-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reward-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reward-card.large {
    grid-column: span 2;
  }

  .planet-stage {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .map-node {
    position: relative;
    inset: auto !important;
    width: 100%;
  }
}

/* Polish 12: product acceptance fixes for landscape phones, tablets, and form feedback. */
.form-grid button:disabled,
.form-grid button.is-loading,
.primary:disabled {
  cursor: not-allowed;
  color: #7b89ad;
  background: linear-gradient(180deg, #eef3ff, #dde6fb);
  box-shadow: none;
  transform: none;
}

.reward-card > img,
.focus-body img,
.scratch-info img {
  display: block;
  inline-size: 100%;
  max-block-size: 210px;
  object-fit: contain;
  object-position: center;
  padding: 12px;
  background:
    radial-gradient(circle at 62% 34%, rgba(255, 224, 98, 0.38), transparent 34%),
    linear-gradient(180deg, #eef7ff, #ffffff);
}

.reward-card > img {
  min-block-size: 148px;
}

.reward-card.large > img {
  background:
    radial-gradient(circle at 52% 44%, rgba(255, 224, 98, 0.48), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(221, 236, 255, 0.9));
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 12px 16px;
  }

  .topbar .brand {
    grid-column: 1;
    grid-row: 1 / 3;
    min-width: 0;
  }

  .topbar .tabs {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar .tabs::-webkit-scrollbar {
    display: none;
  }

  .topbar .mode-switch,
  .topbar .child-switch {
    grid-row: 2;
    min-width: 0;
  }

  .topbar .mode-switch {
    grid-column: 2;
    justify-self: start;
  }

  .topbar .child-switch {
    grid-column: 2;
    justify-self: end;
    max-width: min(100%, 560px);
    overflow-x: auto;
    padding-right: 70px;
    scrollbar-width: none;
  }

  .topbar .child-switch::-webkit-scrollbar {
    display: none;
  }

  .topbar::after {
    width: 58px;
    height: 58px;
    right: 4px;
    top: 22px;
  }

  .parent-task-board .task-list,
  .parent-task-board .task-section.choice .task-list {
    grid-template-columns: 1fr;
  }

  .parent-task-board .task-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    justify-items: stretch;
    min-height: 82px;
    padding: 10px;
    text-align: left;
  }

  .parent-task-board .task-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    font-size: 28px;
  }

  .parent-task-board .task-copy strong {
    min-height: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .parent-task-board .task-copy small {
    line-height: 1.25;
  }

  .parent-task-board .check {
    align-self: center;
  }
}

@media (max-width: 1400px) {
  .adventure-map {
    grid-template-columns: minmax(250px, 0.82fr) minmax(0, 1.18fr);
    min-height: auto;
  }

  .planet-path {
    min-width: 0;
  }

  .map-progress-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .map-progress-card h3,
  .map-progress-card .big-adventure {
    grid-column: 1 / -1;
  }

  .level-card,
  .side-stat {
    margin-bottom: 0;
  }

  .planet-stage {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
  }

  .map-node {
    position: relative;
    inset: auto !important;
    width: 100%;
    min-height: 126px;
  }

  .map-node .orbit {
    width: 72px;
    height: 72px;
    font-size: 38px;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar .brand,
  .topbar .tabs,
  .topbar .mode-switch,
  .topbar .child-switch {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .topbar .child-switch {
    max-width: 100%;
    padding-right: 0;
  }

  .adventure-map,
  .map-progress-card {
    grid-template-columns: 1fr;
  }

  .map-progress-card h3,
  .map-progress-card .big-adventure {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .reward-card,
  .reward-card.large {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    min-height: 156px;
  }

  .reward-card > img {
    min-block-size: 104px;
    max-block-size: 128px;
    padding: 8px;
    border-radius: 16px;
  }

  .reward-card h3 {
    font-size: 19px;
    line-height: 1.2;
  }

  .reward-card p {
    min-height: 0;
    line-height: 1.35;
  }

  .mini-grid {
    max-width: 150px;
  }
}

/* Polish 13: child avatar picker and three-level task layout. */
.child-pill {
  position: relative;
}

.avatar-edit {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #7a55ff, #2d63eb);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(45, 99, 235, 0.22);
}

.avatar-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 37, 92, 0.34);
  backdrop-filter: blur(10px);
}

.avatar-picker-card {
  position: relative;
  width: min(520px, 94vw);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 224, 98, 0.42), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(239, 247, 255, 0.96));
  box-shadow: 0 24px 70px rgba(28, 80, 174, 0.26);
  text-align: center;
}

.avatar-picker-card h3 {
  margin: 0;
  color: #0758c9;
  font-size: 26px;
}

.avatar-picker-card p {
  margin: 8px 0 18px;
  color: #58709d;
  font-weight: 800;
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.avatar-option {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 126px;
  padding: 14px 8px;
  border: 2px solid rgba(111, 151, 255, 0.26);
  border-radius: 20px;
  color: #18366f;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.avatar-option.active {
  border-color: #7a55ff;
  box-shadow: 0 12px 24px rgba(122, 85, 255, 0.2);
}

.avatar-option:disabled {
  cursor: wait;
  opacity: 0.7;
}

.avatar-option img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 18px rgba(43, 98, 206, 0.15);
}

.kid-task-board .task-columns,
.parent-task-board .task-columns {
  grid-template-columns: 1fr !important;
  gap: 16px;
}

.kid-task-board .task-section,
.parent-task-board .task-section {
  min-height: auto;
}

.kid-task-board .task-list,
.parent-task-board .task-list,
.kid-task-board .task-section.choice .task-list,
.parent-task-board .task-section.choice .task-list,
.kid-task-board .task-section.challenge .task-list,
.parent-task-board .task-section.challenge .task-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kid-task-board .task-section.challenge .task-list,
.parent-task-board .task-section.challenge .task-list {
  max-width: 360px;
  margin: 0 auto;
}

.kid-task-board .task-card,
.parent-task-board .task-card {
  min-height: 150px;
}

@media (min-width: 900px) {
  .kid-task-board .task-list,
  .parent-task-board .task-list,
  .kid-task-board .task-section.choice .task-list,
  .parent-task-board .task-section.choice .task-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .avatar-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kid-task-board .task-card,
  .parent-task-board .task-card {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    justify-items: stretch;
    min-height: 92px;
    text-align: left;
  }

  .kid-task-board .task-icon,
  .parent-task-board .task-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 30px;
  }

  .kid-task-board .task-copy strong,
  .parent-task-board .task-copy strong {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .avatar-edit {
    position: absolute;
    right: 6px;
    bottom: -8px;
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .avatar-picker-card {
    padding: 22px 16px;
    border-radius: 22px;
  }

  .avatar-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kid-task-board .task-list,
  .parent-task-board .task-list,
  .kid-task-board .task-section.choice .task-list,
  .parent-task-board .task-section.choice .task-list,
  .kid-task-board .task-section.challenge .task-list,
  .parent-task-board .task-section.challenge .task-list {
    grid-template-columns: 1fr;
  }

  .kid-task-board .task-section.challenge .task-list,
  .parent-task-board .task-section.challenge .task-list {
    max-width: none;
  }
}

/* Polish 16: rebuilt growth map with isolated class names. */
#view-map,
#view-map .map-panel,
#mapNodes {
  width: 100%;
  max-width: none;
  min-width: 0;
}

#mapNodes {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
}

.map-panel {
  min-height: auto !important;
  padding: clamp(14px, 2vw, 24px) !important;
  overflow: visible !important;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.92), transparent 22%),
    radial-gradient(circle at 88% 8%, rgba(255, 224, 98, 0.35), transparent 18%),
    linear-gradient(180deg, rgba(239, 249, 255, 0.98), rgba(255, 255, 255, 0.9)) !important;
}

.map-panel > .panel-title {
  display: flex !important;
  margin-bottom: 18px;
}

.map-panel > .panel-title h2 {
  color: #0758c9 !important;
}

.growth-journey {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.journey-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 190px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 83% 26%, rgba(255, 226, 98, 0.82), transparent 13%),
    radial-gradient(circle at 18% 82%, rgba(106, 224, 255, 0.34), transparent 18%),
    linear-gradient(135deg, #0a4fd2 0%, #2578ff 48%, #7a55ff 100%);
  box-shadow: 0 18px 48px rgba(31, 95, 205, 0.22);
}

.journey-hero-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.journey-kicker {
  justify-self: start;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 1000;
}

.journey-hero h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.journey-hero p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 800;
}

.journey-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 12px;
}

.journey-hero-stats div {
  min-height: 96px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.journey-hero-stats span,
.journey-title p,
.journey-task small,
.journey-energy span,
.journey-level span,
.journey-metrics span {
  color: #66769d;
  font-weight: 800;
}

.journey-hero-stats span {
  color: rgba(255, 255, 255, 0.84);
}

.journey-hero-stats strong {
  display: block;
  margin-top: 9px;
  color: #fff;
  font-size: 30px;
}

.journey-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.55fr) minmax(260px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.journey-panel,
.journey-planets {
  min-width: 0;
  border: 1px solid rgba(90, 143, 240, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 224, 98, 0.22), transparent 22%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(32, 97, 192, 0.12);
}

.journey-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.journey-title {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.journey-title > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #eff7ff, #fff);
  font-size: 26px;
}

.journey-title h3,
.journey-title p {
  margin: 0;
}

.journey-title h3 {
  color: #0758c9;
  font-size: 22px;
}

.journey-title p {
  margin-top: 3px;
  font-size: 13px;
}

.journey-task-list {
  display: grid;
  gap: 10px;
}

.journey-task {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(78, 124, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.journey-task.done {
  background: linear-gradient(180deg, #effff7, #fff);
}

.journey-task > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f3f8ff;
  font-size: 25px;
}

.journey-task b {
  color: #17346f;
  line-height: 1.25;
}

.journey-task small {
  grid-column: 2;
}

.journey-energy,
.journey-level {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: #f7fbff;
}

.journey-energy strong,
.journey-level strong {
  color: #155ee7;
  font-size: 30px;
}

.journey-energy i,
.journey-level i,
.journey-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffc83d, #5f76ff, #7a55ff);
}

.journey-energy i,
.journey-level i {
  height: 12px;
  border-radius: 999px;
}

.journey-planets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 226, 98, 0.45), transparent 16%),
    linear-gradient(135deg, rgba(12, 83, 214, 0.96), rgba(37, 120, 255, 0.93) 48%, rgba(122, 85, 255, 0.92));
}

.journey-planet {
  display: grid;
  gap: 12px;
  min-height: 164px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.journey-planet.unlocked {
  background: rgba(255, 255, 255, 0.92);
}

.journey-planet-head {
  display: grid;
  grid-template-columns: 28px 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.journey-step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #155ee7;
  background: #fff;
  font-weight: 1000;
}

.journey-orbit {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff8c9, #9ce7ff);
  font-size: 34px;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.16);
}

.journey-planet h3,
.journey-planet p {
  margin: 0;
}

.journey-planet h3 {
  color: #fff;
  font-size: 20px;
}

.journey-planet p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
}

.journey-planet.unlocked h3 {
  color: #155ee7;
}

.journey-planet.unlocked p {
  color: #61739f;
}

.journey-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.journey-planet.unlocked .journey-progress {
  background: #dfe8ff;
}

.journey-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 900;
}

.journey-planet.unlocked .journey-foot {
  color: #37528e;
}

.journey-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.journey-metrics div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(99, 145, 225, 0.18);
  border-radius: 18px;
  background: #fff;
}

.journey-metrics strong {
  display: block;
  margin-top: 10px;
  color: #155ee7;
  font-size: 24px;
}

@media (max-width: 1280px) {
  .journey-grid {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  }

  .journey-summary {
    grid-column: 1 / -1;
  }

  .journey-summary .journey-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .journey-hero,
  .journey-grid {
    grid-template-columns: 1fr;
  }

  .journey-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .journey-tasks .journey-task-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-summary {
    grid-column: auto;
  }

  .journey-summary .journey-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .journey-hero {
    min-height: auto;
    padding: 20px;
    border-radius: 22px;
  }

  .journey-hero h2 {
    font-size: 30px;
  }

  .journey-hero-stats,
  .journey-tasks .journey-task-list,
  .journey-planets,
  .journey-summary .journey-metrics {
    grid-template-columns: 1fr;
  }

  .journey-panel,
  .journey-planets {
    padding: 14px;
    border-radius: 20px;
  }

  .journey-planet {
    min-height: 132px;
  }

  .journey-planet-head {
    grid-template-columns: 26px 54px minmax(0, 1fr);
  }

  .journey-orbit {
    width: 54px;
    height: 54px;
    font-size: 30px;
  }
}
