:root {
  --bg-1: #130f2b;
  --bg-2: #22164c;
  --panel: rgba(22, 17, 52, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --muted: #d1d5ff;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --ok: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 20px 40px rgba(0,0,0,.3);
  --radius: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, system-ui, Arial, sans-serif; color: var(--text); background: radial-gradient(circle at top, #352273, var(--bg-1) 48%, #0a0718 100%); min-height: 100%; }
body { min-height: 100vh; }
img, canvas, svg { max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
.shell, .child-shell { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 32px; }
.glass { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px); box-shadow: var(--shadow); border-radius: var(--radius); }
.panel, .hero-card, .topbar, .child-stage, .modal-card { padding: 20px; }
.landing-shell { padding-top: 24px; }
.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(560px, 100%);
  margin: 0 auto 14px;
}
.hero-card h1, .topbar h1, .child-head h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 3rem); }
.eyebrow { margin: 0 0 8px; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: #c4b5fd; }
.child-head-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.child-head-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
.child-head-texts {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.child-welcome {
  margin: 0;
  letter-spacing: .04em;
  font-weight: 800;
  color: #c4b5fd;
}
.child-head-texts h1 {
  margin: 0;
}
.hero-grid, .auth-grid, .dashboard-grid, .children-grid, .controls-grid { display: grid; gap: 16px; }
.hero-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 16px; }
.mini-card { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.06); text-align: center; font-weight: 700; }
.auth-grid, .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 18px; }
.auth-grid {
  width: min(560px, 100%);
  margin-left: auto;
  margin-right: auto;
}
label { display: block; font-size: .92rem; margin-bottom: 12px; color: var(--muted); }
input, textarea, select { width: 100%; margin-top: 8px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); padding: 12px 14px; outline: none; }
.code-input-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.code-input-row input {
  margin-top: 0;
}
.code-paste-btn {
  min-height: 44px;
  border-radius: 12px;
  white-space: nowrap;
}
input[type="color"] {
  width: 52px;
  height: 44px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.12);
}
textarea { resize: vertical; }
.form-row, .section-head, .topbar, .child-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.topbar {
  flex-direction: column;
  align-items: flex-start;
}
.topbar-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.family-code-panel {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,23,42,.45);
}
.family-code-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
#familyCodeValue {
  display: inline-block;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: .08em;
  background: rgba(15,23,42,.7);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  padding: 10px 12px;
  color: #bfdbfe;
}
.dashboard-page .dashboard-shell > .topbar.glass,
.dashboard-page .dashboard-shell > section.panel.glass {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.btn { border: 0; border-radius: 16px; padding: 12px 16px; min-height: 44px; cursor: pointer; font-weight: 800; transition: transform .18s ease, opacity .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ec4899); color: white; }
.btn.secondary { background: linear-gradient(135deg, var(--accent-2), #3b82f6); color: white; }
.btn.ghost { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #f97316); color: white; }
.install-fab {
  position: fixed;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 2400;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 10px 16px;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .02em;
  color: #ecfeff;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 10px 24px rgba(2,6,23,.35);
}
.btn.icon-only {
  padding: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-height: 44px;
  overflow: hidden;
}
.btn.icon-only img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border-radius: inherit;
}
.profile-action-wrap {
  margin-top: 12px;
  overflow: hidden;
  padding: 2px 0;
}
.profile-app-drawer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  padding: 12px;
}
.profile-app-btn {
  min-height: 92px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.28);
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  overflow: hidden;
}
.profile-app-btn-new {
  background: linear-gradient(135deg, rgba(59,130,246,.45), rgba(37,99,235,.35));
  border-color: rgba(147,197,253,.75);
}
.profile-app-btn-qr {
  background: linear-gradient(135deg, rgba(16,185,129,.42), rgba(5,150,105,.34));
  border-color: rgba(110,231,183,.75);
}
.profile-app-btn-open {
  background: linear-gradient(135deg, rgba(14,165,233,.44), rgba(2,132,199,.34));
  border-color: rgba(125,211,252,.75);
}
.profile-app-btn-games {
  background: linear-gradient(135deg, rgba(56,189,248,.46), rgba(37,99,235,.34));
  border-color: rgba(186,230,253,.78);
}
.profile-app-btn-share {
  background: linear-gradient(135deg, rgba(168,85,247,.44), rgba(124,58,237,.34));
  border-color: rgba(216,180,254,.75);
}
.profile-app-btn-edit {
  background: linear-gradient(135deg, rgba(245,158,11,.46), rgba(217,119,6,.36));
  border-color: rgba(253,224,71,.78);
}
.profile-app-btn-photo {
  background: linear-gradient(135deg, rgba(236,72,153,.46), rgba(219,39,119,.36));
  border-color: rgba(251,207,232,.78);
}
.profile-app-btn-delete {
  border-color: rgba(251,113,133,.85);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.profile-app-btn > img {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  display: block;
  object-fit: contain;
}
.profile-app-btn span {
  font-size: .78rem;
  line-height: 1.1;
  font-weight: 900;
  text-align: center;
}
.hidden { display: none !important; }
.toast {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, .74);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 3000;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
}
.toast-content {
  display: block;
  width: min(560px, 100%);
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,.38);
  padding: 18px 16px;
  text-align: center;
  font-size: clamp(1rem, 3.8vw, 1.2rem);
  font-weight: 900;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
  box-shadow: 0 20px 40px rgba(0,0,0,.42);
  transform: translateY(6px) scale(.98);
  transition: transform .2s ease;
}
.toast-inner {
  display: grid;
  gap: 10px;
}
.toast-message {
  margin: 0;
}
.toast-close-btn {
  justify-self: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border-color: rgba(255,255,255,.65) !important;
  background: rgba(15,23,42,.35);
  color: #ffffff;
}
.toast.show .toast-content {
  transform: translateY(0) scale(1);
}
.toast.tone-success .toast-content {
  background: linear-gradient(135deg, #16a34a, #22c55e, #10b981);
  color: #ecfeff;
}
.toast.tone-danger .toast-content {
  background: linear-gradient(135deg, #dc2626, #ef4444, #f97316);
  color: #fff7ed;
}
.toast.tone-warning .toast-content {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6, #8b5cf6);
  color: #eff6ff;
}
.children-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.children-list { display: grid; gap: 12px; }
.child-card, .task-card, .mission-chip { border-radius: 22px; padding: 16px; border: 1px solid var(--line); }
.child-card {
  background: var(--child-card-color, #7c3aed);
  color: var(--child-card-text, #f8fafc);
}
.task-card {
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.11));
}
.mission-chip { background: rgba(255,255,255,.06); }
.child-summary-panel {
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: #0f172a;
  border: 1px solid rgba(15,23,42,.12);
}
.child-summary-panel h4 {
  margin: 0;
  font-size: .9rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.summary-mood {
  margin: 6px 0 10px;
  font-size: .82rem;
  color: rgba(15,23,42,.82);
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  padding: 8px 10px;
  font-weight: 800;
}
.summary-mood.summary-mood-warning {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff7ed;
  border-color: rgba(194,65,12,.55);
}
.summary-mood.summary-mood-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ecfdf5;
  border-color: rgba(21,128,61,.55);
}
.summary-mood.summary-mood-info {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: #eff6ff;
  border-color: rgba(30,64,175,.5);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-top: 1px dashed rgba(15,23,42,.18);
}
.summary-row strong {
  font-size: 1rem;
}
.btn:focus-visible,
.task-icon-btn:focus-visible,
.task-segment-toggle:focus-visible,
.task-segment-edge:focus-visible {
  outline: 3px solid rgba(255,255,255,.9);
  outline-offset: 2px;
}
.child-card .avatar { font-size: 2rem; }
.child-card-collapsible { padding: 0; overflow: hidden; }
.child-card-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}
.profile-toggle-arrow {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 900;
  color: var(--child-card-color, #7c3aed);
  border: 2px solid #ffffff;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0,0,0,.2);
  flex-shrink: 0;
}
.child-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-identity {
  display: grid;
  gap: 6px;
}
.profile-name {
  margin: 0;
  font-size: clamp(1.08rem, 2.5vw, 1.35rem);
  letter-spacing: .01em;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.profile-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.18);
  color: var(--child-card-text, #f8fafc);
  backdrop-filter: blur(4px);
}
.child-card-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.child-card-body > .controls-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.task-meta-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.task-priority-select { font-weight: 900; letter-spacing: .03em; }
.task-priority-select.priority-normal { color: #86efac; }
.task-priority-select.priority-despacio { color: #67e8f9; }
.task-priority-select.priority-urgente { color: #fde047; }
.task-switch-wrap strong { color: #bfdbfe; }
.task-switch-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.task-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
  border: 1px solid rgba(255,255,255,.32);
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
}
.task-switch::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .18s ease;
}
.task-switch:checked {
  background: rgba(34,197,94,.75);
}
.task-switch:checked::after {
  transform: translateX(20px);
}
.gender-switch-row {
  margin-top: 8px;
}
.gender-switch {
  display: inline-block;
  cursor: pointer;
}
.gender-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.gender-switch-track {
  position: relative;
  width: min(100%, 230px);
  min-width: 200px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  padding: 6px;
  border-radius: 999px;
  background: #38bdf8;
  border: 1px solid #0ea5e9;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 4px 14px rgba(14,165,233,.3);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.gender-switch-option {
  position: relative;
  z-index: 2;
  text-align: center;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .01em;
  user-select: none;
  transition: color .2s ease;
}
.gender-switch-option-nino {
  color: #1d4ed8;
}
.gender-switch-option-nina {
  color: rgba(131,24,67,.45);
}
.gender-switch-thumb {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 2px 8px rgba(15,23,42,.2);
  transition: transform .2s ease;
}
.gender-switch-input:checked + .gender-switch-track {
  background: #f9a8d4;
  border-color: #ec4899;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 4px 14px rgba(236,72,153,.3);
}
.gender-switch-input:checked + .gender-switch-track .gender-switch-thumb {
  transform: translateX(100%);
}
.gender-switch-input:checked + .gender-switch-track .gender-switch-option-nino {
  color: rgba(30,64,175,.5);
}
.gender-switch-input:checked + .gender-switch-track .gender-switch-option-nina {
  color: #d946ef;
}
.gender-switch-input:focus-visible + .gender-switch-track {
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 2px;
}
.task-days-wrap {
  margin-top: 8px;
  border-top: 1px dashed rgba(255,255,255,.2);
  padding-top: 8px;
}
.task-rename-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.task-rename-row input {
  margin-top: 0;
}
.task-details {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 14px));
  max-height: 72vh;
  overflow: auto;
  z-index: 1200;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: rgba(15,23,42,.96);
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
  padding: 12px;
}
.task-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.task-config-head h4 {
  margin: 0;
  font-size: .92rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.task-config-dirty {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(250, 204, 21, .22);
  border: 1px solid rgba(250, 204, 21, .5);
  color: #fde68a;
  font-weight: 800;
  font-size: .78rem;
  text-align: center;
}
.task-config-actions {
  position: sticky;
  bottom: 0;
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: linear-gradient(180deg, rgba(15,23,42,0), rgba(15,23,42,.98) 40%);
}
.task-config-close {
  background: linear-gradient(135deg, #ff2d55, #ff6b35);
  color: #ffffff;
  font-weight: 900;
}
.task-config-save {
  background: linear-gradient(135deg, #0ea5ff, #2563eb);
  color: #ffffff;
  font-weight: 900;
}
.task-days-title {
  margin: 0 0 8px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 800;
}
.task-days-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-carousel-wrap {
  margin-top: 10px;
  overflow: hidden;
  border-radius: 18px;
  touch-action: pan-y;
}
.task-carousel-wrap.task-config-open-wrap {
  overflow: visible;
}
.task-carousel-track {
  display: flex;
  gap: 0;
  width: 100%;
  transition: transform .62s ease;
}
.task-carousel-track.task-config-open-track {
  transform: none !important;
}
.task-slide {
  min-width: 100%;
}
.task-carousel-nav {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.task-carousel-nav-blue .btn {
  background: linear-gradient(135deg, #0ea5ff, #2563eb);
  border: 1px solid rgba(255,255,255,.35);
  color: #ffffff;
}
.task-jump-vertical {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.task-jump-btn {
  text-align: left;
  justify-content: flex-start;
}
.task-jump-vertical-pending .task-jump-btn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.28);
}
.task-jump-vertical-completed .task-jump-btn {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.28);
}
.task-jump-btn.active {
  transform: translateY(-1px);
}
.task-jump-vertical-pending .task-jump-btn.active {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border-color: rgba(255,255,255,.5);
}
.task-jump-vertical-completed .task-jump-btn.active {
  background: linear-gradient(135deg, #16a34a, #166534);
  border-color: rgba(255,255,255,.5);
}
.task-action-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
}
.task-icon-btn {
  width: 100%;
  min-height: 88px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  overflow: visible;
  cursor: pointer;
}
.task-icon-btn img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}
.task-icon-btn span {
  font-size: .76rem;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
  color: #e8ecff;
}
.task-icon-btn.danger {
  border-color: rgba(244,63,94,.65);
  background: rgba(244,63,94,.18);
}
.task-action-wrap {
  overflow: visible;
  padding: 2px 0;
}

.task-segment {
  margin-top: 10px;
}
.task-segment-toggle {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 800;
}
.task-segment-body {
  margin-top: 8px;
}
.task-segment-pending .task-segment-toggle {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: rgba(255,255,255,.3);
  color: #ffffff;
}
.task-segment-completed .task-segment-toggle {
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-color: rgba(255,255,255,.3);
  color: #ffffff;
}
.task-segment-pending .task-segment-edge {
  border-top-color: rgba(239, 68, 68, .72);
}
.task-segment-completed .task-segment-edge {
  border-top-color: rgba(34, 197, 94, .72);
}
.task-segment-edge {
  width: 100%;
  height: 16px;
  margin-top: 10px;
  border: 0;
  border-top: 2px dashed rgba(255,255,255,.26);
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}
.task-segment-edge:hover {
  border-top-color: rgba(255,255,255,.55);
}
.copy-target-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.copy-target-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
}
.task-library-box {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(15,23,42,.3);
}
.task-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.task-library-title {
  margin: 0;
  color: #bfdbfe;
  font-weight: 800;
}
.task-library-toggle {
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .8rem;
}
.task-library-panel {
  margin-top: 10px;
}
.task-library-checklist {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}
.task-library-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
  font-size: .85rem;
  line-height: 1.2;
}
.task-library-item input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  margin: 0 !important;
  margin-top: 0 !important;
  flex: 0 0 18px;
}
.task-library-item span {
  display: block;
}
.task-library-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}
.task-library-select-all {
  grid-column: 1 / -1;
}
.day-chip {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .74rem;
  cursor: pointer;
}
.day-chip.active {
  border-color: rgba(34,197,94,.75);
  color: #86efac;
  background: rgba(34,197,94,.18);
}
.profile-photo {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.35);
}
.profile-photo-large {
  width: 118px;
  height: 118px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.35);
  display: block;
  margin: 0;
}
.edit-photo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  margin-bottom: 12px;
}
.edit-photo-placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .86rem;
  color: #cbd5e1;
  border: 2px dashed rgba(255,255,255,.3);
  background: rgba(15,23,42,.45);
}
.photo-editor-wrap {
  display: grid;
  place-items: center;
  margin-top: 12px;
}
#photoEditorCanvas {
  width: 280px;
  height: 280px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
  touch-action: none;
}
.photo-modal-card {
  width: min(520px, 100%);
}
.photo-modal-head {
  margin-bottom: 4px;
}
.photo-modal-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.photo-modal-actions-bottom {
  margin-top: 10px;
}
.photo-zoom-label {
  margin-top: 12px;
  margin-bottom: 0;
}
.task-list { display: grid; gap: 14px; }
.task-card.completed, .mission-chip.completed { border-color: rgba(34,197,94,.5); box-shadow: inset 0 0 0 1px rgba(34,197,94,.35); }
.task-card {
  border: 4px solid #facc15;
}
.task-number-badge {
  min-width: 170px;
  width: fit-content;
  min-height: 62px;
  margin: 0 auto 10px;
  padding: 10px 18px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: #b91c1c;
  border: 4px solid #facc15;
  color: #facc15;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: .02em;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.task-card.completed .task-number-badge {
  background: #15803d;
  border-color: #facc15;
  color: #facc15;
}
.task-head-stack {
  align-items: stretch;
  flex-direction: column;
}
.task-head-stack > div:first-child,
.task-card h3 {
  text-align: center;
}
.task-details > p {
  text-align: center;
}
.task-report-card {
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.1);
  color: #0f172a;
}
.task-evidence-wrap {
  margin-top: 8px;
  border-top: 1px dashed rgba(15,23,42,.2);
  padding-top: 8px;
  display: grid;
  justify-items: center;
  gap: 6px;
}
.task-evidence-thumb {
  width: min(180px, 100%);
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.2);
}
.task-evidence-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(180px, 100%);
  min-height: 56px;
  border-radius: 10px;
  border: 1px dashed rgba(15,23,42,.28);
  color: rgba(15,23,42,.72);
  font-weight: 700;
  font-size: .84rem;
}
.task-evidence-expiry {
  margin: 0;
  font-size: .8rem;
  font-weight: 800;
  color: rgba(15,23,42,.8);
  text-align: center;
}
.task-report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px dashed rgba(15,23,42,.16);
}
.task-report-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.task-report-row span {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(15,23,42,.72);
}
.task-report-row strong {
  font-size: .9rem;
}
.task-details {
  margin-top: 10px;
}
.task-details-toggle {
  min-width: 122px;
}
.task-focus-glow {
  outline: 2px solid rgba(34, 197, 94, .85);
  box-shadow: 0 0 0 3px rgba(34,197,94,.2), inset 0 0 0 1px rgba(34,197,94,.45);
}
.code-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: .82rem; font-weight: 800; background: rgba(255,255,255,.08); }
.copy-link { word-break: break-all; font-size: .88rem; color: #bfdbfe; }
.child-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.child-stage { width: min(860px, 100%); }
.player-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(124,58,237,.26), rgba(6,182,212,.10));
  border: 1px solid var(--line);
}
.visualizer {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .5;
  pointer-events: none;
}
.visualizer canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: saturate(1.1) contrast(1.04);
}
.task-banner, .timer-wrap, .retro-player, .mission-actions, #audioPlayer {
  position: relative;
  z-index: 1;
}
.task-banner { text-align: center; margin-bottom: 16px; }
.task-banner h2 { margin: 8px 0; font-size: clamp(1.6rem, 4vw, 2.6rem); }
#taskCodeBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(15,23,42,.55);
  color: #bfdbfe;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#taskTitle {
  margin: 10px 0 6px;
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 900;
  line-height: 1.02;
  text-shadow: 0 4px 16px rgba(2,6,23,.35);
}
#taskDescription {
  min-height: 20px;
}
.timer-wrap { margin: 14px 0 18px; }
.timer-corner-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.timer-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 0;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(191,219,254,.26);
  background: rgba(15,23,42,.62);
  backdrop-filter: blur(6px);
}
.timer-mode-btn {
  border: 1px solid transparent;
  background: rgba(255,255,255,.04);
  color: #dbeafe;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.timer-mode-btn:hover {
  border-color: rgba(191,219,254,.35);
  background: rgba(255,255,255,.09);
}
.timer-mode-btn.active {
  background: linear-gradient(135deg, rgba(14,165,233,.94), rgba(59,130,246,.94));
  border-color: rgba(191,219,254,.95);
  color: #eff6ff;
  box-shadow: 0 6px 14px rgba(14,165,233,.3);
  transform: translateY(-1px);
}
.timer-wrap.timer-corner {
  position: relative;
  top: auto;
  right: auto;
  margin: 10px auto 14px;
  width: min(430px, 100%);
  z-index: 2;
  --timer-side-size: 116px;
}
.timer-wrap.timer-corner .timer-dual {
  display: block;
}
.timer-wrap.timer-corner .timer-block {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255,255,255,.24);
}
.timer-wrap.timer-corner .timer-pill {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  line-height: 1.05;
}
.timer-wrap.timer-corner .timer-label {
  font-size: .8rem;
  letter-spacing: .08em;
}
.timer-wrap.timer-corner .timer-block:last-child,
.timer-wrap.timer-corner .overtime-copy,
.timer-wrap.timer-corner .progress-copy {
  display: none;
}
.timer-wrap.timer-corner .timer-mood-corner {
  display: grid;
  place-items: center;
  width: var(--timer-side-size);
  min-width: var(--timer-side-size);
  height: var(--timer-side-size);
  padding: 0;
}
.timer-side-stack {
  display: grid;
  grid-template-columns: repeat(2, var(--timer-side-size));
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.timer-wrap.timer-corner .timer-mood-corner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.timer-game-img {
  width: var(--timer-side-size);
  min-width: var(--timer-side-size);
  height: var(--timer-side-size);
  min-height: var(--timer-side-size);
  object-fit: contain;
  object-position: center;
  display: block;
  cursor: pointer;
  transition: transform .16s ease;
}
.timer-game-img:hover {
  transform: translateY(-1px) scale(1.02);
}
.timer-game-img:focus-visible {
  outline: 3px solid rgba(191,219,254,.95);
  outline-offset: 2px;
}
.timer-wrap.timer-corner .timer-mini-bar.primary {
  display: block;
  margin-top: 8px;
  height: 24px;
}
.timer-wrap.timer-corner .timer-mini-bar.primary div {
  background: linear-gradient(90deg, #22c55e, #84cc16, #f97316, #ef4444);
}
.timer-wrap.timer-corner .timer-mini-bar.primary.elapsed-mode div {
  background: linear-gradient(90deg, #22d3ee, #3b82f6, #a855f7, #ec4899);
}
.timer-wrap.timer-corner .timer-label.top {
  display: block;
}
.timer-wrap.timer-corner .timer-pill {
  margin-bottom: 2px;
}
.timer-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.timer-block { text-align: center; }
.timer-mood {
  display: grid;
  place-items: center;
}
.timer-mood img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.28));
}
.timer-label {
  display: block;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.timer-label.top { margin-bottom: 2px; }
.timer-pill { text-align: center; font-size: clamp(2rem, 9vw, 4rem); font-weight: 900; }
.timer-pill.alt { font-size: clamp(1.6rem, 7vw, 3rem); color: #bef264; }
.timer-mini-bar {
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.16);
}
.timer-mini-bar div {
  height: 100%;
  width: 0;
  transition: width .25s linear;
}
.timer-mini-bar.remaining div {
  background: linear-gradient(90deg, #22c55e, #84cc16, #f97316, #ef4444);
}
.timer-mini-bar.elapsed div {
  background: linear-gradient(90deg, #22d3ee, #3b82f6, #a855f7, #ec4899);
}
.overtime-copy {
  min-height: 20px;
  text-align: center;
  color: #fca5a5;
  font-weight: 700;
  margin-top: 4px;
}
.progress-copy { text-align: center; color: var(--muted); margin: 6px 0 10px; }
.controls-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 18px; }
.retro-player {
  margin-top: 18px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.control-item {
  min-width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.icon-control {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  width: 74px;
  min-width: 74px;
  height: 74px;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.icon-control:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.16);
}
.icon-control img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.icon-name {
  font-size: .76rem;
  line-height: 1;
  color: rgba(255,255,255,.92);
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.icon-control.active {
  border-color: rgba(34, 197, 94, .85);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .45);
}
.mission-actions {
  grid-template-columns: 1fr;
}
.mission-actions .btn {
  width: 100%;
  min-height: 58px;
  font-size: 1.06rem;
  font-weight: 900;
}
.mission-list { margin-top: 18px; display: grid; gap: 10px; }
.mission-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.task-status {
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-style: normal;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.task-status.done {
  background: rgba(34, 197, 94, .25);
  border: 1px solid rgba(34, 197, 94, .75);
  color: #86efac;
}
.task-status.pending {
  background: rgba(250, 204, 21, .2);
  border: 1px solid rgba(250, 204, 21, .75);
  color: #fde68a;
}
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 18px; z-index: 2600; }
.modal-card { width: min(420px, 100%); }
.picker-modal-card {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}
.picker-copy {
  margin: 0;
  color: #dbeafe;
  font-size: .95rem;
}
.picker-list {
  overflow: auto;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(15,23,42,.35);
  padding: 8px;
  display: grid;
  gap: 8px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
}
.picker-item input[type="checkbox"] {
  margin: 0;
  width: 36px;
  height: 36px;
}
.picker-item-main {
  display: grid;
  gap: 2px;
}
.picker-item-main strong {
  color: #f8fafc;
}
.picker-item-main small {
  color: #bfdbfe;
}
.picker-item.random-item {
  position: relative;
  transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}
.picker-list-random {
  position: relative;
  padding-top: 56px;
  padding-bottom: 56px;
}
.picker-list-random::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 56px;
  transform: translateY(-50%);
  border-radius: 12px;
  border: 2px solid rgba(59,130,246,.9);
  box-shadow: 0 0 0 2px rgba(59,130,246,.22);
  pointer-events: none;
  z-index: 3;
}
.picker-list-random::after {
  content: '▼';
  position: absolute;
  right: 16px;
  top: calc(50% - 12px);
  color: rgba(191,219,254,.92);
  font-size: 1rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 4;
}
.picker-item.random-item.active {
  border-color: rgba(59,130,246,.8);
  background: rgba(59,130,246,.2);
  opacity: 1;
}
.picker-list-random.spinning .picker-item.random-item.active {
  border-color: rgba(248,113,113,.9);
  background: rgba(220,38,38,.24);
}
.picker-list-random.spinning::before {
  border-color: rgba(248,113,113,.95);
  box-shadow: 0 0 0 2px rgba(239,68,68,.28);
}
.picker-item.random-item.winner {
  border-color: rgba(74,222,128,.95);
  background: rgba(22,163,74,.3);
  box-shadow: 0 0 0 2px rgba(34,197,94,.34);
  animation: randomWinnerBlink .35s ease-in-out 4;
}
.random-chosen-copy {
  margin: 4px 0 0;
  border-radius: 12px;
  border: 1px solid rgba(74,222,128,.6);
  padding: 8px 10px;
  text-align: center;
  font-weight: 900;
  color: #ecfdf5;
  background: linear-gradient(135deg, rgba(22,163,74,.9), rgba(16,185,129,.9));
}
@keyframes randomWinnerBlink {
  0%, 100% { opacity: 1; transform: scale(1.02); }
  50% { opacity: .45; transform: scale(1.05); }
}
.picker-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}
.picker-actions-top {
  margin-bottom: 2px;
}
.proof-preview-wrap {
  border: 1px dashed rgba(255,255,255,.28);
  border-radius: 14px;
  background: rgba(15,23,42,.35);
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 10px;
}
.proof-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
}
.proof-hint {
  margin: 0;
  color: #bfdbfe;
  font-weight: 700;
  text-align: center;
}
.proof-upload-btn {
  display: grid;
  place-items: center;
  cursor: pointer;
}
.create-photo-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.create-photo-preview {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.45);
}
.proof-upload-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.proof-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
.finish-image {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin: 4px auto 10px;
}
#gameCanvas { display: block; width: 100%; max-width: 320px; margin: 0 auto; background: linear-gradient(180deg, #0f172a, #1d4ed8 60%, #0ea5e9); border-radius: 18px; border: 1px solid var(--line); }
@media (max-width: 980px) {
  .shell, .child-shell { width: min(100%, calc(100% - 16px)); }
  .panel, .hero-card, .topbar, .child-stage, .modal-card { padding: 16px; }
  .auth-grid, .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  .shell, .child-shell { width: calc(100% - 12px); padding: 10px 0 22px; }
  .panel, .hero-card, .topbar, .child-stage, .modal-card { padding: 14px; border-radius: 18px; }
  .hero-card h1, .topbar h1, .child-head h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .controls-grid, .hero-grid, .children-grid { grid-template-columns: 1fr; }
  .picker-actions,
  .picker-actions-top {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .child-card-body > .controls-grid,
  .task-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-main-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .profile-app-drawer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
  }
  .profile-app-btn {
    min-height: 86px;
  }
  .task-action-icons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
  }
  .task-details {
    width: calc(100% - 10px);
    bottom: 6px;
    border-radius: 14px;
    max-height: 76vh;
    padding: 10px;
  }
  .profile-app-drawer {
    gap: 8px;
  }
  .task-library-head {
    flex-direction: column;
    align-items: stretch;
  }
  .task-library-toggle {
    width: 100%;
  }
  .photo-modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .task-action-icons {
    gap: 8px;
  }
  .task-icon-btn {
    min-height: 82px;
    padding: 8px 6px;
  }
  .task-icon-btn img {
    width: 36px;
    height: 36px;
  }
  .child-card-toggle { padding: 12px; }
  .child-card-body { padding: 0 12px 12px; }
  .profile-photo { width: 54px; height: 54px; }
  .profile-photo-large { width: 96px; height: 96px; }
  .edit-photo-row {
    flex-direction: column;
    align-items: stretch;
  }
  .edit-photo-row .profile-photo-large {
    margin: 0 auto;
  }
  .topbar-actions { display: grid; gap: 10px; }
  .topbar-actions .btn { width: 100%; }
  .task-banner h2 { font-size: clamp(1.3rem, 8vw, 1.8rem); }
  .timer-pill { font-size: clamp(1.7rem, 10vw, 2.4rem); }
  .timer-pill.alt { font-size: clamp(1.4rem, 9vw, 2rem); }
  .timer-mood img { width: 78px; height: 78px; }
  .timer-mini-bar { height: 24px; }
  .retro-player {
    justify-content: flex-start;
    border-radius: 20px;
    padding: 6px 4px;
    gap: 0;
    scrollbar-width: none;
  }
  .retro-player::-webkit-scrollbar { display: none; }
  .control-item { min-width: 64px; }
  .icon-control { width: 64px; min-width: 64px; height: 64px; }
  .icon-name { font-size: .68rem; }
  .mission-actions { grid-template-columns: 1fr; }
  .mission-chip { padding: 12px; }
  .task-status { margin-left: 6px; padding: 3px 8px; }
  .form-row, .section-head, .topbar, .child-head { flex-direction: column; align-items: stretch; }
  .section-head.compact { flex-direction: row; align-items: center; }
  .retro-player {
    margin-top: 12px;
  }
  .timer-dual { grid-template-columns: 1fr; }
  .child-shell { align-items: flex-start; }
  .toast { padding: 12px; }
  .toast-content {
    width: min(100%, 520px);
    border-radius: 16px;
    padding: 14px 12px;
  }
  .finish-image { width: 110px; height: 110px; }
}

