/* ==========================================================================
   노인 친화 디자인 토큰 (복지센터 앱 톤 · 88px 터치 타겟 · 20px+ 본문)
   ========================================================================== */

:root {
  --color-bg: #F7F3EA;
  --color-surface: #FFFFFF;
  --color-surface-soft: #FFFCF6;
  --color-text: #10201F;
  --color-text-soft: #526663;
  --color-muted: #7A6F62;
  --color-primary: #0F766E;
  --color-primary-dark: #0A4F49;
  --color-primary-soft: #DDF1EE;
  --color-accent: #B7791F;
  --color-accent-dark: #7C4F13;
  --color-accent-darker: #5F3B0D;
  --color-accent-soft: #FFF1CE;
  --color-success: #166534;
  --color-success-soft: #E5F4EA;
  --color-warn: #A16207;
  --color-warn-soft: #FFF3D7;
  --color-danger: #9F1D1D;
  --color-danger-soft: #FDE2E2;
  --color-highlight: #FFF0B8;
  --color-highlight-border: #B7791F;
  --color-border: #DCD4C4;
  --color-border-strong: #C7BBA8;
  --color-shadow: rgba(43, 38, 30, 0.12);
  --color-tree: #14735F;

  --font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', sans-serif;
  --font-size-body: 20px;
  --font-size-sm: 17px;
  --font-size-lg: 23px;
  --font-size-xl: 31px;
  --font-size-xxl: 38px;
  --font-size-verse: 30px;
  --line-height-body: 1.6;

  --touch-target: 88px;
  --radius-card: 8px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --radius: var(--radius-card);
  --radius-lg: var(--radius-control);
  --padding-btn: 22px;
  --gap: 18px;
  --app-width: 430px;

  --anim-fast: 180ms;
  --anim-med: 360ms;
  --anim-slow: 700ms;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-control);
}

/* ==========================================================================
   레이아웃 공통
   ========================================================================== */

.app-header,
.app-main,
.app-footer {
  width: 100%;
  max-width: min(var(--app-width), 100vw);
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.app-header .title {
  min-width: 0;
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-lg);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.app-header .streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.streak-label {
  color: var(--color-text-soft);
  font-size: 14px;
  font-weight: 700;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
}

.app-footer {
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-soft);
  text-align: center;
}

.footer-main,
.footer-note {
  margin: 0;
}

.footer-main {
  font-size: 16px;
  font-weight: 600;
}

.footer-note {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 58px;
  padding: 14px 18px;
  color: var(--color-text);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  font-size: 18px;
  font-weight: 800;
  transition: transform var(--anim-fast) ease, background var(--anim-fast) ease;
}

.back-button::before {
  content: "‹";
  margin-right: 8px;
  font-size: 28px;
  line-height: 1;
}

.back-button:active {
  transform: translateY(1px);
  background: var(--color-primary-soft);
}

/* ==========================================================================
   메인 화면
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--gap);
  min-width: 0;
}

.training-intro {
  padding: 8px 2px 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--color-primary-dark);
  font-size: 15px;
  font-weight: 900;
}

.training-intro h2 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-xxl);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.training-intro p {
  max-width: 420px;
  margin: 10px 0 0;
  color: var(--color-text-soft);
  font-size: var(--font-size-body);
  font-weight: 600;
}

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--color-primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius-card);
  min-width: 0;
}

.welcome-message {
  margin: 0;
  color: var(--color-primary-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.name-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-form label {
  color: var(--color-text-soft);
  font-size: 16px;
  font-weight: 900;
}

.name-input-row {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.name-input-row input {
  flex: 1;
  min-width: 0;
  min-height: 62px;
  padding: 12px 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
}

.name-save,
.name-edit {
  min-height: 62px;
  color: #FFFFFF;
  background: var(--color-primary);
  border-radius: var(--radius-control);
  font-size: 19px;
  font-weight: 900;
}

.name-save {
  flex: 0 0 92px;
}

.name-edit {
  align-self: flex-start;
  padding: 12px 18px;
}

.name-save:active,
.name-edit:active {
  background: var(--color-primary-dark);
}

.tree-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 22px 20px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 24px var(--color-shadow);
  text-align: center;
}

#treeImage {
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  margin-bottom: 2px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 50%;
}

.tree-container svg {
  width: 138px;
  height: 138px;
  filter: saturate(0.86) contrast(0.98);
}

.tree-stage-label {
  margin: 0;
  color: var(--color-tree);
  font-size: var(--font-size-lg);
  font-weight: 900;
}

.tree-points,
.tree-next {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 18px;
  font-weight: 700;
}

.tree-next {
  color: var(--color-muted);
  font-size: 16px;
}

.today-message {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.section-heading-row > div {
  min-width: 0;
}

.section-heading-row h2,
.journey-main h2 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-lg);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-kicker,
.progress-kicker {
  margin: 0 0 4px;
  color: var(--color-primary-dark);
  font-size: 14px;
  font-weight: 900;
}

.daily-reading-card,
.journey-card,
.pilot-card,
.result-progress-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 18px rgba(43, 38, 30, 0.08);
  min-width: 0;
}

.daily-reading-card {
  border-color: rgba(15, 118, 110, 0.24);
}

.difficulty-pill,
.sync-pill {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 12px;
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.daily-passage,
.daily-summary,
.pilot-card p,
.license-note,
.progress-caption,
.result-progress-card p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.daily-passage {
  color: var(--color-accent-dark);
  font-weight: 900;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.tag-row span,
.price-preview span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 800;
}

.daily-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.daily-actions .secondary-cta,
.daily-actions .primary-cta {
  min-height: 74px;
  font-size: 22px;
}

.daily-actions .primary-cta {
  box-shadow: 0 4px 0 var(--color-primary-dark);
}

.daily-done.is-complete {
  color: var(--color-success);
  background: var(--color-success-soft);
  border-color: rgba(22, 101, 52, 0.25);
}

.journey-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.journey-main > div:first-child {
  min-width: 0;
}

.journey-main p {
  margin: 6px 0 0;
  color: var(--color-text-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.level-number {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  color: #FFFFFF;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
  font-size: 34px;
  font-weight: 950;
}

.one-read-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text-soft);
  font-size: 15px;
  font-weight: 900;
}

.mini-progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: #E7DFD1;
  border-radius: var(--radius-pill);
}

.mini-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #8A9A5B);
  border-radius: inherit;
  transition: width var(--anim-med) ease;
}

.license-note {
  padding: 10px 12px;
  background: var(--color-accent-soft);
  border: 1px solid rgba(183, 121, 31, 0.2);
  border-radius: var(--radius-card);
  color: var(--color-accent-dark);
  font-size: 14px;
}

.role-toggle button {
  min-height: 56px;
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius-control);
  font-size: 16px;
  font-weight: 900;
}

.role-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.role-toggle button[aria-pressed="true"] {
  color: #FFFFFF;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.price-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-cta,
.secondary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-control);
  text-align: center;
  transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast) ease,
    background var(--anim-fast) ease;
}

.primary-cta {
  min-height: 94px;
  padding: var(--padding-btn) 30px;
  color: #FFFFFF;
  background: var(--color-primary);
  box-shadow: 0 5px 0 var(--color-primary-dark);
  font-size: var(--font-size-xl);
  font-weight: 900;
}

.primary-cta:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--color-primary-dark);
}

.secondary-cta {
  min-height: var(--touch-target);
  padding: 20px 24px;
  color: var(--color-primary-dark);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  font-size: var(--font-size-lg);
  font-weight: 800;
}

.secondary-cta:active {
  background: var(--color-primary-soft);
}

.danger-cta {
  color: var(--color-danger);
  background: var(--color-surface);
  border-color: #E6B7B7;
}

.danger-cta:active {
  background: var(--color-danger-soft);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  min-width: 0;
  padding: 18px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
}

.stat-card .value {
  color: var(--color-primary-dark);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.stat-card .label {
  margin-top: 8px;
  color: var(--color-text-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

/* ==========================================================================
   게임 화면
   ========================================================================== */

