@font-face {
  font-family: "Baloo Local";
  src: url("./assets/fonts/baloo2-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Baloo Local";
  src: url("./assets/fonts/baloo2-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Local";
  src: url("./assets/fonts/nunito-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Local";
  src: url("./assets/fonts/nunito-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Local";
  src: url("./assets/fonts/nunito-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Local";
  src: url("./assets/fonts/nunito-900.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Nunito Local", "Aptos", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Baloo Local", "Aptos Display", "Segoe UI Variable Display", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  --font-round: "Nunito Local", "Aptos", "Segoe UI Variable Text", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  --ink: #21172f;
  --ink-2: #3a2d4b;
  --muted: #776d83;
  --line: rgba(33, 23, 47, 0.12);
  --paper: #fffaf0;
  --white: #ffffff;
  --sun: #ffca3a;
  --gold: #ff9f1c;
  --berry: #ff5d72;
  --mint: #27c6a4;
  --sky: #4b9eff;
  --violet: #7559ff;
  --shadow-sm: 0 10px 24px rgba(58, 45, 75, 0.10);
  --shadow-md: 0 18px 50px rgba(58, 45, 75, 0.14);
  --shadow-lg: 0 28px 80px rgba(58, 45, 75, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 202, 58, 0.22), rgba(75, 158, 255, 0.12) 42%, rgba(255, 93, 114, 0.16)),
    #fff8ea;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(33, 23, 47, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 23, 47, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  position: relative;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -18px 16px;
  padding: 14px 18px;
  background: rgba(255, 248, 234, 0.76);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(33, 23, 47, 0.08);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(145deg, #fff6a8, #ffca3a);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(33, 23, 47, 0.12);
  font-family: var(--font-display);
  font-weight: 1000;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 0.92;
}

.brand-subtitle,
.eyebrow,
.today-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.premium-chip,
.pill,
.small-button,
.icon-button,
select {
  border: 1px solid rgba(33, 23, 47, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 900;
}

.premium-chip {
  padding: 10px 13px;
  white-space: nowrap;
  font-family: var(--font-round);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
}

.hero-band {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
  gap: 18px;
  align-items: stretch;
  min-height: 420px;
  padding: clamp(20px, 4.4vw, 42px);
  border: 1px solid rgba(33, 23, 47, 0.1);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 240, 0.82)),
    radial-gradient(circle at 18% 15%, rgba(255, 202, 58, 0.48), transparent 34%),
    radial-gradient(circle at 88% 20%, rgba(75, 158, 255, 0.32), transparent 30%),
    linear-gradient(135deg, #fff9e8, #eef7ff);
  box-shadow: var(--shadow-lg);
}

.install-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid rgba(33, 23, 47, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 246, 168, 0.56)),
    rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-md);
}

.install-card h2 {
  margin: 2px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 0.95;
}

.install-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.hero-title {
  margin: 8px 0 12px;
  max-width: 720px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8.8vw, 6.2rem);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: #51465d;
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  line-height: 1.6;
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-round);
  font-weight: 950;
  box-shadow: var(--shadow-sm);
}

.primary-button {
  background: linear-gradient(135deg, var(--ink), #4b2c74);
  color: white;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid rgba(33, 23, 47, 0.1);
}

.hero-visual {
  position: relative;
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: 360px;
}

.mascot-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 50% 58%, rgba(255, 202, 58, 0.38), transparent 42%);
}

.mascot-stage::before,
.mascot-stage::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(33, 23, 47, 0.08);
  background: rgba(255, 255, 255, 0.52);
}

.mascot-stage::before {
  width: 86px;
  height: 86px;
  left: 4%;
  top: 12%;
}

.mascot-stage::after {
  width: 112px;
  height: 112px;
  right: 0;
  bottom: 5%;
}

.mascot {
  position: relative;
  z-index: 1;
  width: min(90%, 360px);
  filter: drop-shadow(0 20px 28px rgba(68, 38, 104, 0.2));
}

.family-score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.score-bubble {
  padding: 14px;
  border: 1px solid rgba(33, 23, 47, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.score-bubble strong {
  display: block;
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  line-height: 1;
}

.score-bubble span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 2px 12px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  font-weight: 800;
  line-height: 0.92;
}

.kids-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.kid-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 214px;
  border: 1px solid rgba(33, 23, 47, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)),
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 48%);
  box-shadow: var(--shadow-md);
}

