:root {
  --ink: #243047;
  --muted: #667085;
  --sky: #54b8d0;
  --rose: #ff2733;
  --gold: #f5c542;
  --leaf: #63b882;
  --paper: #fffdf8;
  --line: #d6e0ea;
  --theme-soft: rgba(84, 184, 208, .18);
  --theme-warm: rgba(245, 197, 66, .18);
  --theme-second: rgba(99, 184, 130, .12);
  --theme-card: rgba(255, 255, 255, .95);
  --theme-panel: #eefaff;
  --theme-accent: #0f6d83;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, var(--theme-soft), transparent 34rem),
    linear-gradient(135deg, var(--theme-warm), var(--theme-second)),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.kid-owner-preview {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 3px solid #29acd1;
  background: #172238;
  color: #fff;
  box-shadow: 0 5px 0 rgba(23, 34, 56, .16);
}

.kid-owner-preview[hidden] {
  display: none;
}

.kid-owner-preview > div,
.kid-owner-preview nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kid-owner-preview p {
  display: grid;
  margin: 0;
}

.kid-owner-preview small {
  color: #d9e9f3;
}

.kid-owner-preview a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  border: 2px solid rgba(255, 255, 255, .24);
  border-radius: 7px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.kid-owner-preview a:hover {
  background: #fff;
  color: #172238;
}

@media (max-width: 760px) {
  .kid-owner-preview {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .kid-owner-preview nav {
    overflow-x: auto;
  }

  .kid-owner-preview a {
    flex: 0 0 auto;
  }
}

body[data-kingdom*="snail"],
body[data-element="beginning"] {
  --sky: #69ad72;
  --leaf: #2f8b58;
  --theme-soft: rgba(73, 155, 91, .22);
  --theme-warm: rgba(245, 197, 66, .18);
  --theme-second: rgba(255, 39, 51, .08);
  --theme-panel: #edf8e8;
  --theme-accent: #276f46;
}

.kid-world-map {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-top: 18px;
  border: 3px solid rgba(47, 139, 88, .22);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--theme-panel), #fff);
}

.kid-world-map > header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.kid-world-map > header > span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; background: var(--theme-accent); }
.kid-world-map-track { display: flex; width: 100%; min-width: 0; max-width: 100%; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 3px 3px 10px; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; }
.kid-world-node { flex: 0 0 min(290px, 78vw); display: grid; grid-template-columns: 70px minmax(0, 1fr) 24px; align-items: center; gap: 10px; min-height: 88px; border: 2px solid #d6e0ea; border-radius: 10px; padding: 8px; text-align: left; background: #fff; scroll-snap-align: start; }
.kid-world-node img { width: 70px; height: 70px; object-fit: contain; }
.kid-world-node strong, .kid-world-node small { display: block; }
.kid-world-node small { margin-top: 4px; color: var(--muted); }
.kid-world-node.is-current { border-color: var(--theme-accent); box-shadow: 0 5px 0 rgba(35, 48, 71, .14); }
.kid-world-node.is-locked { filter: grayscale(1); opacity: .5; }

.kid-portfolio-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--theme-panel) 86%, #fff);
  transition: background-color .25s ease;
}

.kid-status-grid article.is-explorable { position: relative; cursor: pointer; }
.kid-status-grid article.is-explorable em { position: absolute; right: 10px; bottom: 8px; color: var(--theme-accent); font-size: .66rem; font-style: normal; font-weight: 950; text-transform: uppercase; }

body[data-kingdom*="water"],
body[data-kingdom*="goose"],
body[data-kingdom*="shell"],
body[data-kingdom*="turtle"],
body[data-kingdom*="dolphin"],
body[data-element="water"] {
  --sky: #4aa9da;
  --leaf: #48b7a5;
  --theme-soft: rgba(74, 169, 218, .22);
  --theme-warm: rgba(114, 214, 255, .16);
  --theme-second: rgba(72, 183, 165, .13);
  --theme-panel: #eaf9ff;
  --theme-accent: #0b6e91;
}

body[data-kingdom*="earth"],
body[data-kingdom*="owl"],
body[data-kingdom*="elephant"],
body[data-kingdom*="panther"],
body[data-kingdom*="porcupine"],
body[data-element="earth"] {
  --sky: #6aa271;
  --leaf: #8bba61;
  --theme-soft: rgba(106, 162, 113, .2);
  --theme-warm: rgba(139, 186, 97, .15);
  --theme-second: rgba(245, 197, 66, .12);
  --theme-panel: #f0f8e6;
  --theme-accent: #437341;
}

body[data-kingdom*="air"],
body[data-kingdom*="electric"],
body[data-kingdom*="caterpillar"],
body[data-kingdom*="tree"],
body[data-kingdom*="giraffe"],
body[data-kingdom*="unicorn"],
body[data-element*="air"],
body[data-element*="electric"] {
  --sky: #5a95dc;
  --leaf: #8f83e8;
  --theme-soft: rgba(90, 149, 220, .2);
  --theme-warm: rgba(143, 131, 232, .14);
  --theme-second: rgba(245, 197, 66, .12);
  --theme-panel: #f1f4ff;
  --theme-accent: #3f5fa8;
}

