@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

:root {
  --bg-dark: #1b1e1a;
  --glass: rgba(28, 33, 27, 0.55);
  --glass-border: rgba(200, 210, 195, 0.14);
  --glass-hover: rgba(28, 33, 27, 0.78);
  --header-bg: rgba(18, 21, 17, 0.82);
  --gold: #b8a96a;
  --gold-light: #d9cfa0;
  --gold-dim: rgba(184, 169, 106, 0.28);
  --text-primary: #dfe2db;
  --text-secondary: #8f9b8a;
  --text-dim: #566052;
  --cream: #eae8e2;
  --shadow-strong: rgba(0, 0, 0, 0.75);
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Reading mode vars */
  --rm-font-size: 1rem;
  --rm-line-height: 1.95;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Cormorant Garamond', serif;
  background: var(--bg-dark);
  color: var(--text-primary);
}

/* ── Forest background ── */

.forest-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('https://images.unsplash.com/photo-1448375240586-882707db888b?w=1920&q=80&auto=format&fit=crop');
  background-size: cover;
  background-position: center top;
}

.forest-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(14,16,13,0.75) 0%,
    rgba(14,16,13,0.48) 40%,
    rgba(14,16,13,0.68) 100%);
}

.fog-layer {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 220px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.fog-1 { bottom:12%; background: radial-gradient(ellipse at center, rgba(195,210,190,0.10) 0%, transparent 70%); animation: fogDrift 20s ease-in-out infinite; }
.fog-2 { bottom:28%; background: radial-gradient(ellipse at center, rgba(180,200,175,0.06) 0%, transparent 70%); animation: fogDrift 28s ease-in-out infinite reverse; }
.fog-3 { bottom:42%; background: radial-gradient(ellipse at center, rgba(165,188,160,0.04) 0%, transparent 70%); animation: fogDrift 36s ease-in-out infinite; }

@keyframes fogDrift {
  0%,100% { transform: translateX(0) scaleY(1); opacity:1; }
  33%      { transform: translateX(3%) scaleY(1.08); opacity:.8; }
  66%      { transform: translateX(-2%) scaleY(.95); opacity:1; }
}

/* ── Screen system ── */

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
}
.screen.active { opacity:1; pointer-events:all; }
.screen.exit   { opacity:0; pointer-events:none; }

/* ── Welcome ── */

#screen-welcome { align-items:center; justify-content:center; }

.welcome-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.welcome-emblem {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 14px;
  opacity: 0;
  animation: fadeUp .8s .3s ease forwards;
}

.welcome-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem,6vw,5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--cream);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp .8s .5s ease forwards;
}
.welcome-title em { font-style:italic; color:var(--gold-light); display:block; }

.welcome-subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp .8s .7s ease forwards;
}

.btn-enter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 32px;
  background: var(--gold);
  color: #1a1c19;
  border: none;
  border-radius: 40px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .06em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp .8s .9s ease forwards;
  transition: all .3s ease;
}
.btn-enter::before { content:''; position:absolute; inset:0; background:rgba(255,255,255,.18); transform:translateX(-100%); transition:transform .3s ease; }
.btn-enter:hover::before { transform:translateX(0); }
.btn-enter:hover { transform:translateY(-2px); box-shadow:0 12px 32px rgba(184,169,106,.35); }

.welcome-hint {
  font-size: .75rem;
  color: var(--text-dim);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 12px;
  opacity: 0;
  animation: fadeUp .8s 1.1s ease forwards;
}

/* ── Daily poem screen ── */

#screen-daily { flex-direction: column; }

.daily-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 20px 32px;
}

.daily-card {
  width: 100%;
  max-width: 560px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 32px 36px;
  box-shadow: 0 20px 60px var(--shadow-strong);
  animation: fadeUp .6s ease forwards;
}

