:root {
  --container-max: 760px;
  --bg-white: #ffffff;
  --bg-off: #f7f9fc;
  --bg-warm: #fffdf5;
  --navy: #1b254b;
  --navy-light: #334155;
  --ink: #0f172a;
  --text-sub: #64748b;
  --line-gray: #e5e7eb;
  --line-duo: #e5e7eb;
  --line-duo-dark: #d1d5db;
  --blob-blue: #1cb0f6;
  --blob-blue-dark: #1899d6;
  --indigo-accent: #4338ca;
  --blob-purple: #8549ba;
  --blob-purple-dark: #6b379a;
  --quest-pink: #ec5298;
  --quest-pink-dark: #d6367f;
  --yellow: #ffc800;
  --yellow-dark: #e5a400;
  --sky: #38bdf8;
  --sky-light: #e0f2fe;
  --coral: #ff4b4b;
  --coral-dark: #ea2b2b;
  --coral-light: #fee2e2;
  --orange: #ff9600;
  --orange-dark: #cc7800;
  --mint: #10b981;
  --mint-light: #d1fae5;
  --duo-green: #58cc02;
  --duo-green-dark: #46a302;
  --shadow-card: 0 4px 0 #e5e7eb, 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  color: var(--navy);
  background-color: #ffffff;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  line-height: 1.6;
  padding-top: var(--header-offset, calc(96px + var(--safe-top)));
  padding-bottom: calc(92px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

body.is-logged-in {
  padding-top: var(--header-offset, calc(54px + var(--safe-top)));
}

body.lesson-fs-open,
body.modal-open,
body.drawer-open {
  overflow: hidden;
}

button,
a,
input,
textarea,
select {
  touch-action: manipulation;
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--blob-blue);
  outline-offset: 2px;
}

/* ==================== ロード中スプラッシュ画面 ==================== */
.duo-loading-splash {
  position: fixed;
  inset: 0;
  height: 100dvh;
  background: #ffffff;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.duo-loading-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.duo-loading-center {
  text-align: center;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.duo-loading-mascot-stage {
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
}

.duo-loading-owl {
  width: 92px;
  height: 92px;
  object-fit: contain;
  animation: mascotFloatSlow 2.4s ease-in-out infinite;
}

.duo-loading-book {
  position: absolute;
  bottom: 4px;
  right: 8px;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.duo-loading-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.duo-loading-tip {
  font-size: 0.92rem;
  font-weight: 800;
  color: #64748b;
  line-height: 1.55;
}

/* ==================== Google アニメーション絵文字 & SVG 統一クラス ==================== */
.anim-emoji-xs {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -3px;
  flex-shrink: 0;
  pointer-events: none;
}

.anim-emoji-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: -4px;
  flex-shrink: 0;
  pointer-events: none;
}

.anim-emoji-md {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

.emoji-unit-wrap {
  display: inline;
  white-space: inherit;
  font-family: inherit;
}

img.noto-color-svg {
  width: 1.15em;
  height: 1.15em;
  display: inline-block !important;
  vertical-align: -0.18em;
  margin: 0 0.04em;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
  object-fit: contain;
}

/* ==================== 新着バッジ統一スタイル ==================== */
.duo-new-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: linear-gradient(90deg, #ff4b4b 0%, #ec5298 100%);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.14rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(236, 82, 152, 0.28);
  white-space: nowrap;
  animation: newBadgePulse 2.2s ease-in-out infinite;
}

.duo-inline-new-tag {
  display: inline-block;
  background: var(--coral);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 0.04rem 0.42rem;
  border-radius: 6px;
  margin-left: 0.25rem;
  vertical-align: middle;
}

@keyframes newBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ==================== 水色リマインダー風ゲストバナー ==================== */
.guest-limit-banner {
  width: 100%;
  background: var(--blob-blue);
  color: #ffffff;
  padding: 0.48rem 0;
  cursor: pointer;
  border-bottom: 2px solid var(--blob-blue-dark);
}

.guest-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.guest-banner-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.guest-banner-mascot {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.guest-banner-bell {
  position: absolute;
  bottom: -2px;
  right: -4px;
}

.guest-banner-text {
  font-size: 0.8rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
}

.guest-limit-cta {
  background: #ffffff;
  color: var(--blob-blue);
  font-size: 0.8rem;
  font-weight: 900;
  padding: 0.32rem 0.85rem;
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.14);
  white-space: nowrap;
  flex-shrink: 0;
}

body.is-logged-in .guest-limit-banner,
body.is-logged-in .auth-req-tag {
  display: none !important;
}

.auth-req-tag {
  display: inline-block;
  background: #fee2e2;
  color: var(--coral-dark);
  font-size: 0.58rem;
  font-weight: 900;
  padding: 0.04rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}

body:not(.is-logged-in) .requires-auth-lock {
  position: relative;
}

.duo-skill-node-item.locked-node {
  opacity: 0.78;
}

.duo-skill-node-item.locked-node .duo-node-btn {
  color: #94a3b8;
}

.num-cell.locked-cell {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #cbd5e1 !important;
}

.map-year-pill.locked-year {
  background: #f1f5f9;
  color: #64748b;
  border-style: dashed;
}

.google-lock-reason-box {
  background: #fffbeb;
  border: 2px solid var(--orange);
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.65rem;
  text-align: center;
}

.sync-status-banner {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: var(--navy-light);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  margin-bottom: 0.65rem;
  text-align: center;
  line-height: 1.45;
}

.sync-status-banner.is-synced {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.sync-status-banner.is-warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #b45309;
}

.auth-unlock-feature-list {
  list-style: none;
  background: #f8fafc;
  border: 1.5px solid var(--line-duo);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--navy);
  text-align: left;
}

.logged-in-box {
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  border-radius: 16px;
  padding: 0.85rem;
  text-align: center;
}

.logged-in-title {
  font-size: 0.86rem;
  font-weight: 900;
  color: #065f46;
  margin-bottom: 0.25rem;
}

.logged-in-sub {
  font-size: 0.75rem;
  font-weight: 800;
  color: #047857;
  margin-bottom: 0.65rem;
  word-break: break-all;
}

.logged-in-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

/* ==================== 共通レイアウト・ユーティリティ ==================== */
.app-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: calc(0.75rem + var(--safe-left));
  padding-right: calc(0.75rem + var(--safe-right));
  min-width: 0;
}

.full-width-btn {
  width: 100%;
  justify-content: center;
}

.danger-text {
  color: var(--coral) !important;
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--duo-green), var(--blob-blue));
  z-index: 2500;
  transition: width 0.1s ease-out;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  height: 100dvh;
  pointer-events: none;
  z-index: 5800;
}

#toast-container {
  position: fixed;
  bottom: calc(88px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5600;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}

.toast-msg {
  background: var(--navy);
  color: #ffffff;
  border: 2px solid var(--yellow);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  animation: toastPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastPop {
  0% { opacity: 0; transform: translateY(14px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.duo-3d-btn {
  border: none;
  border-radius: 16px;
  padding: 0.8rem 1.15rem;
  min-height: 52px;
  font-size: 0.96rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.15s;
  text-decoration: none;
  user-select: none;
}

.duo-3d-btn.green {
  background: var(--duo-green);
  color: #ffffff;
  box-shadow: 0 5px 0 var(--duo-green-dark);
}

.duo-3d-btn.green:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--duo-green-dark);
}

.duo-3d-btn.next-step-mode {
  background: var(--blob-blue) !important;
  color: #ffffff !important;
  box-shadow: 0 5px 0 var(--blob-blue-dark) !important;
}

.duo-3d-btn.next-step-mode:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--blob-blue-dark) !important;
}

/* ==================== フラット固定トップバー ==================== */
.sticky-header-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2200;
  padding-top: var(--safe-top);
  background: #ffffff;
  border-bottom: 1.5px solid var(--line-gray);
  width: 100%;
  max-width: 100%;
}

.header-bar.duo-flat-top-bar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 50px;
  background: #ffffff;
  border: none;
  border-radius: 0;
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  box-shadow: none;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--navy);
  flex-shrink: 0;
}

.brand-emblem {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--duo-green);
  border: 2px solid var(--duo-green-dark);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 var(--duo-green-dark);
  flex-shrink: 0;
}

.brand-mascot-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-name-row {
  font-family: 'Plus Jakarta Sans', 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-pharma { color: var(--duo-green); }
.brand-quest { color: var(--blob-blue); }

.brand-domain {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-sub);
  margin-top: 0.08rem;
}

.header-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 1;
  min-width: 0;
}

.header-stats-dock {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  gap: 0.35rem;
}

.stat-chip {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.2rem 0.35rem;
  border-radius: 10px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.stat-chip:hover {
  background: #f1f5f9;
}

.stat-chip.streak { color: var(--orange); }
.stat-chip.gems { color: var(--blob-blue); }
.stat-chip.xp { color: var(--yellow-dark); }
.stat-chip.hearts { color: var(--coral); }

.header-heart-timer,
.arena-heart-timer {
  font-family: 'Fredoka', monospace;
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--text-sub);
  background: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 0.04rem 0.3rem;
  border-radius: 999px;
  margin-left: 0.12rem;
}

.stat-divider {
  display: none;
}

.header-auth-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-google-btn,
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: #ffffff;
  color: var(--navy);
  border: 2px solid var(--line-duo-dark);
  padding: 0 0.6rem;
  height: 34px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.76rem;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--line-duo-dark);
  white-space: nowrap;
}

.user-chip {
  display: none;
  align-items: center;
  gap: 0.3rem;
  background: var(--sky-light);
  border: 2px solid var(--blob-blue);
  padding: 0 0.55rem 0 0.25rem;
  height: 34px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--navy);
}

.user-avatar-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  object-fit: cover;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blob-blue), var(--blob-purple));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.66rem;
}

.hamburger-btn {
  width: 34px;
  height: 34px;
  border: 2px solid var(--line-duo-dark);
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--line-duo-dark);
  flex-shrink: 0;
}

