/* 토정비결 — 손그림 일러스트 에디토리얼 디자인 */
:root {
  --ink: #24160f;
  --ink-soft: #6a4a38;
  --paper: #f7ead2;
  --paper-deep: #e8d2ad;
  --cream: #fff9ef;
  --rose: #c97a62;
  --plum: #8f4e53;
  --indigo: #3d4a62;
  --leaf: #7a8662;
  --line: rgba(52, 34, 22, .26);
  --shadow: 0 24px 60px rgba(74, 42, 21, .20);
  --font-title: "Nanum Myeongjo", "Batang", serif;
  --font-body: "Gowun Batang", "Malgun Gothic", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #e6d4b4; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(201, 122, 98, .22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(61, 74, 98, .18), transparent),
    linear-gradient(180deg, #f3e4c8 0%, #ead4b0 55%, #f5e8d0 100%);
  overflow-x: hidden;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

button, input, select { font: inherit; }

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Header ── */
.app-header { padding: 32px 16px 12px; }

.header-inner {
  width: min(1040px, calc(100vw - 28px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  gap: 24px;
  align-items: center;
  position: relative;
  border: 2px solid var(--line);
  border-radius: 36px 28px 40px 24px;
  background: linear-gradient(145deg, rgba(255, 249, 239, .94), rgba(244, 224, 194, .88));
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(255, 249, 239, .5);
}

.header-inner::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(52, 34, 22, .12);
  border-radius: inherit;
  pointer-events: none;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--plum);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.header-title {
  font-family: var(--font-title);
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 800;
  line-height: .95;
  color: #2a1810;
  letter-spacing: -.04em;
}

.header-sub {
  margin-top: 16px;
  max-width: 380px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-art,
.hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  object-fit: cover;
  aspect-ratio: 520 / 340;
  filter: drop-shadow(0 16px 28px rgba(74, 42, 21, .16));
}

/* ── 먹선 프레임 ── */
.ink-card {
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 249, 239, .6);
}

.ink-card-sm {
  box-shadow: 0 10px 24px rgba(80, 48, 27, .1);
}

.ink-panel {
  position: relative;
  padding: 18px 20px;
  background: rgba(255, 252, 245, .72);
  border-radius: 18px 12px 22px 14px;
}

.ink-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 2px solid rgba(58, 36, 24, .28);
  transform: rotate(-.25deg);
}

.ink-input {
  position: relative;
  display: block;
}

.ink-input::before {
  content: "";
  position: absolute;
  inset: -3px -2px;
  pointer-events: none;
  border-radius: 18px 12px 20px 14px;
  background: url("/assets/ink-border.svg") center / 100% 100% no-repeat;
  opacity: .9;
  transform: rotate(-.35deg);
}

.ink-input > input,
.ink-input > select {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--ink);
  border: none;
  border-radius: 14px 10px 16px 12px;
  background: rgba(255, 252, 245, .92);
  transition: box-shadow .2s;
}

.ink-input-sm { flex: 0 0 auto; width: 96px; }
.ink-input-sm > input { text-align: center; }

.ink-input > input:focus,
.ink-input > select:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(143, 78, 83, .35);
}

.ink-btn {
  position: relative;
  border: none !important;
  background: rgba(255, 252, 245, .88) !important;
  box-shadow: none;
}

.ink-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border-radius: inherit;
  background: url("/assets/ink-border.svg") center / 100% 100% no-repeat;
  opacity: .85;
}

.ink-btn.active {
  color: var(--cream) !important;
  background: linear-gradient(145deg, var(--plum), #b86a5e) !important;
}

.ink-btn-main {
  position: relative;
  overflow: visible;
}

.ink-btn-main::before {
  content: "";
  position: absolute;
  inset: -4px -3px;
  pointer-events: none;
  border-radius: 24px 14px 26px 16px;
  background: url("/assets/ink-border.svg") center / 100% 100% no-repeat;
  opacity: .5;
  filter: brightness(2);
}

.ink-btn-ghost {
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
  padding: 10px 16px;
  color: #5b3840;
  border: none;
  border-radius: 16px;
  background: rgba(255, 249, 239, .7);
  transition: transform .2s, background .2s;
}

.ink-btn-ghost::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border-radius: inherit;
  background: url("/assets/ink-border.svg") center / 100% 100% no-repeat;
  opacity: .7;
}

.ink-btn-ghost {
  position: relative;
}

.ink-btn-ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 249, 239, .95);
}