body[data-kingdom*="fire"],
body[data-kingdom*="eagle"],
body[data-kingdom*="dragon"],
body[data-kingdom*="ram"],
body[data-kingdom*="wolf"],
body[data-element="fire"] {
  --sky: #e04d43;
  --leaf: #e3a13d;
  --theme-soft: rgba(224, 77, 67, .18);
  --theme-warm: rgba(245, 197, 66, .15);
  --theme-second: rgba(99, 184, 130, .1);
  --theme-panel: #fff0e8;
  --theme-accent: #9f312d;
}

body[data-kingdom*="tardigrade"],
body[data-element*="all"] {
  --sky: #5b6fd8;
  --leaf: #45b58c;
  --theme-soft: rgba(91, 111, 216, .18);
  --theme-warm: rgba(245, 197, 66, .16);
  --theme-second: rgba(255, 39, 51, .08);
  --theme-panel: #f4f1ff;
  --theme-accent: #4856a8;
}

a {
  color: inherit;
}

.kid-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 52px;
}

.kid-profile-gate {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  border: 3px solid #d6e0ea;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 5px 0 rgba(35, 48, 71, .1);
}

.kid-profile-gate > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  color: #0f6d83;
  background: #e8f8ff;
}

.kid-profile-gate strong,
.kid-profile-gate p {
  margin: 0;
}

.kid-profile-gate.is-connected {
  border-color: rgba(99, 184, 130, .45);
  background: #f0fff4;
}

.kid-profile-gate.is-connected > span {
  color: #127838;
  background: #d9f7e3;
}

.kid-profile-gate button {
  white-space: nowrap;
}

.kid-hero,
.kid-card,
.kid-status-grid article {
  border: 3px solid var(--line);
  border-radius: 12px;
  background: var(--theme-card);
  box-shadow: 0 7px 0 rgba(35, 48, 71, .12);
}

.kid-kingdom-banner {
  display: grid;
  align-content: end;
  min-height: clamp(150px, 24vw, 285px);
  margin-bottom: 16px;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: clamp(18px, 4vw, 34px);
  background-color: #243047;
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: 0 7px 0 rgba(35, 48, 71, .12);
}

.kid-kingdom-banner .kicker { color: #fff; }
.kid-kingdom-banner strong { font-size: clamp(2rem, 5vw, 4.5rem); line-height: .95; }

.kid-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  gap: clamp(18px, 4vw, 38px);
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--sky) 42%, var(--line));
  background:
    radial-gradient(circle at 85% 18%, var(--theme-soft), transparent 18rem),
    linear-gradient(135deg, rgba(255, 255, 255, .96), var(--theme-panel));
}

.kid-hero-progress {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.kid-hero-progress > span {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 9px;
  background: conic-gradient(var(--theme-accent) calc(var(--kid-progress) * 1%), #dce4eb 0);
  box-shadow: 0 10px 0 rgba(35, 48, 71, .12);
}

.kid-hero-progress > span::before {
  content: "";
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
}

.kid-hero-progress img {
  grid-area: 1 / 1;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 50%;
}

.kid-hero-progress > strong { color: var(--theme-accent); font-size: 1.45rem; font-weight: 950; }

.kicker {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: .88;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

p {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.kid-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.kid-hero-actions a,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  color: #fff;
  background: var(--sky);
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(35, 48, 71, .16);
}

.kid-hero-actions a:first-child {
  background: var(--rose);
}

.kid-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.kid-status-grid article {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
}

.kid-status-grid span,
.kid-card > header > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: var(--theme-accent);
  background: var(--theme-panel);
  font-size: 1.15rem;
}

.kid-status-grid strong,
.kid-status-grid small {
  display: block;
  min-width: 0;
}

.kid-status-grid strong {
  font-size: 1.1rem;
  line-height: 1.05;
}

.kid-status-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 850;
}

.kid-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
  gap: 16px;
  margin-top: 18px;
}

.kid-card {
  padding: 18px;
}

.kid-card > header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.quest-card {
  grid-row: span 2;
}

.schedule-card {
  background:
    linear-gradient(135deg, rgba(84, 184, 208, .14), rgba(245, 197, 66, .1)),
    #fff;
}

.kid-class-panel {
  display: grid;
  gap: 12px;
}

.kid-teacher-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 2px solid #d6e0ea;
  border-radius: 14px;
  padding: 10px;
  background: #f7fbff;
}

.kid-teacher-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 999px;
  color: #0f6d83;
  background: #e8f8ff;
  box-shadow: 0 4px 0 rgba(35, 48, 71, .12);
}

.kid-teacher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kid-teacher-row strong,
.kid-teacher-row small {
  display: block;
  min-width: 0;
}

.kid-teacher-row strong {
  font-size: 1.2rem;
  line-height: 1.05;
}

.kid-teacher-row small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 900;
}

