/* Numelu — styles on top of Bootstrap 5. Big, round, calm; touch targets ≥ 56px. */

:root {
  --nm-ink: #2b2d42;
  --nm-muted: #6c7086;
  --nm-bg: #f3fbf8;
  --nm-card: #ffffff;
  --nm-line: #e3ece9;
  --nm-main: #20c997;
  --nm-main-d: #0ca678;
  --nm-warm: #ff922b;
  --nm-star: #fcc419;
  --nm-radius: 24px;
  --nm-shadow: 0 6px 0 rgba(43, 45, 66, .07), 0 14px 30px rgba(43, 45, 66, .06);
  --nm-font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--nm-font);
  color: var(--nm-ink);
  background: var(--nm-bg);
  font-size: 1.0625rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
.nm-main { flex: 1; padding-top: 1rem; padding-bottom: 2rem; }
.nm-h2 { font-size: 1.35rem; margin: 2rem 0 1rem; }
.nm-link { color: var(--nm-main-d); font-weight: 800; text-decoration: none; }
.nm-link:hover { text-decoration: underline; }

/* ---------- header / footer ---------- */
.nm-header { background: #fff; border-bottom: 2px solid var(--nm-line); padding: .5rem 0; position: sticky; top: 0; z-index: 20; }
.nm-brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 900; font-size: 1.4rem; color: var(--nm-ink); text-decoration: none; }
.nm-nav-link {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: .3rem .8rem;
  border: 2px solid var(--nm-line); border-radius: 999px; background: #fff;
  color: var(--nm-ink); font-weight: 800; text-decoration: none; white-space: nowrap;
}
.nm-nav-link:hover, .nm-nav-link.active { border-color: var(--nm-main); color: var(--nm-ink); }
.nm-footer { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; justify-content: space-between; padding: 1rem .75rem 1.5rem; color: var(--nm-muted); font-size: .9rem; }
.dropdown-item.active { background: var(--nm-main); }