.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.daily-date-label {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.daily-streak {
  font-size: .82rem;
  color: var(--gold);
  font-style: italic;
}

.daily-mood-tag {
  display: inline-block;
  background: rgba(184,169,106,.1);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .72rem;
  color: var(--gold);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.daily-poem-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 8px;
  line-height: 1.3;
}

.daily-poet-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.daily-poem-year { color: var(--text-dim); }

.daily-poem-text {
  font-size: 1.05rem;
  line-height: 2;
  font-style: italic;
  font-weight: 300;
  color: var(--cream);
  white-space: pre-line;
  border-left: 2px solid var(--gold-dim);
  padding-left: 18px;
  margin-bottom: 20px;
}

.daily-poem-note {
  font-size: .84rem;
  color: var(--text-secondary);
  line-height: 1.75;
  font-style: italic;
  margin-bottom: 24px;
  padding: 14px 16px;
  background: rgba(184,169,106,.05);
  border-radius: 8px;
}
.daily-poem-note::before { content:'✦  '; color: var(--gold); font-style: normal; }

.daily-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Choice ── */

#screen-choice { align-items:center; justify-content:center; }

.choice-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 640px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.choice-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem,4vw,2.6rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 10px;
  animation: fadeUp .6s ease;
}

.choice-subtitle {
  font-size: .95rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  animation: fadeUp .8s ease;
}

.choice-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
  width: 100%;
  animation: fadeUp 1s ease;
}

.choice-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 36px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition: all .35s ease;
}
.choice-card:hover { background:var(--glass-hover); border-color:var(--gold); transform:translateY(-6px); box-shadow:0 20px 50px rgba(0,0,0,.5); }
.choice-icon { font-size:3rem; transition:transform .3s ease; }
.choice-card:hover .choice-icon { transform:scale(1.1); }
.choice-card h3 { font-family:'Playfair Display',serif; font-size:1.2rem; color:var(--gold-light); }
.choice-card p  { font-size:.85rem; color:var(--text-secondary); line-height:1.5; }

.btn-back-simple {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 9px 22px;
  color: var(--text-secondary);
  font-family: 'Cormorant Garamond', serif;
  font-size: .95rem;
  cursor: pointer;
  transition: all .3s;
}
.btn-back-simple:hover { border-color:var(--gold); color:var(--gold); }

/* ── Header ── */

.main-header {
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}

.header-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--gold-light);
  letter-spacing: .03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--text-secondary);
  font-family: 'Cormorant Garamond', serif;
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-back:hover { border-color:var(--gold); color:var(--gold); }

.btn-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
}
.btn-header-icon:hover { border-color:var(--gold); color:var(--gold); }

/* Reading mode toggle active state */
body.reading-mode .btn-header-icon#btn-reading-mode {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

/* ── Test ── */

#screen-test { flex-direction:column; }

.test-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: 20px;
}

.test-progress-wrap { width:100%; max-width:600px; }

.progress-bar { width:100%; height:6px; background:rgba(200,210,195,.12); border-radius:10px; overflow:hidden; margin-bottom:10px; }
.progress-fill { height:100%; width:0%; background:linear-gradient(90deg,var(--gold),var(--gold-light)); border-radius:10px; transition:width .4s ease; }
.progress-text { text-align:center; font-size:.8rem; color:var(--text-secondary); letter-spacing:.1em; text-transform:uppercase; }

.test-question-card {
  width: 100%;
  max-width: 600px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px var(--shadow-strong);
}

.question-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem,2.5vw,1.25rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--cream);
  text-align: center;
  margin-bottom: 28px;
}

.answer-options { display:flex; flex-direction:column; gap:9px; }

.answer-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  background: rgba(28,33,27,.4);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all .25s ease;
}
.answer-btn:hover  { background:rgba(28,33,27,.7); border-color:var(--gold); transform:translateX(4px); }
.answer-btn.selected { background:var(--gold-dim); border-color:var(--gold); }
.answer-emoji { font-size:1.3rem; flex-shrink:0; }

/* ── Test results ── */

#screen-test-results { flex-direction:column; }

.test-results-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 20px 32px;
}

