/* v1.11 story: cutscene overlay (js/story.js), STORY list in the records screen, intel board (js/intelboard.js). */

/* ---------- Cutscene overlay ---------- */
.story { position: fixed; inset: 0; z-index: 60; background: #050806; color: var(--text); user-select: none; -webkit-user-select: none; cursor: pointer; animation: st-in 0.35s ease-out; }
.story.out { opacity: 0; transition: opacity 0.25s ease-in; }
@keyframes st-in { from { opacity: 0; } to { opacity: 1; } }
.story .st-cv { position: absolute; inset: 0; display: block; }
.st-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 14px max(16px, 5vw); }
.st-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-title { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.1em; color: #F3F6F2; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-skip { margin-left: auto; flex: 0 0 auto; height: 38px; padding: 0 16px; border: 1px solid #2B3A2F; background: rgba(7, 10, 8, 0.7); color: #D9E0DA; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.16em; }
.st-skip span { color: var(--green); margin-left: 4px; }
.st-skip:hover { border-color: var(--muted); color: #fff; }
.st-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 max(16px, 5vw) 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.st-caption { min-height: 1.4em; max-width: 920px; text-align: center; font-family: var(--body); font-style: italic; font-size: 17px; line-height: 1.4; color: var(--muted); }
.st-sub { min-height: 52px; max-width: 920px; width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 10px 16px; background: rgba(7, 10, 8, 0.82); border: 1px solid transparent; opacity: 0; transition: opacity 0.2s; }
.st-sub.on { opacity: 1; border-color: var(--line2); }
.st-who { flex: 0 0 auto; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.14em; color: var(--green); }
.st-text { font-family: var(--body); font-weight: 500; font-size: 19px; line-height: 1.35; color: #F3F6F2; }
.st-bar { width: min(920px, 100%); height: 3px; background: #142017; }
.st-bar i { display: block; height: 100%; width: 0; background: var(--green); }
.st-hint { font-family: var(--mono); font-size: 9px; letter-spacing: 0.22em; color: var(--dim); }
@media (max-width: 700px), (orientation: portrait) {
  .st-top { padding: 10px 12px; }
  .st-title { font-size: 20px; }
  .st-eyebrow { font-size: 10px; letter-spacing: 0.14em; }
  .st-skip { height: 34px; padding: 0 12px; font-size: 14px; }
  .st-bottom { padding: 0 12px calc(12px + env(safe-area-inset-bottom)); gap: 6px; }
  .st-caption { font-size: 14px; }
  .st-sub { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 72px; padding: 8px 12px; }
  .st-who { font-size: 14px; }
  .st-text { font-size: 16px; }
}

/* Debrief: NEW LEAD chip */
.story-chip { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border: 1px solid var(--red); background: rgba(224, 83, 61, 0.12); color: #F3F6F2; font-family: var(--display); font-size: 15px; letter-spacing: 0.12em; animation: chip-pulse 1.6s ease-in-out infinite; }
.story-chip b { color: var(--red); font-weight: 800; }
.story-chip span { font-weight: 700; }
@keyframes chip-pulse { 50% { box-shadow: 0 0 0 4px rgba(224, 83, 61, 0.15); } }

/* ---------- Records: STORY list ---------- */
.story-group .panel-title { display: flex; align-items: center; gap: 12px; }
.story-board-link { margin-left: auto; height: 26px; padding: 0 10px; border: 1px solid #2E7A47; background: transparent; color: var(--green); font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; }
.story-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.story-item { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 12px; border: 1px solid var(--line2); background: var(--panel-solid); color: var(--text); text-align: left; }
.story-item:hover:not(:disabled) { border-color: var(--green-dim); }
.story-item .si-n { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.story-item .si-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.story-item .si-t small { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-item .si-t b { font-family: var(--display); font-size: 18px; letter-spacing: 0.08em; font-weight: 700; }
.story-item .si-s { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--green); white-space: nowrap; }
.story-item.locked { opacity: 0.55; cursor: default; }
.story-item.locked .si-s { color: var(--muted); max-width: 120px; white-space: normal; text-align: right; }

/* ---------- Intel board ---------- */
#screen-intel { overflow: hidden; }
.ib-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
#lobbybar:not(.hidden) ~ #screen-intel .ib-wrap { top: 60px; }
.ib-head { display: flex; align-items: flex-end; gap: 16px; padding: 14px 20px 10px; border-bottom: 1px solid var(--line); background: rgba(7, 10, 8, 0.92); }
.ib-head .title { font-size: 40px; line-height: 0.95; margin: 2px 0 0; }
.ib-sum { display: flex; gap: 18px; margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.ib-sum b { display: block; font-family: var(--display); font-size: 24px; letter-spacing: 0.04em; color: #F3F6F2; }
.ib-head .btn { height: 40px; font-size: 16px; padding: 0 16px; }
.ib-theatres { display: flex; gap: 6px; padding: 8px 20px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: rgba(7, 10, 8, 0.92); }
.ib-theatres::-webkit-scrollbar { display: none; }
.ib-th { flex: 1 0 180px; display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border: 1px solid var(--line2); background: var(--panel-solid); color: var(--text); text-align: left; }
.ib-th.active { border-color: var(--green-dim); }
.ib-th .t1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.1em; }
.ib-th .t1 span { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.ib-th .bar { height: 3px; background: #142017; }
.ib-th .bar i { display: block; height: 100%; background: var(--green); }
.ib-th .t2 { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--muted); min-height: 24px; display: flex; align-items: center; }
.ib-th .t2.done { color: var(--green); }
.ib-claim { white-space: nowrap; height: 24px; padding: 0 10px; border: 1px solid var(--amber); background: rgba(242, 181, 68, 0.14); color: var(--amber); font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; animation: chip-pulse 1.6s ease-in-out infinite; }
.ib-claim:disabled { opacity: 0.6; animation: none; }
.ib-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #3E2D1E; touch-action: none; }
#ib-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#ib-canvas.drag { cursor: grabbing; }
.ib-tools { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.ib-tools button { width: 40px; height: 40px; border: 1px solid #2B3A2F; background: rgba(7, 10, 8, 0.85); color: #D9E0DA; font-family: var(--display); font-size: 20px; font-weight: 700; }
.ib-hint { position: absolute; left: 12px; bottom: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: rgba(243, 230, 210, 0.75); background: rgba(7, 10, 8, 0.6); padding: 5px 8px; pointer-events: none; }
.ib-detail { position: absolute; right: 16px; top: 16px; width: min(340px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; background: var(--panel-solid); border: 1px solid #2E7A47; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); z-index: 2; }
.ib-detail canvas { flex: 0 0 auto; display: block; height: 200px; width: auto; max-width: 100%; align-self: center; background: #2A2018; }
.ib-detail .d-eye { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--green); }
.ib-detail h3 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: 0.06em; color: #F3F6F2; line-height: 1; }
.ib-detail p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.ib-detail .d-act { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-detail .d-act .btn { height: 38px; font-size: 15px; padding: 0 14px; }
.ib-detail .d-x { position: absolute; right: 8px; top: 6px; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
.ib-toast { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--amber); color: var(--amber); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.1em; padding: 10px 18px; z-index: 3; white-space: nowrap; }
.camp-intel-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid #7A3A2E; background: rgba(224, 83, 61, 0.08); color: #F3D9D2; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.14em; }
.camp-intel-btn b { color: var(--red); }
.camp-intel-btn small { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.camp-intel-btn:hover { border-color: var(--red); }
@media (max-width: 900px) {
  #lobbybar:not(.hidden) ~ #screen-intel .ib-wrap { top: 48px; }
  .ib-head { padding: 10px 12px 8px; gap: 10px; flex-wrap: wrap; }
  .ib-head .title { font-size: 30px; }
  .ib-head .eyebrow-lg { font-size: 10px; }
  .ib-sum { gap: 12px; margin-left: 0; order: 3; width: 100%; }
  .ib-sum b { font-size: 18px; }
  .ib-head .btn { margin-left: auto; height: 34px; font-size: 14px; padding: 0 12px; }
  .ib-theatres { padding: 6px 12px; }
  .ib-th { flex: 0 0 172px; padding: 6px 8px; gap: 4px; }
  .ib-th .t1 { font-size: 13px; letter-spacing: 0.06em; white-space: nowrap; }
  .ib-th .t1 span { font-size: 9px; }
  .ib-th .t2 { min-height: 22px; font-size: 9px; letter-spacing: 0.08em; }
  .ib-claim { font-size: 9px; letter-spacing: 0.06em; padding: 0 6px; height: 22px; }
  .ib-detail { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 70%; overflow: auto; }
  .ib-detail canvas { height: 150px; }
  .ib-hint { display: none; }
}
