/* Кампания «Исход из Подгорья» (js/campaign.js): диалоги, полосы катсцены, вспышка, цели акта, итог */
#camp-dlg { position: fixed; left: 50%; bottom: 22px; z-index: 8600; width: min(620px, 94vw); transform: translateX(-50%);
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px 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: cd-in 0.4s cubic-bezier(.2,.9,.3,1.2) both; }
#camp-dlg.cut { bottom: calc(9vh + 14px); }
#camp-dlg.hidden, #camp-bars.hidden, #camp-hud.hidden, #camp-end.hidden { display: none; }
@keyframes cd-in { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cd-face { flex: none; }
.cd-ch { width: 50px; height: 50px; border: 2px solid; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: bold; box-shadow: 0 0 10px rgba(0,0,0,0.6); }
/* портрет 36×36 пикселей (js/campaign/faces.js) ×2; моргание — второй кадр поверх на миг */
.cd-pt { position: relative; display: block; width: 72px; height: 72px; border: 2px solid; overflow: hidden;
  background-image: radial-gradient(circle at 50% 40%, rgba(255,240,200,0.22), rgba(0,0,0,0.35) 75%);
  box-shadow: inset 0 0 0 1px #0a0705, 0 0 10px rgba(0,0,0,0.6); }
.cd-pt img { position: absolute; left: 0; top: 0; width: 72px; height: 72px; image-rendering: pixelated; }
.cd-pt .cd-blink { opacity: 0; animation: cd-blink 4.2s steps(1) infinite; }
@keyframes cd-blink { 0%, 95% { opacity: 0; } 96%, 99% { opacity: 1; } }
.cd-body { flex: 1; min-width: 0; }
.cd-who { font-size: 14px; font-weight: bold; margin-bottom: 2px; }
.cd-text { font-size: 16px; line-height: 1.42; min-height: 2.8em; }
.cd-text.in { animation: cd-text 0.35s ease-out both; }
@keyframes cd-text { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cd-btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.cd-btns button, .ce-btns button, .cmh-show { font: inherit; font-size: 13px; min-height: 34px; padding: 3px 12px; cursor: pointer;
  color: #2a1608; background: linear-gradient(#f1dfb2, #d9bd84); border: 1px solid #6a3c12; }
.cd-btns button.ghost, .ce-btns button.ghost, .cmh-show { color: #f0dca0; background: rgba(0,0,0,0.25); border-color: #6a5028; }
.ce-btns button:disabled { opacity: 0.5; cursor: default; }

/* полосы катсцены сверху и снизу */
#camp-bars { position: fixed; inset: 0; z-index: 8550; pointer-events: none; }
#camp-bars i { position: absolute; left: 0; right: 0; height: 9vh; background: #000; animation: cb-in 0.6s ease-out both; }
#camp-bars i.t { top: 0; } #camp-bars i.b { bottom: 0; }
@keyframes cb-in { from { height: 0; } }

/* вспышка взрыва: прозрачность ставит камера (render) */
#camp-flash { position: fixed; inset: 0; z-index: 8540; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 35%, #fff6d0 0%, #ffb040 35%, rgba(200,80,20,0.6) 70%, rgba(80,30,10,0.4) 100%); }

/* цели акта: на месте панели целей сценария (goal.js в кампании выключен) */
#camp-hud { position: absolute; left: 8px; top: 46px; z-index: 20; width: min(270px, 46vw); padding: 7px 10px 8px;
  color: #f0e2c0; font-family: Kurale, Georgia, serif; font-size: 13px;
  background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.6)), #241a12; border: 2px solid #0a0705; box-shadow: inset 0 0 0 1px var(--gold, #c9a24a); }
.cmh-act { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #e0b070; }
.cmh-step { font-size: 15px; font-weight: bold; color: var(--gold-hi, #f6d458); margin: 1px 0 4px; }
#camp-hud ul { list-style: none; margin: 0; padding: 0; }
#camp-hud li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
#camp-hud li.ok .cmh-t { color: #a8c890; text-decoration: line-through; }
#camp-hud li.opt .cmh-t { font-style: italic; opacity: 0.85; }
.cmh-box { flex: none; width: 14px; height: 14px; border: 1px solid #c9a24a; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #a8e080; }
.cmh-t { flex: 1; }
.cmh-n { color: #f6d458; font-variant-numeric: tabular-nums; }
.cmh-show { min-height: 24px; padding: 0 7px; }
.cmh-meter { margin-top: 4px; font-size: 13px; color: #d8c8a0; }
.cmh-meter b { color: #f6d458; } .cmh-meter b.up { color: #a8e080; } .cmh-meter b.down { color: #f08a6a; }
.cd-btns.choice { flex-direction: column; align-items: stretch; }
.cd-btns.choice button { text-align: left; }
.cmh-timer { margin-top: 4px; font-size: 15px; font-weight: bold; color: #f08a6a; font-variant-numeric: tabular-nums; }
.cmh-hint { margin-top: 4px; font-size: 12px; color: #c8b088; font-style: italic; }

/* итог акта */
#camp-end { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
.ce-box { width: min(440px, 94vw); padding: 16px 18px; text-align: center; color: #f0e2c0; font-family: Kurale, Georgia, serif;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.55)), #241a12; border: 2px solid #0a0705; box-shadow: inset 0 0 0 1px var(--gold, #c9a24a), 0 10px 40px #000; }
.ce-act { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #e0b070; }
.ce-box h2 { margin: 2px 0 6px; font-size: 22px; color: var(--gold-hi, #f6d458); }
.ce-box.lose h2 { color: #f08a6a; }
.ce-stars { font-size: 28px; color: #f6d458; letter-spacing: 4px; text-shadow: 0 0 10px rgba(246,212,88,0.5); }
.ce-why, .ce-outro, .ce-leg { margin: 6px 0; line-height: 1.4; }
.ce-leg { color: #c8e0a0; font-size: 14px; }
.ce-stats { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; color: #d8c8a0; }
.ce-btns { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

/* стартовое меню: «Кампания» — пятая кнопка главной панели (видна вместе с «Новой игрой», после «Ещё» прячется) */
#start-menu .sm-panel[data-panel="main"]:not(.sm-more) > .sm-btn[data-sm="camp"] { display: flex; }
#start-menu .sm-panel[data-panel="main"].sm-more > .sm-btn[data-sm="camp"] { display: none; }
#start-menu .camp-act b { font-size: 15px; }

body.mobile #camp-hud { width: min(240px, 58vw); font-size: 12px; }
body.mobile #camp-dlg { bottom: calc(66px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) { #camp-dlg, .cd-text.in, #camp-bars i, .cd-pt .cd-blink { animation: none !important; } }
