
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/nunito-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/nunito-800-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* 2026-09-02: 土台は Superr（クリーム紙・墨・マーカー橙）。暗い配色は下のブロックのまま */
  --acc: #ff6f1e;
  --acc-lip: #ce500a;
  --on-acc: #171717;
  --bg: #fdfbf9;
  --surface: #f7efe9;
  --border: #bebcbb;
  /* #777777 は白の上で 4.48:1 で、4.5 にわずかに届いていなかった（本番で実測）。
     #6e6e6e で 5.1:1。見た目はほぼ変わらないが、説明文と下部ナビの字が基準に乗る */
  --muted: #5f574f;
  --disabled: #a59f97;
  --text: #171717;
  /* deslop-standard v3: カード 12px・ボタン 20px（Superr） */
  --r: 12px;
  --r-lg: 20px;
  --lip: 4px;
  --lip-sm: 2px;

  --dur: .3s;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-pop: cubic-bezier(.35, 1.8, .35, .83);

  --font: 'Nunito', 'M PLUS Rounded 1c', ui-rounded, "Hiragino Maru Gothic ProN", "BIZ UDPGothic",
          "Yu Gothic UI", Meiryo, "Noto Sans JP", system-ui, sans-serif;

  --nd: 70px;                 
  --nd-lip: 6px;              
  --ring-gap: 6px;            
  --ring-w: 8px;              
  --topbar-h: 56px;

  --p: 0;

  --unit: var(--acc);
  --unit-lip: var(--acc-lip);
  --unit-ink: var(--on-acc);
}

/*
 * 暗い配色。
 *
 * 🚨 2026-08-30。ここは @media (prefers-color-scheme) だけを見ていたので、
 *    サイト上部の切替ボタンでは動かせなかった（OSの設定に固定されていた）。
 *    三段構えにする。
 *      1) 本人が選んでいない → OS に従う（:root:not([data-theme="light"])）
 *      2) 本人が「暗い」を選んだ → OS が明るくても暗い
 *    どれか一つでも欠けると、切り替えが片道になる。
 *
 * ⚠️ 色は scicirc/_theme_head.php と css/style.css の暗い配色に合わせてある。
 *    片方だけ変えると、トップとつるかめの中で地の色が違う。
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --acc: #ff8f4d;
    --acc-lip: #b8430a;
    --bg: #17191f;
    --surface: #262a33;
    --border: #454b58;
    --muted: #c3c8d2;
    --disabled: #8b93a2;
    --text: #eef0f4;
  }
}

:root[data-theme="dark"] {
  --acc: #ff8f4d;
  --acc-lip: #b8430a;
  --bg: #17191f;
  --surface: #262a33;
  --border: #454b58;
  --muted: #c3c8d2;
  --disabled: #8b93a2;
  --text: #eef0f4;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 20px/1.4 var(--font);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

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


.btn {
  position: relative;
  z-index: 0;
  height: 50px;
  padding: 0 16px;
  border: 0 solid transparent;
  border-bottom-width: var(--lip);
  border-radius: var(--r);
  background: none;
  color: var(--btn-ink, var(--on-acc));
  font: 700 16px/46px var(--font);
  letter-spacing: .02em;      
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s;     
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--r);
  background: var(--btn-face, var(--acc));
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(var(--lip)) translateZ(0); }

.btn[disabled], .btn[aria-disabled="true"] {
  transform: translateY(var(--lip)) translateZ(0);
  color: var(--disabled);
  cursor: default;
  filter: none;
}
.btn[disabled]::before, .btn[aria-disabled="true"]::before {
  background: var(--border);
}

:focus-visible {
  outline: 3px solid var(--acc);
  outline-offset: 3px;
}


.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 max(16px, calc(50% - 224px));
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

.topbar-logo {
  flex: 0 0 auto;
  margin-left: -2px;
  color: var(--acc);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-logo:hover { filter: brightness(1.08); }

.stat {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
.stat-icon { font-size: 19px; line-height: 1; }
/* 絵文字だった状態アイコンをSVGに置き換え。sizeはfont-sizeを継承して1emで揃える */
.stat-icon svg { display: block; width: 1em; height: 1em; fill: currentColor; }