.kid-class-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kid-class-stats article {
  border: 2px solid #edf1f5;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.kid-class-stats strong,
.kid-class-stats span {
  display: block;
}

.kid-class-stats strong {
  font-size: 1.15rem;
  line-height: 1.05;
  text-transform: capitalize;
}

.kid-class-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.kid-class-note {
  margin: 0;
  border: 2px dashed rgba(84, 184, 208, .45);
  border-radius: 12px;
  padding: 10px;
  color: #0f6d83;
  background: #effbff;
}

.quest-progress-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quest-progress-track article {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 230px;
  border: 3px solid #edf1f5;
  border-radius: 12px;
  padding: 14px 10px;
  background: #fff;
  text-align: center;
}

.quest-progress-track img {
  width: min(100%, 150px);
  aspect-ratio: 1;
  object-fit: contain;
}

.quest-progress-track strong {
  font-size: 1rem;
}

.quest-progress-track small {
  border-radius: 999px;
  padding: 6px 10px;
  color: #0f6d83;
  background: #e8f8ff;
  font-weight: 950;
  text-transform: uppercase;
}

.quest-progress-track em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 2px solid #ffd96a;
  border-radius: 999px;
  padding: 4px 10px;
  color: #7a5200;
  background: #fff7cf;
  font-style: normal;
  font-weight: 950;
}

.quest-progress-track .is-current {
  border-color: var(--gold);
  box-shadow: 0 5px 0 rgba(245, 197, 66, .28);
}

.quest-progress-track .is-locked {
  opacity: .58;
  filter: grayscale(.75);
}

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

.reward-wallet span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  border-radius: 12px;
  padding: 12px;
  background: #fff7cf;
}

.reward-wallet b {
  grid-row: span 2;
  font-size: 2rem;
}

.reward-wallet strong {
  font-size: 1.6rem;
  line-height: 1;
}

.reward-wallet small {
  color: #7a5200;
  font-weight: 900;
}

.order-list {
  display: grid;
  gap: 12px;
}

.kid-order-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  border: 2px solid #edf1f5;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.kid-order-card.is-ready {
  border-color: rgba(35, 194, 94, .34);
  background: #f0fff5;
}

.kid-order-card.is-preparing {
  border-color: rgba(84, 184, 208, .36);
  background: #f4fcff;
}

.kid-order-card.is-waiting {
  border-color: rgba(245, 197, 66, .52);
  background: #fff9df;
}

.kid-order-card.is-restocked {
  border-color: rgba(143, 31, 40, .26);
  background: #fff6f7;
}

.kid-order-card.is-empty {
  border-style: dashed;
}

.kid-order-image {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 2px solid #dbe6ef;
  border-radius: 16px;
  background: #f7fbff;
}

.kid-order-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kid-order-image b {
  font-size: 2rem;
}

.kid-order-card div {
  min-width: 0;
  padding-right: 104px;
}

.kid-order-card small,
.kid-order-card strong,
.kid-order-card p,
.kid-order-card em {
  display: block;
}

