/* =====================================================================
   女子磨きアプリ MIGAKI：A案（白 × シャンパンゴールド）
   今日の画面（デザイン見本）用スタイル
   ===================================================================== */
:root {
  --bg: #FAF7F2;
  --bg-outer: #F1ECE4;
  --surface: #FFFFFF;
  --text: #2B2622;
  --sub: #8C8279;
  --gold: #C9A96E;
  --track: #ECE5DA;
  --line: #E6DED2;
  --radius: 8px;
  --font-en: "Cormorant Garamond", "Times New Roman", serif;
  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ja);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  word-break: auto-phrase;
}
p, h1, h2 { margin: 0; }

/* ---------- アプリの枠：スマホは全幅、PC・タブレットは中央 480px ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
@media (min-width: 520px) {
  body { background: var(--bg-outer); }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- ヘッダー ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0;
}
.logo {
  font-family: var(--font-en);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: .32em;
  line-height: 1;
}
.nickname { font-size: .82rem; color: var(--sub); letter-spacing: .06em; }

.main { padding: 0 24px; }
.main > section { margin-top: 36px; }

/* 小見出し（英字・ゴールド） */
.section-label {
  font-family: var(--font-en);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .24em;
  color: var(--gold);
}

/* ---------- 日付 ---------- */
.main > .date-block { margin-top: 44px; }
.date {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: 4.2rem;
  line-height: 1;
  letter-spacing: .02em;
}
.date-dow { font-size: 1.35rem; font-weight: 400; letter-spacing: .24em; color: var(--sub); }
.date-lead { margin-top: 14px; font-size: .85rem; color: var(--sub); letter-spacing: .12em; }

/* ---------- 磨きタイプ ---------- */
.main > .type-badge { margin-top: 28px; }
.type-badge {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.type-element {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 1.05rem;
  color: var(--text);
}
.type-text { display: flex; flex-direction: column; min-width: 0; }
.type-caption { font-size: .72rem; color: var(--sub); letter-spacing: .1em; }
.type-name { font-size: .92rem; font-weight: 500; }

/* ---------- 達成率 ---------- */
.rate-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.rate-value {
  font-family: var(--font-en);
  font-weight: 300;
  font-size: 3.6rem;
  line-height: 1;
  color: var(--gold);
}
.rate-unit { font-size: 1.5rem; margin-left: 4px; }
.rate-count { font-size: .82rem; color: var(--sub); }

.bar { height: 3px; margin-top: 14px; background: var(--track); border-radius: 2px; overflow: hidden; }
.bar-thin { height: 2px; }
.bar-fill { height: 100%; width: 0; background: var(--gold); border-radius: inherit; }
/* 初回表示はアニメーションなし。タップで変わるときだけ動かす */
.is-ready .bar-fill { transition: width .5s ease; }

/* ---------- Saya からのメッセージ ---------- */
.message {
  padding: 22px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
}
.message-body { margin-top: 10px; font-size: .92rem; line-height: 1.95; white-space: pre-line; }
.message-sign {
  margin-top: 12px;
  text-align: right;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--sub);
}
.message-sign span { color: var(--text); }

/* ---------- 今日の ToDo（付箋） ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-title { font-size: 1rem; font-weight: 500; letter-spacing: .1em; }

.todo-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }

.note {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 18px 18px 20px;
  background: var(--note);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(43, 38, 34, .04);
  cursor: pointer;
  transition: opacity .25s;
  -webkit-tap-highlight-color: transparent;
}
/* 賢人Todo の付箋スタイルを引き継ぐ：上部のマスキングテープ（控えめに） */
.note::before {
  content: "";
  position: absolute; top: -7px; left: 50%;
  width: 64px; height: 14px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(201, 169, 110, .25);
}
.todo-list li:nth-child(even) .note::before { transform: translateX(-50%) rotate(2deg); }

.note input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.note-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.note-cat { display: flex; align-items: baseline; gap: 8px; font-size: .74rem; color: var(--sub); letter-spacing: .08em; }
.note-cat-en { font-family: var(--font-en); font-size: .82rem; font-weight: 500; letter-spacing: .2em; color: var(--text); }
.note-title { font-size: 1rem; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.note-reason { font-size: .8rem; color: var(--sub); line-height: 1.7; }

.note-check {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  margin-top: 18px;
  display: grid; place-items: center;
  border: 1px solid var(--sub);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  color: transparent;
  transition: background .2s, border-color .2s, color .2s;
}
.note-check svg { width: 18px; height: 18px; }
.note input:focus-visible ~ .note-check { outline: 1px solid var(--gold); outline-offset: 3px; }

.note.is-done .note-check { background: var(--gold); border-color: var(--gold); color: #fff; }
.note.is-done .note-title { color: var(--sub); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--gold); }
.note.is-done .note-reason { opacity: .7; }

/* ---------- 輝きポイント ---------- */
.main > .points { margin-top: 40px; margin-bottom: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.points-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.points-value { font-family: var(--font-en); font-weight: 400; font-size: 2.4rem; line-height: 1.1; }
.points-unit { font-size: 1.1rem; margin-left: 6px; color: var(--gold); }
.rank { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.rank-icon { width: 20px; height: 20px; color: var(--gold); }
.points-next { margin-top: 10px; font-size: .78rem; color: var(--sub); }
.points-left { font-family: var(--font-en); font-size: 1rem; color: var(--gold); }

/* ---------- 下部ナビ ---------- */
.bottom-nav {
  position: fixed; left: 50%; bottom: 0; z-index: 10;
  width: 100%; max-width: 480px;
  transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #FFFFFF;
  border-top: 1px solid var(--line);
}
@media (min-width: 520px) {
  .bottom-nav { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: .68rem; letter-spacing: .06em;
  color: var(--sub);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round;
}
.bottom-nav a[aria-current="page"] { color: var(--text); }
.bottom-nav a[aria-current="page"] svg { color: var(--gold); }
.bottom-nav a:focus-visible { outline: 1px solid var(--gold); outline-offset: -6px; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .note, .note-check { transition: none; }
}