.stat.is-gems { font-size: 15px; }
.stat.is-gems .stat-icon { font-size: 15px; }

.goal {
  flex: 1 1 auto;
  min-width: 72px;
  max-width: 180px;
  margin-left: auto;
}
.goal-bar {
  height: 12px;
  border-radius: 6px;          
  background: var(--border);
  overflow: hidden;
}
.goal-fill {
  width: 0;
  height: 100%;
  border-radius: 6px;
  background: var(--acc);
  transition: width .4s var(--ease-out);   
}
.goal-text {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}


.path {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 48px;       
}

.path-msg {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
  font-size: 16px;
}
.path-msg.is-error { color: var(--text); font-weight: 700; }
.path-msg .btn { display: inline-block; margin-top: 16px; }

.hub-only { padding-top: 24px; }
.hub-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.hub-lead {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.hub-mascot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}
.hub-mascot-img { flex: none; width: 56px; height: 56px; display: block; }
.hub-mascot-bubble {
  margin: 0;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.hub-form { display: flex; flex-direction: column; gap: 24px; }
.hub-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}
.hub-field-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.hub-field input[type="text"] {
  height: 50px;
  padding: 0 16px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font: 700 16px var(--font);
}
.hub-field input[type="text"]:focus { outline: 2px solid var(--acc); outline-offset: 2px; }

.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-chip {
  position: relative;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.hub-chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.hub-chip:has(input:checked) { border-color: var(--acc); color: var(--acc); }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.hub-card {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 24px 12px 20px;
  border: 0;
  border-radius: var(--r-lg);
  background: none;
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s;    
}
.hub-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.hub-card:hover { filter: brightness(1.04); }
.hub-card:active { transform: translateY(var(--lip)) translateZ(0); }
.hub-card-label { font-size: 15px; font-weight: 700; }

.hub-back {
  float: right;
  color: var(--acc);
  font-weight: 700;
  text-decoration: none;
}
.hub-list { display: flex; flex-direction: column; gap: 12px; }
.hub-course {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: var(--r-lg);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: filter .2s;    
}
.hub-course::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.hub-course:hover { filter: brightness(1.04); }
.hub-course:active { transform: translateY(var(--lip)) translateZ(0); }
.hub-course-label { font-size: 15px; font-weight: 700; }

/* 資格の検定ごとの折りたたみ（英検／数検／IELTS）。最初の1つだけ open */
.hub-group { border-top: 1px solid var(--border); }
.hub-group:last-of-type { border-bottom: 1px solid var(--border); }
.hub-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.hub-group-summary::-webkit-details-marker { display: none; }
.hub-group-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .15s;
}
.hub-group[open] > .hub-group-summary::after { transform: rotate(-135deg); }
.hub-group-count { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); }
.hub-group > .hub-list { padding: 0 0 14px; }


.unit-banner {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 76px;
  margin: 16px 0 8px;
  padding: 0 16px;
  border-radius: var(--r-lg);
  background: var(--unit);
  color: var(--unit-ink);
}
.ub-text { flex: 1 1 auto; min-width: 0; }
.ub-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
}
.ub-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ub-persona {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 40%;
  font-size: 14px;
  font-weight: 700;
}
.ub-persona-emoji { font-size: 26px; line-height: 1; }
.ub-persona-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.unit-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 8px;
  color: var(--muted);
}
.unit-sep::before, .unit-sep::after {
  content: "";
  flex: 1 1 auto;
  height: 2px;
  background: var(--border);
}
.unit-sep-text { flex: 0 1 auto; text-align: center; min-width: 0; }
.unit-sep-title { font-size: 14px; font-weight: 700; }
.unit-sep-sub { font-size: 12px; line-height: 1.4; }
.unit-sep-lock { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--acc-lip); line-height: 1.4; }
.unit-sep-skip {
  margin-top: 8px; padding: 6px 12px; border-radius: 999px;
  border: 2px solid var(--border); background: var(--bg); color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.unit-sep-skip:hover { color: var(--text); border-color: var(--text); }
.unit-sep-skip.is-armed { color: var(--acc-lip); border-color: var(--acc-lip); }
.unit-sep-skip:disabled { opacity: .6; cursor: default; }


.track { position: relative; }

.slot {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--nd);
  height: var(--nd);
  transform: translate(calc(-50% + var(--x, 0px)), calc(var(--y, 0px) - 50%));
}
.slot.is-boss { --nd: 88px; }