@media (max-width: 420px) {
  .mini-card { padding: 12px; font-size: .9rem; }
  input, textarea, select { font-size: 16px; }
  .btn { padding: 11px 12px; }
  .icon-control { width: 52px; min-width: 52px; height: 52px; }
  .icon-name { font-size: .58rem; }
  .timer-label { font-size: .72rem; }
  .progress-copy { font-size: .92rem; }
  .profile-app-drawer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-app-btn > img {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
    max-width: 34px;
    max-height: 34px;
  }
  .modal { padding: 10px; }
  .modal-card { width: 100%; max-height: 92vh; overflow: auto; }
}

@media (max-width: 480px) {
  .child-stage { padding-bottom: 170px; }
  .timer-wrap.timer-corner {
    margin: 8px auto 10px;
    width: min(100%, 360px);
    --timer-side-size: 92px;
  }
  .timer-wrap.timer-corner .timer-block {
    min-width: 0;
    padding: 10px 12px;
  }
  .timer-wrap.timer-corner .timer-pill {
    font-size: clamp(1.45rem, 9vw, 2rem);
  }
  .timer-corner-top {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .timer-wrap.timer-corner .timer-mood-corner {
    justify-self: center;
    min-width: var(--timer-side-size);
    padding: 0;
  }
  .timer-side-stack {
    gap: 6px;
  }
  .timer-wrap.timer-corner .timer-mood-corner img {
    width: 100%;
    height: 100%;
  }
  .timer-game-img {
    width: var(--timer-side-size);
    min-width: var(--timer-side-size);
    height: var(--timer-side-size);
    min-height: var(--timer-side-size);
  }
  .timer-mode-toggle {
    width: min(100%, 320px);
    margin: 0 auto;
  }
  .timer-mode-btn {
    min-height: 42px;
    font-size: .78rem;
    padding: 9px 10px;
  }
  .child-head-row { align-items: flex-start; }
  .child-welcome { font-size: .9rem; }
  .child-head h1 { margin-bottom: 4px; }
  .profile-photo-large { width: 84px; height: 84px; }
  .task-banner p, #childStats, .progress-copy { font-size: .9rem; }
  .task-banner { margin-bottom: 10px; }
  .timer-wrap { margin: 8px 0 10px; }
  .timer-mood img { width: 68px; height: 68px; }

  .child-page .retro-player {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    margin-top: 10px;
    padding: 6px 4px;
    background: rgba(16, 12, 44, .92);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
  }

  .child-page .control-item { min-width: 58px; gap: 2px; }
  .child-page .icon-control { width: 58px; min-width: 58px; height: 58px; }
  .child-page .icon-name { font-size: .62rem; letter-spacing: .02em; }

  .mission-actions {
    margin-top: 8px;
  }
}