.ink-btn-ghost:disabled {
  opacity: .4;
  cursor: not-allowed;
}


/* ── Layout ── */
.container {
  width: min(780px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.step { display: none; }
.step.active {
  display: block;
  animation: rise .42s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.card,
.scroll-inner {
  position: relative;
  padding: clamp(24px, 4.5vw, 40px);
  border: 2px solid var(--line);
  border-radius: 28px 22px 32px 20px;
  background: linear-gradient(160deg, rgba(255, 249, 239, .96), rgba(248, 232, 206, .9));
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(52, 34, 22, .14);
  border-radius: inherit;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  position: relative;
  z-index: 1;
}

.card-header h2 {
  font-family: var(--font-title);
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 700;
  color: #2f1d14;
}

.step-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--cream);
  font-family: var(--font-title);
  font-weight: 800;
  border-radius: 50% 46% 52% 44%;
  background: linear-gradient(145deg, var(--plum), #b86a5e);
  box-shadow: 3px 5px 0 rgba(201, 122, 98, .2);
  transform: rotate(-5deg);
}

/* ── Form ── */
.field {
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
}

.field > label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.toggle-group,
.date-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toggle-btn {
  flex: 1 1 140px;
  min-height: 48px;
  padding: 11px 16px;
  cursor: pointer;
  color: var(--ink-soft);
  border-radius: 18px 12px 20px 14px;
  transition: all .2s;
}

.toggle-btn.active {
  transform: translateY(-1px);
}

.unit { color: var(--ink-soft); font-size: .88rem; }

.leap-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink-soft) !important;
  font-weight: 600 !important;
  cursor: pointer;
}

.leap-label.hidden { display: none !important; }

.field-optional {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: .85em;
}

.field-hint {
  margin: 10px 0 0;
  font-size: .78rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.birth-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(47, 42, 37, 0.14);
}

.birth-note.hidden { display: none; }

.saju-chart {
  margin: 0 0 20px;
  padding: 16px 14px;
}

.saju-chart.hidden { display: none; }

.saju-chart-title {
  margin: 0 0 4px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.saju-chart-sub {
  margin: 0 0 14px;
  font-size: .76rem;
  color: var(--ink-soft);
}

.saju-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.saju-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 280px;
  margin: 0 auto;
}

.saju-col-label {
  font-size: .72rem;
  color: var(--plum);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.saju-gan,
.saju-zhi {
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}

.saju-hangul {
  margin-top: 4px;
  font-size: .74rem;
  color: var(--ink-soft);
}

.saju-meta {
  margin-top: 10px;
  font-size: .74rem;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.5;
}

.saju-interpret {
  margin: 0 0 20px;
  padding: 18px 16px;
}

.saju-interpret.hidden { display: none; }

.saju-interpret-header {
  margin-bottom: 14px;
}

.saju-interpret-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--plum);
  border: 1px solid rgba(143, 78, 83, .25);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.saju-interpret-block + .saju-interpret-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(52, 34, 22, .12);
}

.saju-interpret-heading {
  margin: 0 0 8px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--indigo);
  letter-spacing: 0.04em;
}

.saju-interpret-text {
  margin: 0;
  font-size: .92rem;
  line-height: 1.85;
  color: var(--ink);
}

.saju-interpret-loading,
.saju-interpret-error {
  margin: 0;
  font-size: .86rem;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.6;
}

