/* Numbers owns its brand and dashboard. Shared Math learning/HUD contracts stay intact. */
body.numbers-mode { background: #d9f5f3; }
body.numbers-mode .numbers-garden {
  background: #d9f5f3 url('assets/numbers-meadow.webp') center / cover no-repeat;
  position: relative;
}
body.numbers-mode #start-screen { background-position: center; }
body.numbers-mode #start-screen .math-logo-main {
  width: min(570px, 78vw); max-width: 100%; height: auto; max-height: none;
  object-fit: contain; filter: drop-shadow(0 12px 16px #245a5d22);
}
body.numbers-mode .numbers-login-brand { position: absolute; top: 20px; left: 24px; z-index: 2; }
body.numbers-mode .numbers-login-brand .math-mini-logo { width: clamp(135px, 20vw, 200px); height: auto; max-height: none; }
body.numbers-mode .numbers-brand { background: none; border: 0; padding: 0; border-radius: 16px; cursor: pointer; box-shadow: none; }
body.numbers-mode .numbers-brand img { display: block; height: auto; object-fit: contain; }
body.numbers-mode #login-section .login-glass-card { background: #fffffff2; border: 2px solid #fff; box-shadow: 0 18px 55px #245a5d26; }

body.numbers-mode #dashboard-section { flex-direction: column; padding: 0; }
body.numbers-mode #dashboard-section .math-learning-toolbar { width: calc(100% - 48px); margin: 20px auto 0; position: relative; inset: auto; padding: 0; z-index: 1; }
body.numbers-mode #dashboard-section .math-home-logo { width: auto; }
body.numbers-mode #dashboard-section .math-home-logo img { width: clamp(135px, 19vw, 210px); height: auto; }
body.numbers-mode .numbers-foundation-home {
  width: min(1080px, calc(100% - 72px)); margin: auto; padding: 26px 0 118px;
  flex-shrink: 0; text-align: center;
}
body.numbers-mode #dashboard-section .dashboard-stage-board {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch; gap: clamp(10px, 1.7vw, 24px); width: 100%; max-width: none; margin: 0;
}
body.numbers-mode #dashboard-section .dashboard-stage-slot {
  --numbers-accent: #9165dc; --numbers-soft: #f5edff; --numbers-ink: #6941a6;
  display: flex; flex-direction: column; gap: 13px; min-width: 0;
}
body.numbers-mode #dashboard-section [data-stage='2'] { --numbers-accent: #289ad7; --numbers-soft: #e9f7ff; --numbers-ink: #126b9a; }
body.numbers-mode #dashboard-section [data-stage='3'] { --numbers-accent: #ed9252; --numbers-soft: #fff2e5; --numbers-ink: #ab5925; }
body.numbers-mode #dashboard-section [data-stage='4'] { --numbers-accent: #31ab99; --numbers-soft: #e6f8f3; --numbers-ink: #14796c; }
body.numbers-mode #dashboard-section .dashboard-stage-card.level-card {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0;
  position: relative; width: 100%; min-width: 0; min-height: 0; height: 340px;
  padding: 24px 12px 28px; overflow: hidden;
  border: 2px solid #fff; border-top: 7px solid var(--numbers-accent); border-radius: 30px;
  background: radial-gradient(ellipse at 50% 110%, var(--numbers-soft) 0 44%, transparent 44.5%), #fffffff7;
  box-shadow: 0 12px 0 -7px color-mix(in srgb, var(--numbers-accent) 23%, white), 0 18px 32px #215b6326;
  color: #294356; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