.kid-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -38px;
  width: 136px;
  height: 136px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.16;
}

.kid-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--accent);
  color: white;
  font-size: 1.7rem;
  font-weight: 1000;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.13);
}

.rank-badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.kid-card h3 {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 0.95;
}

.points {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 8px;
}

.points strong {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 0.88;
}

.points span,
.status-line {
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  position: relative;
  z-index: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(33, 23, 47, 0.08);
}

.progress-fill {
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffca3a);
}

.control-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel,
.activity-panel {
  padding: 18px;
  border: 1px solid rgba(33, 23, 47, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.approval-panel {
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 0.95;
}

select {
  max-width: 48%;
  padding: 10px 12px;
  font-family: var(--font-round);
}

.pill,
.small-button {
  padding: 10px 12px;
  white-space: nowrap;
}

.task-list,
.reward-list,
.reminder-list,
.activity-log,
.quick-actions,
.approval-list,
.setup-grid {
  display: grid;
  gap: 10px;
}

.task-item,
.reward-item,
.reminder-item,
.log-item,
.quick-row,
.approval-item,
.mini-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(33, 23, 47, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.82);
}

.task-title,
.reward-title,
.reminder-title,
.form-title {
  display: block;
  color: var(--ink-2);
  font-family: var(--font-round);
  font-weight: 950;
}

.task-meta,
.reward-meta,
.reminder-meta,
.log-item,
.approval-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.action-cluster,
.approval-actions,
.form-row {
  display: flex;
  gap: 8px;
}

.action-button {
  min-width: 46px;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: #ffdf79;
  box-shadow: inset 0 -2px 0 rgba(33, 23, 47, 0.12), var(--shadow-sm);
  font-family: var(--font-round);
  font-weight: 1000;
}

.action-button.negative {
  background: #ffd7df;
}

.action-button.good {
  background: #bff4df;
}

.action-button.sky {
  background: #d9ebff;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

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

.mini-form {
  grid-template-columns: 1fr;
}

.mini-form input,
.import-box textarea {
  width: 100%;
  border: 1px solid rgba(33, 23, 47, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  padding: 12px 13px;
  outline: none;
}

.mini-form input:focus,
.import-box textarea:focus {
  border-color: rgba(75, 158, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(75, 158, 255, 0.14);
}

.form-row input {
  min-width: 0;
}

.compact {
  min-height: 42px;
  padding: 10px 14px;
}

.tool-button {
  width: 100%;
}

.import-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.import-box textarea {
  min-height: 108px;
  resize: vertical;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(33, 23, 47, 0.18);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.64);
  font-weight: 800;
}

.tiny-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 650;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  width: min(92vw, 460px);
  padding: 14px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-lg);
  font-weight: 900;
  transform: translate(-50%, 120px);
  transition: transform 180ms ease;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 23, 47, 0.42);
  backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
  display: none;
}

.install-modal {
  width: min(94vw, 540px);
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(33, 23, 47, 0.12);
  border-radius: 24px;
  background: #fffaf0;
  box-shadow: var(--shadow-lg);
}

.install-steps {
  display: grid;
  gap: 10px;
}

.auth-modal {
  display: grid;
  gap: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.auth-form[hidden],
.parent-only[hidden] {
  display: none;
}

.install-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(33, 23, 47, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 1000;
}

.step-title {
  display: block;
  color: var(--ink-2);
  font-weight: 950;
}

.step-copy {
  display: block;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

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

  .topbar {
    margin: 0 -12px 12px;
    padding: 12px;
  }

  .premium-chip {
    display: none;
  }

  .hero-band,
  .control-layout,
  .kids-grid,
  .install-card {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: auto;
    border-radius: 24px;
  }

  .hero-visual {
    min-height: auto;
  }

  .mascot-stage {
    min-height: 240px;
  }

  .family-score {
    grid-template-columns: 1fr 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .kid-card {
    min-height: 194px;
  }

  .panel-head {
    align-items: flex-start;
  }

  select {
    max-width: 58%;
  }

  .task-item,
  .reward-item,
  .quick-row,
  .approval-item {
    grid-template-columns: 1fr;
  }

  .action-cluster,
  .approval-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .action-button {
    width: 100%;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-subtitle {
    display: none;
  }

  .hero-title {
    font-size: 3.1rem;
  }

  .hero-actions {
    display: grid;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .family-score {
    grid-template-columns: 1fr;
  }

  select {
    max-width: 100%;
  }
}
