/* raid.css — raid HUD and panels */
.rhud { position: fixed; inset: 0; }
.rhud button { pointer-events: auto; }
.r-left { position: absolute; left: 76px; top: 10px; min-width: 190px; max-width: 28vw; display: flex; flex-direction: column; gap: 4px; }
.r-name { font-size: max(14px, calc(var(--u) * 1)); color: #f4e2b0; text-shadow: 2px 0 var(--outline), -2px 0 var(--outline), 0 2px var(--outline), 0 -2px var(--outline); }
.r-hpbar { position: relative; height: max(20px, calc(var(--u) * 1.5)); background: #1a1417; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--outline); overflow: hidden; }
.r-hpfill { height: 100%; width: 100%; background: linear-gradient(90deg, #b5523b, #e8dcc0); transition: width .15s; }
.r-hpfill.low { background: #c0392b; animation: pulse .6s infinite; }
.r-hptxt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: max(14px, calc(var(--u) * .95)); color: #fff; text-shadow: 2px 0 var(--outline), -2px 0 var(--outline), 0 2px var(--outline), 0 -2px var(--outline); }
.r-buffs { display: flex; flex-wrap: wrap; gap: 4px; }
.r-badge { font-size: max(12px, calc(var(--u) * .8)); padding: 1px 6px; border: 2px solid var(--line); background: rgba(20, 22, 28, .85); color: var(--ink); box-shadow: 0 2px 0 var(--outline); }
.r-badge.shield { border-color: #79a6d2; color: #bcd8f2; } .r-badge.luck, .r-badge.lucky { border-color: var(--gold); color: #ffe6a8; }
.r-badge.guard { border-color: #b5523b; color: #f2b8a8; } .r-badge.speed { border-color: var(--jade); color: #b8e4cc; } .r-badge.allin { border-color: #e06a5a; color: #ffb0a0; }

.r-top { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; width: 44vw; pointer-events: none; }
.r-timer { font-size: max(18px, calc(var(--u) * 1.8)); color: #fff; text-shadow: 3px 0 var(--outline), -3px 0 var(--outline), 0 3px var(--outline), 0 -3px var(--outline), 3px 3px 0 var(--outline); }
.r-timer.warn { color: #ff7a64; animation: pulse .7s infinite; }
.r-obj { font-size: max(14px, calc(var(--u) * .95)); color: var(--ink); text-align: center; background: rgba(14, 15, 20, .7); border: 2px solid var(--line-dark); padding: 2px 10px; }
.r-obj.open { color: #ffe6a8; border-color: var(--gold); animation: pulse 1s infinite; }
.r-boss { display: none; width: 100%; } .r-boss.on { display: block; }
.r-bossname { text-align: center; font-size: max(14px, calc(var(--u) * .9)); color: #f2b8a8; text-shadow: 2px 0 var(--outline), -2px 0 var(--outline), 0 2px var(--outline), 0 -2px var(--outline); }
.r-bossbar { height: max(12px, calc(var(--u) * .9)); background: #1a1417; border: 3px solid var(--line); box-shadow: 0 3px 0 var(--outline); }
.r-bossfill { height: 100%; width: 100%; background: #b5523b; transition: width .15s; }

.r-bagbtn { position: absolute; right: 76px; top: 10px; min-width: 76px; min-height: 52px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-family: var(--font); font-size: max(14px, calc(var(--u) * .95)); color: var(--ink); background: #3a3f4b; border: 3px solid var(--line); box-shadow: inset 0 -4px 0 rgba(0,0,0,.35), 0 4px 0 var(--outline); cursor: pointer; text-shadow: 2px 2px 0 var(--outline); flex-wrap: wrap; justify-content: center; max-width: 150px; }
.r-bagbtn:active { transform: translateY(2px); }
.bagico { position: relative; width: 20px; height: 16px; background: #b5523b; border: 2px solid #12141a; display: inline-block; margin-top: 4px; }
.bagico::before { content: ""; position: absolute; left: 3px; top: -8px; width: 8px; height: 6px; border: 2px solid #e6d3a0; border-bottom: 0; }
.r-bagv { font-size: max(12px, calc(var(--u) * .8)); }

.r-hint { position: absolute; left: 0; top: 0; opacity: 0; font-size: max(14px, calc(var(--u) * .95)); white-space: nowrap; padding: 3px 10px; background: rgba(14, 15, 20, .85); border: 2px solid var(--gold); color: #ffe6a8; pointer-events: none; transition: opacity .12s; }
.r-hint.on { opacity: 1; }

.r-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 9, 12, .5); z-index: 20; }
.r-panel { width: min(640px, 92vw); max-height: 86vh; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .5); text-align: center; position: relative; }
.r-panel h2 { margin: 0; }
.r-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.r-btns .btn { min-width: 120px; min-height: 48px; }
.r-btns .btn small { font-size: .8em; opacity: .85; }
.r-red { color: #e07a64 !important; } .r-gold { color: #ffd77a !important; }
.r-sub { font-size: max(14px, calc(var(--u) * .95)); color: var(--dim); }
.r-sub.ins img { width: 1.6em; height: 1.6em; vertical-align: middle; image-rendering: pixelated; }
.r-diebox { padding: 4px; }
.r-die { width: calc(var(--u) * 6); height: calc(var(--u) * 6); min-width: 72px; min-height: 72px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 10%; background: #efe8d6; border: 4px solid #12141a; box-shadow: inset -6px -6px 0 rgba(0,0,0,.15), 0 5px 0 var(--outline); }
.r-die span { margin: 12%; background: transparent; }
.r-die span.on { background: #2a2630; box-shadow: inset -2px -2px 0 rgba(0,0,0,.35); }
.r-die.f1 span.on { background: #b5322b; } .r-die.f6 span.on { background: #b8861c; }
.r-die.rattle { animation: dieshake .12s infinite; }
@keyframes dieshake { 0% { transform: translate(-3px, 2px) rotate(-6deg); } 50% { transform: translate(3px, -2px) rotate(6deg); } 100% { transform: translate(-2px, -3px) rotate(-4deg); } }
.r-cards { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 20px; }
.r-card { width: calc(var(--u) * 6); min-width: 84px; padding: 4px; background: #262a33; border: 2px solid var(--line-dark); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: max(12px, calc(var(--u) * .8)); animation: pop .2s; }
.r-card img.ricon { width: calc(var(--u) * 2.6); height: calc(var(--u) * 2.6); min-width: 36px; min-height: 36px; }
.r-card .nm { word-break: break-word; line-height: 1.15; }
.r-card .pr { font-size: max(12px, calc(var(--u) * .8)); }
.r-totalrow { font-size: max(14px, var(--u)); display: flex; gap: 8px; align-items: center; justify-content: center; }
.r-totalrow.big { font-size: calc(var(--u) * 1.4); color: #ffe6a8; }
.r-hintline { font-size: max(12px, calc(var(--u) * .8)); color: var(--dim); }
.r-banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: calc(var(--u) * 3); white-space: nowrap; opacity: 0; pointer-events: none; text-shadow: 3px 0 var(--outline), -3px 0 var(--outline), 0 3px var(--outline), 0 -3px var(--outline), 4px 4px 0 var(--outline); }
.r-banner.on { opacity: 1; animation: slam .35s cubic-bezier(.3,1.4,.5,1); }
.r-banner.bust { color: #ff6a55; } .r-banner.win { color: #ffd77a; top: 22%; font-size: calc(var(--u) * 2); }
.r-panel.bust { border-color: #c0392b; }
.r-panel.flash { animation: goldflash .6s; }
@keyframes goldflash { 0% { box-shadow: 0 0 0 4px #ffd77a, 0 0 40px 10px #ffd77a; } 100% { box-shadow: none; } }

.r-bagpanel { position: fixed; right: 12px; top: 74px; width: min(300px, 46vw); max-height: 70vh; overflow: hidden; z-index: 15; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.r-bagpanel h2 { font-size: max(16px, calc(var(--u) * 1.1)); margin: 0; }
.r-bagpanel h2 small { font-size: .7em; color: var(--dim); }
.r-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.r-slot { aspect-ratio: 1; min-width: 44px; min-height: 44px; background: #1c1f27; border: 3px solid var(--line-dark); padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.r-slot.empty { border-style: dashed; cursor: default; opacity: .5; }
.r-slot.sel { box-shadow: 0 0 0 2px #fff; background: #333846; }
.r-slot img { width: 100%; height: 100%; }
.r-detail { font-size: max(12px, calc(var(--u) * .8)); display: flex; flex-direction: column; gap: 2px; min-height: 3.6em; }
.r-detail .nm { font-size: max(14px, calc(var(--u) * .95)); }
.r-detail .ds { color: var(--dim); }
.r-bagpanel .r-btns .btn { min-width: 80px; min-height: 44px; }

.r-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.r-row { display: flex; align-items: center; gap: 10px; background: #262a33; border: 2px solid var(--line-dark); padding: 6px 8px; text-align: left; }
.r-row .ic { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex: none; }
.r-row .ic img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.r-row .tx { flex: 1; font-size: max(14px, calc(var(--u) * .95)); }
.r-row .sub { font-size: max(12px, calc(var(--u) * .8)); color: #e0a090; }
.r-adico { display: inline-block; padding: 6px; background: #3f6b58; border: 2px solid var(--line); font-size: 14px; }
.r-row .btn { min-width: 104px; }

.r-result { max-width: 600px; }
.r-reslist { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; width: 100%; max-height: 38vh; overflow: hidden; }
.r-res { display: flex; align-items: center; gap: 6px; background: #262a33; border: 2px solid var(--line-dark); padding: 2px 6px; font-size: max(12px, calc(var(--u) * .8)); text-align: left; min-width: 0; }
.r-res .ricon { width: 32px; height: 32px; flex: none; }
.r-res .nm { flex: 1; min-width: 0; line-height: 1.1; }
.r-res.lost { opacity: .6; filter: grayscale(.5); } .r-res.kept { border-color: var(--jade); grid-column: 1 / -1; }
.newtag { font-style: normal; background: var(--red); color: #fff; padding: 0 4px; font-size: .8em; border: 1px solid #f0d49a; }
.slamin { animation: slam .4s cubic-bezier(.3,1.4,.5,1); }
.trophy { display: inline-block; width: 14px; height: 14px; background: #ffd77a; border: 2px solid #12141a; border-radius: 0 0 6px 6px; }

@media (max-height: 460px) {
  .r-panel { padding: 8px; gap: 4px; }
  .r-die { width: 56px; height: 56px; min-width: 56px; min-height: 56px; }
  .r-reslist { max-height: 34vh; }
  .r-banner { font-size: 28px; }
  .r-left { left: 10px; top: 72px; min-width: 0; width: 120px; }
  .r-hint { font-size: 14px; padding: 1px 8px; transform: none !important; left: 0; right: 0; margin: 0 auto; width: fit-content; top: 74px; }
  .r-name { display: none; }
  .r-left { top: 70px; width: 110px; }
  .r-bagbtn .r-bagv { display: none; }
  .r-name { font-size: 12px; }
  .r-hpbar { height: 18px; }
  .r-hptxt { font-size: 12px; }
  .r-top { width: auto; max-width: 46vw; top: 6px; }
  .r-timer { font-size: 20px; }
  .r-obj { font-size: 12px; padding: 1px 6px; }
  .r-bagbtn { right: 10px; top: 62px; min-height: 44px; min-width: 64px; padding: 2px 8px; }
  .r-bagpanel { top: 62px; right: 92px; max-height: calc(100vh - 72px); }
  #subtitle { top: 84px; bottom: auto; max-width: 46%; font-size: 13px; padding: 3px 10px; }
  #toasts { top: 120px; }
}