.test-results-card {
  width: 100%;
  max-width: 520px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 20px 60px var(--shadow-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.result-mood-display { width:100%; text-align:center; padding-bottom:22px; border-bottom:1px solid var(--glass-border); }
.result-emoji        { font-size:3.2rem; margin-bottom:10px; }
.result-mood-label   { font-family:'Playfair Display',serif; font-size:1.7rem; color:var(--gold-light); margin-bottom:6px; }
.result-mood-desc    { font-size:.88rem; color:var(--text-secondary); font-style:italic; }

.result-scores { width:100%; }
.result-scores h3 { font-family:'Playfair Display',serif; font-size:.8rem; color:var(--text-dim); letter-spacing:.14em; text-transform:uppercase; text-align:center; margin-bottom:12px; }

#scores-display { display:flex; flex-direction:column; gap:6px; }

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(28,33,27,.4);
  border-radius: 7px;
  font-size: .88rem;
  color: var(--text-secondary);
}
.score-item.top-score { background:rgba(184,169,106,.12); border:1px solid var(--gold-dim); color:var(--gold-light); }
.score-label  { display:flex; align-items:center; gap:8px; }
.score-value  { font-family:'Playfair Display',serif; font-size:.9rem; color:var(--gold); }

/* ── Main ── */

#screen-main { flex-direction:column; }

.main-layout {
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 2;
  display: flex;
  transition: all .4s ease;
}

.panel-moods {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: rgba(14,16,13,.50);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: width .4s ease, opacity .4s ease;
}

/* Reading mode — hide sidebar, enlarge text */
body.reading-mode .panel-moods {
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

body.reading-mode .poem-text-display {
  font-size: 1.22rem;
  line-height: 2.2;
}

body.reading-mode .poem-card-body {
  padding: 32px 36px;
}

body.reading-mode .poem-card-header {
  padding: 28px 36px 22px;
}

body.reading-mode .poem-title-display {
  font-size: 1.5rem;
}

body.reading-mode .poem-card-footer {
  padding: 20px 36px 28px;
}

.panel-moods-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.panel-moods-title { font-family:'Playfair Display',serif; font-size:1rem; color:var(--cream); margin-bottom:2px; }
.panel-moods-sub   { font-size:.72rem; color:var(--text-dim); }

.mood-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mood-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .25s ease;
}
.mood-item:hover        { background:var(--glass); border-color:var(--glass-border); }
.mood-item.active       { background:var(--glass); border-color:var(--gold-dim); }
.mood-item-emoji        { font-size:1.4rem; flex-shrink:0; }
.mood-item-text         { flex:1; min-width:0; }
.mood-item-name         { font-size:.88rem; color:var(--text-primary); line-height:1.2; }
.mood-item-progress     { display:flex; align-items:center; gap:6px; margin-top:4px; }
.mood-item-bar          { flex:1; height:2px; background:rgba(200,210,195,.12); border-radius:2px; overflow:hidden; }
.mood-item-fill         { height:100%; border-radius:2px; transition:width .5s ease; }
.mood-item-count        { font-size:.62rem; color:var(--text-dim); white-space:nowrap; }

/* ── Poem panel ── */

.panel-poem {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 28px 32px;
  gap: 16px;
}

.poem-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  opacity: .45;
}
.poem-empty-icon { font-size:3rem; }
.poem-empty-text { font-family:'Playfair Display',serif; font-size:1.1rem; font-style:italic; color:var(--text-secondary); }
.poem-empty-sub  { font-size:.82rem; color:var(--text-dim); }

.poem-reading-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 600px;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  flex-shrink: 0;
}
.poem-progress-bar   { flex:1; height:3px; background:rgba(200,210,195,.12); border-radius:2px; overflow:hidden; }
.poem-progress-fill  { height:100%; background:linear-gradient(90deg,var(--gold),var(--gold-light)); border-radius:2px; transition:width .5s ease; }
.poem-progress-label { font-size:.7rem; color:var(--text-dim); letter-spacing:.07em; white-space:nowrap; }