.game-header {
  min-height: 70px;
}

.game-header .title {
  flex: 1;
  text-align: center;
  font-size: 20px;
}

.game-main {
  min-height: calc(100svh - 70px);
  padding-top: 14px;
  gap: 14px;
}

.game-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verse-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 186px;
  padding: 30px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
  box-shadow: 0 8px 18px rgba(43, 38, 30, 0.08);
  transition: opacity var(--anim-med) ease;
}

.verse-display.fading {
  opacity: 0;
}

.verse-display.collapsed {
  display: none;
}

.verse-ref {
  margin: 0 0 12px;
  color: var(--color-primary-dark);
  font-size: 17px;
  font-weight: 900;
}

.verse-text {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-verse);
  font-weight: 850;
  line-height: 1.48;
}

.verse-text .target {
  display: inline-block;
  padding: 2px 10px 4px;
  background: var(--color-highlight);
  border-bottom: 4px solid var(--color-highlight-border);
  border-radius: 8px;
}

.ref-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 28px);
  padding: 8px 14px;
  transform: translateX(-50%);
  color: var(--color-text-soft);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--anim-med) ease;
  white-space: nowrap;
}

.ref-hint.visible {
  opacity: 1;
}

.word-arena {
  position: relative;
  flex: 1;
  min-height: 330px;
  overflow: hidden;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.word-arena::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(15, 118, 110, 0.18);
  border-radius: var(--radius-card);
  pointer-events: none;
}

.floating-word {
  position: absolute;
  min-width: 104px;
  min-height: 76px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  box-shadow: 0 3px 0 var(--color-border-strong);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  will-change: transform;
  transition: transform 0.05s linear;
  -webkit-tap-highlight-color: transparent;
}

.floating-word.target-glow {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 5px var(--color-accent-soft), 0 3px 0 var(--color-accent-dark);
  animation: glowPulse 1.7s ease-in-out infinite;
}

.floating-word.correct {
  color: var(--color-success);
  background: var(--color-success-soft);
  border-color: var(--color-success);
  animation: popSuccess var(--anim-med) ease forwards;
}

.floating-word.wrong-pick {
  background: var(--color-warn-soft);
  border-color: var(--color-warn);
  animation: shakeWrong 380ms ease;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 0 5px var(--color-accent-soft), 0 3px 0 var(--color-accent-dark);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(183, 121, 31, 0.18), 0 3px 0 var(--color-accent-dark);
  }
}

@keyframes popSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(0.02); opacity: 0; }
}

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

.feedback-pulse {
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
}

.feedback-pulse.correct {
  background: rgba(22, 101, 52, 0.10);
  animation: pulseFlash 480ms ease;
}

.feedback-pulse.wrong {
  background: rgba(161, 98, 7, 0.12);
  animation: pulseFlash 480ms ease;
}

@keyframes pulseFlash {
  0% { opacity: 0; }
  45% { opacity: 1; }
  100% { opacity: 0; }
}

.progress-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: #E7DFD1;
  border-radius: var(--radius-pill);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  transition: width var(--anim-fast) linear;
}

.round-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-soft);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.round-counter span {
  line-height: 1.2;
}

.round-counter strong {
  color: var(--color-primary-dark);
  font-size: var(--font-size-lg);
}

.round-hint {
  color: var(--color-muted);
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.game-instruction {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

/* ==========================================================================
   결과 화면
   ========================================================================== */

.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
  box-shadow: 0 10px 24px var(--color-shadow);
}

.result-hero .big-score {
  margin: 0;
  color: var(--color-primary);
  font-size: 78px;
  font-weight: 950;
  line-height: 1;
  animation: scoreBounce 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.result-hero .score-label {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-xl);
  font-weight: 900;
  line-height: 1.25;
}

.result-hero .subtitle {
  margin: 0;
  color: var(--color-text-soft);
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.mode-label {
  margin: 0;
  color: var(--color-muted);
  font-size: 18px;
  font-weight: 800;
}

@keyframes scoreBounce {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.result-stat {
  padding: 20px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: center;
}

.result-stat .stat-value {
  color: var(--color-primary-dark);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.result-stat .stat-label {
  margin-top: 8px;
  color: var(--color-text-soft);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.result-note-wrap {
  margin-top: 2px;
}

.comparison-note {
  min-height: 32px;
  color: var(--color-text-soft);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.comparison-note-positive {
  color: var(--color-tree);
}

.ai-result-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.ai-result-card {
  padding: 18px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: left;
}

.ai-result-card h3 {
  margin: 0 0 8px;
  color: var(--color-primary-dark);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}

.ai-result-card p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.ai-result-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-result-heading-row h3 {
  margin: 0;
}

.ai-prayer-speak {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 15px;
}

.result-progress-card h2 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-lg);
  font-weight: 900;
  line-height: 1.25;
}

.result-actions {
  margin-top: 2px;
}

.confetti-container {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  animation: confettiFall 2.4s ease-in forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* ==========================================================================
   설정 다이얼로그
   ========================================================================== */

.settings-dialog {
  width: calc(100% - 32px);
  max-width: 430px;
  padding: 22px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  box-shadow: 0 24px 60px rgba(20, 24, 20, 0.24);
}

.settings-dialog::backdrop {
  background: rgba(16, 32, 31, 0.38);
}

.settings-dialog h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.settings-sync {
  margin: 0 0 18px;
  padding: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.settings-sync h3 {
  margin: 0 0 8px;
  color: var(--color-primary);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.settings-sync p {
  margin: 0 0 14px;
  color: var(--color-muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  font-size: 20px;
  font-weight: 800;
}

.setting-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  accent-color: var(--color-primary);
}

.setting-ageband {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.setting-ageband legend {
  padding: 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text-soft);
}

.dialog-action {
  min-height: 68px;
  margin-bottom: 12px;
  font-size: 20px;
}

.dialog-close {
  min-height: 82px;
  margin-top: 6px;
}

.loading-message,
.load-error {
  padding: 70px 24px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
}

.loading-message {
  color: var(--color-text-soft);
}

.load-error {
  color: var(--color-accent-darker);
}

/* ==========================================================================
   Utility
   ========================================================================== */

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

.centered-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.compact-actions {
  margin-top: 0;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

/* ==========================================================================
   모드 선택 카드 (index.html)
   ========================================================================== */

.mode-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 112px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-align: left;
  transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast) ease, border-color var(--anim-fast) ease;
  box-shadow: 0 8px 18px rgba(43, 38, 30, 0.08);
}

.mode-card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 10px rgba(43, 38, 30, 0.08);
}

.mode-card:hover {
  border-color: var(--color-primary);
}

.mode-card .mode-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  padding: 8px;
  background: #F4FAF8;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius-control);
}

.mode-card .mode-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mode-card .mode-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.mode-card .mode-title {
  font-size: var(--font-size-lg);
  font-weight: 900;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.mode-card .mode-desc {
  font-size: 16px;
  color: var(--color-text-soft);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mode-card .mode-last {
  font-size: 14px;
  color: var(--color-accent-dark);
  font-weight: 800;
  margin-top: 4px;
}

/* ==========================================================================
   말씀 조각 맞추기 (game-puzzle.html)
   ========================================================================== */

.puzzle-stage,
.story-stage,
.quiz-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  min-height: 520px;
  box-shadow: 0 8px 18px rgba(43, 38, 30, 0.08);
}

.story-stage {
  min-height: 440px;
}

.quiz-stage {
  min-height: 360px;
}

.puzzle-header,
.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.puzzle-ref,
.story-ref {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-soft);
}

.story-title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-text);
}

.tts-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.tts-mini:active {
  transform: translateY(2px);
}

/* ==========================================================================
   오늘 말씀 퀴즈 (game-quiz.html)
   ========================================================================== */

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-ref {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-soft);
}

.quiz-question {
  margin: 0;
  font-size: 30px;
  line-height: 1.45;
  color: var(--color-text);
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-timer {
  height: 8px;
  background: var(--color-surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.quiz-tts-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-tts-options .tts-mini {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 16px;
}

.quiz-choice {
  min-height: 66px;
  padding: 14px 16px;
  text-align: left;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-card);
  transition: background var(--anim-fast), border-color var(--anim-fast), transform var(--anim-fast);
}

.quiz-choice:active {
  transform: translateY(2px);
}

.quiz-choice.correct {
  background: var(--color-success-soft);
  border-color: var(--color-success);
  color: var(--color-success);
}

.quiz-choice.wrong {
  background: var(--color-warn-soft);
  border-color: var(--color-warn);
}

.quiz-feedback {
  min-height: 32px;
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text-soft);
}

.quiz-feedback.correct {
  color: var(--color-success);
}

.quiz-feedback.wrong {
  color: var(--color-warn-dark);
}

/* 슬롯 행 */
.puzzle-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  min-height: 240px;
}

.puzzle-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-card);
  text-align: left;
  font-family: inherit;
  font-size: var(--font-size-body);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--anim-fast), border-color var(--anim-fast), transform var(--anim-fast);
}

