/* hud.css — in-run HUD and run screens */
/* run buttons wear the ui-button art from style.css; .rb only tightens their size */
.btn.rb { min-height: 44px; min-width: 44px; padding: 0 8px; }
.btn.rb:disabled { filter: grayscale(.7) brightness(.65); }
.h-glass { background: rgba(22,12,34,.78); border: 2px solid rgba(123,75,179,.65); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
#hud .h-cluster, #hud .h-round, #hud .h-toasts, #hud .h-banner, #hud .h-hint, #hud .h-float { pointer-events: none; }
.h-ic { width: 28px; height: 28px; object-fit: contain; flex: none; }
.h-ic-sm { width: 22px; height: 22px; } .h-ic-xs { width: 16px; height: 16px; object-fit: contain; }
.h-num { font-size: 18px; line-height: 1; }
/* resource box: bottom-left, two slim rows (altar health / essence n/cap, karma, army) */
.h-cluster { position: absolute; left: 10px; bottom: 10px; width: 184px; box-sizing: border-box; padding: 3px 7px; display: flex; flex-direction: column; gap: 2px; border-radius: 10px; border-width: 1.5px; }
#hud .h-cluster .h-ic { width: 18px; height: 18px; } #hud .h-cluster .h-ic-sm { width: 15px; height: 15px; }
#hud .h-cluster .h-num { font-size: 16px; }
#hud .h-cluster .h-bar { height: 9px; border-width: 1.5px; } #hud .h-cluster .h-karma { height: 7px; }
.h-row { display: flex; align-items: center; gap: 5px; }
.h-row2 { justify-content: space-between; }
.h-ess, .h-army { display: flex; align-items: center; gap: 3px; flex: none; }
.h-kar { flex: 1; min-width: 24px; display: flex; align-items: center; gap: 3px; }
.h-ess.flash { animation: essFlash .5s ease; }
.h-essmax { font-size: 12px; color: var(--ink-dim); align-self: flex-end; margin-bottom: 1px; }
/* info toggle: left of the 2x button; glows until first opened, jade while the info panel is open */
.h-info { position: absolute; right: 116px; top: 10px; width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; display: none; pointer-events: auto; transition: transform .12s, filter .12s; }
.h-info.show { display: block; animation: slideUp .25s both; }
.h-info img { width: 100%; height: 100%; object-fit: contain; display: block; filter: brightness(.85); }
.h-info.on img { filter: drop-shadow(0 0 7px #5dffa8) brightness(1.15); }
.h-info.new img { animation: infoGlow 1.2s ease-in-out infinite; }
.h-info:hover img { filter: brightness(1.25); }
.h-info:active { transform: scale(.9); }
@keyframes infoGlow { 0%, 100% { filter: drop-shadow(0 0 2px #ffd36a); } 50% { filter: drop-shadow(0 0 10px #ffd36a) brightness(1.3); } }
/* essence at its cap: the number glows jade and pulses, the cap turns bright */
.h-ess.full .h-num { color: #5dffa8; text-shadow: 0 0 8px rgba(93,255,168,.9), 0 2px 0 #000; animation: pulse 1s infinite; }
.h-ess.full .h-essmax { color: #5dffa8; }
.h-ess.full img { filter: drop-shadow(0 0 6px #5dffa8); }
/* 2x speed toggle: left of the pause button */
.h-speed { position: absolute; right: 62px; top: 10px; width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; display: none; pointer-events: auto; transition: transform .12s, filter .12s; }
.h-speed.show { display: block; animation: slideUp .25s both; }
.h-speed img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(.6) brightness(.75); display: block; }
.h-speed b { position: absolute; left: 0; right: 0; bottom: -4px; text-align: center; font-size: 14px; line-height: 1; color: var(--ink-dim); }
.h-speed.on img { filter: drop-shadow(0 0 8px #5dffa8) brightness(1.15); }
.h-speed.on b { color: #5dffa8; }
.h-speed.on { animation: pulseSoft 1.6s infinite; }
.h-speed:active { transform: scale(.9); }
@keyframes pulseSoft { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
@keyframes essFlash { 0%, 60% { filter: drop-shadow(0 0 6px #f00) hue-rotate(-60deg) brightness(1.5); transform: scale(1.2); } 100% { filter: none; transform: none; } }
.h-bar { flex: 1; height: 14px; border-radius: 8px; background: #140a20; border: 2px solid #3b2456; overflow: hidden; }
.h-karma { height: 10px; }
.h-fill { height: 100%; width: 0; transition: width .15s linear; background: linear-gradient(#8dffc6, #2fbf7c); }
.h-hp .h-fill.low { background: linear-gradient(#ff8a9d, #c4203f); }
.h-karma .h-fill { background: linear-gradient(#c79bff, #7b4bb3); }
.h-karma.holy { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse .9s infinite; }
.h-karma.holy .h-fill { background: linear-gradient(#fff0b0, #e0a020); }
.h-hp { position: relative; } .h-hpt { }
.h-hpt { min-width: 40px; text-align: right; }
.h-round { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); padding: 4px 16px; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; animation: slideUp .3s both; }
.h-roundn { font-size: 20px; } .h-kind { font-size: 16px; } .h-left { font-size: 16px; color: var(--ink-dim); }
.h-kind:empty, .h-left:empty { display: none; }
.k-holy { color: var(--gold); } .k-boss, .k-duel { color: var(--blood); }
.h-toasts { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.h-toast { font-size: 16px; padding: 4px 14px; background: rgba(22,12,34,.85); border: 2px solid #7b4bb3; border-radius: 10px; animation: slideUp .25s both; transition: opacity .3s; max-width: 80vw; text-align: center; }
.h-toast.out { opacity: 0; }
.t-codex { border-color: var(--jade); } .t-quest, .t-gold { border-color: var(--gold); } .t-warn { border-color: var(--blood); }
.h-banner { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); text-align: center; opacity: 0; width: 90%; }
.h-banner.go { animation: bannerSlam 2.2s ease both; }
.h-bt { font-size: clamp(32px, 6vw, 56px); letter-spacing: 2px; } .h-bs { font-size: clamp(16px, 2.4vw, 22px); margin-top: 6px; color: var(--ink-dim); }
@keyframes bannerSlam { 0% { opacity: 0; transform: translate(-50%,-50%) scale(1.6); } 10% { opacity: 1; transform: translate(-50%,-50%) scale(.94); } 16% { transform: translate(-50%,-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.05); } }
.h-prep { position: absolute; right: 12px; top: 64px; width: 168px; padding: 6px; display: none; flex-direction: column; gap: 5px; }
.h-prep.on { display: flex; animation: slideLeft .25s ease-out both; }
@keyframes slideLeft { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.h-prev { font-size: 13px; text-align: center; line-height: 1.2; }
.h-warn { font-size: 13px; text-align: center; color: var(--gold); background: rgba(90,60,10,.5); border: 1px solid var(--gold); border-radius: 8px; padding: 2px 4px; animation: pulse 1.2s infinite; }
.h-stances { display: flex; gap: 4px; }
.btn.h-st { flex: 1; min-width: 0; padding: 2px 1px; font-size: 13px; }
.btn.h-st.active { border-color: var(--jade); background: linear-gradient(#1f6b4a, #0f3a2a); box-shadow: 0 0 8px rgba(93,255,168,.6); }
.btn.h-wide { width: 100%; font-size: 14px; } .btn.h-go { min-height: 46px; font-size: 16px; }
.h-bic { width: 22px; height: 22px; object-fit: contain; }
.h-help { font-size: 12px; text-align: center; color: var(--ink-dim); line-height: 1.2; }
/* folded info panel: the prep panel keeps only stances, workshop and start (the holy warning stays) */
#hud.panel-closed .h-prev, #hud.panel-closed .h-help { display: none; }
/* spell bar: a column on the right edge, under the prep panel (1-4 then the familiar skill 5) */
.h-spells { position: absolute; right: 12px; bottom: 14px; display: none; flex-direction: column; gap: 8px; }
.h-spells.on { display: flex; animation: spellsIn .25s both; }
@keyframes spellsIn { 0% { transform: translateX(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.btn.h-sp { position: relative; width: 60px; height: 60px; min-width: 60px; min-height: 60px; padding: 0; border: 2px solid #7b4bb3; border-image: none; border-radius: 12px; background: linear-gradient(#2d1a45, #170c25); overflow: hidden; }
.h-sp-ic { width: 76%; height: 76%; object-fit: contain; }
.btn.h-sp .h-key { position: absolute; left: 4px; top: 1px; font-size: 14px; }
.btn.h-sp .h-cost { position: absolute; right: 3px; bottom: 1px; font-size: 14px; display: flex; align-items: center; gap: 1px; }
.h-cd { position: absolute; inset: 0; border-radius: 10px; }
.h-cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.btn.h-sp.dim { filter: grayscale(.6) brightness(.7); }
.btn.h-sp.armed { border-color: var(--jade); box-shadow: 0 0 14px var(--jade), inset 0 0 10px rgba(93,255,168,.5); transform: translateY(-4px); filter: none; }
.h-hint:has(~ .h-insp.on) { bottom: 150px; }
.h-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: 16px; opacity: 0; transition: opacity .2s; padding: 3px 12px; background: rgba(22,12,34,.7); border-radius: 8px; white-space: nowrap; max-width: 92vw; }
.h-hint.on { opacity: 1; }
.h-float { position: absolute; font-size: 20px; opacity: 0; white-space: nowrap; transform: translate(-50%, 0); }
.h-float.go { animation: floatUp .8s ease-out both; }
@keyframes floatUp { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -40px); } }

/* ---------- run screens ---------- */
.rs .rs-title { font-size: clamp(22px, 4vw, 34px); text-align: center; }
.rs .gold { color: var(--gold); } .rs .blood { color: var(--blood); } .rs .bad { color: var(--blood); } .rs .dim { color: var(--ink-dim); }
.rs-panel { border-width: 18px; border-image: url("../assets/ui-panel.webp") 22% fill / 18px stretch; padding: 8px; }
.rs-ic { width: 22px; height: 22px; object-fit: contain; }
.rs-th { width: 40px; height: 40px; object-fit: contain; flex: none; } .rs-th.big { width: 110px; height: 110px; } .rs-th.mid { width: clamp(70px, 14vh, 130px); height: clamp(70px, 14vh, 130px); }
.rs-th.sil { filter: brightness(0); }
.rs-fb { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #3a2358; font-size: 20px; }
.rs-ws { background: radial-gradient(ellipse at center, rgba(10,4,16,.2), rgba(5,2,8,.88)), url("../assets/workshop-bg.webp") center / cover; }
.rs-ws-title { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.btn.rs-closeb { position: absolute; left: 76px; top: 10px; }
.rs-ws-main { position: absolute; left: 8px; right: 8px; top: 62px; bottom: 8px; display: grid; grid-template-columns: clamp(150px, 26%, 260px) 1fr clamp(150px, 23%, 240px); gap: 8px; }
.rs-left, .rs-right { display: flex; flex-direction: column; min-height: 0; }
.rs-right { align-self: end; max-height: 62%; }
.rs-sub { font-size: 16px; text-align: center; color: var(--jade); margin-bottom: 4px; }
.rs-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; touch-action: pan-y; min-height: 0; padding: 2px; }
.btn.rs-card { justify-content: flex-start; width: 100%; min-height: 48px; padding: 3px 6px; border: 2px solid #5a3a82; border-image: none; border-radius: 10px; background: rgba(30,16,46,.85); font-size: 15px; white-space: normal; text-align: left; flex: none; }
.rs-card .rs-cn { flex: 1; line-height: 1.1; } .rs-card .rs-cx { font-size: 16px; color: var(--gold); }
.rs-card.mut, .rs-slot.mut { border-color: var(--jade); box-shadow: 0 0 10px rgba(93,255,168,.6); }
.rs-card:disabled { opacity: .45; }
.rs-note { font-size: 14px; line-height: 1.25; padding: 2px 4px; border-bottom: 1px dashed rgba(185,170,201,.3); }
.rs-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.rs-cloth { position: relative; width: 100%; max-width: 420px; padding: 14px 12px; display: flex; align-items: center; gap: 4px; border-radius: 12px; background: linear-gradient(135deg, #4a3a30, #2c211c); box-shadow: inset 0 0 0 4px rgba(0,0,0,.25), 0 6px 18px rgba(0,0,0,.6); outline: 2px dashed rgba(243,234,216,.45); outline-offset: -8px; }
.btn.rs-slot { width: clamp(70px, 17vh, 110px); height: clamp(70px, 17vh, 110px); min-width: 0; min-height: 0; padding: 0; flex: none; border-radius: 50%; border: 3px dashed var(--ink-dim); border-image: none; background: radial-gradient(#1b0f28, #0a0510); }
.rs-slot.full { border-style: solid; border-color: #b9aac9; }
.rs-slot .rs-th { width: 78%; height: 78%; } .rs-plus { font-size: 34px; color: var(--ink-dim); }
.rs-line { flex: 1; height: 0; border-top: 3px dashed var(--ink-dim); position: relative; }
.rs-fill { position: absolute; left: 0; right: 0; top: -3px; height: 3px; background: var(--jade); box-shadow: 0 0 8px var(--jade); transform: scaleX(0); transform-origin: left; }
.rs-needle { display: none; position: absolute; left: 0; top: 0; width: 44px; height: 44px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 0 6px var(--jade)); z-index: 3; }
.rs-spark { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 8px var(--jade); pointer-events: none; z-index: 3; }
.rs-spark.big { width: 12px; height: 12px; position: absolute; }
.rs-prev { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 6px 12px; background: rgba(15,8,24,.8); border: 2px solid #5a3a82; border-radius: 12px; max-width: 420px; width: 100%; justify-content: center; }
.rs-pth { flex: none; } .rs-pth:empty { display: none; }
.rs-pname { font-size: 16px; text-align: center; } .rs-pstat { font-size: 14px; color: var(--ink-dim); text-align: center; }
.rs-ptx { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.btn.rs-stitch { min-width: 180px; font-size: 18px; } .rs-stitch.lack span:last-child { color: var(--blood); }
.rs-over { position: absolute; inset: 0; background: rgba(5,2,8,.6); display: flex; align-items: center; justify-content: center; animation: fadeIn .2s both; }
.rs-result { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 240px; }
.rs-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 20px); }
.rs-head { animation: slideUp .3s both; padding: 0 12px; }
.rs-cards { display: flex; gap: clamp(8px, 2vw, 24px); justify-content: center; }
.btn.rs-rcard { flex-direction: column; justify-content: flex-start; gap: 8px; white-space: normal; width: clamp(140px, 26vw, 260px); height: clamp(210px, 62vh, 380px); padding: 12px 10px; border: 3px solid #7b4bb3; border-image: none; border-radius: 14px; background: linear-gradient(#2b1744, #150a24); text-align: center; align-items: center; }
.rs-cards.two .rs-rcard { width: clamp(180px, 36vw, 340px); }
.rs-rcard.relic { border-color: var(--gold); background: linear-gradient(#3a2a10, #1a1208); }
.rs-rcard.picked { animation: flare .45s ease both !important; }
@keyframes flare { 0% { transform: scale(1); } 40% { transform: scale(1.12); filter: brightness(2) drop-shadow(0 0 24px var(--jade)); } 100% { transform: scale(1.2); opacity: 0; } }
.rs-seal { width: clamp(56px, 14vh, 96px); height: clamp(56px, 14vh, 96px); flex: none; display: flex; align-items: center; justify-content: center; font-size: 34px; border: 3px dashed #c79bff; border-radius: 50%; background: radial-gradient(#6b3aa3, #2a1244); box-shadow: 0 0 14px rgba(155,100,230,.7); }
.rs-rcard.relic .rs-seal { border: 4px solid var(--gold); border-radius: 12px; background: conic-gradient(#e0a020, #5a8fd8, #d85a7a, #e0a020); color: #fff; }
.rs-rname { font-size: 18px; line-height: 1.15; } .rs-rdesc { font-size: 14px; line-height: 1.3; color: var(--ink-dim); flex: 1; }
.rs-lv { font-size: 15px; color: var(--jade); }
/* reward / milestone choices: a slim row of cards in the top band, the zones stay visible below */
.modal-back.rs-top { justify-content: flex-start; padding-top: 50px; gap: 6px; background: linear-gradient(rgba(5,2,8,.9), rgba(5,2,8,.72) 38%, rgba(5,2,8,.08) 62%, transparent); }
.rs-top .rs-title { font-size: clamp(18px, 3vw, 24px); }
.rs-top .rs-cards { gap: 8px; padding: 0 10px; align-items: stretch; }
.rs-top .btn.rs-rcard { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; width: clamp(150px, 28vw, 270px); height: auto; min-height: 60px; padding: 6px 8px; border-width: 2px; border-radius: 12px; }
.rs-top .rs-cards.two .rs-rcard { width: clamp(180px, 34vw, 310px); }
.rs-top .rs-seal { width: 40px; height: 40px; font-size: 20px; border-width: 2px; }
.rs-top .rs-rcard.relic .rs-seal { border-width: 2px; border-radius: 9px; }
.rs-top .rs-th.mid { width: 48px; height: 48px; }
.rs-rtx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rs-top .rs-rname { font-size: 15px; } .rs-top .rs-rdesc { font-size: 13px; line-height: 1.25; flex: none; } .rs-top .rs-lv { font-size: 12px; }
.rs-dlg { width: min(420px, 90vw); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rs-hold { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.rs-have { display: flex; align-items: center; gap: 6px; font-size: 18px; } .rs-have img { width: 38px; height: 38px; object-fit: contain; }
.rs-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: stretch; }
.btn.rs-vb { flex-direction: column; gap: 0; font-size: 16px; white-space: normal; }
.rs-vl { display: inline-flex; align-items: center; gap: 6px; } .rs-vs { font-size: 14px; color: var(--blood); }
.rs-stat { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 18px; justify-content: space-between; }
.rs-sv { margin-left: auto; font-size: 20px; color: var(--gold); }
.rs-stat img { width: 26px; height: 26px; object-fit: contain; }
/* shorter windows: the column folds into two (1 2 / 3 4 / 5) so it stays under the prep panel */
@media (max-height: 700px) {
  .h-spells.on { display: grid; grid-template-columns: repeat(2, 52px); gap: 8px; }
  .btn.h-sp { width: 52px; height: 52px; min-width: 52px; min-height: 52px; }
}
/* narrow phones: the round label sits right of the HUD cluster (clear of the pause corner), toasts below the left panels */
@media (max-width: 780px) {
  .h-round { left: 298px; transform: none; padding: 3px 10px; gap: 6px; max-width: calc(100% - 298px - 172px); overflow: hidden; }
  .h-roundn { font-size: 17px; } .h-kind, .h-left { font-size: 14px; }
  .h-toasts { left: 12px; top: 70px; transform: none; align-items: flex-start; max-width: calc(100% - 230px); }
  .h-toasts .h-toast:nth-last-child(n+3) { display: none; }
}
@media (max-width: 640px) {
  .h-toasts .h-toast:nth-last-child(n+2) { display: none; }
  #app.sub-on .h-toasts { visibility: hidden; }
  /* the slimmer resource box stays left of the centred inspect bar */
  #hud .h-cluster { width: 164px; left: 8px; bottom: 8px; padding: 2px 6px; }
  #hud .h-cluster .h-ic { width: 16px; height: 16px; } #hud .h-cluster .h-ic-sm { width: 14px; height: 14px; }
  #hud .h-cluster .h-hpt { min-width: 0; }
  #hud .h-speed, #hud .h-info { width: 44px; height: 44px; } #hud .h-info { right: auto; left: 9px; top: 124px; }
  .h-toasts { left: 66px; }
  .h-cluster { width: 148px; }
  /* small phones in battle: detail tips are off here, so the info button waits for the prep phase */
  #hud.ph-battle .h-info { display: none; }
  #hud .h-round { left: 0; right: 0; margin: 0 auto; width: max-content; transform: none; padding: 3px 8px; max-width: 132px; }
  .h-roundn { font-size: 15px; } .h-left { font-size: 13px; } .h-kind { display: none; }
}
@media (max-height: 400px) { .h-help { display: none; } }
@media (max-height: 460px) {
  .h-cluster { width: 168px; } .h-ic { width: 24px; height: 24px; } .h-num { font-size: 16px; }
  .h-prep { width: 160px; padding: 5px; gap: 4px; top: 60px; }
  .btn.h-st { min-height: 44px; } .btn.h-wide { min-height: 44px; } .btn.h-go { min-height: 44px; }
  /* very short windows with a mouse: one row in the bottom-right corner, the inspect bar shifts left of it */
  .h-spells { bottom: 8px; right: 10px; }
  .h-spells.on { display: flex; flex-direction: row; gap: 6px; }
  .btn.h-sp { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  .rs-panel { border-width: 14px; border-image-width: 14px; padding: 4px; }
  .rs-ws-main { top: 56px; } .rs-card { font-size: 14px; }
  .rs-cloth { padding: 8px; }
}