.gwe-breakdown {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: .8rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.gwe-breakdown.hidden { display: none; }

.gwe-breakdown-title {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.gwe-breakdown-list {
  margin: 0;
  padding: 0 0 0 18px;
}

.gwe-breakdown-list li { margin: 4px 0; }

.date-panel.hidden { display: none; }

.date-select-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ink-input-select > select {
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 2px),
    calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.ink-input > input[type="date"] {
  cursor: pointer;
  color-scheme: light;
}

.ink-input > input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
}

.calendar-toggle { margin-bottom: 12px; }

/* ── Buttons ── */
.btn-main,
.btn-reset {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  cursor: pointer;
  border: 0;
  font-family: var(--font-title);
  font-weight: 700;
  transition: transform .2s, box-shadow .2s;
}

.btn-main {
  margin-top: 8px;
  padding: 16px 20px;
  color: var(--cream);
  font-size: 1.05rem;
  letter-spacing: .06em;
  border-radius: 22px 14px 24px 16px;
  background: linear-gradient(145deg, #7a4249, #c97a62);
  box-shadow: 6px 8px 0 rgba(61, 74, 98, .12), 0 14px 24px rgba(100, 49, 47, .18);
}

.btn-main:hover { transform: translateY(-2px); }

.btn-reset {
  margin-top: 16px;
  padding: 14px;
  width: 100%;
}

/* ── Character cards ── */
.char-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.char-card {
  position: relative;
  padding: 20px 16px 18px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--line);
  border-radius: 24px 18px 28px 16px;
  background: rgba(255, 252, 245, .82);
  box-shadow: 0 12px 28px rgba(80, 48, 27, .08);
  transition: transform .22s, border-color .22s, box-shadow .22s;
}

.char-card:nth-child(odd) { transform: rotate(-.3deg); }
.char-card:nth-child(even) { transform: rotate(.35deg); }

.char-card:hover,
.char-card.selected {
  border-color: rgba(143, 78, 83, .55);
  box-shadow: 6px 8px 0 rgba(201, 122, 98, .12), 0 20px 36px rgba(80, 48, 27, .12);
  transform: translateY(-4px) rotate(-.5deg);
}

.char-portrait-wrap {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(74, 42, 21, .12);
}

.char-portrait-wrap picture,
.hero-art picture,
.speech-portrait picture,
.fortune-portrait picture {
  display: block;
  width: 100%;
  height: 100%;
}

.char-img,
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-art .char-img,
.hero-art .hero-img {
  height: auto;
  aspect-ratio: 520 / 340;
  border-radius: 18px;
}

.char-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.speech-portrait,
.fortune-portrait {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}

.speech-portrait .char-img,
.fortune-portrait .char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-name {
  margin-bottom: 6px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.02rem;
  color: #4b2b24;
}

.char-desc {
  color: var(--ink-soft);
  font-size: .84rem;
  line-height: 1.55;
}

/* ── Result preview (step 3) ── */
.result-preview {
  margin-bottom: 22px;
  padding: 18px 16px;
  text-align: center;
}

.preview-text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.8;
  color: var(--ink);
}

.preview-gwe {
  display: block;
  margin-top: 8px;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--plum);
}

/* ── Full result sections (step 4) ── */
.result-section {
  margin-bottom: 28px;
}

.result-section > h3 {
  margin: 0 0 14px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--indigo);
  letter-spacing: 0.02em;
}

.daily-date {
  margin: 0 0 12px;
  font-size: .82rem;
  color: var(--ink-soft);
}

.daily-pillar {
  margin: 0 0 14px;
  font-size: .88rem;
  color: var(--plum);
  font-weight: 700;
}

.daily-text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.85;
  color: var(--ink);
}

.lucky-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
  justify-content: center;
}

.lucky-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(52, 34, 22, .15);
  background: rgba(255, 255, 255, 0.5);
  font-size: .86rem;
  font-weight: 700;
  color: var(--ink);
}

.lucky-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(52, 34, 22, .2);
  flex-shrink: 0;
}