.poem-mood-tag {
  align-self: flex-start;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: .75rem;
  color: var(--gold);
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ── Poem card ── */

.poem-card {
  width: 100%;
  max-width: 600px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 60px var(--shadow-strong);
}

/* ── Enhanced poem card animations ── */

@keyframes slideInFromRight {
  from { transform: translateX(60px) scale(.97); opacity:0; }
  to   { transform: translateX(0) scale(1); opacity:1; }
}
@keyframes slideInFromLeft {
  from { transform: translateX(-60px) scale(.97); opacity:0; }
  to   { transform: translateX(0) scale(1); opacity:1; }
}
@keyframes slideOutToLeft {
  from { transform: translateX(0) scale(1); opacity:1; }
  to   { transform: translateX(-60px) scale(.97); opacity:0; }
}
@keyframes slideOutToRight {
  from { transform: translateX(0) scale(1); opacity:1; }
  to   { transform: translateX(60px) scale(.97); opacity:0; }
}

.poem-card.slide-in-right  { animation: slideInFromRight  .36s cubic-bezier(.25,.46,.45,.94) forwards; }
.poem-card.slide-in-left   { animation: slideInFromLeft   .36s cubic-bezier(.25,.46,.45,.94) forwards; }
.poem-card.slide-out-left  { animation: slideOutToLeft    .26s cubic-bezier(.4,0,1,1) forwards; }
.poem-card.slide-out-right { animation: slideOutToRight   .26s cubic-bezier(.4,0,1,1) forwards; }

/* ── Poem card internals ── */

.poem-card-header {
  position: relative;
  overflow: hidden;
  padding: 24px 28px 20px;
  background: rgba(14,16,13,.55);
  border-bottom: 1px solid var(--glass-border);
}

.quote-mark {
  position: absolute;
  right: 16px;
  top: -10px;
  font-family: 'Playfair Display', serif;
  font-size: 7rem;
  color: rgba(184,169,106,.08);
  line-height: 1;
  pointer-events: none;
}

.poem-title-display {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 400;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 8px;
  transition: font-size .3s ease;
}

.poet-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:3px; }
.poet-display { font-size:.76rem; letter-spacing:.18em; text-transform:uppercase; color:var(--text-secondary); }

.btn-author-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: .68rem;
  color: var(--text-dim);
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .2s;
}
.btn-author-inline:hover { border-color:var(--gold); color:var(--gold); }
.poem-year { font-size:.68rem; color:var(--text-dim); }

.poem-card-body { padding: 24px 28px; }

.poem-text-display {
  font-size: var(--rm-font-size, 1rem);
  line-height: var(--rm-line-height, 1.95);
  font-style: italic;
  font-weight: 300;
  color: var(--cream);
  white-space: pre-line;
  border-left: 2px solid var(--gold-dim);
  padding-left: 16px;
  transition: font-size .3s ease, line-height .3s ease;
}

.poem-card-footer {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--glass-border);
}

.poem-note-display {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.75;
  font-style: italic;
}
.poem-note-display::before { content:'✦ '; color:var(--gold); font-style:normal; }

.poem-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.poem-source-link:hover { color:var(--gold); border-bottom-color:var(--gold-dim); }

.poem-actions { display:flex; gap:10px; flex-wrap:wrap; width:100%; max-width:600px; }

/* ── Buttons ── */

.btn-next-poem {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--gold);
  color: #1a1c19;
  border: none;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .3s;
}
.btn-next-poem:hover { background:var(--gold-light); transform:translateY(-2px); box-shadow:0 8px 20px rgba(184,169,106,.3); }

.btn-prev-poem {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: .95rem;
  cursor: pointer;
  transition: all .3s;
}
.btn-prev-poem:hover { border-color:var(--gold); color:var(--gold); }

.btn-change-mood {
  padding: 10px 22px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(200,210,195,.08);
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: .9rem;
  cursor: pointer;
  transition: all .3s;
}
.btn-change-mood:hover { border-color:var(--glass-border); color:var(--text-secondary); }

/* ── Statistics screen ── */

#screen-stats { flex-direction:column; }

.stats-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  align-self: center;
}

/* Summary row */
.stats-summary {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 12px 40px var(--shadow-strong);
}

.stats-arc-wrap {
  position: relative;
  flex-shrink: 0;
  width: 88px;
  height: 88px;
}
.stats-arc-svg { width:88px; height:88px; }

.stats-arc-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.stats-arc-pct { font-family:'Playfair Display',serif; font-size:1.1rem; color:var(--gold-light); line-height:1; }
.stats-arc-sub { font-size:.58rem; color:var(--text-dim); letter-spacing:.1em; text-transform:uppercase; margin-top:2px; }