.node {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nd);
  height: calc(var(--nd) + var(--nd-lip));
  padding: 0;
  border: 0 solid transparent;
  border-bottom-width: var(--nd-lip);
  border-radius: 50%;
  background: none;
  color: var(--unit-ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: filter .2s;     
}
.node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--unit);
}
.node:hover { filter: brightness(1.04); }
.node:active { transform: translateY(var(--nd-lip)) translateZ(0); }

.node.is-locked {
  transform: translateY(var(--nd-lip)) translateZ(0);
  color: var(--disabled);
  filter: none;
}
.node.is-locked::before {
  background: var(--border);
}
.node.is-locked:active { transform: translateY(var(--nd-lip)) translateZ(0); }
.node-icon { display: block; }
.node-icon .ico { display: block; width: 32px; height: 32px; }
.node.is-boss .node-icon .ico { width: 38px; height: 38px; }

.node-check { display: block; width: 34px; height: 34px; color: var(--unit-ink); }

.node.is-locked .node-icon { color: var(--muted); }

.node.is-boss {
  height: var(--nd);
  border-bottom-width: 0;
  font-size: 36px;
}
.node.is-boss::before {
  border-radius: 0;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}
.node.is-boss::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--unit-lip);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  transform: translateY(var(--nd-lip));
}
.node.is-boss:active::after, .node.is-boss.is-locked::after { opacity: 0; }
.node.is-boss.is-locked::before { background: var(--border); }


.ring {
  position: absolute;
  inset: calc(-1 * (var(--ring-gap) + var(--ring-w)));   
  z-index: 0;
  border: var(--ring-w) solid var(--border);             
  border-radius: 50%;
  pointer-events: none;
}
@supports ((-webkit-mask: radial-gradient(#000, #000)) or (mask: radial-gradient(#000, #000))) {
  .ring {
    border: 0;
    background:
      conic-gradient(var(--unit) calc(var(--p, 0) * 1%), var(--border) 0);
    -webkit-mask: radial-gradient(closest-side,
      transparent calc(100% - var(--ring-w)), #000 calc(100% - var(--ring-w)));
    mask: radial-gradient(closest-side,
      transparent calc(100% - var(--ring-w)), #000 calc(100% - var(--ring-w)));
  }
}

.ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: var(--ring-w) solid var(--unit);
  opacity: 0;
  animation: ring-pulse 2.2s var(--ease-out) infinite;
  pointer-events: none;
}
@keyframes ring-pulse {
  0%   { transform: scale(1); opacity: .55; }
  70%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ring::after { animation: none; display: none; }
}


.bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 26px);
  z-index: 5;
  min-width: 62px;
  height: 38px;
  padding: 0 12px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--unit-on-bg, var(--unit));
  font: 700 14px/34px var(--font);
  letter-spacing: .02em;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  animation: bob 1.8s var(--ease-out) infinite;
}
.bubble::before, .bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  border: 8px solid transparent;
  border-bottom-width: 0;
  transform: translateX(-50%);
}
.bubble::before { border-top-color: var(--border); }
.bubble::after  { margin-top: -2px; border-top-color: var(--bg); }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -5px; }
}


.mascot {
  position: absolute;
  left: 50%;
  z-index: 0;
  width: 80px;
  height: 80px;
  --mascot-nudge: -6px;
  transform: translate(
    calc(-50% + var(--mx, 0px)),
    calc(var(--my, 0px) - 50% + var(--mascot-nudge))
  );
  pointer-events: none;
}
.mascot img, .mascot svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: bob 2.4s var(--ease-out) infinite;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mascot img,
  :root:not([data-theme="light"]) .mascot svg {
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9));
  }
}
[data-theme="dark"] .mascot img,
[data-theme="dark"] .mascot svg {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9));
}


