/* Лор: сцена-карточка, подсветка экрана и журнал «Лор» (js/lore.js) */
#lore-card { position: fixed; left: 50%; top: 64px; z-index: 8500; width: min(520px, 94vw); transform: translateX(-50%);
  padding: 9px 13px 10px; color: #f0e2c0; font-family: Kurale, Georgia, serif;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.55)), var(--wood-tex, none), #241a12;
  border: 2px solid #0a0705; box-shadow: inset 0 0 0 1px var(--gold, #c9a24a), 0 8px 30px rgba(0,0,0,0.85);
  animation: lc-in 0.5s cubic-bezier(.2,.9,.3,1.2) both; }
#lore-card.hidden, #lore-fx.hidden { display: none; }
#lore-card.out { animation: lc-out 0.4s ease-in both; pointer-events: none; }
@keyframes lc-in { from { opacity: 0; transform: translate(-50%, -24px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes lc-out { to { opacity: 0; transform: translate(-50%, -14px); } }
.lc-top { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: #c8b088; }
.lc-top b { flex: 1; font-size: 16px; color: var(--gold-hi, #f6d458); letter-spacing: 0.3px; }
.lc-kind { text-transform: uppercase; letter-spacing: 1.5px; font-size: 10.5px; color: #e0b070; }
.lc-ch { opacity: 0.75; }
.lc-say { display: flex; gap: 10px; align-items: flex-start; margin: 7px 0 8px; }
.lc-face { flex: none; width: 42px; height: 42px; border: 2px solid; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: bold; animation: lc-glow 2.4s ease-in-out infinite; }
@keyframes lc-glow { 50% { box-shadow: 0 0 14px 2px currentColor; } }
.lc-body { flex: 1; min-width: 0; }
.lc-name { font-size: 13px; font-weight: bold; margin-bottom: 1px; }
.lc-text { font-size: 15px; line-height: 1.42; min-height: 2.8em; cursor: pointer; }
.lc-text.note { font-style: italic; color: #e2d4b0; }
.lc-text.dark { color: #b8f0a0; text-shadow: 0 0 8px rgba(120,255,90,0.45); letter-spacing: 0.2px; }
.lc-btns { display: flex; align-items: center; gap: 6px; }
.lc-btns button { font: inherit; font-size: 13px; min-height: 34px; padding: 3px 11px; color: #f0dca0; background: rgba(0,0,0,0.25); border: 1px solid #6a5028; cursor: pointer; }
.lc-btns button.primary { color: #2a1608; background: linear-gradient(#f1dfb2, #d9bd84); border-color: #6a3c12; }
.lc-dots { flex: 1; text-align: center; }
.lc-dots i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: rgba(240,220,160,0.25); }
.lc-dots i.on { background: var(--gold-hi, #f6d458); }
#lore-card.k-letter { background: radial-gradient(ellipse at 30% 20%, #f1e2b4, #dcc58a 70%, #c9ad6d); color: #3a2a14; box-shadow: inset 0 0 30px rgba(120,80,30,0.45), 0 8px 30px #000; }
#lore-card.k-letter .lc-top b { color: #5a2a14; } #lore-card.k-letter .lc-top, #lore-card.k-letter .lc-kind { color: #7a4a1a; }
#lore-card.k-letter .lc-text.note { color: #3a2a14; }
#lore-card.k-letter .lc-btns button:not(.primary) { color: #3a2a14; border-color: #7a5a2a; background: rgba(90,60,25,0.12); }
#lore-card.k-voice { box-shadow: inset 0 0 0 1px #7ad050, 0 0 34px rgba(110,40,170,0.6), 0 8px 30px #000; }

/* подсветка экрана: не ловит касания, только настроение */
#lore-fx { position: fixed; inset: 0; z-index: 8400; pointer-events: none; animation: lf-in 1.2s ease-out both; }
#lore-fx.out { animation: lf-out 0.5s ease-in both; }
@keyframes lf-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lf-out { to { opacity: 0; } }
#lore-fx.k-memory { background: radial-gradient(ellipse at center, transparent 45%, rgba(90,60,20,0.38) 100%); }
#lore-fx.k-find { background: radial-gradient(ellipse at center, transparent 55%, rgba(120,90,20,0.25) 100%); }
#lore-fx.k-vision { background: radial-gradient(ellipse at center, transparent 35%, rgba(60,20,90,0.42) 100%); animation: lf-in 1.4s ease-out both, lf-pulse 3s ease-in-out 1.4s infinite; }
#lore-fx.k-voice { background: radial-gradient(ellipse at center, transparent 25%, rgba(0,0,0,0.62) 85%, rgba(40,90,20,0.5) 100%); animation: lf-in 0.9s ease-out both, lf-pulse 2.2s ease-in-out 0.9s infinite; }
#lore-fx.k-fire { background: radial-gradient(ellipse at 70% 105%, rgba(255,130,40,0.35), transparent 45%), radial-gradient(ellipse at center, transparent 55%, rgba(60,30,10,0.3) 100%); animation: lf-in 1.2s ease-out both, lf-pulse 1.6s ease-in-out 1.2s infinite; }
#lore-fx.k-song { background: radial-gradient(ellipse at center, transparent 50%, rgba(120,70,20,0.3) 100%); }
#lore-fx.k-letter { background: radial-gradient(ellipse at center, transparent 55%, rgba(60,40,15,0.3) 100%); }
@keyframes lf-pulse { 50% { opacity: 0.7; } }
#lore-fx i { position: absolute; bottom: 20%; font-style: normal; color: #f6d458; font-size: 26px; text-shadow: 0 0 8px #000; opacity: 0; animation: lf-note 4.5s ease-out infinite; }
#lore-fx i:nth-child(1) { left: 22%; } #lore-fx i:nth-child(2) { left: 41%; animation-delay: 1.1s; } #lore-fx i:nth-child(3) { left: 63%; animation-delay: 2.2s; }
#lore-fx i:nth-child(4) { left: 80%; animation-delay: 3.2s; } #lore-fx i:nth-child(5) { left: 52%; animation-delay: 0.6s; }
@keyframes lf-note { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-38vh) rotate(-12deg); } }
#lore-fx.k-find i { width: 6px; height: 6px; border-radius: 50%; background: #fff2b0; box-shadow: 0 0 10px 3px #f6d458; top: 30%; bottom: auto; animation: lf-spark 2.2s ease-in-out infinite; }
#lore-fx.k-find i:nth-child(1) { left: 30%; top: 22%; } #lore-fx.k-find i:nth-child(2) { left: 70%; top: 18%; } #lore-fx.k-find i:nth-child(3) { left: 18%; top: 60%; }
#lore-fx.k-find i:nth-child(4) { left: 84%; top: 55%; } #lore-fx.k-find i:nth-child(5) { left: 50%; top: 80%; }
@keyframes lf-spark { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { #lore-card, #lore-fx, #lore-fx i, .lc-face { animation: none !important; } #lore-fx i { display: none; } }

/* телефон: сверху окно обучения — сцена снизу, над вкладками */
body.mobile #lore-card { top: auto; bottom: calc(66px + env(safe-area-inset-bottom)); padding: 7px 10px 8px; }
/* горизонталь: окно обучения слева — сцена правее него, «Пропустить» обучения не закрывает */
body.mobile.land #lore-card { left: calc((var(--left, 60px) + min(330px, 44vw) + 100vw) / 2); width: min(440px, calc(100vw - var(--left, 60px) - min(330px, 44vw) - 24px)); bottom: calc(var(--sb, 0px) + 56px); }
body.mobile .lc-text { font-size: 14px; }
body.mobile .lc-face { width: 36px; height: 36px; font-size: 18px; }
body.mobile .lc-btns button { min-height: 40px; }

/* журнал «Лор» — пергамент, как летопись */
#lore-book { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; }
#lore-book.hidden { display: none; }
.lb-box { position: relative; width: min(580px, 94%); height: min(660px, 90%); display: flex; flex-direction: column; padding: 12px 18px;
  background: radial-gradient(ellipse at 30% 20%, #f1e2b4, #dcc58a 70%, #c9ad6d); color: #3a2a14; border: 2px solid #3a2a14; border-radius: 4px;
  box-shadow: inset 0 0 40px rgba(120,80,30,0.45), 0 10px 40px #000; font-family: Georgia, 'Times New Roman', serif; }
.lb-head { display: flex; justify-content: flex-end; }
.lb-head button { font: inherit; min-width: 38px; min-height: 34px; background: rgba(90,60,25,0.15); color: #3a2a14; border: 1px solid #7a5a2a; border-radius: 3px; cursor: pointer; }
#lb-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 6px; }
.lb-title { text-align: center; font-size: 20px; color: #5a2a14; margin-bottom: 6px; }
.lb-title small { font-size: 13px; color: #7a4a1a; }
.lb-ch { display: flex; justify-content: space-between; margin: 14px 0 4px; padding-bottom: 2px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: #7a4a1a; border-bottom: 1px solid rgba(122,74,26,0.45); }
.lb-ch i { font-style: normal; letter-spacing: 0; }
.lb-ch.locked { opacity: 0.55; }
.lb-lock { margin: 4px 0; font-style: italic; opacity: 0.6; font-size: 13.5px; }
.lb-f { margin: 4px 0; padding: 5px 8px; border-radius: 3px; background: rgba(90,60,25,0.08); cursor: pointer; }
.lb-f > b { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; color: #4a2410; }
.lb-f > b i { font-weight: normal; font-size: 11.5px; color: #8a5a2a; text-transform: uppercase; letter-spacing: 1px; }
.lb-f.locked { cursor: default; opacity: 0.6; display: flex; gap: 8px; font-size: 13.5px; }
.lb-f.locked b { color: #6a4a2a; }
.lb-b { display: none; }
.lb-f.open .lb-b { display: block; }
.lb-e { margin: 6px 0; font-size: 14.5px; line-height: 1.45; }
.lb-q { margin: 3px 0 3px 10px; font-size: 13.5px; line-height: 1.4; font-style: italic; border-left: 2px solid rgba(122,74,26,0.35); padding-left: 8px; }
.lb-q b { font-style: normal; filter: brightness(0.55) saturate(1.5); }
.lb-b button { margin: 6px 0 2px; font: inherit; font-size: 12.5px; padding: 3px 10px; background: rgba(90,60,25,0.15); color: #3a2a14; border: 1px solid #7a5a2a; border-radius: 3px; cursor: pointer; }

/* обучение: реплики старосты */
#tut .tut-who { color: #e0a050; }