.puzzle-slot .slot-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.puzzle-slot .slot-text {
  flex: 1;
  font-size: 22px;
  font-weight: 600;
}

.puzzle-slot.filled {
  background: var(--color-accent-soft);
  border-style: solid;
  border-color: var(--color-accent);
}

.puzzle-slot.slot-correct {
  background: var(--color-success-soft);
  border-color: var(--color-success);
  color: var(--color-success);
}

.puzzle-slot.slot-wrong {
  background: var(--color-warn-soft);
  border-color: var(--color-warn);
  animation: shakeWrong 420ms ease;
}

/* 조각 풀 */
.puzzle-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  min-height: 120px;
}

.puzzle-piece {
  min-height: 64px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  box-shadow: 0 3px 0 var(--color-border-strong);
  cursor: pointer;
  transition: transform var(--anim-fast), box-shadow var(--anim-fast);
}

.puzzle-piece:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--color-border);
}

.puzzle-piece.placed {
  opacity: 0.25;
  pointer-events: none;
  cursor: default;
}

.puzzle-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.puzzle-actions .primary-cta,
.puzzle-actions .secondary-cta {
  flex: 1;
  min-height: 72px;
  max-width: none;
}

.puzzle-actions .primary-cta:disabled {
  background: var(--color-border);
  color: var(--color-text-soft);
  box-shadow: none;
  cursor: not-allowed;
}

/* ==========================================================================
   이야기 순서 맞추기 (game-story.html)
   ========================================================================== */

.story-narration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 24px;
  text-align: center;
}

.story-narration p {
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

.story-narration .story-start {
  max-width: 420px;
}

.story-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.story-slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-height: 180px;
  padding: 8px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-card);
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: background var(--anim-fast), border-color var(--anim-fast);
}

.story-slot .slot-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  align-self: flex-start;
  margin: 4px;
}

.story-slot .slot-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.story-slot.filled {
  background: var(--color-accent-soft);
  border-style: solid;
  border-color: var(--color-accent);
}

.story-slot.slot-correct {
  background: var(--color-success-soft);
  border-color: var(--color-success);
}

.story-slot.slot-wrong {
  background: var(--color-warn-soft);
  border-color: var(--color-warn);
  animation: shakeWrong 420ms ease;
}

.story-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-card);
  box-shadow: 0 3px 0 var(--color-border-strong);
  font-family: inherit;
  cursor: pointer;
  min-height: 180px;
  text-align: center;
  transition: transform var(--anim-fast), box-shadow var(--anim-fast);
}

.story-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--color-border);
}

.story-card.placed {
  opacity: 0.3;
  pointer-events: none;
}

.story-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-bg);
}

.story-card-text-box {
  display: grid;
  place-items: center;
  padding: 12px;
  background: #F5EFE3;
  border: 1px solid var(--color-border);
}

.story-card-text-box span {
  color: var(--color-text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.story-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.story-card-caption {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  padding: 0 4px;
}

/* ==========================================================================
   Motion preference & small screen
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .floating-word {
    transition: none;
  }
}

@media (max-width: 420px) {
  :root {
    --font-size-body: 19px;
    --font-size-lg: 22px;
    --font-size-xl: 28px;
    --font-size-xxl: 34px;
    --font-size-verse: 26px;
    --gap: 16px;
  }

  .app-header {
    min-height: 70px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .app-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .app-header .streak {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 16px;
  }

  .streak-label {
    display: none;
  }

  #treeImage {
    width: 160px;
    height: 160px;
  }

  .tree-container svg {
    width: 126px;
    height: 126px;
  }

  .floating-word {
    min-width: 92px;
    min-height: 68px;
    padding: 13px 18px;
    font-size: 23px;
  }

  .result-hero .big-score {
    font-size: 68px;
  }

  .mode-card { padding: 16px; min-height: 104px; gap: 14px; }
  .mode-card .mode-icon { width: 68px; height: 68px; padding: 6px; }

  .daily-reading-card,
  .journey-card,
  .pilot-card,
  .result-progress-card {
    padding: 16px;
  }

  .section-heading-row {
    align-items: flex-start;
  }

  .daily-actions .secondary-cta,
  .daily-actions .primary-cta {
    min-height: 70px;
    font-size: 20px;
  }

  .level-number {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }

  .puzzle-piece { font-size: 18px; padding: 12px 16px; min-height: 56px; }
  .puzzle-slot .slot-text { font-size: 18px; }
  .puzzle-actions { flex-direction: column; }

  .story-pool { grid-template-columns: repeat(2, 1fr); }
  .story-slots { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .story-slot { min-height: 150px; }
  .story-card { min-height: 150px; }
  .story-card-caption { font-size: 13px; }
}

@media (max-width: 600px) {
  body {
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  :root {
    --font-size-verse: 24px;
  }

  .training-intro h2 {
    font-size: 31px;
  }

  .primary-cta {
    font-size: 26px;
  }

  .round-counter {
    gap: 8px;
    font-size: 15px;
  }

  .back-button {
    min-width: 94px;
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-height: 720px) {
  .verse-display {
    min-height: 160px;
    padding: 24px 18px;
  }

  .word-arena {
    min-height: 270px;
  }

  .primary-cta {
    min-height: 88px;
  }
}

/* ==========================================================================
   Home dashboard redesign (mockup-aligned)
   ========================================================================== */

:root {
  --home-yellow: #FFD21A;
  --home-yellow-dark: #F2B600;
  --home-cream: #FFF7E2;
  --home-card: #FFFDF7;
  --home-brown: #3A2308;
  --home-brown-2: #5A3510;
  --home-border: #EFD59A;
  --home-green: #5DAE31;
  --home-pink: #F94F78;
  --home-blue: #247FD0;
  --home-shadow: rgba(94, 58, 10, 0.16);
  --home-radius: 22px;
}

body.home-dashboard {
  display: block;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #FFD400 0%, #FFE066 172px, #FFF8E8 173px, #FFF8E8 100%);
  color: #1E1405;
}

.home-dashboard .home-topbar,
.home-dashboard .home-main,
.home-dashboard .bottom-tabbar {
  width: 100%;
  max-width: min(1024px, 100vw);
  margin: 0 auto;
}

.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 118px;
  padding: calc(22px + env(safe-area-inset-top)) 30px 18px;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: clamp(72px, 12vw, 132px);
  height: clamp(72px, 12vw, 132px);
  padding: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 8px 18px rgba(61, 37, 0, 0.22);
}

.brand-title {
  margin: 0;
  color: #2B1900;
  font-size: clamp(30px, 5.2vw, 54px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
  overflow-wrap: anywhere;
}

.brand-subtitle {
  margin: 8px 0 0;
  color: #2F1A00;
  font-size: clamp(17px, 2.8vw, 25px);
  font-weight: 900;
  line-height: 1.25;
}

.top-actions {
  display: flex;
  gap: 14px;
  flex: 0 0 auto;
}

.round-icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(58px, 8vw, 82px);
  height: clamp(58px, 8vw, 82px);
  color: var(--home-brown);
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 9px 18px rgba(82, 49, 0, 0.18);
  font-size: 0;
  font-weight: 900;
}

.round-icon-button::before {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1;
}

.notification-button::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 4px solid var(--home-brown);
  border-top-width: 2px;
  border-radius: 50% 50% 45% 45%;
  font-size: 0;
}