.pop-scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .35);
}

.pop {
  position: absolute;
  z-index: 25;
  width: 272px;
  max-width: 100%;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--unit);
  color: var(--unit-ink);
}
.pop.is-locked {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.pop:focus { outline: none; }

.pop-arrow {
  position: absolute;
  bottom: 100%;
  border: 10px solid transparent;
  border-top-width: 0;
  border-bottom-color: var(--unit);
  transform: translateX(-50%);
}
.pop.is-locked .pop-arrow { border-bottom-color: var(--surface); }

.pop-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.pop-meta {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.4;
}
.pop.is-locked .pop-meta { color: var(--muted); }
.pop-stars { margin-top: 8px; font-size: 16px; letter-spacing: .08em; }
.pop .btn { display: block; width: 100%; margin-top: 16px; }

.pop-locked-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
}
.pop-locked-preview .pop-stars {
  margin: 0;
  color: var(--disabled);
}
.pop-locked-xp {
  font-size: 13px;
  font-weight: 700;
  color: var(--disabled);
}


.path-end {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  text-align: center;
}
.path-end-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
}
.path-end-title {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 700;
}
.path-end-text {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
}
.path-end .btn { display: inline-block; margin-top: 24px; min-width: 200px; }


.jump {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 53px;
  padding: 0;
  border: 0 solid transparent;
  border-bottom-width: var(--lip);
  border-radius: var(--r);
  background: none;
  color: var(--acc);
  cursor: pointer;
  transition: filter .2s;
}
.jump::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
}
.jump:active { transform: translateY(var(--lip)) translateZ(0); }
.jump svg { width: 26px; height: 26px; display: block; }
.jump[hidden] { display: none; }


.learn-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;              
  display: flex;
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--border);
  background: var(--bg);
}

.learn-nav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;         
  padding: 6px 2px;
  border: 2px solid transparent;
  border-radius: var(--r-lg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.learn-nav-item svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.learn-nav-item:hover { color: var(--text); }

.learn-nav-item.is-active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.path,
.courses-main { padding-bottom: calc(48px + 66px + env(safe-area-inset-bottom)); }

.jump { bottom: calc(24px + 66px + env(safe-area-inset-bottom)); }



@keyframes duo-pop {
  0%   { opacity: 0; transform: scale(.72); }
  62%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes duo-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes duo-nudge {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-6px); }
  70%      { transform: translateY(-2px); }
}

.duo-pop   { animation: duo-pop  .42s var(--ease-pop) both; }
.duo-rise  { animation: duo-rise var(--dur) var(--ease-out) both; }
.duo-nudge { animation: duo-nudge .5s var(--ease-pop) 1; }

@keyframes kame-hop {
  0%   { transform: translateY(0)    scaleY(1);   }
  18%  { transform: translateY(0)    scaleY(.86); }
  46%  { transform: translateY(-15px) scaleY(1.06); }
  72%  { transform: translateY(0)    scaleY(.92); }
  100% { transform: translateY(0)    scaleY(1);   }
}
@keyframes kame-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, 2px); }
  60% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, 1px); }
}
.kame-hop   { animation: kame-hop   .6s var(--ease-pop) 1; transform-origin: 50% 100%; }
.kame-shake { animation: kame-shake .5s ease-in-out 1;     transform-origin: 50% 100%; }

.duo-d1 { animation-delay: .09s; }
.duo-d2 { animation-delay: .18s; }
.duo-d3 { animation-delay: .27s; }
.duo-d4 { animation-delay: .36s; }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble { animation: none; }
  .mascot img, .mascot svg { animation: none; }
  .kame-hop, .kame-shake { animation: none; }
  .goal-fill, .btn, .node, .jump { transition: none; }

  .duo-pop, .duo-rise, .duo-nudge {
    animation-duration: 1ms;
    animation-delay: 0s;
  }
}