body.numbers-mode #dashboard-section .dashboard-stage-card .stage-badge {
  position: static; display: inline-flex; align-items: center; justify-content: center;
  width: auto; height: auto; min-height: 27px; padding: 4px 14px; margin: 0;
  background: var(--numbers-soft); color: var(--numbers-ink); border: 0; border-radius: 999px;
  font: 800 12px/1.5 'Outfit','Noto Sans KR',sans-serif; letter-spacing: .06em; box-shadow: none;
}
body.numbers-mode #dashboard-section .stage-illustration {
  display: flex; align-items: center; justify-content: center;
  width: 148px; height: 148px; max-width: 90%; margin: 13px 0 9px;
  background: none; border-radius: 0; box-shadow: none; flex: 0 0 auto;
}
body.numbers-mode #dashboard-section .stage-illustration img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
body.numbers-mode #dashboard-section .dashboard-stage-card .level-title {
  font-size: 29px; line-height: 1.35; font-weight: 900; margin: 0; color: #294356;
}
body.numbers-mode #dashboard-section .dashboard-stage-card .level-desc {
  display: block; margin: 10px 0 0; padding: 0; font-size: 16px; line-height: 1.55; font-weight: 700;
  color: #4e6574; white-space: normal; max-width: 100%; word-break: keep-all; overflow-wrap: anywhere;
}
body.numbers-mode #dashboard-section .stage-first-try {
  width: 100%; min-height: 48px; padding: 10px 8px; margin: 0;
  color: var(--numbers-ink); font-size: 14px; line-height: 1.5; font-weight: 800;
  border: 2px solid #fff; border-radius: 16px; background: #fffffff2;
  box-shadow: 0 5px 14px #245a5d14; word-break: keep-all; cursor: pointer;
  transition: transform .2s, background .2s;
}
body.numbers-mode #numbers-home-progress {
  width: fit-content; max-width: 100%; margin: 24px auto 0; padding: 9px 18px;
  background: #ffffffe8; border: 1px solid #fff; border-radius: 999px;
  color: #3c6472; font-size: 13px; font-weight: 700; line-height: 1.6;
}
body.numbers-mode #numbers-home-progress:empty { display: none; }
@media (hover: hover) {
  body.numbers-mode #dashboard-section .dashboard-stage-card:hover { transform: translateY(-7px); box-shadow: 0 12px 0 -7px color-mix(in srgb, var(--numbers-accent) 23%, white), 0 24px 40px #215b6338; }
  body.numbers-mode #dashboard-section .stage-first-try:hover { background: var(--numbers-soft); transform: translateY(-2px); }
}
body.numbers-mode :is(.dashboard-stage-card,.stage-first-try,.numbers-brand):focus-visible { outline: 3px solid #126b9a; outline-offset: 5px; }
body.numbers-mode .rpg-action-tray a { text-decoration: none; }
body.numbers-mode .rpg-action-tray[aria-hidden='true'] { visibility: hidden; }

/* Reports retain the existing data and menu contracts. */
.numbers-report-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 150px; }
.numbers-report-shell > header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.numbers-brand img { width: 180px; height: auto; }
.numbers-report-shell h1 { color: #254a67; font-size: 1.6rem; font-weight: 900; }
.numbers-student { padding: 18px; background: #fff; border: 1px solid #cce4f2; border-radius: 22px; margin-bottom: 18px; }
.numbers-student > header { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.numbers-student h2 { font-size: 1.2rem; font-weight: 900; }
#numbers-records-section, #numbers-class-section { overflow: auto; background: #eef9ff; }
.numbers-error { color: #a62535; padding: 20px; font-weight: 800; }

@media (max-width: 900px) {
  body.numbers-mode .numbers-foundation-home { width: calc(100% - 44px); padding-top: 20px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card.level-card { height: 300px; border-radius: 25px; padding: 22px 10px; }
  body.numbers-mode #dashboard-section .stage-illustration { width: 120px; height: 120px; margin-top: 16px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-title { font-size: 25px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-desc { font-size: 14px; }
}
@media (max-width: 600px) {
  body.numbers-mode .numbers-login-brand { top: 12px; left: 12px; }
  body.numbers-mode .numbers-login-brand .math-mini-logo { width: 132px; }
  body.numbers-mode #dashboard-section .math-learning-toolbar { width: calc(100% - 24px); margin-top: 12px; }
  body.numbers-mode #dashboard-section .math-home-logo img { width: 145px; }
  body.numbers-mode .numbers-foundation-home { width: calc(100% - 20px); padding: 16px 0 110px; }
  body.numbers-mode #dashboard-section .dashboard-stage-board { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
  body.numbers-mode #dashboard-section .dashboard-stage-slot { gap: 9px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card.level-card { height: 215px; border-width: 1px; border-top-width: 5px; border-radius: 18px; padding: 14px 4px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .stage-badge { min-height: 22px; padding: 3px 7px; font-size: 9px; }
  body.numbers-mode #dashboard-section .stage-illustration { width: 70px; height: 70px; max-width: 100%; margin: 14px 0 10px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-title { font-size: 20px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-desc { font-size: 11px; line-height: 1.5; margin-top: 7px; }
  body.numbers-mode #dashboard-section .stage-first-try { min-height: 46px; border-radius: 13px; padding: 7px 4px; font-size: 10px; line-height: 1.5; }
  body.numbers-mode #numbers-home-progress { font-size: 11px; margin-top: 18px; padding: 8px 14px; }
  .numbers-report-shell > header { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 360px) {
  body.numbers-mode #dashboard-section .dashboard-stage-board { gap: 5px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-title { font-size: 18px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-desc { font-size: 10px; }
  body.numbers-mode #dashboard-section .stage-illustration { width: 58px; height: 64px; }
}
@media (max-height: 650px) and (min-width: 601px) {
  body.numbers-mode #dashboard-section .math-learning-toolbar { margin-top: 8px; }
  body.numbers-mode #dashboard-section .math-home-logo img { width: 145px; }
  body.numbers-mode .numbers-foundation-home { padding: 12px 0 105px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card.level-card { height: 230px; padding: 13px 10px; }
  body.numbers-mode #dashboard-section .stage-illustration { width: 96px; height: 96px; margin: 8px 0; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-title { font-size: 23px; }
  body.numbers-mode #dashboard-section .dashboard-stage-card .level-desc { margin-top: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  body.numbers-mode #dashboard-section .dashboard-stage-card.level-card { animation: none; transition: none; }
  body.numbers-mode #dashboard-section .stage-first-try { transition: none; }
  body.numbers-mode #start-screen .floating { animation: none; }
}