.stats-numbers {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-num-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stats-num-val   { font-family:'Playfair Display',serif; font-size:1.5rem; color:var(--gold-light); }
.stats-num-label { font-size:.78rem; color:var(--text-dim); }

.stats-streak-item { margin-top: 2px; }
.stats-num-streak  { font-size:.9rem; color:var(--gold); font-style:italic; }

/* Stats sections */
.stats-section {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 8px 30px var(--shadow-strong);
}

.stats-section-title {
  font-family: 'Playfair Display', serif;
  font-size: .8rem;
  color: var(--text-dim);
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Mood breakdown rows */
.stats-mood-row { margin-bottom: 12px; }
.stats-mood-row:last-child { margin-bottom: 0; }

.stats-mood-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.stats-mood-fraction { margin-left:auto; font-size:.7rem; color:var(--text-dim); }

.stats-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(200,210,195,.1);
  border-radius: 4px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(.25,.46,.45,.94);
  min-width: 2px;
}

/* Author list */
.stats-author-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: .88rem;
}
.stats-author-item:last-child { border-bottom:none; }
.stats-author-medal { font-size:1rem; flex-shrink:0; }
.stats-author-name  { flex:1; color:var(--text-primary); }
.stats-author-count { color:var(--text-dim); font-size:.78rem; }

.stats-empty { font-size:.85rem; color:var(--text-dim); font-style:italic; text-align:center; padding: 8px 0; }

/* ── Author page ── */

#screen-author { flex-direction:column; }

.author-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  padding: 24px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  align-self: center;
}

.author-card {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 16px 60px var(--shadow-strong);
}

.author-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--glass-border);
}

.author-emoji-badge {
  width: 60px; height:60px; flex-shrink:0;
  display: flex; align-items:center; justify-content:center;
  font-size: 2.6rem;
  background: rgba(184,169,106,.1);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
}

.author-title-block { display:flex; flex-direction:column; gap:5px; padding-top:2px; }
.author-name        { font-family:'Playfair Display',serif; font-size:1.6rem; font-weight:400; color:var(--gold-light); }
.author-years       { font-size:.72rem; letter-spacing:.18em; text-transform:uppercase; color:var(--text-dim); }
.author-poem-count  { font-size:.76rem; color:var(--gold); opacity:.8; }
.author-bio         { font-size:.95rem; line-height:1.8; color:var(--text-secondary); font-style:italic; }

.author-poems-section { display:flex; flex-direction:column; gap:12px; }
.author-poems-title   { font-family:'Playfair Display',serif; font-size:1rem; font-weight:400; color:var(--cream); }
.author-poems-list    { display:flex; flex-direction:column; gap:8px; }

.author-poem-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 18px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .25s ease;
}
.author-poem-item:hover  { background:var(--glass-hover); border-color:var(--gold-dim); transform:translateX(4px); }
.author-poem-mood  { font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; opacity:.8; }
.author-poem-title { font-family:'Playfair Display',serif; font-size:1rem; font-style:italic; color:var(--cream); }
.author-poem-year  { font-size:.68rem; color:var(--text-dim); }

/* ── Keyframes ── */

@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Scrollbar ── */

::-webkit-scrollbar       { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--glass-border); border-radius:2px; }
::-webkit-scrollbar-thumb:hover { background:var(--gold-dim); }

/* ── Mobile ── */

@media (max-width: 700px) {
  .main-layout { flex-direction:column; }

  .panel-moods {
    width: 100% !important;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    opacity: 1 !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }

  body.reading-mode .panel-moods { max-height:0; overflow:hidden; border:none; }

  .mood-list { flex-direction:row; overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap; padding:8px 10px; gap:8px; }
  .mood-item { min-width:100px; flex-direction:column; text-align:center; padding:8px; gap:5px; }
  .mood-item-progress { justify-content:center; }

  .panel-poem { padding:16px 14px 20px; }
  .choice-cards { grid-template-columns:1fr; }
  .test-question-card { padding:24px 18px; }
  .answer-btn { padding:11px 14px; }
  .poem-actions { flex-direction:column; }
  .author-body { padding:16px 14px 24px; }
  .daily-card { padding:24px 20px; }

  .stats-summary { flex-direction:column; align-items:flex-start; gap:16px; }
  .stats-body { padding:16px 14px 32px; }

  .header-actions { gap:6px; }
  .btn-header-icon { width:30px; height:30px; }
}
