/* fire/style.css — 새벽 3시, 화재경보 전용 화면 요소 (공통 ui.css 위에 덧씌움) */

/* 경보 빨간 테두리 · 연기 · 숨 막힘 · 암전 · 눈꺼풀 */
.fr-red { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,0,20,0) 32%, rgba(255,24,18,0.55) 76%, rgba(190,0,0,0.88)); }
.fr-smoke { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0;
  background: linear-gradient(to bottom, rgba(58,55,52,0.97) 0%, rgba(70,66,62,0.82) 42%, rgba(82,78,73,0.5) 78%, rgba(90,86,80,0.32) 100%); }
.fr-dark { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 22%, rgba(0,0,0,0.75) 62%, rgba(0,0,0,0.98) 100%); }
.fr-black { position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: #000; }
.fr-lid { position: fixed; left: 0; right: 0; height: 51%; background: #000; z-index: 3; pointer-events: none; transform: scaleY(0); }
.fr-lid.t { top: 0; transform-origin: 50% 0%; }
.fr-lid.b { bottom: 0; transform-origin: 50% 100%; }

/* 시작 순간: 화재 경보 */
.fr-alert { position: fixed; left: 0; right: 0; top: 24%; z-index: 3; text-align: center; pointer-events: none; opacity: 0; color: #fff; }
.fr-alert.show { opacity: 1; animation: frAlert 0.42s steps(1) infinite; }
.fr-alert b { display: block; font-size: 64px; font-weight: 900; line-height: 1.05; color: #ff3b2f; letter-spacing: 0.04em;
  text-shadow: 0 4px 0 #000, 0 0 34px rgba(255,40,20,0.85); }
.fr-alert small { display: block; margin-top: 8px; font-size: 17px; font-weight: 800; color: #ffe2d8; text-shadow: 0 2px 0 #000; }
@keyframes frAlert { 0% { opacity: 1; } 55% { opacity: 0.55; } }
@media (max-height: 520px) { .fr-alert { top: 12%; } .fr-alert b { font-size: 46px; } }

/* 자막 (안내방송 · 119 · 나) */
.fr-sub { position: fixed; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 40px); transform: translateX(-50%) translateY(-6px); z-index: 3;
  max-width: min(92vw, 560px); width: max-content; background: rgba(8,8,10,0.74); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  padding: 8px 14px; font-size: 16px; font-weight: 800; line-height: 1.38; text-align: center; word-break: keep-all; color: #fff;
  pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.fr-sub.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.fr-sub i { font-style: normal; display: inline-block; font-size: 12px; font-weight: 900; border-radius: 6px; padding: 1px 6px; margin-right: 7px; vertical-align: 2px; }
.fr-sub.pa i { background: #ffd54a; color: #1a1408; }
.fr-sub.pa { color: #fff3c2; }
.fr-sub.c119 i { background: #e5383b; color: #fff; }
.fr-sub.c119 { color: #ffd9d6; }
.fr-sub.me i { background: rgba(255,255,255,0.18); color: #fff; }
.fr-sub.big { font-size: 21px; padding: 10px 16px; top: calc(max(14px, env(safe-area-inset-top)) + 36px); }
@media (max-width: 480px) { .fr-sub { font-size: 15px; top: calc(max(12px, env(safe-area-inset-top)) + 52px); } .fr-sub.big { font-size: 19px; top: auto; bottom: 30%; } }

/* 작은 안내 (아래 가운데) */
.fr-hint { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px); max-width: min(92vw, 520px);
  background: rgba(10,10,14,0.74); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 8px 14px; font-size: 15px; font-weight: 800;
  text-align: center; word-break: keep-all; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
.fr-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }
body.touch .fr-hint { bottom: calc(236px + env(safe-area-inset-bottom)); font-size: 14px; }
body.fr-on .ods-prompt { font-size: 15px; padding: 7px 14px; border: 1px solid rgba(255,213,74,0.45); max-width: 88vw; white-space: normal; text-align: center; word-break: keep-all; }

/* 숨 게이지 */
.fr-breath .track { width: 120px; }
.fr-breath .fill { background: linear-gradient(90deg, #7fd6ff, #d6f3ff); }
.fr-breath.low .fill { background: linear-gradient(90deg, #ff4b4b, #ff9a4b); }
.fr-breath span { font-size: 13px; }

/* 가상 상황 표시 */
.fr-tag { position: fixed; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2; pointer-events: none; font-size: 10px; color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em; display: none; white-space: nowrap; }
body.fr-on.fr-played .fr-tag { display: block; }

/* 버튼 글자 */
.ctl-btn small { font-size: 12px; font-weight: 800; }
.ctl-btn.slot-d .ctl-label { font-size: 17px; }

/* 결과: 행동요령 체크리스트 */
.fr-check { text-align: left; margin: 10px 0 8px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.fr-check-h { font-size: 12px; font-weight: 800; color: #a59a83; margin-bottom: 6px; letter-spacing: 0.04em; }
.fr-check ul { list-style: none; display: grid; gap: 4px; }
.fr-check li { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: start; font-size: 13px; line-height: 1.35; }
.fr-check li b { font-size: 11px; font-weight: 900; text-align: center; border-radius: 6px; padding: 2px 0; margin-top: 1px; }
.fr-check li.ok b { background: rgba(127,224,138,0.2); color: #8ff09c; }
.fr-check li.miss b { background: rgba(255,93,93,0.18); color: #ff8a80; }
.fr-check li em { font-style: normal; color: #8f8a7e; font-size: 11px; margin-right: 2px; }
.fr-check li small { display: block; font-size: 11px; color: #b9a58a; }
.fr-check li.ok span { color: #e8e2d2; }
.fr-check li.miss span { color: #f2e6d8; }
.fr-src { font-size: 10.5px; color: #8f8a7e; margin-top: 8px; }

/* 큰 가운데 글자: 단어 단위 줄바꿈, 폰에서는 작게 (두 줄 안에) */
body.fr-on .ods-msg { word-break: keep-all; }
@media (max-width: 480px) {
  body.fr-on .ods-msg { font-size: 34px; }
  body.fr-on .ods-msg.scream { font-size: 38px; }
  body.fr-on .ods-msg.dread { font-size: 26px; letter-spacing: 0.04em; }
}
/* 기침: 글자 대신 숨 게이지가 떨림 */
.fr-breath.hit { animation: frHit 0.45s ease-out; }
.fr-breath.hit .fill { background: linear-gradient(90deg, #ff4b4b, #ff9a4b); }
@keyframes frHit { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
