
:root {
  --bg: #0a1224;
  --surface: #11192b;
  --surface-2: #1a2238;
  --border: #1f2a44;
  --text: #ede8d8;
  --muted: #8e95a8;
  --gold: #e8b84a;
  --gold-hover: #f3c963;
  --accent: #c9961a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: 'Boska', Georgia, serif; }
body {
  min-height: 100vh; font-family: 'Boska', Georgia, serif;
  color: var(--text); background: var(--bg); line-height: 1.6; font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
.ll-err { padding: 3rem; text-align: center; color: #ff8e8e; }

.ll-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,18,36,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.ll-brand {
  font-family: 'Boska', Georgia, serif; font-weight: 700; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 0.5rem; font-size: 1rem;
}
.ll-logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: inline-block;
}
.ll-back {
  font-size: 0.875rem; font-weight: 600; color: var(--muted);
  padding: 0.5rem 0.75rem; border-radius: 9999px; border: 1px solid var(--border);
  text-decoration: none; transition: all 200ms;
}
.ll-back:hover { color: var(--gold); border-color: var(--gold); }
.ll-headernav { display: flex; align-items: center; gap: 0.55rem; }
.ll-headernav .ll-back { text-decoration: none; }
.ll-achievements-link {
  color: #f6d981; border-color: rgba(232,184,74,0.72);
  background: rgba(232,184,74,0.1);
  box-shadow: inset 0 0 0 1px rgba(255,226,142,0.08);
}
.ll-achievements-link:hover { color: #fff0b8; background: rgba(232,184,74,0.18); }
.ll-trophy { width: 15px; height: 15px; display: inline-block; margin-right: 0.3rem; color: var(--gold); vertical-align: -2px; }

.ll-scene {
  flex: 1; max-width: 760px; width: 100%; margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.ll-chapter {
  display: inline-flex; align-items: center; padding: 0.25rem 0.75rem;
  border-radius: 9999px; background: rgba(232,184,74,0.08);
  border: 1px solid rgba(232,184,74,0.3); color: var(--gold);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1rem;
}
.ll-illust {
  position: relative; border-radius: 1.5rem; overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #1a2438, #0a0e18);
  margin-bottom: 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.ll-illust img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ll-title {
  font-family: 'Boska', Georgia, serif; font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.15; margin-bottom: 1.25rem;
}
.ll-desc { font-size: 1rem; color: var(--text); line-height: 1.75; }
.ll-desc p { margin-bottom: 1rem; }
.ll-desc p:last-child { margin-bottom: 0; }
.ll-resume {
  margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 0.75rem;
  background: rgba(232,184,74,0.08); border: 1px solid rgba(232,184,74,0.3);
  color: var(--gold); font-family: 'Boska', Georgia, serif;
  font-size: 0.875rem; font-weight: 600;
}

.ll-badge {
  display: inline-block; padding: 0.5rem 1rem; border-radius: 9999px;
  background: rgba(232,184,74,0.1); border: 1px solid rgba(232,184,74,0.4);
  color: var(--gold); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem;
}
.ll-scripture {
  margin-top: 2rem; padding: 1.5rem;
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0.5rem; font-style: italic;
  font-family: 'Boska', Georgia, serif; font-size: 1.125rem;
  color: var(--text); line-height: 1.5;
}
.ll-verseref { margin-top: 0.75rem; font-style: normal; font-family: 'Boska', Georgia, serif; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.04em; }

.ll-futurelink {
  margin-top: 2rem; padding: 1.25rem; border-radius: 0.75rem;
  background: var(--surface); border: 1px dashed rgba(232,184,74,0.4);
  text-align: center; opacity: 0.75;
}
.ll-futurelink__title { color: var(--gold); font-weight: 700; margin-bottom: 0.25rem; }
.ll-futurelink__sub { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }

.ll-charselect {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem;
}
@media (max-width: 540px) { .ll-charselect { grid-template-columns: 1fr; } }
.ll-charcard {
  padding: 1.5rem; border-radius: 1rem; background: var(--surface);
  border: 1px solid var(--border); text-align: center; cursor: pointer;
  transition: all 200ms; color: var(--text); font: inherit;
}
.ll-charcard:hover { border-color: var(--gold); background: var(--surface-2); transform: translateY(-2px); }
.ll-charavatar {
  height: 220px; margin: -0.5rem auto 0.75rem;
  display: grid; place-items: end center; overflow: hidden;
}
.ll-charavatar img {
  width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.32));
}
.ll-charname { font-family: 'Boska', Georgia, serif; font-size: 1.25rem; font-weight: 700; color: var(--gold); margin-bottom: 0.5rem; }
.ll-chardesc { font-size: 0.9rem; color: var(--muted); }

.ll-choices { margin-top: 2rem; display: grid; gap: 0.75rem; }
.ll-choice {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-align: left; cursor: pointer;
  transition: all 200ms; font: inherit; text-decoration: none;
}
.ll-choice:hover { border-color: var(--gold); background: var(--surface-2); transform: translateY(-1px); }
.ll-choice-letter {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(232,184,74,0.12);
  border: 1px solid rgba(232,184,74,0.35);
  color: var(--gold); font-weight: 700;
}
.ll-choice-text { flex: 1; font-size: 1rem; font-weight: 500; }

.ll-continue { margin-top: 2rem; display: flex; justify-content: center; }
.ll-continue-btn {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.5rem; border-radius: 9999px;
  background: var(--gold); color: #0a0c14;
  font-weight: 700; font-size: 1rem; border: none; cursor: pointer;
  transition: all 200ms; font-family: inherit;
}
.ll-continue-btn:hover { background: var(--gold-hover); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.55); }

.ll-endactions { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }

.ll-audio {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30;
  margin: 0;
}
.ll-audio-btn {
  min-width: 110px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.75rem 1.1rem; border-radius: 9999px;
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #0a0c14;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  font-family: 'Boska', Georgia, serif; font-weight: 700; font-size: 0.95rem; cursor: pointer;
  transition: all 200ms;
}
.ll-audio-btn:hover { background: var(--gold-hover); transform: translateY(-1px); }
.ll-audio-icon { font-size: 1.05rem; line-height: 1; }
.ll-audio-time { font-size: 0.8rem; opacity: 0.7; font-weight: 500; margin-left: 0.4rem; }
.ll-audio-player { display: none; }

.ll-unlock {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 1.25rem; overflow-y: auto;
  background: rgba(4,9,20,0.94); backdrop-filter: blur(14px);
}
.ll-unlock__glow {
  position: fixed; inset: 10% 20%; pointer-events: none;
  background: radial-gradient(circle, rgba(232,184,74,0.3), transparent 68%);
  animation: ll-unlock-pulse 1.8s ease-in-out infinite alternate;
}
.ll-unlock__panel {
  position: relative; width: min(100%, 560px);
  padding: clamp(1.5rem, 5vw, 2.75rem); text-align: center;
  color: #f8f3e7; background: linear-gradient(160deg, rgba(26,38,66,0.98), rgba(9,17,34,0.99));
  border: 1px solid rgba(232,184,74,0.55); border-radius: 1.5rem;
  box-shadow: 0 28px 90px rgba(0,0,0,0.55), 0 0 45px rgba(232,184,74,0.12);
  animation: ll-unlock-rise 0.48s cubic-bezier(.2,.8,.2,1) both;
}
.ll-unlock__eyebrow {
  margin-bottom: 0.75rem; color: #e8b84a;
  font: 700 0.72rem/1.2 "Boska", Georgia, serif;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.ll-unlock__visual {
  position: relative; width: min(58vw, 230px); min-height: 180px;
  margin: 0 auto 1rem; display: grid; place-items: center;
}
.ll-unlock__avatar {
  width: 100%; max-height: 290px; object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.35));
}
.ll-unlock__icon {
  position: absolute; right: -0.25rem; bottom: 0.25rem;
  width: 72px; height: 72px; padding: 0.8rem; color: #e8b84a;
  background: #0b1428; border: 1px solid rgba(232,184,74,0.5);
  border-radius: 50%; box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}
.ll-unlock__icon--fallback {
  position: static; width: 132px; height: 132px; margin: 1.5rem auto;
}
.ll-unlock__title {
  margin: 0 0 0.7rem;
  font: 700 clamp(1.55rem, 5vw, 2.25rem)/1.08 "Boska", Georgia, serif;
}
.ll-unlock__earned {
  margin: 0 0 1rem; color: #e8b84a;
  font: 700 1.02rem/1.4 "Boska", Georgia, serif;
}
.ll-unlock__verse {
  margin: 0 auto 1.4rem; color: #c9c3b5;
  font: 500 0.95rem/1.6 "Boska", Georgia, serif;
}
.ll-unlock__verse span {
  display: block; margin-top: 0.35rem; color: #f8f3e7; font-size: 0.8rem;
}
.ll-unlock__continue {
  min-width: 190px; padding: 0.85rem 1.35rem;
  color: #0a0c14; background: #e8b84a; border: 0; border-radius: 999px;
  font: 700 0.95rem/1 "Boska", Georgia, serif; cursor: pointer;
}
.ll-resume-choice { display: grid; align-content: start; gap: 1rem; }
.ll-resume-choice__card {
  margin-top: 1rem; padding: clamp(1.5rem, 5vw, 2.5rem);
  background: linear-gradient(155deg, rgba(26,34,56,0.98), rgba(13,23,43,0.98));
  border: 1px solid rgba(232,184,74,0.42); border-radius: 1.5rem;
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}
.ll-resume-choice__eyebrow {
  margin-bottom: 0.65rem; color: var(--gold); font-size: 0.8rem;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.ll-resume-choice__card .ll-desc { color: var(--muted); }
.ll-resume-choice__card .ll-desc strong { color: var(--text); }
.ll-resume-choice__actions { display: grid; gap: 0.75rem; margin-top: 1.5rem; }
.ll-resume-choice__actions .ll-continue-btn { justify-content: center; width: 100%; }
.ll-resume-choice__restart { justify-content: center; width: 100%; }
.ll-achievement-notices {
  position: fixed; z-index: 1200; top: 5rem; right: 1rem;
  width: min(380px, calc(100vw - 2rem)); display: grid; gap: 0.75rem;
}
.ll-achievement-notice {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 0.8rem;
  padding: 1rem; color: #f8f3e7;
  background: linear-gradient(145deg, rgba(18,29,52,0.98), rgba(8,15,30,0.99));
  border: 1px solid rgba(232,184,74,0.82); border-radius: 1rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.48), 0 0 24px rgba(232,184,74,0.12);
  animation: ll-notice-in 0.32s ease-out both;
}
.ll-achievement-notice.is-leaving { opacity: 0; transform: translateX(24px); transition: 220ms ease; }
.ll-achievement-notice__icon {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: #12192b; background: linear-gradient(145deg, #f7d878, #c99018);
  border-radius: 50%;
}
.ll-achievement-notice__trophy { width: 25px; height: 25px; }
.ll-achievement-notice__copy { display: grid; gap: 0.18rem; line-height: 1.35; }
.ll-achievement-notice__copy strong { color: #f6d981; font-size: 1rem; }
.ll-achievement-notice__copy span { color: #d9d3c7; font-size: 0.86rem; }
.ll-achievement-notice__copy a { margin-top: 0.25rem; color: #f6d981; font-size: 0.83rem; font-weight: 700; }
.ll-achievement-notice__close {
  width: 30px; height: 30px; color: #d9d3c7; background: transparent;
  border: 0; border-radius: 50%; font: 700 1.2rem/1 Boska, Georgia, serif; cursor: pointer;
}
.ll-achievement-notice__close:hover { color: #fff; background: rgba(255,255,255,0.08); }
@keyframes ll-notice-in {
  from { opacity: 0; transform: translateX(26px) scale(0.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes ll-unlock-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ll-unlock-pulse {
  from { opacity: 0.6; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1.06); }
}
@media (max-width: 540px) {
  .ll-scene { padding-bottom: 6rem; }
  .ll-audio { right: 0.75rem; bottom: 0.75rem; }
  .ll-audio-time { display: none; }
  .ll-header { padding: 0.75rem; }
  .ll-headernav { gap: 0.3rem; }
  .ll-headernav .ll-back { padding: 0.45rem 0.6rem; font-size: 0.72rem; }
  .ll-charavatar { height: 200px; }
  .ll-achievement-notices { top: 4.35rem; right: 0.65rem; width: calc(100vw - 1.3rem); }
}
@media (prefers-reduced-motion: reduce) {
  .ll-unlock__glow, .ll-unlock__panel, .ll-achievement-notice { animation: none; }
}