#settingsButton::before {
  content: "";
  width: 34px;
  height: 34px;
  background:
    radial-gradient(circle, var(--home-brown) 0 28%, transparent 29%),
    conic-gradient(from 0deg, var(--home-brown) 0 10%, transparent 10% 20%, var(--home-brown) 20% 30%, transparent 30% 40%, var(--home-brown) 40% 50%, transparent 50% 60%, var(--home-brown) 60% 70%, transparent 70% 80%, var(--home-brown) 80% 90%, transparent 90% 100%);
  border-radius: 50%;
}

.notification-count {
  position: absolute;
  top: -2px;
  right: -2px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  color: #FFFFFF;
  background: #FF3B30;
  border: 3px solid #FFD21A;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 28px calc(118px + env(safe-area-inset-bottom));
}

.dashboard-card,
.home-dashboard .daily-reading-card,
.home-dashboard .journey-card,
.home-dashboard .pilot-card,
.home-dashboard .mode-picker,
.home-dashboard .tree-container {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 235, 0.96));
  border: 2px solid var(--home-border);
  border-radius: var(--home-radius);
  box-shadow: 0 10px 22px var(--home-shadow);
}

.welcome-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 150px;
  padding: 24px 24px 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(239, 213, 154, 0.82);
  border-radius: var(--home-radius);
  box-shadow: 0 10px 22px var(--home-shadow);
}

.home-dashboard .welcome-message {
  margin: 0;
  color: #1A1206;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 950;
  line-height: 1.35;
}

.home-dashboard .today-message {
  margin: 8px 0 0;
  color: #3F2A11;
  font-size: clamp(16px, 2.3vw, 21px);
  font-weight: 850;
  text-align: left;
}

.senior-portrait {
  width: clamp(106px, 18vw, 172px);
  height: clamp(112px, 18vw, 178px);
  object-fit: contain;
  border-radius: 28px;
}

.welcome-card .name-form {
  grid-column: 1 / -1;
  max-width: 540px;
}

.welcome-card .name-edit {
  grid-column: 1 / -1;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.home-dashboard .daily-reading-card {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  padding: 28px;
}

.home-dashboard .daily-reading-card::after {
  content: none;
}

.daily-illustration {
  position: absolute;
  right: 22px;
  bottom: 0;
  width: clamp(118px, 18vw, 182px);
  height: auto;
  max-height: 92%;
  object-fit: contain;
  z-index: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.dashboard-card-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-card-heading h2,
.section-title-row h2,
.daily-course-card h2 {
  margin: 0;
  color: #161006;
  font-size: clamp(22px, 3.1vw, 30px);
  font-weight: 950;
  line-height: 1.25;
}

.home-dashboard .section-kicker {
  margin: 0 0 6px;
  color: #8B5600;
  font-size: 17px;
  font-weight: 950;
}

.home-dashboard .daily-reading-card h2 {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 158px);
  margin: 16px 0 10px;
  color: #1A1206;
  font-size: clamp(26px, 3.8vw, 38px);
  font-weight: 950;
  line-height: 1.2;
}

.home-dashboard .daily-passage,
.home-dashboard .daily-summary {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 160px);
  color: #25180A;
}

.home-dashboard .daily-passage {
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 950;
}

.home-dashboard .daily-summary {
  margin-top: 10px;
  font-size: clamp(17px, 2.3vw, 21px);
  font-weight: 800;
}

.home-dashboard .tag-row {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 160px);
  margin-top: 16px;
}

.home-dashboard .tag-row span {
  color: #6E4100;
  background: #FFF0BF;
  border-color: #F0C85E;
}

.yellow-cta,
.primary-course-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 16px 30px;
  color: #1B1204;
  background: linear-gradient(180deg, #FFE066, #FFC700);
  border: 2px solid #E6A900;
  border-radius: 20px;
  box-shadow: 0 5px 0 #C88300;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 950;
}

.yellow-cta {
  margin-top: 24px;
}

.yellow-cta:active,
.primary-course-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #C88300;
}

.mission-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(180deg, #FFD719, #FFC400);
  border-color: #E3AC00;
}

.mission-card #missionProgressText {
  color: #171006;
  font-size: 20px;
  font-weight: 950;
  white-space: nowrap;
}

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  color: #1A1206;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  font-size: 20px;
  font-weight: 900;
}

.mission-row strong {
  color: #C46600;
  font-size: 18px;
  font-weight: 950;
}