.hb-line {
  width: 15px;
  height: 2.2px;
  background: var(--navy);
  border-radius: 999px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-btn.active .hb-line:nth-child(1) { transform: translateY(6.2px) rotate(45deg); }
.hamburger-btn.active .hb-line:nth-child(2) { opacity: 0; }
.hamburger-btn.active .hb-line:nth-child(3) { transform: translateY(-6.2px) rotate(-45deg); }

/* ==================== 4画面カルーセル ==================== */
.master-main-wrap {
  padding-top: 0.5rem;
  padding-bottom: 0.8rem;
  overflow: hidden;
}

.master-carousel-viewport {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.master-carousel-track {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  align-items: flex-start;
  gap: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 0.38s cubic-bezier(0.22, 0.85, 0.25, 1);
  will-change: transform;
  touch-action: pan-y;
}

.master-carousel-viewport.is-animating {
  transition: height 0.3s ease;
}

.master-carousel-track.is-dragging,
.master-carousel-track.no-transition {
  transition: none;
}

.master-carousel-viewport.is-swiping {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

.master-slide {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 10px;
}

.master-slide img {
  -webkit-user-drag: none;
}

.master-slide.is-parked {
  visibility: hidden;
}

/* ==================== 4画面共通：上部ヒーローカード（緑・水色・ピンク・紫） ==================== */
.duo-home-green-hero {
  background: var(--duo-green);
  border-radius: 24px;
  padding: 1.15rem 1.05rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 6px 20px rgba(88, 204, 2, 0.24);
  transition: background-color 0.28s ease, box-shadow 0.28s ease;
}

.duo-home-green-hero.review-mode {
  background: var(--orange);
  box-shadow: 0 6px 20px rgba(255, 150, 0, 0.24);
}

.duo-hero-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.duo-home-hero-sub {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  margin-top: 0.15rem;
}

.duo-home-hero-switch-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.14);
  padding: 0.2rem;
  border-radius: 999px;
}

.home-hero-mode-pill {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.home-hero-mode-pill.active {
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.duo-training-start-pill.home-green-pill {
  color: var(--duo-green-dark);
}

.duo-home-green-hero.review-mode .duo-training-start-pill.home-green-pill {
  color: var(--orange-dark);
}

.duo-stats-purple-hero {
  background: var(--blob-purple);
  border-radius: 24px;
  padding: 1.15rem 1.05rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 6px 20px rgba(133, 73, 186, 0.24);
}

.duo-league-eyebrow {
  font-size: 0.75rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.04em;
}

.duo-league-main-title {
  font-size: 1.32rem !important;
}

/* ==================== ホーム：9科目ステップ学習パス ==================== */
.duo-home-path-stage {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-radius: 24px;
  padding: 1rem 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.duo-chest-count-pill {
  font-size: 0.72rem;
  font-weight: 900;
  color: #059669;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  padding: 0.14rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.duo-subject-path-Header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.duo-path-divider-line {
  flex: 1;
  height: 2px;
  background: var(--line-duo);
}

.duo-path-divider-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: #64748b;
  white-space: nowrap;
}

.duo-skill-nodes-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.duo-skill-node-item {
  width: 100%;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-bottom-color: var(--line-duo-dark);
  border-radius: 20px;
  padding: 0.7rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  cursor: pointer;
  text-align: center;
  user-select: none;
  position: relative;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.duo-skill-node-item:hover {
  border-color: var(--blob-blue);
}

.duo-skill-node-item:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.duo-skill-node-item.active {
  background: #f0fdf4;
  border-color: var(--duo-green);
  border-bottom-color: var(--duo-green-dark);
}

.duo-skill-node-item.completed {
  background: #fffbeb;
  border-color: var(--yellow);
  border-bottom-color: var(--yellow-dark);
}

.duo-node-top-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.duo-step-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--text-sub);
  background: #f8fafc;
  border: 1px solid var(--line-duo);
  padding: 0.02rem 0.35rem;
  border-radius: 999px;
}

.duo-active-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.52rem;
  font-weight: 900;
  background: var(--duo-green);
  color: white;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
}

.duo-node-avatar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  pointer-events: none;
}

.duo-node-ring {
  --node-color: var(--blob-blue);
  --node-dark: var(--blob-blue-dark);
  --node-ring: var(--blob-blue);
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
}

.duo-node-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.duo-node-ring-track,
.duo-node-ring-fill {
  fill: none;
  stroke-width: 5;
}

.duo-node-ring-track { stroke: #e5e7eb; }

.duo-node-ring-fill {
  stroke: var(--node-ring);
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 0.85, 0.25, 1);
}

.duo-node-ring.is-empty .duo-node-ring-fill { opacity: 0; }

.duo-node-btn {
  position: relative;
  width: 54px;
  height: 54px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--node-color);
  background: radial-gradient(circle at 36% 26%, color-mix(in srgb, var(--node-color) 70%, #ffffff) 0%, var(--node-color) 55%);
  box-shadow:
    0 5px 0 var(--node-dark),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.duo-node-btn::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 16%;
  width: 68%;
  height: 32%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.duo-node-icon {
  position: relative;
  display: grid;
  place-items: center;
  line-height: 1;
}

.duo-node-icon img { width: 26px; height: 26px; }

.duo-skill-node-item:active .duo-node-btn {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--node-dark), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.duo-skill-node-item.active .duo-node-ring {
  --node-color: var(--duo-green);
  --node-dark: var(--duo-green-dark);
  --node-ring: var(--duo-green);
}

.duo-skill-node-item.completed .duo-node-ring {
  --node-color: var(--yellow);
  --node-dark: var(--yellow-dark);
  --node-ring: var(--yellow-dark);
}

.duo-skill-node-item.locked-node .duo-node-ring {
  --node-color: #dfe3ea;
  --node-dark: #c2c9d4;
}

.duo-node-check {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--duo-green);
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 var(--duo-green-dark);
}

.duo-node-current-mascot {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 26px;
  height: 26px;
  padding: 2px;
  object-fit: contain;
  background: #ffffff;
  border: 2px solid var(--duo-green);
  border-radius: 50%;
}

.duo-node-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  pointer-events: none;
}

.duo-node-stars {
  display: block;
  font-size: 0.68rem;
  color: #f59e0b;
  line-height: 1;
  pointer-events: none;
}

/* ==================== トレーニングルーム ==================== */
.duo-training-room-hero {
  background: var(--blob-blue);
  border-radius: 24px;
  padding: 1.15rem 1.05rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 6px 20px rgba(28, 176, 246, 0.22);
}

.duo-training-hero-heading {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.duo-training-feature-card {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 1.1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.duo-training-feature-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.duo-training-feature-title {
  font-size: 1.18rem;
  font-weight: 900;
  color: #ffffff;
}

.duo-training-feature-desc {
  font-size: 0.84rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.42;
}

.duo-training-start-pill {
  margin-top: 0.25rem;
  background: #ffffff;
  color: var(--blob-blue);
  border: none;
  border-radius: 14px;
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(15, 23, 42, 0.14);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  white-space: nowrap;
}

.duo-training-start-pill:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.14);
}

.duo-training-feature-mascot {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.duo-training-owl-img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.duo-training-sub-emoji {
  position: absolute;
  bottom: 0;
  right: 0;
}

.duo-training-list-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.duo-training-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.2rem;
}

.duo-training-sec-label {
  font-size: 0.92rem;
  font-weight: 900;
  color: #64748b;
}