.course-chip {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 448px;
  margin: 16px auto 24px;
  padding: 12px 16px;
  border-radius: var(--r);
  color: var(--text);
  text-decoration: none;
}
.course-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
}
.course-chip:active { transform: translateY(var(--lip)) translateZ(0); }

.course-chip-name {
  flex: 1;
  min-width: 0;              
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.course-chip-action {
  flex: none;
  color: var(--color-primary-text, var(--acc-lip));
  font-size: 16px;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .course-chip-action { color: var(--acc); }
}
[data-theme="dark"] .course-chip-action { color: var(--acc); }



.stat.is-freeze[hidden] { display: none; }
.stat.is-freeze { color: var(--muted); font-size: 15px; }
.stat.is-freeze .stat-icon { font-size: 15px; }


.goal {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}
.goal-bar { display: block; }
.goal-fill { display: block; }
.goal:active { transform: translateY(var(--lip-sm)) translateZ(0); }


.toasts {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  left: 16px;
  right: 16px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 448px;
  margin: 0 auto;
  pointer-events: none;
}

.toast {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
}
.toast::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid var(--acc);
  border-radius: var(--r);
  background: var(--bg);
}
.toast:active { transform: translateY(var(--lip)) translateZ(0); }

.toast-icon { flex: none; font-size: 26px; line-height: 1; }
.toast-body { flex: 1 1 auto; min-width: 0; }
.toast-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.toast-note {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}


.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--bg);
  color: var(--text);
}
.sheet-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.sheet-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.goal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.goal-row {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.goal-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
}
.goal-row:active { transform: translateY(var(--lip)) translateZ(0); }

.goal-row.is-on::before {
  border-color: var(--acc);
}

.goal-row-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.goal-row-label { font-size: 20px; font-weight: 700; }
.goal-row-note { font-size: 14px; color: var(--muted); }
.goal-row-now {
  padding: 0 8px;
  border-radius: 12px;
  background: var(--acc);
  color: var(--on-acc);       
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
}
.goal-row-xp {
  flex: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}

.sheet-later { display: block; width: 100%; margin-top: 24px; }