.lucky-numbers {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.gwe-summary-block {
  text-align: center;
  margin-bottom: 16px;
}

.gwe-summary-block .gwe-digits {
  margin: 8px 0;
}

/* ── Result ── */
.result-card { text-align: center; }

.char-speech {
  position: relative;
  z-index: 1;
  margin-bottom: 26px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--cream);
  border: 2px solid rgba(255, 249, 239, .25);
  border-radius: 26px 18px 30px 16px;
  background: linear-gradient(145deg, var(--indigo), #5a3d42);
  box-shadow: 6px 8px 0 rgba(61, 74, 98, .1);
}

.speech-portrait {
  width: 96px;
  height: 96px;
}

.speech-portrait .char-svg { filter: none; }

.speech-text {
  font-size: 1.02rem;
  line-height: 1.8;
  max-width: 520px;
}

.gwe-reveal {
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}

.gwe-label {
  color: var(--ink-soft);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.gwe-digits {
  margin: 12px 0;
  font-family: var(--font-title);
  font-size: clamp(3rem, 11vw, 5.5rem);
  font-weight: 800;
  color: var(--plum);
  letter-spacing: .1em;
  animation: fadeIn .5s ease;
}

.gwe-title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #2f1d14;
}

.gwe-sub {
  margin-top: 6px;
  color: var(--rose);
  font-weight: 700;
}

.gwe-desc {
  max-width: 580px;
  margin: 16px auto 0;
  text-align: left;
  line-height: 1.85;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scroll fortune sheet ── */
.scroll-sheet {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.scroll-rod {
  height: 18px;
  margin: 0 auto;
  max-width: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(180deg, #6a4a38, #3d2a1e 40%, #5c4030);
  box-shadow: 0 4px 12px rgba(42, 24, 16, .25);
}

.scroll-rod-top { margin-bottom: -4px; }
.scroll-rod-bottom { margin-top: -4px; }

.scroll-inner {
  border-radius: 4px 4px 8px 8px;
  border-left-width: 3px;
  border-right-width: 3px;
  background:
    linear-gradient(90deg, rgba(232, 210, 173, .5) 0%, transparent 4%, transparent 96%, rgba(232, 210, 173, .5) 100%),
    linear-gradient(180deg, #faf3e4, #f0e2c8);
}

.fortune-header {
  padding: 32px 24px 28px;
  text-align: center;
  border-bottom: 2px solid rgba(52, 34, 22, .12);
}

.fortune-header-label {
  color: var(--ink-soft);
  font-size: .82rem;
  letter-spacing: .16em;
  margin-bottom: 8px;
}

.fortune-header-gwe {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 3.8vw, 1.9rem);
  font-weight: 800;
  color: #2f1d14;
}

.fortune-header-info {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: .92rem;
}

.fortune-portrait {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(74, 42, 21, .15);
}

.fortune-body { padding: 28px 24px 32px; }

.yearly-section {
  margin-bottom: 28px;
}

.yearly-section h3,
.monthly-section h3 {
  margin-bottom: 14px;
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: #4b2b24;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(52, 34, 22, .12);
}

.yearly-text { line-height: 1.95; font-size: .98rem; }

.monthly-hint {
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: .88rem;
}

/* ── 월별 운세 달력 넘기기 ── */
.month-book {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.month-book-stage {
  perspective: 1200px;
  min-height: 220px;
}

.month-page {
  transform-style: preserve-3d;
  transition: transform .45s ease, opacity .35s ease;
}

.month-page.flip-in-next {
  animation: pageFlipNext .48s ease both;
}

.month-page.flip-in-prev {
  animation: pageFlipPrev .48s ease both;
}

@keyframes pageFlipNext {
  0%   { transform: rotateY(-18deg) translateX(12px); opacity: 0; }
  100% { transform: rotateY(0) translateX(0); opacity: 1; }
}

@keyframes pageFlipPrev {
  0%   { transform: rotateY(18deg) translateX(-12px); opacity: 0; }
  100% { transform: rotateY(0) translateX(0); opacity: 1; }
}

.month-page-inner {
  min-height: 200px;
  padding: 24px 22px;
}

.month-page-label {
  color: var(--ink-soft);
  font-size: .8rem;
  letter-spacing: .14em;
  margin-bottom: 6px;
}

.month-page-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--plum);
  margin-bottom: 14px;
}

.month-page-text {
  font-size: .95rem;
  line-height: 1.85;
  color: var(--ink);
}

.month-nav {
  white-space: nowrap;
  font-size: .82rem;
  padding: 10px 12px;
}

.month-counter {
  margin-top: 14px;
  text-align: center;
  font-family: var(--font-title);
  font-size: .9rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.month-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.month-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid rgba(58, 36, 24, .35);
  border-radius: 50%;
  background: rgba(255, 252, 245, .8);
  cursor: pointer;
  transition: transform .2s, background .2s;
}

.month-dot.active {
  background: var(--plum);
  border-color: var(--plum);
  transform: scale(1.2);
}

.month-dot:hover { transform: scale(1.15); }

/* ── Loading ── */
.loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 28, 20, .65);
  backdrop-filter: blur(4px);
}

.loading.hidden { display: none; }

.loading-box {
  min-width: 220px;
  padding: 28px 24px;
  text-align: center;
  border: 2px solid var(--line);
  border-radius: 24px 16px 28px 14px;
  background: rgba(255, 249, 239, .95);
  box-shadow: var(--shadow);
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border: 3px solid rgba(143, 78, 83, .2);
  border-top-color: var(--plum);
  border-radius: 48% 52% 50% 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-msg {
  color: var(--ink-soft);
  font-family: var(--font-title);
  font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 360px; margin: 0 auto; }
  .char-grid { grid-template-columns: 1fr; }
  .month-book {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .month-nav { width: 100%; }
}

@media (max-width: 480px) {
  .container,
  .header-inner { width: min(100% - 20px, 780px); }
  .card { padding: 20px 14px; }
  .ink-input-sm { width: 76px; }
  .date-select-row { grid-template-columns: 1fr; }
}