.mission-check {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(180deg, #72C94B, #3B9B21);
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
}

.mission-check::before {
  content: "";
  width: 16px;
  height: 9px;
  border-left: 4px solid #FFFFFF;
  border-bottom: 4px solid #FFFFFF;
  transform: rotate(-45deg) translate(1px, -1px);
}

.mission-check.is-empty,
.mission-row:not(.is-complete) .mission-check {
  background: transparent;
  border: 3px dashed #B77B21;
}

.mission-check.is-empty::before,
.mission-row:not(.is-complete) .mission-check::before {
  display: none;
}

.score-card {
  grid-column: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 20px 26px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #5A3610, #2E1B08);
  border: 2px solid #2A1806;
  border-radius: var(--home-radius);
  box-shadow: 0 10px 20px rgba(58, 35, 8, 0.22);
  text-align: left;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 950;
}

.score-card strong {
  color: #FFFFFF;
  font-size: clamp(26px, 4vw, 40px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.score-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--home-brown);
  background: #FFD21A;
  border-radius: 50%;
  font-size: 0;
}

.score-icon::before {
  content: "";
  width: 22px;
  height: 22px;
  background: #8D5600;
  clip-path: polygon(18% 20%, 82% 20%, 70% 62%, 58% 62%, 58% 78%, 72% 78%, 72% 88%, 28% 88%, 28% 78%, 42% 78%, 42% 62%, 30% 62%);
}

.daily-course-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.daily-course-card p {
  margin: 6px 0 0;
  color: #4A351A;
  font-size: 18px;
  font-weight: 800;
}

.home-dashboard .mode-picker {
  max-width: none;
  padding: 24px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-link {
  min-height: 40px;
  padding: 6px 8px;
  color: #4A351A;
  background: transparent;
  font-size: 17px;
  font-weight: 900;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-dashboard .mode-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 300px;
  padding: 18px;
  border-width: 3px;
  border-radius: 24px;
  text-align: center;
  overflow: hidden;
}

.home-dashboard .mode-card-speed {
  background: linear-gradient(180deg, #EAF8E7 0 66%, #FFFFFF 67% 100%);
  border-color: #B8D8B4;
}

.home-dashboard .mode-card-puzzle {
  background: linear-gradient(180deg, #FFE6EA 0 66%, #FFFFFF 67% 100%);
  border-color: #F4B7C2;
}

.home-dashboard .mode-card-story {
  background: linear-gradient(180deg, #E2F0FF 0 66%, #FFFFFF 67% 100%);
  border-color: #A9C9EC;
}

.home-dashboard .mode-card .mode-icon {
  width: 100%;
  height: 122px;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: hidden;
  border-radius: 14px;
}

.home-dashboard .mode-card .mode-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.home-dashboard .mode-card .mode-title {
  min-height: 58px;
  color: #10201F;
  font-size: clamp(20px, 2.7vw, 28px);
  font-weight: 950;
  line-height: 1.18;
}

.home-dashboard .mode-card .mode-desc {
  color: #2E2212;
  font-size: 16px;
  font-weight: 800;
}

.home-dashboard .mode-card .mode-last {
  color: #6E4A20;
  font-size: 13px;
  font-weight: 850;
}

.mode-start {
  display: grid;
  place-items: center;
  min-height: 58px;
  margin-top: auto;
  color: #FFFFFF;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 950;
}

.mode-card-speed .mode-start { background: linear-gradient(180deg, #70C64D, #3F9C25); }
.mode-card-puzzle .mode-start { background: linear-gradient(180deg, #FF6A8D, #EE3D68); }
.mode-card-story .mode-start { background: linear-gradient(180deg, #38A0EA, #1875C4); }

.quiz-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 18px;
  color: #1A1206;
  background: #FFF7DD;
  border: 2px solid var(--home-border);
  border-radius: 18px;
  font-size: 20px;
  font-weight: 950;
  text-align: left;
}

.quiz-shortcut span {
  color: #8B5600;
  font-size: 14px;
  font-weight: 850;
}

.community-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.group-card,
.friend-card {
  padding: 24px;
}

.group-card {
  position: relative;
  overflow: hidden;
  padding-right: min(48%, 210px);
}

.group-card > *:not(.group-illustration) {
  position: relative;
  z-index: 1;
}

.group-illustration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: min(46%, 210px);
  max-height: 118px;
  object-fit: contain;
  pointer-events: none;
}

.group-name {
  margin: 12px 0 4px;
  color: #241606;
  font-size: 20px;
  font-weight: 900;
}

.group-rank {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
}

.group-rank strong {
  color: #1A1206;
  font-size: 48px;
  font-weight: 950;
  line-height: 1;
}

.group-rank span,
.group-score {
  color: #3E2A12;
  font-size: 18px;
  font-weight: 850;
}

.group-score {
  margin: 14px 0 0;
}

.group-score strong {
  font-size: 28px;
  color: #1A1206;
}

.group-progress-fill {
  width: 68%;
  background: linear-gradient(90deg, #FFD21A, #FFA800);
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.activity-feed li {
  padding: 8px 0;
  color: #2E2212;
  border-bottom: 1px solid #F0DFC0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.activity-feed li:last-child {
  border-bottom: 0;
}

.home-dashboard .journey-card,
.home-dashboard .pilot-card {
  padding: 22px;
}

.home-dashboard .tree-container {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  text-align: left;
  padding: 20px 22px;
}

.home-dashboard #treeImage {
  width: 112px;
  height: 112px;
}

.home-dashboard .tree-container svg {
  width: 86px;
  height: 86px;
}

.bottom-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  min-height: 86px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  color: #FFFFFF;
  background: linear-gradient(180deg, #4A2A0A, #2A1805);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -8px 24px rgba(31, 19, 5, 0.24);
  transform: translateX(-50%);
}

.tab-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 58px;
  color: #FFFFFF;
  background: transparent;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 950;
}

.tab-item.is-active,
.tab-game {
  color: #2A1805;
  background: var(--home-yellow);
}

@media (max-width: 760px) {
  body.home-dashboard {
    background: linear-gradient(180deg, #FFD400 0%, #FFD400 92px, #FFF8E8 93px, #FFF8E8 100%);
  }

  .home-topbar {
    min-height: 82px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border-width: 3px;
  }

  .brand-title {
    font-size: 24px;
  }

  .brand-subtitle {
    display: none;
  }

  .top-actions {
    gap: 8px;
  }

  .round-icon-button {
    width: 46px;
    height: 46px;
  }

  .notification-count {
    min-width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .home-main {
    gap: 10px;
    padding: 0 14px calc(98px + env(safe-area-inset-bottom));
  }

  .welcome-card {
    grid-template-columns: 1fr auto;
    min-height: 132px;
    padding: 14px 16px;
    gap: 10px;
  }

  .welcome-card .name-form {
    margin-top: 8px;
  }

  .senior-portrait {
    width: 86px;
    height: 104px;
  }

  .home-hero-grid,
  .community-grid,
  .daily-course-card {
    grid-template-columns: 1fr;
  }

  .score-card {
    grid-column: auto;
  }

  .home-dashboard .daily-reading-card {
    min-height: 212px;
    padding: 18px;
  }

  .home-dashboard .daily-reading-card h2,
  .home-dashboard .daily-passage,
  .home-dashboard .daily-summary,
  .home-dashboard .tag-row {
    max-width: calc(100% - 94px);
  }

  .home-dashboard .daily-reading-card h2 {
    font-size: 27px;
    line-height: 1.16;
    margin-bottom: 10px;
  }

  .home-dashboard .daily-passage {
    font-size: 18px;
    line-height: 1.35;
    margin-bottom: 0;
  }

  .home-dashboard .daily-summary,
  .home-dashboard .tag-row {
    display: none;
  }

  .daily-illustration {
    right: 12px;
    bottom: 42px;
    width: 84px;
    max-height: 128px;
  }

  .game-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .home-dashboard .mode-picker {
    padding: 16px;
  }

  .home-dashboard .mode-card {
    min-height: 162px;
    padding: 9px;
    border-radius: 16px;
  }

  .home-dashboard .mode-card .mode-icon {
    height: 58px;
  }

  .home-dashboard .mode-card .mode-title {
    min-height: 42px;
    font-size: 16px;
  }

  .home-dashboard .mode-card .mode-desc,
  .home-dashboard .mode-card .mode-last {
    display: none;
  }

  .mode-start {
    min-height: 38px;
    border-radius: 14px;
    font-size: 16px;
  }

  .bottom-tabbar {
    min-height: 78px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 22px 22px 0 0;
  }

  .tab-item {
    min-height: 54px;
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .brand-title {
    font-size: 21px;
  }

  .home-dashboard .mode-card {
    min-height: 154px;
  }

  .home-dashboard .mode-card .mode-title {
    font-size: 15px;
  }
}

/* ==========================================================================
   v2 — Yellow / Cream / Brown senior dashboard with 5 mode accents.
   These rules override legacy v1 tokens where applicable.
   ========================================================================== */

:root {
  /* Brand */
  --y-primary: #FFD400;
  --y-deep: #FFC400;
  --y-soft: #FFEB80;
  --cream: #FFF9EA;
  --card: #FFFFFF;
  --border-soft: #E8D7AF;
  --border-strong: #D5BE8A;
  --brown-deep: #3B240A;
  --brown-soft: #4A2C0A;
  --brown-mid: #6B4A1F;
  --ink: #1A1A1A;
  --ink-soft: #4A3A1E;

  /* Mode accents */
  --accent-speed: #5BAE35;
  --accent-puzzle: #F84E78;
  --accent-story: #1E86D9;
  --accent-memory: #7B5BE8;
  --accent-imprint: #E89B2D;

  --accent-speed-soft: #E6F5DD;
  --accent-puzzle-soft: #FDE2EA;
  --accent-story-soft: #DCEDFB;
  --accent-memory-soft: #ECE3FB;
  --accent-imprint-soft: #FCE8CB;

  --success: #5DBB3C;
  --badge-red: #FF3B30;
  --warn-orange: #FF9F43;

  --shadow-soft: 0 6px 18px rgba(75, 50, 12, 0.10);
  --shadow-card: 0 4px 12px rgba(75, 50, 12, 0.08);
}

/* Re-map legacy tokens to v2 palette so old screens get the new look. */
:root {
  --color-bg: var(--cream);
  --color-surface: var(--card);
  --color-surface-soft: var(--cream);
  --color-text: var(--ink);
  --color-primary: var(--y-deep);
  --color-primary-dark: var(--brown-deep);
  --color-accent: var(--y-primary);
  --color-accent-dark: var(--brown-deep);
  --color-accent-soft: var(--y-soft);
  --color-highlight: var(--y-soft);
  --color-highlight-border: var(--y-deep);
  --color-border: var(--border-soft);
  --color-border-strong: var(--border-strong);
}

/* ---- v2 home shell ---- */
body.home-v2,
body.bible-v2,
body.mode-v2,
body.stats-v2,
body.community-v2 {
  background: var(--cream);
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.v2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 18px 14px;
  background: var(--y-primary);
  border-radius: 0 0 28px 28px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.v2-topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.v2-topbar .brand img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--card);
  padding: 6px;
  object-fit: contain;
}

.v2-topbar .brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: var(--brown-deep);
  letter-spacing: -0.5px;
}

.v2-topbar .brand p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--brown-mid);
  font-weight: 600;
}

.v2-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--brown-deep);
  position: relative;
  border: 2px solid var(--border-soft);
}

.v2-icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 6px;
  background: var(--badge-red);
  color: white;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- v2 main + cards ---- */
.v2-main {
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v2-card {
  background: var(--card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}

.v2-greeting {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  background: linear-gradient(180deg, #FFFEF8 0%, var(--card) 100%);
}

.v2-greeting .greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v2-greeting h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--brown-deep);
  line-height: 1.4;
}

.v2-greeting .portrait {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  object-fit: cover;
  background: var(--y-soft);
  flex-shrink: 0;
}

.v2-streak-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.v2-pill {
  background: var(--cream);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-pill .pill-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--y-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.v2-pill .pill-text strong {
  display: block;
  font-size: 13px;
  color: var(--brown-mid);
  font-weight: 700;
}

.v2-pill .pill-text span {
  display: block;
  font-size: 18px;
  color: var(--brown-deep);
  font-weight: 800;
}

/* ---- mission card ---- */
.v2-mission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.v2-mission-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--brown-deep);
}

.v2-mission-head .mission-progress {
  background: var(--y-soft);
  color: var(--brown-deep);
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
}

.v2-mission-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v2-mission-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
}

.v2-mission-row .check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: transparent;
}

.v2-mission-row.is-complete .check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.v2-mission-row.is-complete .check::before {
  content: "\2713";
}

.v2-mission-row .label {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--brown-deep);
}

.v2-mission-row .status {
  font-size: 14px;
  font-weight: 800;
  color: var(--brown-mid);
}

.v2-mission-row.is-complete .status {
  color: var(--success);
}

/* ---- score + group strip ---- */
.v2-score-strip {
  background: linear-gradient(135deg, var(--brown-deep) 0%, var(--brown-soft) 100%);
  color: white;
  border-radius: 22px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v2-score-strip .score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v2-score-strip .score-label {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.85;
}

.v2-score-strip .score-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--y-primary);
}

.v2-score-strip .group-rank {
  font-size: 14px;
  opacity: 0.85;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
}

/* ---- 5-mode grid ---- */
.v2-modes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.v2-modes-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--brown-deep);
}