.ub-persona-emoji.has-img {
  display: block;
  width: 44px;
  height: 44px;
}
.ub-persona-emoji.has-img img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== 動き（2026-09-04） ===== */
/* 済んだ直後の粒。ユニット色。--dx/--dy は JS が入れる */
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst i {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--unit, var(--accent, #ff5f00));
  animation: burst-fly .62s var(--ease-out) forwards;
}
.burst i:nth-child(even) { width: 6px; height: 6px; border-radius: 2px; }
@keyframes burst-fly {
  0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; }
}
/* 鍵のノードを押したとき */
.node.is-wiggle { animation: node-wiggle .38s ease-in-out 1; }
@keyframes node-wiggle {
  0%, 100% { translate: 0 0; }
  20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 3px 0; }
}
/* 連続日数の炎（1日以上のとき） */
#stat-streak.is-lit .stat-icon { color: #ff5f00; animation: flame 1.7s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes flame {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30%      { transform: scale(1.08) rotate(-3deg); }
  60%      { transform: scale(.96) rotate(3deg); }
}
/* 下のノードはスクロールで順に現れる（画面内のものは最初から見えている） */
.slot.reveal { opacity: 0; translate: 0 10px; transition: opacity .32s var(--ease-out), translate .32s var(--ease-out); }
.slot.reveal.in { opacity: 1; translate: 0 0; }
/* ユニットの帯の題名が切り替わるとき */
.ub-title.swap, .ub-kicker.swap { animation: ub-swap .26s var(--ease-out) 1; }
@keyframes ub-swap {
  from { opacity: 0; translate: 0 6px; }
  to   { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .burst i, .node.is-wiggle, #stat-streak.is-lit .stat-icon, .ub-title.swap, .ub-kicker.swap { animation: none; }
  .slot.reveal { opacity: 1; translate: 0 0; transition: none; }
}

/* 2026-09 academic path surface: preserve progression, remove game chrome. */
:root {
  --r: 8px;
  --r-lg: 8px;
  --lip: 0px;
  --lip-sm: 0px;
  --nd-lip: 0px;
  --ring-gap: 4px;
  --ring-w: 4px;
  --font: "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}
body { font: 400 16px/1.7 var(--font); }
.topbar {
  height: 64px;
  border-bottom-width: 1px;
  padding-inline: max(18px, calc(50% - 280px));
}
.topbar-logo { font-size: 15px; letter-spacing: .04em; }
.stat { gap: 6px; font-size: 14px; }
.stat-icon { font-size: 16px; }
.stat.is-gems,
.stat.is-gems .stat-icon { font-size: 14px; }
.goal-bar { height: 8px; border-radius: 2px; }
.goal-fill { border-radius: 2px; }
.goal-text { font-size: 11px; font-weight: 400; }
.path { max-width: 600px; padding-inline: 20px; }
.hub-title,
.hub-lead { text-align: left; }
.hub-lead { max-width: 42rem; }
.hub-mascot-bubble {
  border-width: 1px;
  border-radius: 8px;
}
.hub-chip {
  border-width: 1px;
  border-radius: 8px;
}
.hub-card,
.hub-card::before,
.hub-course,
.hub-course::before {
  border-radius: 8px;
}
.hub-card::before,
.hub-course::before { border-width: 1px; }
.btn {
  height: 48px;
  border: 1px solid var(--btn-face, var(--acc-lip));
  border-radius: 8px;
  background: var(--btn-face, var(--acc));
  line-height: 46px;
  box-shadow: none;
}
.btn::before { display: none; }
.btn:active { transform: none; }
.btn[disabled],
.btn[aria-disabled="true"] { background: var(--border); }
.unit-banner {
  height: auto;
  min-height: 72px;
  margin: 20px 0 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.ub-kicker { color: var(--unit-lip); }
.ub-title { color: var(--text); }
.ub-persona { color: var(--muted); }
.unit-sep::before,
.unit-sep::after { height: 1px; }
.unit-sep-skip {
  border-width: 1px;
  border-radius: 8px;
}
.node {
  border: 1px solid var(--unit);
  border-radius: 50%;
  background: var(--bg);
  color: var(--unit);
  box-shadow: none;
}
.node::before {
  border: 0;
  border-radius: 50%;
  background: var(--bg);
}
.node.is-locked { color: var(--muted); border-color: var(--border); background: var(--surface); }
.node.is-locked::before {
  border: 0;
  background: var(--surface);
}
.node.is-boss {
  border: 2px solid var(--unit);
  border-radius: 50%;
  background: var(--surface);
}
.node.is-boss::before,
.node.is-boss::after { display: none; }
/* いまいる丸（次にやるノード）はサイトの橙で塗る（CEO 9/25）。ユニット色はDBから来るので、ここは --acc に固定する。
   橙の上の記号は墨色（白を載せない＝deslop-standard） */
.slot[data-state="current"] .node,
.slot[data-state="current"] .node::before { background: var(--acc); }
.slot[data-state="current"] .node { border-color: var(--acc-lip); color: var(--on-acc); }
.slot[data-state="current"] .ring { border-color: var(--acc); }
.ring {
  inset: calc(-1 * (var(--ring-gap) + var(--ring-w)));
  border: 1px solid var(--unit);
  border-radius: 50%;
  background: transparent;
}
.ring::after { display: none; }
.bubble {
  height: auto;
  min-height: 36px;
  padding: 0 12px;
  border-width: 1px;
  border-radius: 8px;
  animation: none;
  line-height: 34px;
}
.toast,
.toast::before,
.goal-row,
.goal-row::before {
  border-radius: 8px;
}
.toast::before,
.goal-row::before { border-width: 1px; }
.goal-row:active { transform: none; }
.goal-row-now {
  padding-inline: 7px;
  border: 1px solid var(--acc);
  border-radius: 8px;
  background: transparent;
  color: var(--acc-lip);
  line-height: 22px;
}
.sheet { border-radius: 8px 8px 0 0; }
.slot.reveal { transition: none; opacity: 1; translate: 0 0; }
#stat-streak.is-lit .stat-icon { animation: none; }