.kid-order-card small {
  color: var(--red);
  font-size: .72rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.kid-order-card strong {
  margin-top: 2px;
  font-size: 1.1rem;
  line-height: 1;
}

.kid-order-card p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kid-order-card em {
  margin-top: 6px;
  color: #0f6d83;
  font-style: normal;
  font-weight: 950;
}

.kid-order-status {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: 98px;
  border-radius: 999px;
  padding: 7px 9px;
  background: #e8f8ff;
  color: #0f6d83;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.kid-order-card.is-ready .kid-order-status {
  background: #2fc56a;
  color: #fff;
}

.kid-order-card.is-restocked .kid-order-status {
  background: #8f1f28;
  color: #fff;
}

.kid-order-timeline { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.kid-order-timeline span { border: 1px solid #d7dee6; border-radius: 999px; padding: 3px 7px; background: #f4f6f8; color: #667085; font-size: .65rem; font-style: normal; font-weight: 900; }
.kid-order-timeline span.is-done { border-color: #8bd5a2; background: #e8f8ed; color: #16783a; }
.kid-order-timeline span.is-refunded { border-color: #f0c45b; background: #fff6d9; color: #7a5700; }

.kid-order-card.is-waiting .kid-order-status {
  background: #f5c542;
  color: #4d3500;
}

.progress-action-card {
  grid-column: 1 / -1;
}

.kid-progress-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.kid-battle-admin-bar { display: flex; justify-content: space-between; gap: 14px; align-items: center; border: 2px solid #273247; padding: 10px 12px; background: #eef5ff; }
.kid-battle-admin-bar > span { display: grid; grid-template-columns: auto auto; gap: 2px 8px; align-items: center; }
.kid-battle-admin-bar > span i { grid-row: 1 / 3; color: #8f1f28; font-size: 1.35rem; }
.kid-battle-admin-bar small { color: var(--muted); font-weight: 800; }
.kid-battle-admin-bar label { display: inline-flex; align-items: center; gap: 8px; font-weight: 950; }
.kid-battle-admin-bar input { width: 22px; height: 22px; accent-color: #8f1f28; }

.kid-bad-guy-roster { min-width: 0; padding: 12px; background: #fff; }
.kid-bad-guy-roster > header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.kid-bad-guy-roster > header small { color: var(--muted); font-weight: 800; }
.kid-bad-guy-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-color: #8f1f28 #edf1f5; }
.kid-bad-guy-button { position: relative; display: flex; flex: 0 0 126px; flex-direction: column; align-items: center; min-width: 0; border: 2px solid #8a8888; border-radius: 8px; padding: 8px; color: #273247; background: #fff; text-align: center; }
.kid-bad-guy-button > span { display: block; flex: 0 0 88px; width: 88px; height: 88px; margin: 0 auto 6px; border: 0; border-radius: 7px; overflow: hidden; background: #fff; }
.kid-bad-guy-button img { width: 100%; height: 100%; object-fit: contain; }
.kid-bad-guy-button strong, .kid-bad-guy-button small { display: block; overflow-wrap: anywhere; }
.kid-bad-guy-button small { margin-top: 3px; color: #667085; font-weight: 800; }
.kid-bad-guy-button > i { position: absolute; top: 72px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: #8f1f28; }
.kid-bad-guy-button.is-locked img { filter: grayscale(1); opacity: .46; }
.kid-bad-guy-button.is-unlocked { border-color: #2ebc63; background: #fff; }
.kid-bad-guy-button.is-unlocked > i { background: #168442; }
.kid-bad-guy-button.is-active { outline: 4px solid #f5c542; outline-offset: 2px; }
.kid-active-battle { border: 3px solid #8f1f28; padding: 12px; background: #fff4f4; }
.kid-active-battle > header { display: flex; gap: 10px; align-items: center; }
.kid-active-battle > header > span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; background: #8f1f28; }
.kid-active-battle strong, .kid-active-battle small { display: block; }
.kid-active-battle small { color: var(--muted); font-weight: 800; }
.kid-active-battle-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.kid-active-battle-tasks article { border: 1px solid #e8b9bd; padding: 9px; background: #fff; }
.kid-active-battle-tasks span { display: block; margin-top: 3px; color: var(--muted); font-weight: 800; }
.kid-battle-dice-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.kid-battle-dice-board article { display: grid; grid-template-columns: auto auto; gap: 2px 8px; align-items: center; border: 2px solid #d8dee8; border-radius: 8px; padding: 10px; background: #fff; }
.kid-battle-dice-board i { grid-row: 1 / 3; color: #8f1f28; font-size: 1.35rem; }
.kid-battle-dice-board strong { font-size: 1.4rem; line-height: 1; }
.kid-battle-dice-board span { color: var(--muted); font-size: .72rem; font-weight: 900; }
.kid-homework-clock.is-disabled { filter: grayscale(.7); opacity: .72; }

.kid-battle-modal[hidden] { display: none; }
.kid-battle-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(20, 26, 39, .72); }
.kid-battle-dialog { position: relative; display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 22px; width: min(760px, 100%); border: 5px solid #111; border-radius: 8px; padding: 24px; background: #fff; }
.kid-battle-dialog > .modal-close { position: absolute; top: 10px; right: 10px; left: auto; z-index: 5; display: grid; place-items: center; width: 38px; min-width: 38px; height: 38px; min-height: 38px; margin: 0; border: 0; border-radius: 50%; padding: 0; color: #fff; background: #111; font-size: 1rem; line-height: 1; box-shadow: none; }
.kid-battle-dialog > img { width: 100%; aspect-ratio: 1; border: 0; border-radius: 8px; object-fit: contain; background: #fff4f4; }
.kid-battle-dialog h2 { margin: 4px 0 10px; font-size: clamp(1.8rem, 4vw, 3.25rem); line-height: 1; }
.kid-battle-dialog p { color: var(--muted); font-weight: 850; line-height: 1.45; }
.kid-battle-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.kid-battle-modal-actions button { min-height: 42px; border-radius: 6px; padding: 0 14px; color: #fff; background: #000; }
.kid-battle-modal-actions [data-confirm-battle] { color: #fff; background: #000; }
.kid-battle-modal-actions [data-confirm-battle][hidden] { display: none; }

@media (max-width: 720px) {
  .kid-battle-admin-bar, .kid-bad-guy-roster > header { align-items: flex-start; flex-direction: column; }
  .kid-active-battle-tasks { grid-template-columns: 1fr; }
  .kid-battle-dice-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kid-battle-dialog { grid-template-columns: 1fr; max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px; }
  .kid-battle-dialog > img { width: min(230px, 70vw); margin: 0 auto; }
  .kid-comment-lane > header { align-items: flex-start; flex-direction: column; }
  .kid-comment-dialog { grid-template-columns: 1fr; max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px; }
  .kid-comment-dialog .kid-comment-form { grid-template-columns: 1fr; }
}

.kid-action-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 2px solid #dbe6ef;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.kid-action-item > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: #0f6d83;
  background: #e8f8ff;
  font-size: 1.2rem;
}

.kid-action-item strong,
.kid-action-item small {
  display: block;
}

.kid-action-item small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.kid-action-item a,
.kid-action-item button {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: var(--sky);
  text-decoration: none;
  white-space: nowrap;
}

.kid-action-item.is-parent > span,
.kid-action-item.is-parent button {
  background: var(--leaf);
}

.kid-homework-clock {
  grid-column: 1 / -1;
  border-color: rgba(84, 184, 208, .7);
  background: #f1fbff;
}

.kid-homework-clock.is-running {
  border-color: #2ebc63;
  background: #f0fff5;
}

.kid-homework-clock-main time {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.kid-homework-clock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kid-homework-clock-actions button:last-child {
  background: #8f1f28;
}

.kid-homework-clock-actions button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.kid-homework-still-arting {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  border: 3px solid #f5c542;
  border-radius: 10px;
  padding: 9px;
  background: #fff6cf;
  animation: homeworkCheckPulse 1.1s ease-in-out infinite alternate;
}

.kid-homework-still-arting[hidden] { display: none; }
.kid-homework-still-arting > i { color: #8f1f28; font-size: 1.35rem; }
.kid-homework-still-arting button { background: #2ebc63; }

@keyframes homeworkCheckPulse {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(245, 197, 66, 0); }
  to { transform: scale(1.01); box-shadow: 0 0 0 6px rgba(245, 197, 66, .18); }
}

.kid-action-item.is-legacy-proof {
  border-color: rgba(245, 197, 66, .72);
  background: #fff8d9;
}

.kid-action-item.is-legacy-proof > span {
  color: #7a5200;
  background: #fff1ad;
}

.kid-action-review-state {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border: 2px solid rgba(245, 197, 66, .72);
  border-radius: 999px;
  padding: 6px 9px;
  color: #7a5200;
  background: #fff;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.kid-action-split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.kid-action-split button:last-child {
  color: var(--ink);
  background: #eef4f8;
}

.kid-action-split button:disabled {
  color: #6d7a8c;
  background: #dbe6ef;
  opacity: .82;
}

.kid-battle-task-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border: 2px solid rgba(255, 39, 51, .22);
  border-radius: 14px;
  padding: 12px;
  background: #fff7f7;
}

.kid-battle-task-preview header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.kid-battle-task-preview header > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  color: #8f1f28;
  background: #ffe6e8;
}

.kid-battle-task-preview header strong,
.kid-battle-task-preview header small {
  display: block;
}

.kid-battle-task-preview header small {
  color: var(--muted);
  font-weight: 850;
}

.kid-battle-task-preview > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kid-battle-task-preview article {
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 900;
}

.kid-battle-task-preview article span {
  color: #8f1f28;
}

.portfolio-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, var(--theme-soft), rgba(255, 39, 51, .06)),
    #fff;
}

.kid-portfolio-panel {
  display: grid;
  gap: 14px;
}

.kid-portfolio-cover {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 3px solid color-mix(in srgb, var(--sky) 42%, #d6e0ea);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .94)),
    var(--theme-panel);
}

.kid-portfolio-cover img {
  width: 140px;
  aspect-ratio: 1;
  border: 4px solid #fff;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 6px 0 rgba(35, 48, 71, .12);
}

.kid-portfolio-cover strong,
.kid-portfolio-cover span,
.kid-portfolio-cover small {
  display: block;
}

.kid-locked-portfolio-tools {
  display: grid;
  gap: 14px;
  border: 3px solid #8f1f28;
  border-radius: 12px;
  padding: 16px;
  background: #fff7f7;
}

.kid-locked-portfolio-tools > header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.kid-locked-portfolio-tools > header > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8f1f28;
}

.kid-locked-portfolio-tools header strong,
.kid-locked-portfolio-tools header small {
  display: block;
}

.kid-locked-portfolio-tools header small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.kid-legacy-stage-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kid-legacy-stage-picker button {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 3px solid #d6e0ea;
  border-radius: 10px;
  padding: 9px;
  text-align: left;
  color: var(--ink);
  background: #fff;
}

.kid-legacy-stage-picker button.is-selected {
  border-color: var(--sky);
  box-shadow: 0 5px 0 rgba(35, 48, 71, .14);
}

.kid-legacy-stage-picker img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.kid-legacy-stage-picker strong,
.kid-legacy-stage-picker small {
  display: block;
}

.kid-legacy-stage-picker small {
  margin-top: 4px;
  color: var(--muted);
}

.kid-locked-portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kid-locked-portfolio-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  color: #fff;
  background: var(--sky);
  font-weight: 950;
}

.kid-locked-portfolio-actions button:last-child {
  background: var(--leaf);
}

.kid-locked-portfolio-tools > p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 760px) {
  .kid-legacy-stage-picker { grid-template-columns: 1fr; }
}

.kid-portfolio-cover strong {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: .94;
}

.kid-portfolio-cover span {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 950;
}

.kid-portfolio-cover small {
  width: fit-content;
  margin-top: 10px;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--theme-accent);
  background: color-mix(in srgb, var(--theme-panel) 70%, #fff);
  font-weight: 950;
}

.kid-portfolio-book {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kid-portfolio-page,
.kid-portfolio-empty {
  min-width: 0;
  border: 2px solid #dbe6ef;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 5px 0 rgba(35, 48, 71, .1);
}

.kid-portfolio-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.kid-portfolio-page.is-proof {
  border-color: rgba(245, 197, 66, .72);
}

.kid-portfolio-page.is-update {
  border-color: rgba(99, 184, 130, .45);
}

.kid-portfolio-page.is-bring-in {
  border-color: rgba(84, 184, 208, .55);
  background:
    linear-gradient(135deg, rgba(232, 248, 255, .72), rgba(255, 255, 255, .96)),
    #fff;
}

.kid-portfolio-page.is-released {
  border-color: rgba(99, 184, 130, .72);
}

.kid-portfolio-image {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: #eef4f8;
}

.kid-portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kid-portfolio-image span,
.kid-portfolio-empty > span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  color: #0f6d83;
  background: #dff7ff;
  font-size: 1.6rem;
}

.kid-portfolio-page em {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  color: #7a5200;
  background: #fff1ad;
  font-size: .75rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.kid-portfolio-page.is-bring-in em {
  color: #0f6d83;
  background: #dff7ff;
}

.kid-portfolio-page.is-released em {
  color: #127838;
  background: #d9f7e3;
}

.kid-portfolio-page strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
  line-height: 1.05;
}

.kid-portfolio-page p {
  display: -webkit-box;
  min-height: 3.9em;
  margin: 7px 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.kid-portfolio-page small {
  color: var(--muted);
  font-weight: 900;
}

.kid-portfolio-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 190px;
  align-content: center;
  text-align: center;
}

.kid-portfolio-empty p {
  max-width: 420px;
  margin-bottom: 0;
}

.kid-comment-lane {
  display: grid;
  gap: 12px;
  border: 2px dashed rgba(84, 184, 208, .5);
  border-radius: 16px;
  padding: 12px;
  background: rgba(232, 248, 255, .65);
}

.kid-comment-lane > header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.kid-comment-lane > header > span { min-width: 0; }
.kid-comment-lane > header button { min-height: 40px; border-radius: 6px; padding: 0 13px; color: #273247; background: #f7d6e7; white-space: nowrap; }
.kid-comment-lane > header button i { color: #f5c542; -webkit-text-stroke: 1px rgba(122, 82, 0, .35); }

.kid-comment-lane header strong,
.kid-comment-lane header small {
  display: block;
}

.kid-comment-lane header small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 850;
}

.kid-comment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kid-comment-list > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px 7px 7px;
  color: #0f6d83;
  background: #fff;
  font-weight: 900;
}

.kid-comment-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  flex: 0 0 40px;
  color: #f5c542;
  background: #f7d6e7;
  -webkit-text-stroke: 1px rgba(122, 82, 0, .28);
}

.kid-comment-list > span > span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  min-width: 0;
}

.kid-comment-list small {
  color: var(--muted);
  font-weight: 800;
}

.kid-comment-list b {
  color: var(--ink);
}

.kid-comment-list em {
  border-radius: 999px;
  padding: 3px 7px;
  color: #7a5200;
  background: #fff1ad;
  font-size: .72rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.kid-comment-list .is-pending {
  background: #fff9df;
}

.kid-comment-list em.is-approved {
  color: #127838;
  background: #d9f7e3;
}

.kid-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(150px, .55fr) auto;
  gap: 10px;
  align-items: end;
}

.kid-comment-modal[hidden] { display: none; }
.kid-comment-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(20, 26, 39, .72); }
.kid-comment-dialog { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; width: min(720px, 100%); border: 4px solid #273247; border-radius: 8px; padding: 24px; background: #fff; }
.kid-comment-dialog > .modal-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 38px; min-width: 38px; height: 38px; min-height: 38px; border: 0; border-radius: 50%; padding: 0; color: #fff; background: #111; }
.kid-comment-dialog-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #f5c542; background: #f7d6e7; font-size: 1.45rem; -webkit-text-stroke: 1px rgba(122, 82, 0, .28); }
.kid-comment-dialog h2 { margin: 2px 48px 5px 0; }
.kid-comment-dialog p { margin: 0; color: var(--muted); font-weight: 800; }
.kid-comment-dialog .kid-comment-form { grid-column: 1 / -1; margin-top: 4px; border-top: 2px solid #edf1f5; padding-top: 14px; }

.kid-comment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.kid-comment-form textarea,
.kid-comment-form input {
  width: 100%;
  min-height: 44px;
  border: 2px solid #d6e0ea;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 850;
}

.kid-comment-form textarea {
  resize: vertical;
}

.kid-comment-form button {
  min-height: 48px;
  white-space: nowrap;
}

.kid-comment-form small {
  grid-column: 1 / -1;
  color: #0f6d83;
  font-weight: 900;
}

.battle-card {
  grid-column: 1 / -1;
}

.battle-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 3px solid rgba(255, 39, 51, .22);
  border-radius: 14px;
  padding: 14px;
  background: #fff7f7;
}

.battle-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.battle-preview strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.battle-preview p {
  margin-bottom: 0;
}

.kid-access-modal {
  z-index: 1000;
  width: min(520px, calc(100% - 24px));
  overflow: visible;
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
}

.kid-access-modal::backdrop {
  background: rgba(20, 29, 48, .56);
}

.kid-access-card {
  position: relative;
  display: grid;
  gap: 14px;
  border: 4px solid #54b8d0;
  border-radius: 18px;
  padding: 24px;
  background: #fffdf8;
  box-shadow: 0 18px 44px rgba(35, 48, 71, .28);
}

.kid-access-card .modal-close {
  z-index: 20;
  position: absolute;
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 999px;
  padding: 0;
  background: #111827;
}

.kid-access-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 950;
  text-transform: uppercase;
}

.kid-access-card input {
  min-height: 52px;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 950;
}

.kid-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.kid-access-actions button[value="cancel"] {
  color: var(--ink);
  background: #eef4f8;
}

.kid-access-status {
  margin: 0;
  color: #0f6d83;
}

.kid-proof-modal {
  width: min(780px, calc(100% - 24px));
}

.kid-proof-card {
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-color: #f5c542;
}

.kid-proof-card .modal-close {
  top: 8px;
  right: 8px;
  z-index: 50;
}

.proof-type-row,
.kid-proof-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-type-row button {
  min-height: 40px;
  color: var(--ink);
  background: #eef4f8;
}

.proof-type-row button.is-active {
  color: #fff;
  background: var(--rose);
}

.kid-proof-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: hidden;
  border: 3px dashed rgba(84, 184, 208, .45);
  border-radius: 16px;
  background: #effbff;
  cursor: grab;
  touch-action: none;
}

.kid-proof-preview.is-square {
  width: min(100%, 430px);
  aspect-ratio: 1;
  justify-self: center;
}

.kid-proof-preview:not(.is-square) { aspect-ratio: var(--proof-ratio, 1.5); min-height: 0; }

.kid-proof-ratio { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.kid-proof-ratio[hidden] { display: none; }
.kid-proof-ratio > span { grid-column: 1 / -1; font-weight: 900; }
.kid-proof-ratio input { width: 100%; }
.kid-proof-ratio small:last-child { text-align: right; }

.kid-proof-preview.is-dragging {
  cursor: grabbing;
}

.kid-proof-preview > span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  color: #0f6d83;
  background: #dff7ff;
  font-size: 2rem;
}

.kid-proof-preview.has-image > span {
  display: none;
}

.kid-proof-preview img {
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: contain;
  transform-origin: center;
  user-select: none;
}

.kid-proof-tools {
  justify-content: center;
}

.kid-proof-crop-modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.kid-proof-crop-modes button {
  min-height: 40px;
  color: var(--ink);
  background: #eef4f8;
}

.kid-proof-crop-modes button.is-active {
  color: #fff;
  background: #0f6d83;
}

.kid-proof-crop-modes small {
  flex-basis: 100%;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.kid-enrollment-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border-top: 2px solid var(--line);
  padding-top: 12px;
}

.kid-enrollment-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  padding: 9px 10px;
  background: #eefaff;
  font-weight: 850;
}

.kid-quest-market-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  border-radius: 7px;
  padding: 10px 13px;
  color: #fff;
  background: var(--rose);
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(35, 48, 71, .16);
}

.kid-proof-tools button {
  min-width: 48px;
  min-height: 44px;
  border-radius: 999px;
}

.kid-proof-card textarea {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  resize: vertical;
}

.quest-progress-track .oam-stage-card { min-height: 230px; color: inherit; }
.quest-progress-track .oam-stage-card > em:not(.stage-lock-badge) { display: inline-flex; min-height: 32px; border: 2px solid #ffd96a; border-radius: 999px; padding: 4px 10px; color: #7a5200; background: #fff7cf; font-style: normal; }

.oam-oamiemon-info-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; background: rgba(20, 29, 45, .72); }
.oam-oamiemon-info-modal[hidden] { display: none; }
.oam-oamiemon-info-card { position: relative; width: min(1040px, 96vw); max-height: 92vh; overflow: auto; border-radius: 28px; padding: 24px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.oam-info-header { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; padding-right: 42px; }
.oam-info-header img { width: 140px; height: 140px; border: 4px solid #de84b4; border-radius: 24px; background: #fff4fb; object-fit: contain; filter: drop-shadow(0 14px 20px rgba(35, 48, 71, .18)); }
.oam-stage-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.oam-stage-card, .gateway-card { position: relative; display: grid; justify-items: center; border: 2px solid #dce3e9; border-radius: 18px; padding: 12px; color: #243047; background: #fff; text-align: center; font-weight: 900; }
.oam-stage-card img { width: 100%; max-height: 180px; aspect-ratio: 1; object-fit: contain; }
.oam-stage-card strong, .oam-stage-card span { display: block; }
.oam-stage-card span { color: var(--rose); font-weight: 950; }
.oam-stage-card.current { border-color: #de84b4; box-shadow: 0 0 0 4px rgba(222, 132, 180, .18), 0 0 26px rgba(222, 132, 180, .45); }
.oam-stage-card.locked, .gateway-card.locked { filter: grayscale(.85); opacity: .62; }
.stage-lock-badge, .shopkeeper-lock-badge { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 48px; height: 48px; border: 4px solid #fff; border-radius: 50%; color: #fff; background: #243047; box-shadow: 0 7px 18px rgba(35, 48, 71, .28); }
.oam-info-section-drawer { margin-top: 28px; }
.oam-info-section-drawer > summary { display: inline-flex; border-radius: 999px; padding: 9px 15px; color: #0f6d83; background: #eef7fb; font-size: 1.05rem; cursor: pointer; }
.bad-guy-drawer > summary { color: #9a4b10; background: #fff4e8; }
.kingdom-shop-drawer > summary { color: #477018; background: #f4f9ee; }
.bad-guy-info-card { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 18px; align-items: center; width: 100%; margin-top: 14px; border: 3px solid #ff2733; border-radius: 12px; padding: 14px; color: #243047; background: #fff7f7; text-align: left; }
.bad-guy-info-img { width: 100%; max-height: 180px; object-fit: contain; }
.kingdom-shop-preview { margin-top: 14px; }
.shop-gateway-card { overflow: hidden; width: min(100%, 720px); margin-inline: auto; }
.shop-gateway-hero-img { width: 100%; max-height: 240px; object-fit: cover; }
.shop-gateway-closed-row { display: flex; justify-content: center; margin-top: -58px; position: relative; }
.shop-gateway-owner { position: relative; display: block; }
.shop-gateway-owner > img { width: 116px; height: 116px; border: 6px solid #fff; border-radius: 50%; background: #fff; object-fit: cover; }
.shopkeeper-lock-badge { right: -4px; bottom: -4px; width: 42px; height: 42px; }
.oamiemon-map { margin-top: 14px; }
.gateway-branch h3 { margin: 16px 0 8px; }
.gateway-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; }
.gateway-grid .gateway-card.is-wide { justify-self: center; width: min(620px, 100%); }
.gateway-card h4 { margin: 6px 0; }
.gateway-card > strong { color: var(--leaf); font-size: .75rem; text-transform: uppercase; }
.gateway-card.locked > strong { color: var(--muted); }
.oamiemon-gateway-img { width: 100%; max-height: 150px; aspect-ratio: 1; object-fit: contain; }
.current-level-badge { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 10px; color: #fff; background: #ff2733; font-size: .72rem; font-style: normal; font-weight: 950; text-transform: uppercase; box-shadow: 0 5px 0 rgba(35, 48, 71, .16); }
.gateway-card.is-selected { border-color: #de84b4; box-shadow: 0 0 0 4px rgba(222, 132, 180, .16); }
.oam-stage-detail-slot { margin: 16px 0; }
.oam-stage-detail-card { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 18px; align-items: center; border: 3px solid #dce3e9; border-radius: 16px; padding: 16px; background: #fff; }
.oam-stage-detail-card img { width: 100%; max-height: 210px; object-fit: contain; }
.gateway-info-detail { border: 2px solid #dce3e9; border-radius: 12px; padding: 14px; background: #f8fbfd; }

.closed-shop-modal,
.kid-notice-modal { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; padding: 20px; background: rgba(20, 29, 45, .72); }
.closed-shop-modal[hidden], .kid-notice-modal[hidden] { display: none; }
.closed-shop-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; width: min(640px, 94vw); border: 4px solid #ffd7e9; border-radius: 20px; padding: 24px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.closed-shop-card > img { width: clamp(132px, 24vw, 190px); height: clamp(132px, 24vw, 190px); border: 6px solid #fff; border-radius: 50%; object-fit: cover; box-shadow: 0 16px 30px rgba(35, 48, 71, .18); }
.closed-shop-card h2 { margin: 2px 0 8px; font-size: clamp(1.7rem, 4vw, 2.7rem); line-height: .98; }
.kid-notice-card { position: relative; width: min(520px, 94vw); border: 4px solid #b9dff0; border-radius: 20px; padding: 28px; text-align: center; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.kid-notice-card > span { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: var(--theme-accent); font-size: 2rem; }

@media (max-width: 860px) {
  .kid-hero,
  .kid-dashboard-grid,
  .battle-preview {
    grid-template-columns: 1fr;
  }

  .kid-hero-progress {
    width: min(180px, 100%);
    justify-self: center;
  }

  .kid-hero-progress img { width: 100%; }

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

  .quest-progress-track {
    grid-template-columns: 1fr;
  }

  .kid-profile-gate {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .kid-profile-gate button {
    grid-column: 1 / -1;
  }

  .kid-class-stats {
    grid-template-columns: 1fr;
  }

  .kid-progress-actions,
  .kid-action-item,
  .kid-portfolio-cover,
  .kid-comment-lane,
  .kid-comment-form {
    grid-template-columns: 1fr;
  }

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

  .kid-action-split {
    justify-content: flex-start;
  }

  .oam-stage-row, .gateway-grid { grid-template-columns: 1fr; }
  .oam-info-header { flex-direction: column; align-items: flex-start; }
  .bad-guy-info-card, .oam-stage-detail-card, .closed-shop-card { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .kid-status-grid,
  .reward-wallet,
  .kid-portfolio-book {
    grid-template-columns: 1fr;
  }
}
