/* Item 4: the respawn panel (not a modal; the bag and chat stay usable while the character lies down).
   Redesign 2026-10-08: a dark kill card "คุณโดนสังหาร · จาก <ชื่อ> · ดาเมจ" with the respawn buttons sliding in after the fall. */
#respawn-panel{position:absolute;z-index:50;left:50%;bottom:max(140px,calc(16vh + env(safe-area-inset-bottom,0px)));transform:translateX(-50%);box-sizing:border-box;width:min(420px,calc(100vw - 32px));color:#f6e7cf;font:14px/1.5 'Nunito Sans','Noto Sans Thai',Tahoma,sans-serif;pointer-events:auto}
#respawn-panel[hidden]{display:none}
#respawn-panel *,#respawn-panel *::before,#respawn-panel *::after{box-sizing:border-box}
#respawn-panel :focus-visible{outline:3px solid #f0c75e;outline-offset:2px}
.respawn-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 18px 14px;border-radius:16px;text-align:center;overflow:hidden;
 background:radial-gradient(120% 70% at 50% 0,#5a1d1a 0,transparent 70%),linear-gradient(#2a1714f2,#1b1110f2);
 box-shadow:0 0 0 1px #000,0 0 0 3px #a8803e,0 0 0 4px #3b2618,0 16px 46px #000c,inset 0 0 40px #0008;animation:respawn-in .38s cubic-bezier(.2,.9,.25,1.15)}
.respawn-ribbon{display:flex;align-items:center;justify-content:center;gap:10px;width:calc(100% + 36px);margin:0 -18px 6px;padding:11px 14px 9px;
 background:linear-gradient(90deg,transparent,#8f1f1b 18%,#b52a22 50%,#8f1f1b 82%,transparent);border-bottom:1px solid #e0a95a66;box-shadow:inset 0 1px #ff8b6a55}
.respawn-mark{display:grid;place-items:center;color:#ffd892;filter:drop-shadow(0 2px 0 #3a0c0a);animation:respawn-mark .5s .1s both}
#respawn-title{margin:0;font-size:24px;font-weight:900;letter-spacing:.5px;color:#fff1d6;text-shadow:0 2px 0 #3a0c0a,0 0 18px #ff6b4f88}
.respawn-cause{margin:0;color:#e8d3b2;font-size:15px}
.respawn-cause[hidden]{display:none}
.respawn-from{color:#c9ad87}
.respawn-killer{color:#ffcf6b;font-weight:900;font-size:17px;text-shadow:0 1px 0 #000}
.respawn-level{margin-left:4px;padding:0 6px;border-radius:999px;background:#ffcf6b22;color:#ffd88a;font-size:12px;font-weight:800;vertical-align:2px}
.respawn-level:empty{display:none}
.respawn-damage{display:flex;align-items:baseline;justify-content:center;gap:8px;margin:0;color:#d6b996;font-size:13px}
.respawn-damage[hidden]{display:none}
.respawn-damage-value{color:#ff5a45;font-size:30px;font-weight:900;line-height:1.1;text-shadow:0 2px 0 #3a0c0a,0 0 14px #ff3b2a77;animation:respawn-hit .45s .15s both}
.respawn-note{margin:2px 0 0;color:#9fd39a;font-weight:800;font-size:12.5px}
.respawn-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%;margin-top:6px;opacity:0;transform:translateY(6px);transition:opacity .3s,transform .3s}
#respawn-panel.respawn-ready .respawn-actions{opacity:1;transform:none}
.respawn-actions button{flex:1 1 150px;min-height:44px;font:inherit;font-weight:900;cursor:pointer}
.respawn-primary{padding:6px 14px;border:2px solid #d8ae5f;border-radius:12px;background:linear-gradient(#468257,#2c5a3b 60%,#244c31);color:#fff6df;text-shadow:0 2px 0 #183221;box-shadow:inset 0 1px #7fb08a,0 3px 0 #183221}
.respawn-secondary{padding:6px 14px;border:1px solid #a8875a;border-radius:12px;background:#3a2a20;color:#f2dfc1}
.respawn-actions button:hover:not(:disabled){filter:brightness(1.08)}
.respawn-actions button:disabled{opacity:.6;cursor:default}
.respawn-actions button[hidden]{display:none}
.respawn-error{margin:2px 0 0;color:#ff9b86;font-size:12.5px;font-weight:700}
.respawn-error[hidden]{display:none}
@keyframes respawn-in{from{opacity:0;transform:translateY(14px) scale(.94)}to{opacity:1;transform:none}}
@keyframes respawn-mark{from{opacity:0;transform:scale(1.8) rotate(-20deg)}to{opacity:1;transform:none}}
@keyframes respawn-hit{0%{opacity:0;transform:scale(2.1)}60%{opacity:1;transform:scale(.92)}100%{transform:none}}
@media (prefers-reduced-motion:reduce){.respawn-card,.respawn-mark,.respawn-damage-value{animation:none}.respawn-actions{transition:none}}
/* Phones held upright: the chat box and the hotbar fill the lower half, so the panel sits under the top menu. */
@media (max-width:600px) and (min-height:481px){#respawn-panel{bottom:auto;top:clamp(132px,21vh,220px)}}
/* Phones in landscape: lower and smaller so the joystick and the action buttons stay free. */
@media (max-height:480px){#respawn-panel{bottom:calc(12px + env(safe-area-inset-bottom,0px));width:min(380px,calc(100vw - 2*min(190px,30vw)))}.respawn-card{padding:0 12px 10px;gap:2px}.respawn-ribbon{padding:7px 10px 6px;margin-bottom:3px}#respawn-title{font-size:18px}.respawn-mark svg{width:22px;height:22px}.respawn-killer{font-size:15px}.respawn-damage-value{font-size:22px}.respawn-actions button{min-height:38px;flex-basis:120px}}

.respawn-summary{margin-top:6px;font-size:14px;line-height:1.55;color:#e8dcc0;text-align:center}
.respawn-summary[hidden]{display:none}
