/* Additions for the dialogue states, intro video, HUD feedback and phones. Loaded after style.css. */
#title { transition: opacity .6s ease; }
#title.out { opacity: 0; pointer-events: none; }

#bark { opacity: 0; transform: translateX(-50%) translateY(-12px); padding: 0 4px; }
#bark.on { opacity: 1; transform: translateX(-50%); }
#bark .txtcol, #storyDlg .txtcol { flex: 1 1 auto; min-width: 0; }

#story:not(.on) .bar.top { transform: translateY(-100%); }
#story:not(.on) .bar.bot { transform: translateY(100%); }
#storyDlg, #skip { transition: opacity .35s ease, transform .35s ease; }
#story:not(.on) #storyDlg, #story:not(.on) #skip { opacity: 0; pointer-events: none; }
#storyDlg.pop { animation: dlgPop .32s cubic-bezier(.2,1.3,.4,1); }
@keyframes dlgPop { from { opacity: .2; transform: translateX(-50%) translateY(10px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
#storyDlg .who { font-size: 16px; margin-bottom: 2px; }

#vidSkip { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); min-height: 46px; font-size: 16px; padding: 4px 18px; }
#vid video { transition: transform 5s ease-out; transform-origin: 50% 40%; }
#vid.hold video { transform: scale(1.07); }
#vid.waiting video { opacity: 0; }

#kbdBoard { right: calc(12px + env(safe-area-inset-right)); }
#title.loading #prompt { animation: none; opacity: 0.9; }

#hurtfx { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255,80,60,0) 50%, rgba(255,70,50,0.55) 100%); }
#hurtfx.on { animation: hurtIn .55s ease-out; }
@keyframes hurtIn { 0% { opacity: 1; } 100% { opacity: 0; } }

#hud .hpbox { min-width: 0; padding: 2px 6px 4px; }
#lockInfo { display: inline-flex; align-items: center; gap: 4px; opacity: 0.75; transition: color .15s, opacity .15s; }
#lockInfo img { width: 22px; height: 22px; }
#lockInfo.on { color: #ffd98a; opacity: 1; }
.boostbar.ready { box-shadow: 0 0 8px rgba(190, 250, 255, 0.8); }
#chain.on { opacity: 1; animation: chainPop .35s cubic-bezier(.2,1.5,.4,1); }
@keyframes chainPop { from { transform: translateX(-50%) scale(1.6); } to { transform: translateX(-50%) scale(1); } }
#hintbox { padding: 10px 22px; background: rgba(14, 24, 30, 0.42); border-radius: 14px; border: 1px solid rgba(255, 226, 166, 0.35); opacity: 0; }
#hintbox .hk { width: 24px; height: 24px; vertical-align: -6px; }
#hintbox b { color: #ffd98a; }

#toast2 { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: clamp(18px, 3.4vh, 28px); font-weight: 900; color: #ffe8b0; letter-spacing: 0.08em; opacity: 0; }
#toast2.show { animation: slam 1.8s cubic-bezier(.2,1.3,.4,1) forwards; }
#toast2 img { width: 1.2em; height: 1.2em; vertical-align: -0.25em; }

.modal .box { padding: 10px 18px 6px; }
.modal .btn span { pointer-events: none; }

@media (max-height: 460px) {
  #hud .hpbox { min-width: 0; }
  .hp { width: 14px; height: 14px; }
  .scoreline { font-size: 19px; margin-top: 2px; }
  .subline { font-size: 14px; }
  #lockInfo img { width: 18px; height: 18px; }
  .boostbar { width: 96px; margin-top: 4px; }
  #bark { top: 50px; width: min(50vw, 600px); }
  #bossbar { width: min(40vw, 520px); }
  #bossbar .name { font-size: 13px; margin-bottom: 2px; }
  #hintbox { font-size: 14px; line-height: 1.55; padding: 6px 14px; bottom: 44%; }
  #storyDlg .who { font-size: 13px; }
  #card .t { font-size: clamp(26px, 9vh, 48px); }
  #chain { font-size: 24px; }
  .modal p { font-size: 13px; line-height: 1.45; }
}