.nm-star { color: #d5dbe1; }
.nm-star.on { color: var(--nm-star); text-shadow: 0 1px 0 #e8950066; }

/* ---------- cards & buttons ---------- */
.nm-card { background: var(--nm-card); border: 2px solid var(--nm-line); border-radius: var(--nm-radius); box-shadow: var(--nm-shadow); }
.nm-btn {
  min-height: 56px; padding: .6rem 1.5rem; border-radius: 18px; border: 0;
  font-weight: 800; font-size: 1.15rem; transition: transform .08s, box-shadow .08s;
}
.nm-btn:active { transform: translateY(3px); }
.nm-btn-next, .nm-btn-next:hover, .nm-btn-next:focus { background: var(--nm-main); color: #fff; box-shadow: 0 5px 0 var(--nm-main-d); }
.nm-btn-next:active { box-shadow: 0 2px 0 var(--nm-main-d); }
.nm-btn-hint, .nm-btn-hint:hover, .nm-btn-hint:focus { background: #fff4d6; color: #8a5a00; box-shadow: 0 5px 0 #f1d27a; }
.nm-btn-hint:active { box-shadow: 0 2px 0 #f1d27a; }
.nm-btn-danger, .nm-btn-danger:hover { background: #fff; color: #c92a2a; box-shadow: inset 0 0 0 2px #ffc9c9; }
.nm-btn:focus-visible, .nm-choice:focus-visible, .nm-key:focus-visible, .nm-icon-btn:focus-visible,
.nm-grade:focus-visible, .nm-skill:focus-visible, .nm-lang:focus-visible { outline: 4px solid #74c0fc; outline-offset: 2px; }
.nm-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--nm-line); background: #fff;
  font-size: 1.3rem; font-weight: 800; color: var(--nm-ink); text-decoration: none; line-height: 1;
}
.nm-icon-btn:hover { border-color: var(--nm-main); color: var(--nm-ink); }

/* ---------- mascot ---------- */
@keyframes nm-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes nm-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-9%); } }

/* ---------- language chooser ---------- */
.nm-page-landing .nm-main { display: flex; align-items: center; justify-content: center; }
.nm-landing { text-align: center; padding: 2rem 0; width: 100%; }
.nm-landing h1 { font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 900; margin: .5rem 0 2rem; }
.nm-landing-logo { animation: nm-hop 1s ease 2; }
.nm-langs { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.nm-lang {
  display: flex; flex-direction: column; min-width: min(240px, 100%); padding: 1.3rem 2rem;
  background: #fff; border: 3px solid var(--nm-line); border-radius: var(--nm-radius); box-shadow: var(--nm-shadow);
  color: var(--nm-ink); text-decoration: none; transition: transform .12s, border-color .12s;
}
.nm-lang b { font-size: 1.9rem; font-weight: 900; }
.nm-lang span { color: var(--nm-muted); font-weight: 700; }
.nm-lang:hover, .nm-lang.last { border-color: var(--nm-main); transform: translateY(-3px); color: var(--nm-ink); }

/* ---------- home ---------- */
.nm-hero { display: flex; align-items: center; gap: 1.25rem; padding: 1rem 0 .5rem; }
.nm-hero-face { width: clamp(84px, 18vw, 150px); flex: none; }
.nm-hero .lead { color: var(--nm-muted); font-weight: 600; max-width: 42rem; }
.nm-grade {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; height: 100%;
  padding: 1.1rem 1.1rem 1rem; border-radius: var(--nm-radius); background: var(--nm-c); color: var(--nm-ink);
  text-decoration: none; box-shadow: 0 6px 0 rgba(43, 45, 66, .16); transition: transform .12s;
}
.nm-grade:hover { transform: translateY(-3px); color: var(--nm-ink); }
.nm-grade:active { transform: translateY(3px); }
.nm-grade-icon { font-size: 2.4rem; line-height: 1.1; }
.nm-grade b { font-size: 1.3rem; font-weight: 900; }
.nm-grade small { font-weight: 700; opacity: .75; }
.nm-grade-stars { margin-top: .5rem; padding: .1rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .78); font-weight: 800; font-size: .95rem; }
.nm-step { padding: 1.25rem; height: 100%; }
.nm-step h3 { font-size: 1.2rem; margin: .4rem 0 .3rem; }
.nm-step p { margin: 0; color: var(--nm-muted); font-weight: 600; }
.nm-step-icon { font-size: 2rem; line-height: 1; }

/* ---------- grade ---------- */
.nm-gradehead { display: flex; align-items: center; gap: .9rem; padding: 1rem; margin-bottom: 1.25rem; border-radius: var(--nm-radius); background: var(--nm-c); }
.nm-gradehead h1 { margin: 0; }
.nm-gradehead p { margin: 0; font-weight: 700; opacity: .8; }
.nm-skill {
  position: relative; display: flex; align-items: center; gap: .9rem; height: 100%; padding: 1rem;
  background: #fff; border: 2px solid var(--nm-line); border-radius: var(--nm-radius); box-shadow: var(--nm-shadow);
  color: var(--nm-ink); text-decoration: none; transition: transform .12s, border-color .12s;
}
.nm-skill:hover { transform: translateY(-2px); border-color: var(--nm-main); color: var(--nm-ink); }
.nm-skill.rec { border-color: var(--nm-main); }
.nm-skill-icon { font-size: 2rem; width: 58px; height: 58px; flex: none; display: grid; place-items: center; background: var(--nm-bg); border-radius: 18px; }
.nm-skill-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.nm-skill-body b { font-weight: 800; font-size: 1.1rem; line-height: 1.2; }
.nm-skill-body small { color: var(--nm-muted); font-weight: 600; line-height: 1.25; margin: .15rem 0 .5rem; }
.nm-skill-stars { font-size: 1.25rem; white-space: nowrap; letter-spacing: 1px; }
.nm-skill-rec { position: absolute; top: -12px; right: 14px; padding: .05rem .7rem; border-radius: 999px; background: var(--nm-main); color: #fff; font-size: .8rem; font-weight: 800; }
.nm-bar { display: block; height: 8px; border-radius: 8px; background: var(--nm-line); overflow: hidden; }
.nm-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--nm-main); transition: width .5s; }

/* ---------- player ---------- */
.nm-page-play .nm-main { padding-top: .6rem; }
.nm-top { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.nm-dots { flex: 1; display: flex; gap: 6px; justify-content: center; }
.nm-dots i { flex: 1; max-width: 46px; height: 12px; border-radius: 12px; background: var(--nm-line); }
.nm-dots i.now { background: #a5d8ff; }
.nm-dots i.clean { background: var(--nm-main); }
.nm-dots i.helped { background: var(--nm-star); }
.nm-dots i.fail { background: #ffc078; }

.nm-stage { padding: .75rem; }
.nm-say { display: flex; align-items: center; gap: .6rem; padding: .15rem .25rem .6rem; font-size: clamp(1.15rem, 3.4vw, 1.5rem); font-weight: 800; line-height: 1.25; }
.nm-scene-host { background: #fbfdff; border: 2px dashed #d8e6f3; border-radius: 18px; scroll-margin-top: 70px; }
.nm-scene { display: block; width: 100%; height: auto; font-family: var(--nm-font); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.nm-scene text { pointer-events: none; }

.nm-fb { display: flex; gap: .75rem; align-items: flex-start; margin-top: .75rem; padding: .8rem 1rem; border-radius: 18px; border: 2px solid; animation: nm-in .25s ease; }
.nm-fb[hidden] { display: none; }
.nm-fb-face { width: 58px; flex: none; }
.nm-fb-title { font-weight: 900; font-size: 1.15rem; }
.nm-fb-text { font-weight: 600; }
.nm-fb-text p { margin: 0 0 .35rem; }
.nm-fb-text p:last-child { margin: 0; }
.nm-tip { color: #5f4b00; }
.nm-fb-ok { background: #e6fcf5; border-color: #96f2d7; }
.nm-fb-try { background: #fff4e6; border-color: #ffd8a8; }
.nm-fb-hint { background: #e7f5ff; border-color: #a5d8ff; }
.nm-fb-show { background: #f3f0ff; border-color: #d0bfff; }
@keyframes nm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.nm-panel { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.nm-expr { text-align: center; font-size: clamp(2rem, 8vw, 3rem); font-weight: 900; line-height: 1.2; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35em; white-space: pre-wrap; }
.nm-expr[hidden] { display: none; }
.nm-slot { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; min-height: 1.5em; padding: 0 .25em; border: 3px dashed #a5d8ff; border-radius: 14px; color: #74c0fc; background: #f8fbff; }
.nm-slot.filled { color: var(--nm-ink); border-style: solid; }
.nm-slot.ok { color: #087f5b; border-color: var(--nm-main); background: #e6fcf5; border-style: solid; }
.nm-slot.shown { color: #6741d9; border-color: #b197fc; background: #f3f0ff; border-style: solid; }
.nm-frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; font-size: .8em; }
.nm-frac b { padding: 0 .2em; border-bottom: .09em solid currentColor; font-weight: inherit; }
.nm-frac i { font-style: normal; padding: 0 .2em; }

.nm-choices { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); }
.nm-choices-3 { grid-template-columns: repeat(3, 1fr); }
.nm-choice, .nm-key {
  min-height: 64px; border-radius: 18px; border: 2px solid #cfe3f5; background: #fff; color: var(--nm-ink);
  font-size: 1.8rem; font-weight: 900; box-shadow: 0 5px 0 #cfe3f5; transition: transform .08s, box-shadow .08s;
  touch-action: manipulation;
}
.nm-choice:active, .nm-key:active { transform: translateY(3px); box-shadow: 0 2px 0 #cfe3f5; }
.nm-choice:disabled, .nm-key:disabled { opacity: .5; box-shadow: none; }
.nm-choice.nm-miss { opacity: 1; background: #fff4e6; border-color: #ffd8a8; color: #c98a3c; }
.nm-choice.nm-hit { opacity: 1; background: #e6fcf5; border-color: var(--nm-main); color: #087f5b; }
.nm-pad { display: grid; gap: .5rem; grid-template-columns: repeat(5, 1fr); }
.nm-key { min-height: 58px; font-size: 1.6rem; }
.nm-key-alt { background: #f1f3f5; }
.nm-key-ok { grid-column: span 3; background: var(--nm-main); border-color: var(--nm-main-d); box-shadow: 0 5px 0 var(--nm-main-d); color: #fff; }
.nm-key-ok:active { box-shadow: 0 2px 0 var(--nm-main-d); }
.nm-tapnote { text-align: center; font-weight: 800; color: var(--nm-muted); font-size: 1.2rem; padding: .5rem; }
.nm-actions { display: flex; gap: .75rem; }
.nm-actions .nm-btn { flex: 1; }
.nm-actions [hidden] { display: none; }

.nm-finish { max-width: 560px; margin: 1rem auto; padding: 2rem 1.25rem; text-align: center; }
.nm-finish-face { width: 130px; margin: 0 auto .5rem; }
.nm-finish-stars { font-size: 2.4rem; font-weight: 900; margin: 0; }
.nm-finish-list { list-style: none; padding: 0; margin: 1rem auto; display: inline-block; text-align: left; font-weight: 700; }
.nm-finish-list i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: .5rem; }
.nm-finish-list .clean { background: var(--nm-main); }
.nm-finish-list .helped { background: var(--nm-star); }
.nm-finish-list .fail { background: #ffc078; }
.nm-finish-note { color: var(--nm-muted); font-weight: 600; }
.nm-finish-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ---------- articles ---------- */
.nm-article { max-width: 820px; margin: 0 auto; }
.nm-article .lead { color: var(--nm-muted); font-weight: 600; }
.nm-method { display: flex; gap: 1rem; padding: 1.1rem 1.25rem; margin-bottom: .9rem; }
.nm-method h2 { font-size: 1.25rem; margin: 0 0 .3rem; }
.nm-method p { margin: 0; }
.nm-total { font-size: 1.5rem; font-weight: 800; }
.nm-table th { color: var(--nm-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.nm-tag { display: inline-block; padding: .05rem .6rem; margin: .1rem 0; border-radius: 999px; background: #fff4e6; color: #8a5a00; font-size: .85rem; font-weight: 700; }

/* ---------- phones ---------- */
@media (max-width: 575.98px) {
  .nm-main { padding-left: .6rem; padding-right: .6rem; }
  .nm-stage { padding: .5rem; }
  .nm-panel { padding: .75rem; gap: .75rem; }
  .nm-pad { gap: .4rem; }
  .nm-key { min-height: 52px; }
  .nm-fb { padding: .6rem .7rem; }
  .nm-fb-face { width: 44px; }
  .nm-hero { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Numi, the companion ---------- */
.nm-numi { width: 100%; height: auto; display: block; overflow: visible; }
.nm-numi-host { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.nm-numi-body { animation: nm-breathe 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.nm-numi .nm-eyes { animation: nm-blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
.nm-numi .nm-sprout { animation: nm-sway 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.nm-numi .nm-waving { animation: nm-wave .45s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
.nm-numi .nm-twinkle { animation: nm-twinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.nm-numi[data-mood="happy"] .nm-numi-body, .nm-numi[data-mood="cheer"] .nm-numi-body { animation: nm-hop .55s ease 2, nm-breathe 3.6s ease-in-out 1.1s infinite; }
.nm-numi[data-mood="wow"] .nm-numi-body { animation: nm-pop .4s ease 1, nm-breathe 3.6s ease-in-out .4s infinite; }
.nm-numi[data-mood="think"] .nm-numi-body { animation: nm-tilt 2.4s ease-in-out infinite; }
@keyframes nm-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .975); } }
@keyframes nm-sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(6deg); } }
@keyframes nm-wave { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes nm-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }
@keyframes nm-pop { 0% { transform: scale(1); } 45% { transform: scale(1.1, 1.06); } 100% { transform: scale(1); } }
@keyframes nm-tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.nm-nav-face { width: 30px; display: inline-block; margin: -4px 0; }
.nm-nav-face .nm-numi-body, .nm-nav-face .nm-eyes, .nm-nav-face .nm-sprout { animation: none; }
.nm-say-numi { width: 62px; flex: none; margin: -6px 0 -2px; }
.nm-say-text { flex: 1; }
.nm-fb > div { flex: 1; }
.nm-fb-numi { background: #f3f0ff; border-color: #d0bfff; }
.nm-slot.numi { color: #6741d9; border-color: #b197fc; background: #f3f0ff; border-style: solid; }
.nm-dots i.teach { background: #d0bfff; }
.nm-judge .nm-choice { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem; }
.nm-judge .nm-choice small { font-size: 1rem; font-weight: 800; }
.nm-key-wide { width: 100%; }
.nm-finish-news { display: inline-block; margin: .5rem .25rem 0; padding: .3rem 1rem; border-radius: 999px; background: #e6fcf5; font-weight: 800; }
.nm-finish-face { width: 150px; }

.nm-home { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: 1.5rem; margin-bottom: 1rem; }
.nm-home-stage { flex: 1 1 240px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 300px;
  padding: 1rem; border-radius: 20px; background: linear-gradient(#e7f5ff 0 68%, #b2f2bb 68% 100%); }
.nm-home-numi { width: min(230px, 70%); }
.nm-home-info { flex: 2 1 300px; }
.nm-home-info h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; }
.nm-home-stagename { font-size: 1.2rem; margin: 0 0 .4rem; }
.nm-home-next { color: var(--nm-muted); font-weight: 700; margin: .4rem 0 0; }
.nm-bar-big { height: 14px; }
.nm-bubble { position: relative; margin-bottom: 14px; padding: .5rem 1rem; border-radius: 18px; background: #fff; border: 2px solid var(--nm-line);
  font-weight: 800; text-align: center; box-shadow: var(--nm-shadow); }
.nm-bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; margin-left: -7px; background: #fff;
  border-right: 2px solid var(--nm-line); border-bottom: 2px solid var(--nm-line); transform: rotate(45deg); }
.nm-swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.nm-swatch { width: 48px; height: 48px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--nm-line); }
.nm-swatch.on { box-shadow: 0 0 0 4px var(--nm-ink); }
.nm-wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.nm-wear { display: flex; flex-direction: column; align-items: center; gap: .1rem; min-height: 92px; padding: .5rem .3rem; border-radius: 18px;
  border: 2px solid var(--nm-line); background: #fff; color: var(--nm-ink); line-height: 1.15; }
.nm-wear span { font-size: 1.7rem; }
.nm-wear b { font-size: .9rem; }
.nm-wear small { color: var(--nm-muted); font-weight: 800; }
.nm-wear.on { border-color: var(--nm-main); background: #e6fcf5; box-shadow: 0 4px 0 var(--nm-main); }
.nm-wear.locked { background: #f1f3f5; opacity: .75; }
.nm-facts { margin: .6rem 0 0; padding-left: 1.2rem; }
.nm-facts li { margin-bottom: .2rem; }
@media (max-width: 575.98px) {
  .nm-say-numi { width: 50px; }
  .nm-home { padding: 1rem; }
}
@media (max-width: 575.98px) {
  .nm-brand span { display: none; }
  .nm-nav-link { padding: .3rem .6rem; }
}

.nm-ico { width: 1.7em; height: 1.7em; display: block; margin: 0 auto; }