.v2-modes-head .more-link {
  background: none;
  border: none;
  color: var(--brown-mid);
  font-weight: 700;
  font-size: 14px;
}

.v2-modes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.v2-mode-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 130px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--border-soft);
  overflow: hidden;
  position: relative;
  text-align: left;
  font-family: inherit;
}

.v2-mode-card[data-mode="speed"] { border-color: var(--accent-speed); background: var(--accent-speed-soft); }
.v2-mode-card[data-mode="puzzle"] { border-color: var(--accent-puzzle); background: var(--accent-puzzle-soft); }
.v2-mode-card[data-mode="story"] { border-color: var(--accent-story); background: var(--accent-story-soft); }
.v2-mode-card[data-mode="memory"] { border-color: var(--accent-memory); background: var(--accent-memory-soft); }
.v2-mode-card[data-mode="imprint"] { border-color: var(--accent-imprint); background: var(--accent-imprint-soft); }

.v2-mode-card .new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--badge-red);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.v2-mode-card .mode-illust {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.v2-mode-card .mode-illust img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.v2-mode-card .mode-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-mode-card .mode-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--brown-deep);
  line-height: 1.25;
}

.v2-mode-card .mode-meta {
  font-size: 11px;
  color: var(--brown-mid);
  font-weight: 600;
}

.v2-mode-card .mode-cta {
  margin-top: 6px;
  display: inline-block;
  background: var(--y-primary);
  color: var(--brown-deep);
  font-weight: 800;
  font-size: 13px;
  border-radius: 12px;
  padding: 6px 0;
  text-align: center;
}

.v2-mode-card[data-mode="speed"] .mode-cta { background: var(--accent-speed); color: white; }
.v2-mode-card[data-mode="puzzle"] .mode-cta { background: var(--accent-puzzle); color: white; }
.v2-mode-card[data-mode="story"] .mode-cta { background: var(--accent-story); color: white; }
.v2-mode-card[data-mode="memory"] .mode-cta { background: var(--accent-memory); color: white; }
.v2-mode-card[data-mode="imprint"] .mode-cta { background: var(--accent-imprint); color: white; }

/* ---- weekly summary, memorization, encouragement ---- */
.v2-summary-card h3,
.v2-bible-card h3,
.v2-memorize-card h3,
.v2-cheer-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
  color: var(--brown-deep);
}

