/* Mochi Mountain — design tokens, reset, primitives.
   All colour/spacing/typography constants live HERE and nowhere else. */

:root{
  /* brand */
  --brand:#F2789F;  --brand-dark:#D4527D;  --brand-soft:#FFE1EC;
  --ink:#5B3E7A;    --ink-soft:#8B76A6;
  --bg:#FFF6E5;     --surface:#FFFFFF;     --line:#E8DCC8;
  --ok:#17A67A;     --ok-soft:#DDF4EC;     --ok-dark:#118060;
  --bad:#E4574F;    --bad-soft:#FCE3E1;    --bad-dark:#BF3D36;
  --gold:#F5B93C;   --flame:#FF8A3D;       --locked:#DED2C0;
  --locked-ink:#A99B86;

  /* unit accents */
  --u1:#F2789F; --u2:#F5A03C; --u3:#4FB3A7; --u4:#7C7BE8;
  --u5:#E4574F; --u6:#3FA9E0; --u7:#B478D8; --u8:#5FAF52;

  /* type */
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Quicksand", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-jp: "Hiragino Maru Gothic ProN", "Yu Gothic Medium", "YuGothic", "Noto Sans JP", "Meiryo", sans-serif;

  /* scale */
  --r-sm:10px; --r-md:14px; --r-lg:20px; --r-xl:28px; --r-pill:999px;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px; --sp-7:48px;
  --edge:4px;                     /* pressable button bottom edge */
  --shell:480px;                  /* app max width */
  --topbar-h:60px; --nav-h:64px;
  --mochi-line:#EFE3D2;                 /* mascot outline + arm stroke */
  --highlight:rgba(255,255,255,.45);   /* inner sheen on filled bars/buttons */
  --scrim:rgba(0,0,0,.38);             /* dialog backdrop */
  --shadow-sm:0 2px 0 rgba(91,62,122,.08);
  --shadow-md:0 6px 18px rgba(91,62,122,.12);
  --shadow-lg:0 16px 40px rgba(91,62,122,.20);
  --ease-pop:cubic-bezier(.34,1.56,.64,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--font); font-size:16px; line-height:1.45;
  -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%;
  touch-action:manipulation; overscroll-behavior-y:contain;
}
h1,h2,h3,h4,p,figure{ margin:0; }
button,input,select,textarea{ font:inherit; color:inherit; }
button{ background:none; border:0; padding:0; cursor:pointer; }
ul,ol{ margin:0; padding:0; list-style:none; }
img,svg{ display:block; max-width:100%; }
a{ color:var(--brand-dark); }

/* Japanese content — never inherit the Latin rounded stack */
.jp{ font-family:var(--font-jp); letter-spacing:.04em; font-feature-settings:"palt" 0; }

/* layout primitives */
.shell{ width:100%; max-width:var(--shell); margin-inline:auto; padding-inline:var(--sp-4); }
.stack{ display:flex; flex-direction:column; }
.row{ display:flex; align-items:center; }
.center{ display:flex; align-items:center; justify-content:center; }
.between{ display:flex; align-items:center; justify-content:space-between; }
.grow{ flex:1 1 auto; min-height:0; min-width:0; }
.gap-1{ gap:var(--sp-1);} .gap-2{ gap:var(--sp-2);} .gap-3{ gap:var(--sp-3);}
.gap-4{ gap:var(--sp-4);} .gap-5{ gap:var(--sp-5);} .gap-6{ gap:var(--sp-6);}
.hidden{ display:none !important; }

/* text */
.t-hero{ font-size:28px; font-weight:800; letter-spacing:-.01em; }
.t-title{ font-size:22px; font-weight:800; }
.t-lead{ font-size:18px; font-weight:700; }
.t-body{ font-size:16px; font-weight:600; }
.t-small{ font-size:13px; font-weight:700; }
.t-cap{ font-size:11px; font-weight:800; letter-spacing:.10em; text-transform:uppercase; }
.muted{ color:var(--ink-soft); }
.tc{ text-align:center; }

/* focus — never removed, only restyled */
:focus{ outline:none; }
:focus-visible{ outline:3px solid var(--brand); outline-offset:3px; border-radius:var(--r-sm); }

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* app scaffold — main.js fills #topbar/#view/#nav */
#app{ min-height:100dvh; display:flex; flex-direction:column; }
#view{ flex:1 1 auto; min-height:0; }
body.in-lesson #topbar, body.in-lesson #nav{ display:none; }