.super-gradient-badge {
  display: inline-block;
  background: linear-gradient(90deg, #2dd4bf 0%, #38bdf8 35%, #a855f7 70%, #ec4899 100%);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-style: italic;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.7rem;
  border-radius: 8px;
  text-transform: uppercase;
}

.duo-training-Rows-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.duo-training-menu-row {
  position: relative;
  width: 100%;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-bottom-color: var(--line-duo-dark);
  border-radius: 18px;
  padding: 0.85rem 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.duo-training-menu-row:hover {
  border-color: var(--blob-blue);
}

.duo-training-menu-row:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.duo-menu-row-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.duo-menu-row-title {
  font-size: 1.02rem;
  font-weight: 900;
  color: var(--navy);
}

.duo-menu-row-sub {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-sub);
}

.duo-menu-circle-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.duo-menu-circle-icon.purple { background: #d8b4fe; }
.duo-menu-circle-icon.orange { background: #ff9600; }
.duo-menu-circle-icon.blue   { background: #1cb0f6; }
.duo-menu-circle-icon.green  { background: #10b981; }
.duo-menu-circle-icon.yellow { background: #fef08a; }

.duo-menu-new-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--coral);
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 0.1rem 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(255, 75, 75, 0.3);
}

.duo-menu-count-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--coral);
  color: #ffffff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  min-width: 26px;
  height: 22px;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(255, 75, 75, 0.3);
}

.duo-menu-count-badge.blue {
  background: var(--blob-blue);
  box-shadow: 0 2px 6px rgba(28, 176, 246, 0.3);
}

/* ==================== クエスト ＆ 本日のミッション共通デザイン ==================== */
.duo-quest-pink-hero {
  background: var(--quest-pink);
  border-radius: 24px;
  padding: 1.2rem 1.05rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 6px 20px rgba(236, 82, 152, 0.24);
}

.duo-quest-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.duo-quest-hero-heading {
  font-size: 1.38rem;
  font-weight: 900;
  color: #ffffff;
}

.duo-quest-hero-rem {
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.15rem;
}

.duo-quest-hero-mascot {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.duo-quest-sub-emoji {
  position: absolute;
  bottom: 0;
  right: -2px;
}

.duo-quest-hero-white-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 0.95rem 1rem;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.duo-quest-main-goal-title {
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--navy);
}

.duo-quest-bar-big-track {
  position: relative;
  width: 100%;
  height: 22px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.duo-quest-bar-big-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--yellow);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.duo-quest-bar-big-label {
  position: relative;
  z-index: 2;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
}

.duo-quest-white-body {
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-radius: 24px;
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.duo-quest-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.duo-quest-sec-label {
  font-size: 0.96rem;
  font-weight: 900;
  color: #64748b;
}

.quest-tabs-modern {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  background: #f1f5f9;
  border: 1.5px solid var(--line-duo);
  border-radius: 999px;
  padding: 0.18rem;
}

.quest-tab-dot {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.quest-tab-dot.active {
  background: var(--quest-pink);
  color: #ffffff;
}

.quests-swipe-carousel {
  display: flex;
  overflow-x: hidden;           /* 横移動は JS(initQuestCarouselSwipe)が制御 */
  overflow-y: visible;
  scrollbar-width: none;
  touch-action: pan-y;          /* 縦スクロールはブラウザ、横ドラッグはJSに確実に渡す */
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

.quests-swipe-carousel.is-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.quests-swipe-carousel::-webkit-scrollbar {
  display: none;
}

.quest-slide-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

.daily-quests-list.duo-vertical-quests {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.quest-item {
  background: #ffffff;
  border-bottom: 1.5px solid #f1f5f9;
  padding: 0.35rem 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.daily-quests-list.duo-vertical-quests > .quest-item:last-child {
  border-bottom: none;
  padding-bottom: 0.2rem;
}

.quest-item-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--navy);
}

.quest-item-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.quest-progress-track {
  position: relative;
  width: 100%;
  height: 20px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quest-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--yellow);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.quest-item.completed .quest-progress-fill {
  background: var(--duo-green);
}

.quest-bar-center-num {
  position: relative;
  z-index: 2;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  color: #475569;
}

.quest-chest-icon {
  width: 54px;
  min-height: 54px;
  border-radius: 14px;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.25rem;
  flex-shrink: 0;
}

.quest-chest-btn {
  cursor: pointer;
  border-bottom-width: 3px;
  border-bottom-color: #f59e0b;
  transition: transform 0.1s ease;
}

.quest-chest-btn:active {
  transform: translateY(2px);
}

.quest-chest-btn.ready {
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 100%);
  border-color: #b45309;
  animation: chestShake 1.4s ease-in-out infinite;
}

.quest-chest-btn.opened {
  background: #ecfdf5;
  border-color: var(--mint);
}

@keyframes chestShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-5deg) scale(1.04); }
  75% { transform: rotate(5deg) scale(1.04); }
}

.quest-chest-mini-label {
  font-size: 0.56rem;
  font-weight: 900;
  color: var(--navy);
  white-space: nowrap;
  line-height: 1;
}

.duo-weekend-quest-card {
  border-top: 2px solid #f1f5f9;
  padding-top: 0.9rem;
}

.duo-weekend-quest-headline {
  font-size: 1rem;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

/* ==================== 共通カードスタイル ==================== */
.lounge-style-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-bottom-color: var(--line-duo-dark);
  border-radius: var(--radius-xl);
  padding: 1.15rem 1.05rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.home-lounge-bridge-card {
  border-color: #bfdbfe;
  border-bottom-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.lounge-card-top-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.lounge-card-meta-col {
  flex: 1;
  min-width: 0;
}

.lounge-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  margin-bottom: 0.5rem;
}

.lounge-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.lounge-pill-tag.green {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #059669;
}

.lounge-card-title {
  font-size: clamp(1.04rem, 3vw, 1.22rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.lounge-card-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  line-height: 1.45;
}

.lounge-pastel-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lounge-pastel-icon-box.mint { background: linear-gradient(135deg, #d1fae5 0%, #e0f2fe 100%); }
.lounge-pastel-icon-box.blue { background: linear-gradient(135deg, #e0f2fe 0%, #ede9fe 100%); }

.lounge-pastel-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.lounge-action-outline-btn {
  width: 100%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-bottom-width: 4px;
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  min-height: 48px;
  font-size: 0.86rem;
  font-weight: 900;
  color: var(--indigo-accent);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.lounge-action-outline-btn:hover {
  border-color: var(--blob-blue);
}

.lounge-action-outline-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.q-img-fallback-card {
  width: 100%;
  padding: 1.4rem 1rem;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.6;
}

.duo-super-hero-banner {
  background: linear-gradient(135deg, #0b3b5b 0%, #1d2671 52%, #4c1d95 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.duo-super-hero-banner.compact {
  padding: 0.9rem;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.super-hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.super-hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.super-hero-text-col { flex: 1; min-width: 0; }

.super-banner-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.15rem;
}

.unit-sub-desc {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

@keyframes mascotFloatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

.shop-super-owl {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.duo-section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.duo-shop-style-sub {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-sub);
}

/* ============================================================================
   ★ 全画面問題回答ポップアップ (#duo-lesson-fullscreen-modal) ★
   ============================================================================ */
.duo-lesson-fs-modal {
  position: fixed;
  inset: 0;
  height: 100dvh;
  background: #f4f6fb;
  z-index: 4000;
  display: none;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.duo-lesson-fs-modal.open {
  display: flex;
  animation: fsLessonFadeIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fsLessonFadeIn {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

.duo-lesson-fs-shell {
  position: relative;
  width: 100%;
  max-width: 780px;
  height: 100dvh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.08);
}

.paperclip-top {
  display: none;
  position: absolute;
  top: calc(0.45rem + var(--safe-top));
  right: 5.5rem;
  z-index: 15;
  background: #fef3c7;
  border: 2px solid var(--orange);
  color: #c2410c;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  pointer-events: none;
}

.paperclip-top.active-clip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.duo-fs-lesson-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: calc(0.65rem + var(--safe-top)) 0.9rem 0.55rem;
  background: #ffffff;
  border-bottom: 1.5px solid var(--line-duo);
}

.duo-fs-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid var(--line-duo-dark);
  border-bottom-width: 4px;
  background: #ffffff;
  color: var(--text-sub);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.duo-lesson-progress-wrap { flex: 1; min-width: 0; }
.duo-lesson-progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.22rem; }

.session-primary-badge {
  background: var(--duo-green);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 0.08rem 0.55rem;
  border-radius: 999px;
}

.duo-combo-badge {
  background: #ffedd5;
  color: #ea580c;
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.66rem;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
}

.duo-lesson-bar-track { width: 100%; height: 14px; background: #e5e7eb; border-radius: 999px; overflow: hidden; position: relative; }
.duo-lesson-bar-fill { height: 100%; width: 0%; background: var(--duo-green); border-radius: 999px; position: relative; transition: width 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }
.duo-lesson-bar-shine { position: absolute; top: 3px; left: 8px; right: 8px; height: 3px; background: rgba(255, 255, 255, 0.38); border-radius: 999px; }

.duo-lesson-hearts {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--coral);
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-radius: 12px;
  padding: 0.2rem 0.52rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.duo-fs-sub-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  background: var(--bg-off);
  border-bottom: 1.5px solid var(--line-duo);
  overflow-x: auto;
  scrollbar-width: none;
}

.duo-fs-sub-toolbar::-webkit-scrollbar { display: none; }

.duo-fs-sub-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.q-number-badge {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--yellow);
  color: var(--navy);
  height: 32px;
  padding: 0 0.6rem;
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--yellow-dark);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.q-action-btn {
  background: #ffffff;
  border: 1.5px solid var(--line-duo-dark);
  border-bottom-width: 3px;
  border-radius: 8px;
  height: 32px;
  padding: 0 0.55rem;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--navy);
  white-space: nowrap !important;
  flex-shrink: 0;
}

.q-action-btn.active { background: #e0f2fe; border-color: var(--blob-blue); color: #0369a1; }
.q-action-btn.clipped { background: #fef3c7; border-color: var(--orange); color: #c2410c; }
.q-action-btn.red-active { background: #fee2e2; border-color: var(--coral); color: #b91c1c; }

.duo-fs-lesson-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 0.95rem 4.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.xp-burst-float {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, #ffc800, #ff9600);
  color: #1b254b;
  border: 3px solid #ffffff;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  padding: 0.45rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.45);
  z-index: 4600;
  opacity: 0;
  pointer-events: none;
}

.xp-burst-float.animate {
  animation: xpFloatUp 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes xpFloatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -20px) scale(1.12); }
  75% { opacity: 1; transform: translate(-50%, -52px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -78px) scale(0.9); }
}

.duo-retry-banner {
  flex-shrink: 0;
  background: #fef3c7;
  border: 2px solid var(--orange);
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0.42rem 0.7rem;
  border-radius: 12px;
  text-align: center;
}

.q-jpeg-viewer {
  flex-shrink: 0;
  width: 100%;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-radius: 18px;
  overflow: hidden;
}

.q-stem-text-box {
  padding: 0.75rem 0.95rem;
  background: #f8fafc;
  border-bottom: 1.5px solid var(--line-duo);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.6;
}

.q-stem-lead-tag {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 0.08rem 0.45rem;
  border-radius: 6px;
  margin-right: 0.35rem;
}

.q-jpeg-stage {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: zoom-in;
  min-height: 180px;
  padding: 0.6rem;
  background: #ffffff;
}

.q-jpeg-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
}

.q-jpeg-img.high-contrast { filter: contrast(1.25) brightness(1.02); }

.choices-helper-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: var(--bg-off);
  border-radius: 10px;
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--text-sub);
}

.choices-list.image-choice-pad {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.42rem;
  width: 100%;
}

.choices-list.graded-locked .img-choice-num-btn,
.choices-list.graded-locked .img-choice-slash-btn {
  pointer-events: none;
}

.img-choice-col { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

.img-choice-num-btn {
  width: 100%;
  min-height: 52px;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 5px;
  border-bottom-color: var(--line-duo-dark);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy);
  transition: transform 0.12s ease, background 0.15s ease;
}

.img-choice-num-circle {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.img-choice-num-circle.no-answer-text {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
}

.img-choice-num-btn.selected-pending {
  background: #ddf4ff !important;
  border-color: var(--blob-blue) !important;
  border-bottom-color: var(--blob-blue-dark) !important;
  color: #0369a1 !important;
  transform: translateY(-2px);
}

.img-choice-num-btn.correct {
  background: #d7ffb8 !important;
  border-color: var(--duo-green) !important;
  border-bottom-color: var(--duo-green-dark) !important;
  color: #166534 !important;
  animation: choiceCorrectBounce 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes choiceCorrectBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.12) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}

.img-choice-num-btn.wrong {
  background: #ffdfe0 !important;
  border-color: var(--coral) !important;
  border-bottom-color: var(--coral-dark) !important;
  color: #991b1b !important;
  animation: choiceWrongShake 0.4s ease;
}

@keyframes choiceWrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.img-choice-slash-btn {
  width: 100%;
  min-height: 25px;
  background: var(--bg-off);
  border: 1.5px solid var(--line-duo);
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
}

.img-choice-col.eliminated .img-choice-num-btn { opacity: 0.35; text-decoration: line-through; }
.img-choice-col.eliminated .img-choice-slash-btn { background: var(--navy); color: #ffffff; }

.explanation-box.duo-answer-sheet {
  flex-shrink: 0;
  display: none;
  margin-top: 0.35rem;
  background: var(--bg-warm);
  border: 2.5px solid var(--duo-green);
  border-bottom-width: 6px;
  border-radius: 20px;
  padding: 1rem;
  animation: sheetSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.explanation-box.duo-answer-sheet.sheet-wrong {
  border-color: var(--coral);
  background: #fffafa;
}

@keyframes sheetSlideUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

.duo-feedback-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 2px solid var(--duo-green);
  margin-bottom: 0.7rem;
  background: #d7ffb8;
}

.duo-feedback-banner.is-wrong { background: #ffdfe0; border-color: var(--coral); }
.duo-feedback-main { display: flex; align-items: center; gap: 0.55rem; flex: 1; min-width: 0; }
.duo-feedback-mascot { width: 36px; height: 36px; object-fit: contain; }
.duo-feedback-title { font-weight: 900; font-size: 0.94rem; color: var(--navy); }
.duo-feedback-sub { font-size: 0.72rem; font-weight: 800; color: var(--navy-light); }
.duo-xp-gain-pill { background: var(--yellow); color: var(--navy); font-family: 'Fredoka', sans-serif; font-weight: 800; font-size: 0.76rem; padding: 0.2rem 0.65rem; border-radius: 999px; }

.exp-top-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.45rem; }
.exp-point-badge { font-size: 0.74rem; font-weight: 900; color: var(--blob-purple); }
.exp-redsheet-hint { font-size: 0.7rem; font-weight: 800; color: var(--text-sub); }
.explanation-body-text {
  font-size: 0.88rem;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.68;
  white-space: pre-line;
}

.red-sheet-word {
  background: #fee2e2;
  color: #dc2626;
  font-weight: 900;
  padding: 0.04rem 0.34rem;
  border-radius: 6px;
  border-bottom: 2px solid #ef4444;
  cursor: pointer;
  display: inline-block;
}

body.red-sheet-active .red-sheet-word { background: #ff4b4b; color: transparent; user-select: none; }
body.red-sheet-active .red-sheet-word.peek { background: #fef2f2; color: #dc2626; }

.mnemonic-banner {
  margin-top: 0.7rem;
  background: #fef9c3;
  border: 2px dashed var(--yellow-dark);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.confidence-box { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 2px dashed var(--line-duo); }
.confidence-label { font-size: 0.74rem; font-weight: 800; color: var(--text-sub); }
.conf-btn-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.4rem; }
.conf-btn { border: 2px solid var(--line-duo); border-bottom-width: 4px; border-radius: 12px; padding: 0.42rem 0.2rem; font-weight: 800; font-size: 0.72rem; cursor: pointer; background: white; color: var(--navy); }
.conf-sub { font-size: 0.62rem; }
.conf-btn.hard { background: #fee2e2; border-color: #fca5a5; border-bottom-color: var(--coral); }
.conf-btn.good { background: #fef3c7; border-color: #fde68a; border-bottom-color: var(--yellow-dark); }
.conf-btn.easy { background: #d1fae5; border-color: #6ee7b7; border-bottom-color: var(--mint); }

.duo-fs-lesson-footer {
  flex-shrink: 0;
  background: #ffffff;
  border-top: 2px solid var(--line-duo);
  padding: 0.65rem 0.95rem calc(0.75rem + var(--safe-bottom));
}

.duo-fs-footer-main-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 74px;
  gap: 0.5rem;
  align-items: center;
}

.duo-fs-nav-sub {
  min-height: 50px;
  border-radius: 15px;
  font-size: 0.76rem;
}

.duo-fs-submit-main {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
  border-radius: 16px;
}

.mini-btn {
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-bottom-color: var(--line-duo-dark);
  border-radius: 12px;
  padding: 0.36rem 0.65rem;
  min-height: 36px;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  white-space: nowrap;
  text-decoration: none;
}

.mini-btn.active { background: var(--yellow); border-color: var(--yellow-dark); }

/* ==================== 問題ナンバーマップ＆スマート絞り込み ==================== */
.map-smart-card {
  gap: 0.95rem;
}

.map-smart-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.map-smart-title-col {
  flex: 1;
  min-width: 200px;
}

.map-header-actions-col {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.map-unified-deck {
  background: #f8fafc;
  border: 2px solid var(--line-duo);
  border-radius: 20px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.map-deck-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.map-deck-block + .map-deck-block {
  padding-top: 0.7rem;
  border-top: 1.5px dashed #cbd5e1;
}

.map-year-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1.5px solid var(--line-duo);
  border-radius: 14px;
  padding: 0.28rem;
}

.map-year-arrow {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--line-duo-dark);
  background: var(--bg-off);
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--navy);
}

.map-year-pills {
  display: flex;
  gap: 0.32rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  touch-action: pan-x;
}

.map-year-pills::-webkit-scrollbar { display: none; }

.map-year-pill {
  border: 1.5px solid var(--line-duo);
  background: #ffffff;
  border-radius: 10px;
  padding: 0.28rem 0.72rem;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  color: var(--navy);
}

.map-year-pill.active {
  background: var(--blob-blue);
  color: #ffffff;
  border-color: var(--blob-blue-dark);
}

.map-year-progress-summary {
  background: #ffffff;
  border: 1.5px solid var(--line-duo);
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.map-prog-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.map-prog-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.map-prog-main-label { font-size: 0.8rem; font-weight: 900; color: var(--navy); }
.map-prog-pct-badge { font-family: 'Fredoka', sans-serif; font-size: 0.82rem; font-weight: 800; background: #ecfdf5; color: #059669; border: 1.5px solid #6ee7b7; padding: 0.04rem 0.5rem; border-radius: 999px; }
.map-prog-sub-count { font-size: 0.72rem; font-weight: 800; color: var(--text-sub); }
.map-guest-lock-note { font-size: 0.68rem; font-weight: 800; color: var(--orange-dark); background: #fffbeb; border: 1px solid #fde68a; padding: 0.08rem 0.48rem; border-radius: 999px; }

.map-prog-bar-stack {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.map-prog-seg-ok { background: var(--duo-green); height: 100%; transition: width 0.35s ease; }
.map-prog-seg-ng { background: var(--coral); height: 100%; transition: width 0.35s ease; }

.map-refine-label-title { font-size: 0.75rem; font-weight: 900; color: var(--navy); }

#map-status-pill-group.map-status-bento-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
}

.map-filter-seg {
  border: 1.5px solid #cbd5e1;
  border-bottom-width: 3px;
  background: #ffffff;
  color: var(--navy-light);
  border-radius: 14px;
  padding: 0.42rem 0.25rem;
  min-height: 50px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.16rem;
}

.map-seg-top { font-size: 0.72rem; font-weight: 900; color: var(--navy); white-space: nowrap; }
.map-seg-badge { font-family: 'Fredoka', sans-serif; font-size: 0.72rem; font-weight: 800; padding: 0.04rem 0.45rem; border-radius: 999px; }
.map-seg-badge.neutral { background: #f1f5f9; color: var(--navy-light); }
.map-seg-badge.danger  { background: #fee2e2; color: var(--coral-dark); }
.map-seg-badge.success { background: #d1fae5; color: #047857; }
.map-seg-badge.warn    { background: #fef3c7; color: #b45309; }

.map-filter-seg.active {
  background: #e0f2fe;
  border-color: var(--blob-blue);
  border-bottom-color: var(--blob-blue-dark);
}

.map-subject-chips-wrap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.38rem;
  width: 100%;
}

.map-subj-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-bottom-width: 3px;
  border-radius: 12px;
  padding: 0.38rem 0.25rem;
  min-height: 36px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-subj-chip.active {
  background: var(--navy);
  border-color: #0f172a;
  color: #ffffff;
}

.map-util-btn {
  background: #ffffff;
  border: 1.5px solid var(--line-duo-dark);
  border-bottom-width: 3px;
  border-radius: 999px;
  padding: 0.24rem 0.7rem;
  min-height: 32px;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-sub);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-util-btn.has-active-filter {
  background: #fef3c7;
  border-color: var(--orange);
  border-bottom-color: var(--orange-dark);
  color: #b45309;
}

.map-grid-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.map-grid-guide-text { font-size: 0.72rem; font-weight: 800; color: var(--text-sub); }
.map-filtered-count-label { font-size: 0.75rem; font-weight: 900; color: var(--blob-blue); }

.map-range-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.3rem 0 0.25rem;
  touch-action: pan-x;
}

.map-range-tabs::-webkit-scrollbar { display: none; }

.map-range-tab {
  flex: 0 0 auto;
  border: 1.5px solid var(--line-duo-dark);
  border-bottom-width: 3px;
  background: #ffffff;
  color: var(--navy);
  border-radius: 11px;
  padding: 0.28rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 74px;
}

.map-range-tab.active {
  background: var(--blob-blue);
  border-color: var(--blob-blue-dark);
  color: #ffffff;
}

.map-range-sub { font-size: 0.58rem; font-weight: 800; opacity: 0.85; }

.num-grid-100 { width: 100%; margin-top: 0.3rem; }

.map-year-page {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 2px;
}

.num-cell {
  min-height: 42px;
  border: 1.5px solid var(--line-duo-dark);
  border-bottom-width: 3px;
  border-radius: 10px;
  background: #ffffff;
  font-family: 'Fredoka', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
  position: relative;
  color: var(--navy);
}

.num-cell-subj { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 0.52rem; font-weight: 800; opacity: 0.75; line-height: 1; }
.num-cell.current { outline: 3px solid var(--blob-blue); background: #e0f2fe; font-weight: 900; }
.num-cell.ok { background: var(--duo-green); border-color: var(--duo-green-dark); color: #ffffff; }
.num-cell.ng { background: var(--coral); border-color: var(--coral-dark); color: #ffffff; }
.cell-clip-badge { position: absolute; top: -5px; right: -4px; font-size: 0.54rem; }

.map-range-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1.5px dashed var(--line-duo);
}

.map-range-pager-label { font-size: 0.74rem; font-weight: 900; color: var(--text-sub); }
.map-bottom-admin-row { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

/* ==================== 週間スタンプ帳 ＆ 成績・バッジ ==================== */
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.stamp-day {
  border: 2px solid #cbd5e1;
  border-bottom-width: 4px;
  border-radius: 14px;
  padding: 0.42rem 0.15rem;
  text-align: center;
  font-size: 0.64rem;
  font-weight: 800;
  background: #ffffff;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.16rem;
}

.stamp-day.stamped {
  border-color: var(--orange);
  border-bottom-color: var(--orange-dark);
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.stamp-day.frozen {
  border-color: #38bdf8;
  border-bottom-color: #0284c7;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.stamp-day.is-today {
  outline: 2.5px solid var(--blob-blue);
  outline-offset: 1px;
}

.stamp-day-head { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.stamp-dow { font-size: 0.65rem; font-weight: 900; color: var(--navy); }
.stamp-date-num { font-family: 'Fredoka', sans-serif; font-size: 0.58rem; font-weight: 700; color: var(--text-sub); }

.stamp-mark {
  width: 28px;
  height: 28px;
  margin: 0.08rem auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
  background: #e2e8f0;
  color: var(--text-sub);
}

.stamp-day.stamped .stamp-mark { background: #ffffff; border: 2px solid var(--orange); }
.stamp-day.frozen .stamp-mark { background: #ffffff; border: 2px solid #38bdf8; }
.stamp-status-caption { font-size: 0.56rem; font-weight: 900; color: var(--text-sub); }
.stamp-day.stamped .stamp-status-caption { color: #b45309; }
.stamp-day.frozen .stamp-status-caption { color: #0369a1; }

.overall-accuracy-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0.6rem;
  align-items: center;
  background: #f8fafc;
  border: 2px solid var(--line-duo);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
}

.overall-acc-main { border-right: 2px dashed var(--line-duo); padding-right: 0.6rem; }
.overall-acc-label { display: block; font-size: 0.66rem; font-weight: 900; color: var(--blob-blue); }
.overall-acc-big { font-family: 'Fredoka', sans-serif; font-size: 1.85rem; font-weight: 800; color: var(--duo-green); line-height: 1.05; }
.overall-acc-sub { font-size: 0.66rem; font-weight: 800; color: var(--text-sub); }
.overall-sub-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.32rem; text-align: center; }
.overall-mini-stat { background: #ffffff; border: 1.5px solid var(--line-duo); border-radius: 10px; padding: 0.36rem 0.1rem; display: flex; flex-direction: column; }
.overall-mini-num { font-family: 'Fredoka', sans-serif; font-size: 0.96rem; font-weight: 800; }
.overall-mini-num.blue { color: var(--blob-blue); }
.overall-mini-num.mint { color: var(--duo-green); }
.overall-mini-num.purple { color: var(--blob-purple); }
.overall-mini-label { font-size: 0.58rem; font-weight: 800; color: var(--text-sub); }

.sub-section-heading { font-size: 0.88rem; font-weight: 900; color: var(--navy); }

.subject-bars-grid-clean,
.badges-grid-clean {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.subj-mini-card {
  background: #f8fafc;
  border: 1.5px solid var(--line-duo);
  border-radius: 14px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}

.subj-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.12rem; }
.subj-name-label { font-size: 0.72rem; font-weight: 900; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subj-acc-pill { font-family: 'Fredoka', sans-serif; font-size: 0.66rem; font-weight: 800; color: var(--orange); }
.subj-count-row { display: flex; justify-content: space-between; font-size: 0.6rem; font-weight: 800; color: var(--text-sub); margin-bottom: 0.18rem; }
.subj-bar-track { height: 6px; background: var(--line-gray); border-radius: 999px; overflow: hidden; }
.subj-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blob-blue), var(--duo-green)); width: 0%; transition: width 0.3s ease; }

.badge-item {
  border: 1.5px solid var(--line-duo);
  border-bottom-width: 4px;
  border-radius: 16px;
  padding: 0.65rem 0.45rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: #ffffff;
}

.badge-item.unlocked { background: #fffbeb; border-color: var(--yellow-dark); }
.badge-item.locked { background: #f8fafc; opacity: 0.72; }
.badge-icon-wrap { width: 38px; height: 38px; border-radius: 50%; background: #fef9c3; display: grid; place-items: center; font-size: 1.25rem; }
.badge-title { font-size: 0.72rem; font-weight: 900; color: var(--navy); }
.badge-desc { font-size: 0.6rem; font-weight: 700; color: var(--text-sub); }
.badge-progress-bar { width: 100%; height: 5px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.badge-progress-fill { height: 100%; background: var(--duo-green); transition: width 0.3s ease; }
.badge-status-tag { font-size: 0.58rem; font-weight: 900; padding: 0.06rem 0.4rem; border-radius: 999px; background: #f1f5f9; }

/* ==================== 学習ガジェット ==================== */
.quick-tool-modal-box {
  max-width: 480px !important;
  width: min(94vw, 480px);
  max-height: 88dvh;
  padding: 1.15rem;
  border-radius: 26px;
}

.desk-gadget-box {
  border: 2px solid var(--line-duo);
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
}

.gadget-tab-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--bg-off);
  border-bottom: 1.5px solid var(--line-duo);
}

.gadget-tab-btn {
  padding: 0.68rem 0.2rem;
  border: none;
  background: transparent;
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
}

.gadget-tab-btn.active {
  background: #ffffff;
  color: var(--blob-blue);
  box-shadow: inset 0 -3px 0 var(--blob-blue);
}

.gadget-pane { display: none; padding: 0.85rem; }
.gadget-pane.active { display: block; }

.calc-body,
.sticky-pad-mini,
.timer-equal-wrap {
  height: min(460px, 64dvh);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 16px;
  padding: 0.85rem;
}

.calc-body { background: var(--bg-off); gap: 0.55rem; }
.calc-screen { background: #ffffff; border: 2px solid var(--line-duo); border-radius: 12px; padding: 0.6rem 0.8rem; text-align: right; font-family: 'Fredoka', monospace; font-size: 1.45rem; font-weight: 700; overflow-x: auto; white-space: nowrap; color: var(--navy); }
.calc-formula-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.formula-chip { background: #e0f2fe; color: #0369a1; border: 1.5px solid #bae6fd; border-radius: 10px; padding: 0.28rem 0.58rem; font-size: 0.72rem; font-weight: 800; cursor: pointer; }
.calc-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 0.42rem; flex: 1; }
.calc-key { background: #ffffff; border: 1.5px solid var(--line-duo-dark); border-bottom-width: 4px; border-radius: 12px; min-height: 44px; font-family: 'Fredoka', sans-serif; font-size: 1.08rem; font-weight: 700; color: var(--navy); cursor: pointer; }
.calc-key.op { background: #eff6ff; border-color: #bfdbfe; color: #0284c7; }
.calc-key.eq { background: var(--duo-green); border-color: var(--duo-green-dark); color: #ffffff; }
.calc-key.clr { background: #fee2e2; border-color: #fca5a5; color: var(--coral-dark); }

.sticky-pad-mini { background: #fef9c3; border: 2px solid #fde047; gap: 0.45rem; }
.sticky-filter-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.32rem; }
.sticky-filter-btn { background: #ffffff; border: 1.5px solid #facc15; border-radius: 10px; padding: 0.34rem 0.25rem; font-size: 0.72rem; font-weight: 800; cursor: pointer; color: var(--navy); }
.sticky-filter-btn.active { background: var(--navy); color: var(--yellow); border-color: var(--navy); }
.sticky-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.42rem; }
.sticky-item { background: #ffffff; border-left: 4px solid var(--coral); padding: 0.55rem 0.65rem; border-radius: 10px; font-size: 0.78rem; font-weight: 800; display: flex; flex-direction: column; gap: 0.22rem; word-break: break-word; }
.sticky-item.starred { border-left-color: var(--yellow-dark); background: #fffbeb; }
.sticky-item-top { display: flex; justify-content: space-between; align-items: center; }
.sticky-q-jump { background: #e0f2fe; color: var(--blob-blue); border: none; border-radius: 6px; padding: 0.08rem 0.45rem; font-size: 0.66rem; font-weight: 900; cursor: pointer; }
.sticky-form-options { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.25rem; font-size: 0.68rem; font-weight: 800; }
.sticky-link-label { display: inline-flex; align-items: center; gap: 0.28rem; cursor: pointer; }
.sticky-form-row { display: flex; gap: 0.38rem; }
.sticky-input-field { flex: 1; min-width: 0; border: 2px solid #eab308; border-radius: 12px; padding: 0.45rem 0.65rem; font-size: 16px; background: #ffffff; color: var(--navy); }

.timer-equal-wrap { background: var(--bg-off); gap: 0.7rem; }
.clock-mini-ui { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.85rem; background: #f3e8ff; border: 2px solid #e9d5ff; border-radius: 14px; padding: 1.1rem; text-align: center; }
.pomodoro-state-label { font-size: 0.74rem; font-weight: 900; color: var(--blob-purple); }
.timer-digits { font-family: 'Fredoka', monospace; font-size: 2.8rem; font-weight: 700; color: var(--navy); line-height: 1.05; }
.pomo-controls-col { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; }
.pomo-preset-row { display: flex; justify-content: center; gap: 0.42rem; width: 100%; }
.ambient-bgm-bar { display: flex; justify-content: space-between; align-items: center; background: #ffffff; border: 1.5px solid var(--line-duo); border-radius: 12px; padding: 0.55rem 0.8rem; font-size: 0.76rem; font-weight: 800; }

.bottom-domain-pill-wrap { display: flex; justify-content: center; margin-top: 0.9rem; }
.bottom-domain-pill { background: #f8fafc; border: 1.5px solid var(--line-duo); color: var(--text-sub); font-size: 0.74rem; font-weight: 800; padding: 0.28rem 1rem; border-radius: 999px; text-decoration: none; }

/* ==================== 画面右下常駐：メモ＆電卓クイック起動アイコン ==================== */
.floating-tools-dock {
  position: fixed;
  right: calc(0.65rem + var(--safe-right));
  bottom: calc(78px + var(--safe-bottom));
  z-index: 4200;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
  transition: bottom 0.2s ease;
}

/* 全画面問題演習モーダル表示中はフッターの「次 ▶」ボタンと重ならない位置に配置 */
body.lesson-fs-open .floating-tools-dock {
  bottom: calc(88px + var(--safe-bottom));
}

.floating-tool-fab {
  pointer-events: auto;
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 2px solid var(--line-duo-dark);
  border-bottom-width: 4px;
  background: #ffffff;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.floating-tool-fab.memo-fab { background: #fef9c3; border-color: var(--yellow-dark); }
.floating-tool-fab.calc-fab { background: #e0f2fe; border-color: var(--blob-blue); }
.fab-icon { font-size: 1.05rem; line-height: 1; display: grid; place-items: center; }
.fab-label { font-size: 0.54rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.fab-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--coral); color: #ffffff; font-family: 'Fredoka', sans-serif; font-size: 0.6rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #ffffff; }

/* ==================== 6アイコン・ボトムナビゲーション ==================== */
.duo-bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  background: #ffffff;
  border-top: 2px solid var(--line-duo);
  padding: 0.35rem calc(0.35rem + var(--safe-right)) calc(0.4rem + var(--safe-bottom)) calc(0.35rem + var(--safe-left));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 100%;
}

.duo-tab-item {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  cursor: pointer;
  color: var(--text-sub);
  padding: 0.05rem 0;
}

.duo-tab-icon-box {
  width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  transition: all 0.16s ease;
}

.duo-tab-svg {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.duo-more-dots-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #c084fc;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  letter-spacing: -1px;
}

.duo-tab-label {
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--text-sub);
  white-space: nowrap;
}

.duo-tab-item.active .duo-tab-icon-box {
  background: #ddf4ff;
  border-color: #38bdf8;
}

.duo-tab-item.active .duo-tab-label {
  color: #0284c7;
}

/* ==================== ハンバーガードロワー ＆ モーダル共通 ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 3150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open { opacity: 1; visibility: visible; }

.drawer-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(335px, 86vw);
  max-width: 86vw;
  height: 100dvh;
  background: #ffffff;
  z-index: 3200;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  padding: calc(0.8rem + var(--safe-top)) 0.95rem calc(0.9rem + var(--safe-bottom));
  overflow: hidden;
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.18);
}

.drawer-menu.open { transform: translateX(0%); }
.drawer-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.6rem; border-bottom: 1.5px solid var(--line-duo); margin-bottom: 0.5rem; }
.drawer-body-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 0.6rem; }
.drawer-mascot-row { display: flex; align-items: center; gap: 0.45rem; }
.drawer-mascot-bubble { width: 38px; height: 38px; border-radius: 50%; background: var(--sky-light); display: grid; place-items: center; }
.drawer-mascot-anim { width: 26px; height: 26px; }
.drawer-mascot-name { font-size: 0.84rem; font-weight: 900; }
.drawer-exam-countdown { font-size: 0.66rem; font-weight: 800; color: var(--text-sub); }
.duo-icon-close-btn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-duo); background: #ffffff; font-weight: 900; cursor: pointer; display: grid; place-items: center; }
.drawer-section-title { font-size: 0.7rem; font-weight: 900; color: var(--text-sub); margin-bottom: 0.4rem; margin-top: 0.2rem; }
.drawer-instant-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; margin-bottom: 0.6rem; }
.drawer-instant-card { border: 1.5px solid var(--line-duo); border-bottom-width: 4px; border-radius: 14px; padding: 0.5rem 0.4rem; display: flex; flex-direction: column; align-items: center; gap: 0.12rem; cursor: pointer; background: #ffffff; }
.d-tool-badge { font-size: 0.5rem; font-weight: 900; padding: 0.04rem 0.35rem; border-radius: 999px; background: var(--bg-off); }
.d-tool-icon { font-size: 1.35rem; line-height: 1.1; display: grid; place-items: center; }
.d-tool-title { font-size: 0.74rem; font-weight: 900; color: var(--navy); }
.d-tool-sub { font-size: 0.6rem; color: var(--text-sub); font-weight: 700; }
.drawer-quick-toggle-row { margin-bottom: 0.7rem; }
.drawer-redsheet-wide-btn { width: 100%; background: #fff1f2; border: 1.5px solid #fecdd3; border-bottom: 3px solid var(--coral); border-radius: 12px; padding: 0.5rem 0.75rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; font-weight: 900; color: #be123c; cursor: pointer; }
.drawer-redsheet-pill { background: var(--coral); color: #ffffff; font-size: 0.62rem; padding: 0.06rem 0.42rem; border-radius: 999px; }
.drawer-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; margin-bottom: 0.7rem; }
.drawer-stat-box { border: 1.5px solid var(--line-duo); border-radius: 12px; padding: 0.38rem 0.5rem; display: flex; flex-direction: column; }
.d-stat-label { font-size: 0.62rem; font-weight: 800; color: var(--text-sub); }
.d-stat-val { font-family: 'Fredoka', sans-serif; font-size: 0.96rem; font-weight: 700; }
.drawer-nav-list { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.4rem; }
.drawer-nav-item { width: 100%; background: #ffffff; border: 1.5px solid var(--line-duo); border-bottom-width: 3px; border-radius: 12px; padding: 0.48rem 0.7rem; font-size: 0.75rem; font-weight: 800; color: var(--navy); display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-decoration: none; }
.drawer-nav-item.lounge-drawer-link { background: #fffbeb; border-color: var(--yellow-dark); }
.drawer-footer { flex-shrink: 0; padding-top: 0.6rem; border-top: 1.5px solid var(--line-duo); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65); display: none; align-items: center; justify-content: center; z-index: 4500; padding: 0.8rem; }
.modal-backdrop.open { display: flex; }
.modal-box { background: #ffffff; border: 2px solid var(--line-duo); border-radius: 24px; max-width: 500px; width: 100%; max-height: 90dvh; overflow-y: auto; padding: 1.1rem; }
.modal-box.lightbox-box { max-width: 920px; }
.modal-header-row, .duo-modal-top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; padding-bottom: 0.55rem; border-bottom: 1.5px solid var(--line-duo); }
.modal-title, .duo-modal-center-title { font-size: 0.98rem; font-weight: 900; }
.modal-desc { font-size: 0.76rem; color: var(--text-sub); font-weight: 700; margin-bottom: 0.75rem; line-height: 1.5; }
.lightbox-img-container { text-align: center; overflow: auto; max-height: 76dvh; display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.lightbox-img { max-width: 100%; height: auto; border-radius: 8px; }

.duo-gem-counter-pill { background: var(--sky-light); border: 1.5px solid var(--blob-blue); color: var(--blob-blue); font-family: 'Fredoka', sans-serif; font-size: 0.8rem; font-weight: 800; padding: 0.14rem 0.6rem; border-radius: 999px; }
.shop-heart-status-pill { font-size: 0.72rem; font-weight: 800; color: #ffffff; background: rgba(255, 255, 255, 0.16); padding: 0.14rem 0.55rem; border-radius: 999px; }

.modal-backdrop.duo-fullscreen-backdrop {
  background: radial-gradient(circle at 50% 25%, rgba(29, 38, 113, 0.96) 0%, rgba(15, 23, 42, 0.98) 80%);
  padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
  z-index: 5000;
}

.modal-box.duo-fullscreen-card {
  max-width: 440px;
  width: 100%;
  min-height: min(540px, 86dvh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.6rem 1.3rem;
  border-radius: 28px;
  border: 3px solid var(--line-duo);
  border-bottom-width: 7px;
}

.event-eyebrow-pill { display: inline-block; background: #e0f2fe; border: 1.5px solid #7dd3fc; color: #0284c7; font-family: 'Montserrat', sans-serif; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.1em; padding: 0.2rem 0.8rem; border-radius: 999px; margin-bottom: 0.6rem; }
.fs-weekly-strip { width: 100%; background: #f8fafc; border: 1.5px solid var(--line-duo); border-radius: 14px; padding: 0.55rem 0.45rem; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; margin-bottom: 0.9rem; }
.fs-day-col { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.62rem; font-weight: 800; color: var(--text-sub); }
.fs-day-dot { width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; display: grid; place-items: center; font-size: 0.68rem; color: var(--navy); }
.fs-day-col.active .fs-day-dot { background: #fffbeb; border: 2px solid var(--orange); }
.fs-day-col.frozen .fs-day-dot { background: #e0f2fe; border: 2px solid #38bdf8; }

.duo-two-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; margin-bottom: 0.6rem; }
.duo-pack-card { position: relative; border: 2px solid var(--line-duo); border-bottom-width: 4px; border-radius: 16px; padding: 1.05rem 0.55rem 0.75rem; text-align: center; cursor: pointer; }
.duo-pack-card.selected-shop-item, .duo-item-tile.selected-shop-item { border-color: var(--duo-green) !important; background: #f0fdf4 !important; }
.duo-pack-ribbon { position: absolute; top: 0; left: 0; right: 0; background: #e0f2fe; color: #0284c7; font-size: 0.58rem; font-weight: 900; padding: 0.14rem; border-radius: 14px 14px 0 0; }
.duo-pack-visual { height: 52px; display: flex; align-items: center; justify-content: center; margin: 0.2rem 0; }
.duo-blue-tile.single { width: 46px; height: 50px; border-radius: 12px; background: var(--blob-blue); display: grid; place-items: center; font-size: 1.4rem; }
.duo-blue-tile.multi { position: relative; width: 92px; height: 50px; display: flex; align-items: center; justify-content: center; }
.tile-card { position: absolute; width: 38px; height: 44px; border-radius: 10px; background: var(--blob-blue); border: 2px solid #ffffff; display: grid; place-items: center; font-size: 1.05rem; }
.tile-card.c1 { transform: translateX(-16px) rotate(-12deg); }
.tile-card.c2 { z-index: 2; }
.tile-card.c3 { transform: translateX(16px) rotate(12deg); }
.duo-pack-name { font-size: 0.76rem; font-weight: 900; }
.duo-pack-price { font-size: 0.72rem; font-weight: 800; color: var(--blob-blue); }

.duo-my-items-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.42rem; }
.duo-item-tile { border: 1.5px solid var(--line-duo); border-bottom-width: 3px; border-radius: 14px; padding: 0.55rem 0.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.18rem; cursor: pointer; text-align: center; }
.duo-item-icon-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-off); display: grid; place-items: center; font-size: 1.15rem; }
.duo-item-name { font-size: 0.68rem; font-weight: 900; }
.duo-item-count { font-size: 0.62rem; font-weight: 800; color: var(--blob-blue); }

.shop-confirm-panel { margin-top: 0.7rem; background: #f0fdf4; border: 2px solid var(--duo-green); border-radius: 14px; padding: 0.7rem; }
.shop-confirm-title { font-size: 0.82rem; font-weight: 900; }
.shop-confirm-desc { font-size: 0.7rem; font-weight: 700; color: var(--text-sub); margin: 0.18rem 0 0.5rem; }
.shop-confirm-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.4rem; }

.event-popup-box, .lesson-complete-box, .no-hearts-box, .timer-alert-box { text-align: center; max-width: 420px; }
.event-character-stage, .no-hearts-stage, .timer-alert-icon { position: relative; width: 112px; height: 112px; margin: 0 auto 0.75rem; display: grid; place-items: center; }
.event-noto-anim-img { width: 92px; height: 92px; object-fit: contain; }
.event-sub-mascot-badge { position: absolute; bottom: 0; right: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); border: 2px solid #ffffff; display: grid; place-items: center; }
.event-sub-mascot-img { width: 24px; height: 24px; }
.event-popup-title, .lesson-complete-title, .no-hearts-title, .timer-alert-title { font-size: 1.25rem; font-weight: 900; margin-bottom: 0.35rem; color: var(--navy); }
.event-popup-desc, .no-hearts-desc, .lesson-complete-sub, .timer-alert-desc { font-size: 0.8rem; font-weight: 700; color: var(--text-sub); margin-bottom: 0.85rem; line-height: 1.5; }
.duo-result-cards { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; margin: 0.5rem 0 0.85rem; }
.duo-result-card { border: 1.5px solid var(--line-duo); border-bottom-width: 3px; border-radius: 14px; padding: 0.5rem 0.25rem; background: #f8fafc; }
.duo-result-label { font-size: 0.62rem; font-weight: 800; color: var(--text-sub); }
.duo-result-val { font-family: 'Fredoka', sans-serif; font-size: 0.98rem; font-weight: 800; color: var(--navy); margin-top: 0.1rem; }
.no-hearts-options { display: flex; flex-direction: column; gap: 0.45rem; width: 100%; }

.auth-feedback-box {
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  font-size: 0.74rem;
  font-weight: 700;
  color: #0369a1;
  line-height: 1.5;
}

.auth-feedback-box.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* ==================== スマホ最適化 ==================== */
img, svg, video, canvas { max-width: 100%; }
.duo-fs-lesson-body, .duo-fs-lesson-body * { min-width: 0; }
.duo-fs-lesson-body { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .app-container {
    padding-left: calc(0.6rem + var(--safe-left));
    padding-right: calc(0.6rem + var(--safe-right));
  }
  .brand-domain,
  .header-heart-timer,
  .user-name-label,
  .header-google-btn .google-btn-text {
    display: none !important;
  }
  .brand-emblem { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mascot-img { width: 20px; height: 20px; }
  .brand-name-row { font-size: 0.88rem; }
  .header-stats-dock { gap: 0.12rem; }
  .stat-chip { font-size: 0.82rem; padding: 0.14rem 0.22rem; gap: 0.15rem; }
  .header-google-btn { width: 34px; padding: 0; }
  .user-chip { padding: 0 0.25rem; height: 34px; }

  #map-status-pill-group.map-status-bento-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.36rem;
  }
  #map-status-pill-group.map-status-bento-grid .map-filter-seg:nth-child(1),
  #map-status-pill-group.map-status-bento-grid .map-filter-seg:nth-child(2) {
    grid-column: span 3;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.42rem 0.7rem;
    min-height: 42px;
  }
  #map-status-pill-group.map-status-bento-grid .map-filter-seg:nth-child(3),
  #map-status-pill-group.map-status-bento-grid .map-filter-seg:nth-child(4),
  #map-status-pill-group.map-status-bento-grid .map-filter-seg:nth-child(5) {
    grid-column: span 2;
    padding: 0.4rem 0.2rem;
    min-height: 48px;
  }
  .map-subject-chips-wrap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.34rem;
  }
  .map-subj-chip[data-subjfilter="病態・薬物治療"],
  .map-subj-chip[data-subjfilter="法規・制度・倫理"] {
    grid-column: span 2;
  }
  .subject-bars-grid-clean,
  .badges-grid-clean {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-year-page {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }
  .overall-accuracy-panel {
    grid-template-columns: 1fr;
  }
  .overall-acc-main {
    border-right: none;
    border-bottom: 2px dashed var(--line-duo);
    padding-right: 0;
    padding-bottom: 0.45rem;
    text-align: center;
  }

  .duo-fs-sub-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.4rem calc(0.6rem + var(--safe-right)) 0.4rem calc(0.6rem + var(--safe-left));
  }
  .duo-fs-sub-actions {
    width: auto;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.28rem;
  }
  .q-number-badge {
    font-size: 0.72rem;
    height: 30px;
    padding: 0 0.48rem;
  }
  .q-action-btn {
    height: 30px;
    min-height: 30px;
    padding: 0 0.48rem;
    font-size: 0.68rem;
    line-height: 1;
    white-space: nowrap !important;
  }

  .floating-tools-dock {
    flex-direction: row;
    gap: 0.35rem;
  }
  .floating-tool-fab {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  input[type="text"],
  input[type="search"],
  input[type="email"],
  textarea,
  select {
    font-size: 16px;
  }

  .guest-banner-inner { gap: 0.45rem; }
  .guest-banner-left { gap: 0.4rem; flex: 1 1 auto; }
  .guest-banner-mascot { width: 32px; height: 32px; }
  .guest-banner-text {
    font-size: 0.72rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .guest-limit-cta { font-size: 0.74rem; padding: 0.3rem 0.6rem; }

  .modal-box,
  .drawer-body-scroll,
  .duo-fs-lesson-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

@media (max-width: 380px) {
  .duo-skill-nodes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .duo-tab-label {
    display: none;
  }
  .stat-chip { font-size: 0.76rem; padding: 0.12rem 0.16rem; gap: 0.1rem; }
  .brand-name-row { font-size: 0.8rem; }
  .guest-banner-text { font-size: 0.68rem; }
  .q-action-btn { font-size: 0.64rem; padding: 0 0.38rem; }
}

/* ==================== 崩れ防止＆アクセシビリティ ==================== */
.duo-path-divider-title,
.brand-name-row {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-box,
.duo-fs-lesson-body,
.sticky-note,
.sticky-item,
.quest-card,
.quest-item {
  overflow-wrap: anywhere;
}

button, .mini-btn, .q-action-btn, .floating-tool-fab, .stat-chip {
  -webkit-user-select: none;
  user-select: none;
}

.no-master-swipe,
.quests-swipe-carousel {
  overscroll-behavior-x: contain;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .master-carousel-track,
  .master-carousel-viewport.is-animating {
    transition: none;
  }
}


/* ==================== ① クエスト見出し：タブを常に同じ行に固定 ==================== */
.duo-quest-list-header--tabs {
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.duo-quest-list-header--tabs .duo-quest-sec-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duo-quest-list-header--tabs .quest-tabs-modern {
  flex: 0 0 auto;
  max-width: 100%;
}

.duo-quest-list-header--tabs .quest-tab-dot {
  padding: 0.28rem 0.6rem;
}

@media (max-width: 360px) {
  .duo-quest-list-header--tabs .quest-tab-dot {
    padding: 0.26rem 0.42rem;
    font-size: 0.66rem;
  }
}

/* ==================== ③ 「その他」：コラム最新記事カード ==================== */
.latest-col-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.15rem 0.1rem 0.2rem;
}

.latest-col-state {
  padding: 1.6rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-sub);
  line-height: 1.8;
}

.latest-col-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.7rem 0.75rem 0.75rem;
  background: #ffffff;
  border: 2px solid var(--line-duo);
  border-bottom-width: 4px;
  border-bottom-color: var(--line-duo-dark);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.latest-col-card:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.latest-col-card:hover { border-color: var(--blob-blue); }

.latest-col-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--sky-light);
  display: grid;
  place-items: center;
}

.latest-col-icon img { width: 36px; height: 36px; }

.latest-col-body { flex: 1 1 auto; min-width: 0; }

.latest-col-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.64rem;
  font-weight: 900;
  color: var(--text-sub);
  margin-bottom: 0.18rem;
}

.latest-col-new {
  background: var(--quest-pink);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.05rem 0.42rem;
  letter-spacing: 0.04em;
}

.latest-col-cat {
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.latest-col-title {
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-col-sub {
  margin-top: 0.12rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-sub);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-col-foot {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
  font-size: 0.64rem;
  font-weight: 900;
  color: var(--text-sub);
}

.latest-col-gem { color: var(--blob-blue); }

.latest-col-arrow {
  flex: 0 0 auto;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--line-duo-dark);
  line-height: 1;
}

/* ==================== ④ レベルアップゲージ ==================== */
.level-gauge-card { gap: 0.8rem; }

.level-gauge-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.level-gauge-badge {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a66bff, var(--blob-purple));
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 3px #e9d8fd, 0 4px 0 rgba(94, 44, 140, 0.35);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.level-gauge-badge-lv { font-size: 0.62rem; font-weight: 900; letter-spacing: 0.06em; opacity: 0.9; }
.level-gauge-badge-num { font-size: 1.45rem; font-weight: 900; margin-top: 0.08rem; }

.level-gauge-head-text { flex: 1 1 auto; min-width: 0; }
.level-gauge-title { font-size: 0.96rem; font-weight: 900; color: var(--ink); }
.level-gauge-sub { margin-top: 0.15rem; font-size: 0.74rem; font-weight: 800; color: var(--text-sub); }

.level-gauge-total {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--blob-purple);
  background: #f5edff;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  white-space: nowrap;
}

.level-gauge-track {
  position: relative;
  height: 26px;
  border-radius: 999px;
  background: #eef2f7;
  border: 2px solid var(--line-duo);
  overflow: hidden;
}

.level-gauge-fill {
  position: relative;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c084fc, var(--blob-purple));
  transition: width 0.7s cubic-bezier(0.22, 0.85, 0.25, 1);
  overflow: hidden;
}

.level-gauge-shine {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 4px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.level-gauge-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #4c1d95;
  text-shadow: 0 0 3px #ffffff, 0 0 3px #ffffff;
  pointer-events: none;
}

.level-gauge-league {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding-top: 0.6rem;
  border-top: 1.5px dashed var(--line-duo);
}

.level-gauge-league-text { font-size: 0.72rem; font-weight: 900; color: var(--text-sub); }

.level-gauge-league-track {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.level-gauge-league-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.7s cubic-bezier(0.22, 0.85, 0.25, 1);
}

.level-gauge-card.level-up-pulse { animation: levelUpPulse 0.9s ease; }

@keyframes levelUpPulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(166, 107, 255, 0.55); }
  35%  { transform: scale(1.025); box-shadow: 0 0 0 10px rgba(166, 107, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(166, 107, 255, 0); }
}


/* ==================== 広告を見てライフ全回復 ==================== */
.shop-ad-btn { margin-top: 1.2rem; margin-bottom: 0.15rem; }

.ad-heart-box { max-width: 360px; width: 100%; text-align: center; }

.ad-heart-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.ad-heart-tag {
  flex: 0 0 auto;
  white-space: nowrap;
  background: #64748b;
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
}

.ad-heart-title { font-size: 0.82rem; font-weight: 900; color: var(--ink); }

.ad-slot {
  min-height: 180px;
  border: 2px dashed var(--line-duo-dark);
  border-radius: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
}

.ad-slot.has-image {
  min-height: 0;
  padding: 0;
  gap: 0;
  border: 2px solid var(--line-duo);
  background: #ffffff;
  overflow: hidden;
  display: block;
}

.ad-slot-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(46vh, 340px);
  object-fit: contain;
}

.ad-slot-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.ad-slot-fallback[hidden], .ad-slot-img[hidden] { display: none; }

.ad-slot-text { font-size: 0.86rem; font-weight: 900; color: var(--text-sub); }
.ad-slot-sub { font-size: 0.7rem; font-weight: 800; color: var(--text-sub); opacity: 0.7; }

.ad-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 0.8rem 0 0.4rem;
}

.ad-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #58cc02, #89e219);
  transition: width 0.2s linear;
}

.ad-heart-desc { font-size: 0.78rem; font-weight: 800; color: var(--text-sub); margin: 0 0 0.7rem; }

#ad-close-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }


/* クエスト：リセット案内 */
.quest-reset-note {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-sub);
}


/* ==================== あなた専用レッスンコース（横スクロールの道を歩くキャラクター） ==================== */
.course-card {
  /* 外枠は .duo-home-path-stage が持つので、ここでは枠・余白なし（二重枠を避ける） */
  background: none;
  border: none;
  padding: 0;
  /* flex の親の中で内容の幅まで広がらないようにする（横スクロールさせるため必須） */
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.course-title { font-size: 1.05rem; font-weight: 900; color: var(--ink); margin-bottom: 0.4rem; }

.course-scroll-wrap { position: relative; margin: 0 -0.85rem; } /* 外枠の左右余白ぶん広げて、端から端までスクロールさせる */

/* 左右の端をふわっと消して「横にスクロールできる」ことを示す */
.course-scroll-wrap::before,
.course-scroll-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  z-index: 6;
  pointer-events: none;
}
.course-scroll-wrap::before { left: 0; background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0)); }
.course-scroll-wrap::after { right: 0; background: linear-gradient(270deg, #ffffff, rgba(255, 255, 255, 0)); }

.course-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-y;        /* 縦はページ、横はJSのドラッグで確実に動かす */
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-overflow-scrolling: touch;
}
.course-scroll::-webkit-scrollbar { display: none; }

.course-rail { position: relative; height: 178px; margin: 0 14px; }

/* --- レッスンボタン --- */
.course-lnode {
  position: absolute;
  top: 56px;
  width: 112px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
}

.course-node-box { height: 70px; width: 100%; display: grid; place-items: center; }

.course-node {
  position: relative;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.25s ease;
}

.course-node:active { transform: translateY(2px); }

.course-lnode.done .course-node { background: #cdf28f; box-shadow: 0 4px 0 #b3dc72; }
.course-lnode.locked .course-node { background: #e6e8ee; box-shadow: 0 4px 0 #cfd3dc; }
.course-lnode.active .course-node {
  background: #ffd23f;
  box-shadow: 0 5px 0 #e0a51c;
  transform: scale(1.18);
  animation: coursePulse 1.9s ease-in-out infinite;
}
.course-lnode.active .course-node:active { transform: scale(1.18) translateY(2px); }

@keyframes coursePulse {
  0%, 100% { transform: scale(1.18); }
  50% { transform: scale(1.24); }
}

.course-ico { display: none; }
.course-lnode.done .course-ico-check { display: block; width: 52%; height: 52%; }
.course-lnode.active .course-ico-play {
  display: block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-left: 17px solid #d9831a;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-radius: 3px;
}
.course-lnode.locked .course-ico-lock { display: grid; width: 46%; height: 46%; }
.course-ico-lock img { width: 100%; height: 100%; filter: grayscale(1) opacity(0.55); }

.course-step-pill {
  display: none;
  background: #ffd23f;
  color: #a05a00;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.course-lnode.active .course-step-pill { display: block; }

.course-step-label { font-size: 0.76rem; font-weight: 900; color: var(--text-sub); white-space: nowrap; }
.course-lnode.active .course-step-label { color: var(--ink); }

/* --- ボタン同士をつなぐ道と、途中の4マス --- */
.course-link {
  position: absolute;
  top: 88px;
  height: 7px;
  border-radius: 999px;
  background: #e1e5ec;
  z-index: 0;
}

.course-link-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #9be15d;
  transition: width 0.3s ease;
}

.course-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #cfd5df;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.course-dot.on { background: #58cc02; border-color: #46a302; }

/* --- 歩くキャラクター（ボタンの上の道を進む） --- */
.course-walker {
  position: absolute;
  top: 0;
  height: 56px;
  width: 0;
  z-index: 5;
  pointer-events: none;
  transition: left 0.34s ease-in-out;
}

.course-walker img {
  position: absolute;
  left: 0;
  bottom: 7px;
  width: 44px;
  height: 44px;
  max-width: none; /* 全体の img{max-width:100%} が、幅0の親に効いて消えるのを防ぐ */
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.2));
}

.course-walker-emoji {
  position: absolute;
  left: 0;
  bottom: 7px;
  transform: translateX(-50%);
  font-size: 36px;
  line-height: 1;
}

.course-walker.walking .course-walker-emoji { animation: courseWalkBob 0.36s ease-in-out infinite; }

.course-walker-shadow {
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 26px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.13);
  transform: translateX(-50%);
}

.course-walker.walking img { animation: courseWalkBob 0.36s ease-in-out infinite; }

@keyframes courseWalkBob {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-5deg); }
  50% { transform: translateX(-50%) translateY(-7px) rotate(5deg); }
}

.course-start-btn { margin-top: 0.7rem; }

/* 演習画面の進捗バー上を進む駒 */
.duo-lesson-progress-wrap { position: relative; }

.duo-lesson-piece-lane {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 28px;
  pointer-events: none;
}

.duo-lesson-piece-lane.show { display: block; }

.duo-lesson-piece {
  max-width: none;
  position: absolute;
  bottom: 0;
  left: calc(13px + (100% - 26px) * var(--p, 0));
  width: 26px;
  height: 26px;
  transform: translateX(-50%);
  transition: left 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25));
}

.duo-lesson-piece.hop { animation: lessonPieceHop 0.45s ease; }

@keyframes lessonPieceHop {
  0% { transform: translateX(-50%) translateY(0); }
  45% { transform: translateX(-50%) translateY(-9px) scale(1.15); }
  100% { transform: translateX(-50%) translateY(0); }
}


/* ==================== ★ メイン機能：レッスンコースの特別演出 ==================== */
.course-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 214, 102, 0.30), transparent 55%),
    radial-gradient(90% 80% at 100% 10%, rgba(120, 205, 255, 0.28), transparent 55%),
    linear-gradient(160deg, #1d2a7a 0%, #3b2b9e 55%, #6b36c4 100%);
  border: 2px solid rgba(255, 214, 102, 0.75);
  border-bottom: 5px solid #e0a51c;
  box-shadow: 0 12px 30px rgba(59, 43, 158, 0.38);
  animation: courseStageGlow 3.6s ease-in-out infinite;
}

@keyframes courseStageGlow {
  0%, 100% { box-shadow: 0 12px 30px rgba(59, 43, 158, 0.38), 0 0 0 rgba(255, 214, 102, 0); }
  50% { box-shadow: 0 12px 30px rgba(59, 43, 158, 0.38), 0 0 24px rgba(255, 214, 102, 0.5); }
}

.course-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  animation: courseTwinkle 2.8s ease-in-out infinite;
}
.course-sparkle.s1 { top: 14%; left: 8%; }
.course-sparkle.s2 { top: 24%; right: 10%; animation-delay: 0.9s; }
.course-sparkle.s3 { top: 66%; left: 46%; animation-delay: 1.7s; }

@keyframes courseTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 0.95; transform: scale(1.4); }
}

.course-ribbon {
  display: inline-block;
  background: linear-gradient(90deg, #ffe27a, #ffb81a);
  color: #5a3600;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 2px 0 #c98600;
  margin-bottom: 0.5rem;
}

.course-stage .course-title {
  color: #ffffff;
  font-size: 1.25rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  margin-bottom: 0.2rem;
}

/* 端のフェードは、背景色に関係なく効くマスクで表現 */
.course-stage .course-scroll-wrap::before,
.course-stage .course-scroll-wrap::after { display: none; }
.course-stage .course-scroll {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}

.course-stage .course-lnode.done .course-node { background: linear-gradient(180deg, #c3f77f, #7ed321); box-shadow: 0 4px 0 #4f9d10; }
.course-stage .course-lnode.locked .course-node { background: rgba(255, 255, 255, 0.16); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.course-stage .course-lnode.active .course-node {
  background: linear-gradient(180deg, #ffe985, #ffbe1a);
  box-shadow: 0 5px 0 #d99200, 0 0 0 6px rgba(255, 214, 102, 0.28), 0 0 26px rgba(255, 214, 102, 0.75);
}
.course-stage .course-ico-lock img { filter: grayscale(1) brightness(1.7) opacity(0.75); }
.course-stage .course-step-label { color: rgba(255, 255, 255, 0.72); }
.course-stage .course-lnode.active .course-step-label { color: #ffffff; }
.course-stage .course-link { background: rgba(255, 255, 255, 0.2); }
.course-stage .course-link-fill { background: #8be34a; }
.course-stage .course-dot { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.42); }
.course-stage .course-dot.on { background: #8be34a; border-color: #5cb82a; }
.course-stage .course-walker-shadow { background: rgba(0, 0, 0, 0.35); }

/* アイテム報酬のバッジ（宝箱ステージは大きく光る） */
.course-node-box { position: relative; }

.course-reward {
  position: absolute;
  top: 0;
  left: calc(50% + 15px);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  z-index: 3;
}
.course-reward img { width: 15px; height: 15px; }

.course-lnode.milestone .course-reward {
  width: 34px;
  height: 34px;
  top: -10px;
  left: calc(50% + 8px);
  font-size: 19px;
  background: linear-gradient(180deg, #fff3b8, #ffc83d);
  box-shadow: 0 3px 0 #c98600, 0 0 14px rgba(255, 214, 102, 0.9);
  animation: courseGiftWiggle 1.8s ease-in-out infinite;
}
.course-lnode.milestone .course-reward img { width: 22px; height: 22px; }
.course-lnode.milestone.locked .course-node,
.course-lnode.milestone.active .course-node { outline: 2px dashed rgba(255, 214, 102, 0.8); outline-offset: 4px; }
.course-lnode.done .course-reward { display: none; }

@keyframes courseGiftWiggle {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.12); }
}

/* 主役のボタン：金色＋きらっと光る */
.course-stage .course-start-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffe985, #ffb81a);
  color: #5a3600;
  font-size: 1.05rem;
  box-shadow: 0 5px 0 #c98600, 0 0 22px rgba(255, 200, 60, 0.5);
}
.course-stage .course-start-btn:active { box-shadow: 0 2px 0 #c98600, 0 0 14px rgba(255, 200, 60, 0.5); }
.course-stage .course-start-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 36%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  animation: courseSheen 3.2s ease-in-out infinite;
}

@keyframes courseSheen {
  0%, 55% { left: -60%; }
  100% { left: 130%; }
}

/* 完走画面：ごほうびボックス */
.lesson-reward-box {
  width: 100%;
  margin: 0.55rem 0 0.2rem;
  padding: 0.65rem 0.7rem 0.7rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff9e0, #ffefb0);
  border: 2px solid #f5c542;
  border-bottom-width: 4px;
  text-align: center;
}
.lesson-reward-box[hidden] { display: none; }
.lesson-reward-box.milestone {
  background: linear-gradient(160deg, #ffe985, #ffbe1a);
  border-color: #d99200;
  box-shadow: 0 0 22px rgba(255, 200, 60, 0.6);
  animation: courseGiftWiggle 2.4s ease-in-out infinite;
}
.lesson-reward-title { font-size: 0.9rem; font-weight: 900; color: #7a4b00; margin-bottom: 0.4rem; }
.lesson-reward-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
.lesson-reward-chip {
  background: #ffffff;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 900;
  color: #5a3600;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.lesson-reward-note { margin-top: 0.35rem; font-size: 0.66rem; font-weight: 800; color: #8a6a1a; }

/* 広告ポップは、他のポップアップ（クエスト達成など）が開いていても必ず最前面に表示 */
#ad-heart-modal { z-index: 6000; }


/* 10秒広告の「✕」（右上）。途中で閉じると報酬なし */
.ad-heart-box { position: relative; }
.ad-x-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}
.ad-x-btn[hidden] { display: none; }
.ad-heart-head { padding-right: 2rem; }


/* 連問：共通の問題文を表示していることを示す帯 */
.q-shared-stem-note {
  display: block;
  margin: 0 0 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  background: #eef6ff;
  color: #1d6fb8;
  font-size: 0.72rem;
  font-weight: 800;
}