.v2-summary-graph {
  height: 72px;
  width: 100%;
  background: var(--cream);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.v2-summary-graph svg {
  width: 100%;
  height: 100%;
}

.v2-summary-graph .avg-pill {
  position: absolute;
  right: 10px;
  top: 8px;
  background: white;
  color: var(--brown-deep);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

.v2-bible-card .last-passage {
  font-size: 16px;
  color: var(--brown-deep);
  font-weight: 700;
  margin: 4px 0 12px;
}

.v2-bible-card .last-text {
  font-size: 14px;
  color: var(--brown-mid);
  margin: 0 0 14px;
  line-height: 1.5;
}

.v2-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--y-primary);
  color: var(--brown-deep);
  font-size: 16px;
  font-weight: 800;
  border-radius: 16px;
  padding: 12px 16px;
  min-height: 56px;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.v2-cta.is-secondary {
  background: var(--cream);
  color: var(--brown-deep);
  border: 2px solid var(--border-strong);
}

.v2-cta.is-complete {
  background: var(--success);
  color: white;
}

.v2-memorize-card .memo-progress {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 8px;
}

.v2-memorize-card .memo-count {
  font-size: 26px;
  font-weight: 900;
  color: var(--brown-deep);
}

.v2-memorize-card .memo-total {
  font-size: 16px;
  color: var(--brown-mid);
  font-weight: 700;
}

.v2-progress-bar {
  height: 10px;
  background: var(--cream);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.v2-progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--y-deep) 0%, var(--y-primary) 100%);
  border-radius: 999px;
  transition: width 400ms ease;
}

.v2-cheer-card {
  background: linear-gradient(135deg, var(--accent-imprint-soft) 0%, var(--y-soft) 100%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.v2-cheer-card .cheer-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.v2-cheer-card .cheer-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--brown-deep);
  line-height: 1.5;
}

.v2-cheer-card .cheer-text small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brown-mid);
  margin-top: 4px;
}

/* ---- bottom 5-tab nav ---- */
.v2-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--brown-deep);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  z-index: 60;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.15);
}

.v2-tabbar .tab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
}

.v2-tabbar .tab .tab-icon {
  font-size: 22px;
  line-height: 1;
}

.v2-tabbar .tab.is-active {
  color: var(--y-primary);
}

.v2-tabbar .tab.is-active.is-elevated {
  position: relative;
}

.v2-tabbar .tab.is-active.is-elevated::before {
  content: "";
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--y-primary);
  z-index: -1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.v2-tabbar .tab.is-active.is-elevated .tab-icon,
.v2-tabbar .tab.is-active.is-elevated .tab-label {
  color: var(--brown-deep);
  position: relative;
  z-index: 1;
}

.v2-tabbar .tab.is-active.is-elevated .tab-icon {
  margin-top: -16px;
}

/* ---- bible reading screen ---- */
.bible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-soft);
}

.bible-header .back {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border-soft);
  font-size: 22px;
  color: var(--brown-deep);
  font-weight: 800;
}

.bible-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--brown-deep);
}

.bible-header .actions {
  display: flex;
  gap: 8px;
}

.bible-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--cream);
  padding: 0 16px;
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
}

.bible-tabs button {
  flex: 1;
  background: none;
  border: none;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brown-mid);
  border-bottom: 3px solid transparent;
  font-family: inherit;
}

.bible-tabs button.is-active {
  color: var(--brown-deep);
  border-bottom-color: var(--y-primary);
}

.bible-selectors {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
}

.bible-selectors select {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--brown-deep);
  font-family: inherit;
  background-image: linear-gradient(45deg, transparent 50%, var(--brown-mid) 50%),
    linear-gradient(135deg, var(--brown-mid) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.bible-content {
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bible-verse {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background 200ms ease;
  border: 2px solid transparent;
  text-align: left;
  font-family: inherit;
  width: 100%;
  align-items: flex-start;
}

.bible-verse:hover,
.bible-verse:focus-visible {
  background: var(--cream);
}

.bible-verse.is-current {
  background: var(--y-soft);
  border-color: var(--y-deep);
  box-shadow: 0 4px 0 var(--y-deep);
}

.bible-verse.is-memorize {
  background: var(--accent-imprint-soft);
  border-color: var(--accent-imprint);
}

.bible-verse .verse-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--y-deep);
  width: 26px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.bible-verse.is-current .verse-num {
  color: var(--brown-deep);
}

.bible-verse .verse-text {
  font-size: 19px;
  line-height: 1.7;
  color: var(--brown-deep);
  flex: 1;
  font-weight: 600;
}

.bible-footer {
  position: sticky;
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 12px 16px;
  background: var(--cream);
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 30;
}

.bible-footer .nav-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}

.bible-footer .nav-row button {
  min-height: 56px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  border: none;
  font-family: inherit;
}

.bible-footer .nav-prev,
.bible-footer .nav-next {
  background: var(--card);
  color: var(--brown-deep);
  border: 1px solid var(--border-soft);
}

.bible-footer .nav-listen {
  background: var(--y-primary);
  color: var(--brown-deep);
}

.bible-footer .nav-listen.is-playing {
  background: var(--y-deep);
  animation: pulse-listen 1s ease-in-out infinite;
}

@keyframes pulse-listen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.bible-footer .progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--brown-mid);
}

.bible-footer .progress-row .progress-bar {
  flex: 1;
}

.bible-action-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 90;
}

.bible-action-sheet[open] {
  display: flex;
}

.bible-action-sheet .sheet-body {
  width: 100%;
  max-width: var(--app-width);
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bible-action-sheet .sheet-body .sheet-quote {
  font-size: 16px;
  color: var(--brown-mid);
  font-weight: 700;
  margin: 0 0 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.bible-action-sheet .sheet-body button {
  min-height: 56px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  background: var(--cream);
  color: var(--brown-deep);
  border: 1px solid var(--border-soft);
  text-align: left;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bible-action-sheet .sheet-body button.is-primary {
  background: var(--accent-imprint);
  color: white;
  border-color: var(--accent-imprint);
}

/* ---- imprint mode ---- */
.imprint-shell {
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.imprint-stepper {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--brown-mid);
  padding: 12px 14px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
}

.imprint-stepper .step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
}

.imprint-stepper .step.is-active {
  background: var(--accent-imprint-soft);
  color: var(--accent-imprint);
}

.imprint-stepper .step.is-done {
  color: var(--success);
}

.imprint-stepper .arrow {
  color: var(--border-strong);
}

.imprint-verse-card {
  background: var(--card);
  border-radius: 22px;
  padding: 22px 18px;
  border: 1px solid var(--border-soft);
  font-size: 22px;
  line-height: 1.7;
  color: var(--brown-deep);
  font-weight: 700;
  min-height: 160px;
}

.imprint-verse-card .blank {
  display: inline-block;
  background: var(--accent-imprint-soft);
  color: var(--accent-imprint);
  border: 2px dashed var(--accent-imprint);
  border-radius: 8px;
  padding: 0 6px;
  margin: 0 1px;
  font-weight: 800;
  min-width: 36px;
  text-align: center;
}

.imprint-verse-card .blank.is-active {
  background: var(--y-soft);
  border-color: var(--y-deep);
  color: var(--brown-deep);
  animation: blank-pulse 1.2s ease-in-out infinite;
}

.imprint-verse-card .blank.is-filled {
  background: var(--accent-speed-soft);
  border-color: var(--accent-speed);
  color: var(--brown-deep);
}

.imprint-verse-card .blank.is-hint {
  animation: hint-flash 1.4s ease-in-out 3;
}

@keyframes blank-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes hint-flash {
  0%, 100% { background: var(--accent-imprint-soft); }
  50% { background: var(--y-primary); }
}

.imprint-input-display {
  background: var(--cream);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 60px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--brown-deep);
  text-align: center;
}

.imprint-keypad {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.imprint-key {
  min-height: 56px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--border-soft);
  font-size: 22px;
  font-weight: 800;
  color: var(--brown-deep);
  font-family: inherit;
  cursor: pointer;
}

.imprint-key:active,
.imprint-key.is-pressed {
  background: var(--y-soft);
  border-color: var(--y-deep);
  transform: translateY(1px);
}

.imprint-key.is-action {
  background: var(--cream);
  font-size: 16px;
}

.imprint-key.is-delete {
  grid-column: span 2;
  background: var(--accent-puzzle-soft);
  color: var(--accent-puzzle);
}

.imprint-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
}

