/* Screen "book" structural styles. Only CSS variables from base.css are used
   (--bg, --bg-elev, --bg-sunken, --ink, --ink-soft, --line, --accent, ...),
   so the three themes apply. All selectors are flat .book-* classes layered on
   top of .panel/.card/.btn/.tag/.progress from base.css. */

.book { display: flex; flex-direction: column; gap: 0; }
.book .btn { min-height: 44px; }

/* ---------- header ---------- */
.book-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.book-head-text { flex: 1 1 320px; min-width: 0; }
.book-title { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 6px; }
.book-lead { margin: 0; color: var(--ink-soft); max-width: 60ch; }
.book-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.book-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-width: 108px; padding: 8px 12px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; line-height: 1.2;
}
.book-stat-icon { font-size: 1.3rem; line-height: 1; margin-bottom: 2px; }
.book-stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.book-stat-label { font-size: 0.74rem; color: var(--ink-soft); }

/* ---------- week event ---------- */
.book-week {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px; margin-bottom: 12px;
  border-radius: var(--radius-sm); background: var(--bg-sunken); border-left: 4px solid var(--warn);
}
.book-week-icon { font-size: 1.4rem; line-height: 1.2; }
.book-week .link { font: inherit; }

/* ---------- top actions ---------- */
.book-actions { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-bottom: var(--gap); }
.book-small { font-size: 0.9rem; }
.book-callout {
  padding: 10px 14px; margin: 0 0 var(--gap); border-radius: var(--radius-sm);
  background: var(--bg-sunken); border-left: 4px solid var(--accent); font-weight: 600;
}

/* ---------- pages (guild levels) ---------- */
.book-page { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.book-page.is-locked { opacity: 0.78; }
.book-page-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.book-page-titles { flex: 1 1 200px; min-width: 0; }
.book-page-title { margin: 0; font-size: 1.4rem; }
.book-page-sub { font-size: 0.9rem; }
.book-page-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.book-empty { padding: 6px 0 2px; margin: 0; }

/* ---------- spell cards ---------- */
.book-spells { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.book-spell { background: var(--bg); position: relative; transition: outline-color 0.3s; outline: 3px solid transparent; outline-offset: 2px; }
.book-spell.is-learned { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.book-spell.is-available { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.book-spell.is-week { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 65%, transparent), var(--shadow); }
.book-spell.is-highlight { outline-color: var(--accent); }
.book-spell-top { display: flex; gap: 10px; align-items: center; }
.book-spell-titles { min-width: 0; }
.book-spell-spell { font-size: 1.1rem; }
.book-spell-name { font-size: 0.85rem; }
.book-spell-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.book-spell-note { margin: 0; }
.book-spell-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.book-spell-actions .btn { flex: 1 1 140px; }

/* ---------- strength meter (spaced repetition) ---------- */
.book-strength { display: flex; flex-direction: column; gap: 4px; }
.book-strength-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; font-weight: 600; }
.book-strength.is-bright .progress-fill { background: var(--good); }
.book-strength.is-fading .book-strength-label { color: var(--bad); }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .book-stats { width: 100%; }
  .book-stat { flex: 1 1 30%; min-width: 0; padding: 8px 6px; }
  .book-spells { grid-template-columns: 1fr; }
  .book-actions .btn { flex: 1 1 100%; }
  .book-actions .book-small { width: 100%; }
}