.imprint-actions button {
  min-height: 56px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  border: none;
}

.imprint-actions .btn-listen {
  background: var(--cream);
  color: var(--brown-deep);
  border: 2px solid var(--border-soft);
}

.imprint-actions .btn-confirm {
  background: var(--accent-imprint);
  color: white;
}

.imprint-meta {
  font-size: 14px;
  color: var(--brown-mid);
  font-weight: 700;
  text-align: center;
}

/* ---- memory mode ---- */
.memory-shell {
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.memory-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.memory-stats-row .stat {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  text-align: center;
}

.memory-stats-row .stat strong {
  display: block;
  font-size: 13px;
  color: var(--brown-mid);
  font-weight: 700;
  margin-bottom: 4px;
}

.memory-stats-row .stat span {
  font-size: 22px;
  font-weight: 900;
  color: var(--brown-deep);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.memory-cell {
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 2px solid var(--border-soft);
  border-radius: 16px;
  font-size: 28px;
  font-weight: 800;
  color: var(--brown-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  text-align: center;
  padding: 6px;
}

.memory-cell.is-revealed {
  background: var(--accent-memory-soft);
  border-color: var(--accent-memory);
}

.memory-cell.is-matched {
  background: var(--accent-speed-soft);
  border-color: var(--accent-speed);
  pointer-events: none;
}

.memory-cell.is-hidden::before {
  content: "?";
  font-size: 32px;
  color: var(--border-strong);
}

.memory-cell.is-hidden .face {
  display: none;
}

.memory-cell .face {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memory-cell .face.is-symbol {
  font-size: 32px;
}

/* ---- stats / mypage ---- */
.stats-tabs {
  display: flex;
  gap: 8px;
  background: var(--card);
  border-radius: 16px;
  padding: 6px;
  border: 1px solid var(--border-soft);
}

.stats-tabs button {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--brown-mid);
  border-radius: 12px;
  font-family: inherit;
}

.stats-tabs button.is-active {
  background: var(--y-soft);
  color: var(--brown-deep);
}

.stats-summary {
  background: var(--cream);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
}

.stats-summary .period-label {
  font-size: 13px;
  color: var(--brown-mid);
  font-weight: 700;
  margin-bottom: 8px;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats-summary-grid .item {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.stats-summary-grid .item .item-label {
  font-size: 11px;
  color: var(--brown-mid);
  font-weight: 700;
}

.stats-summary-grid .item .item-value {
  display: block;
  font-size: 16px;
  color: var(--brown-deep);
  font-weight: 900;
  margin-top: 4px;
}

.cognition-card h3 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  color: var(--brown-deep);
}

.cognition-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cognition-row:last-child {
  margin-bottom: 0;
}

.cognition-row .name {
  flex: 0 0 90px;
  font-size: 14px;
  color: var(--brown-deep);
  font-weight: 700;
}

.cognition-row .bar {
  flex: 1;
  height: 14px;
  background: var(--cream);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.cognition-row .bar .fill {
  height: 100%;
  border-radius: 999px;
  transition: width 600ms ease;
}

.cognition-row[data-domain="speed"] .bar .fill { background: var(--accent-speed); }
.cognition-row[data-domain="memory"] .bar .fill { background: var(--accent-imprint); }
.cognition-row[data-domain="attention"] .bar .fill { background: var(--accent-puzzle); }
.cognition-row[data-domain="logic"] .bar .fill { background: var(--accent-story); }

.cognition-row .value {
  flex: 0 0 70px;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: var(--brown-deep);
}

.cognition-row .value small {
  display: block;
  font-size: 11px;
  color: var(--success);
  font-weight: 700;
}

/* ---- community ---- */
.community-shell {
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.community-tabs {
  display: flex;
  gap: 8px;
  background: var(--card);
  border-radius: 16px;
  padding: 6px;
  border: 1px solid var(--border-soft);
}

.community-tabs button {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--brown-mid);
  border-radius: 12px;
  font-family: inherit;
}

.community-tabs button.is-active {
  background: var(--y-soft);
  color: var(--brown-deep);
}

.community-mission {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border-soft);
}

.community-mission h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--brown-deep);
  font-weight: 800;
}

.community-mission .mission-progress-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--y-deep);
  margin: 8px 0 8px;
}

.community-rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
}

.community-rank-row .rank-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--brown-deep);
  width: 24px;
}

.community-rank-row.is-mine {
  background: var(--accent-imprint-soft);
  border-color: var(--accent-imprint);
}

.community-rank-row .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--y-soft);
  flex-shrink: 0;
}

.community-rank-row .who {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--brown-deep);
}

.community-rank-row .pts {
  font-size: 15px;
  font-weight: 800;
  color: var(--brown-deep);
}

/* ---- responsive tweaks ---- */
@media (max-width: 380px) {
  .v2-modes-grid {
    grid-template-columns: repeat(5, 130px);
  }
}

@media (max-width: 350px) {
  .imprint-keypad {
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }
  .imprint-key {
    min-height: 50px;
    font-size: 19px;
  }
}

/* ============================================================ */
/* Image icons (replacing inline emoji)                          */
/* ============================================================ */

.icon-img {
  display: inline-block;
  object-fit: contain;
  flex-shrink: 0;
}

/* Bottom 5-tab navigation icons */
.v2-tabbar .tab .tab-icon img,
.v2-tabbar .tab .tab-icon.icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.v2-tabbar .tab.is-active.is-elevated .tab-icon img {
  width: 36px;
  height: 36px;
}

/* Pills on greeting card (streak, read, garden) */
.v2-pill .pill-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* Top-bar brand logo */
.v2-topbar .brand img {
  object-fit: contain;
}

/* Greeting portrait image */
.v2-greeting .portrait {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Mission row check (when image used) */
.v2-mission-row .check:has(img) {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
}

.v2-mission-row .check:has(img)::before {
  content: none;
}

.v2-mission-row .check img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.v2-mission-row.is-complete .check img.icon-todo {
  display: none;
}

.v2-mission-row .check img.icon-done {
  display: none;
}

.v2-mission-row.is-complete .check img.icon-done {
  display: inline-block;
}

/* Mode card illustrations */
.v2-mode-card .mode-illust img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Cheer icon */
.v2-cheer-card .cheer-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Top-bar icon button (settings, alarm) */
.v2-icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Stats / community / bible header right-side decorative icon */
.bible-header .actions img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* Section banner illustration (e.g. growth graph in stats summary) */
.v2-card .section-banner {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
