/* Safe, isolated PvP UI: dark gold + violet, no changes to other HUD elements */
#rh-duel { display:none;position:fixed;right:16px;top:112px;width:min(330px,calc(100vw - 32px));z-index:999;
  background:linear-gradient(125deg,rgba(16,10,25,.96),rgba(5,7,11,.94));border:1px solid #826043;border-radius:12px;
  box-shadow:0 12px 45px rgba(0,0,0,.7),0 0 24px rgba(108,37,176,.14);color:#ebdeff;font:13px Georgia,serif;pointer-events:auto;}
#rh-duel *{box-sizing:border-box}
#rh-duel .rh-title{background:linear-gradient(90deg,#21112b,#09070f);border-bottom:1px solid #7d593b;padding:11px 12px;
 color:#e9d093;letter-spacing:1.5px;font-weight:bold;display:flex;justify-content:space-between;align-items:center}
#rh-duel-content{padding:12px}#rh-duel-content[hidden],#rh-duel-invite[hidden],#rh-duel-hud[hidden]{display:none!important}
#rh-duel button{cursor:pointer;border-radius:7px;border:1px solid #83633a;background:#21152b;color:#e8d69e;padding:8px 10px;font:inherit}
#rh-duel button:hover,#rh-duel button:focus-visible{background:#42205d;border-color:#c59a62;outline:1px solid #9a65bf}
#rh-duel .rh-challenge{display:block;width:100%;text-align:left;margin:6px 0}
#rh-duel-status{color:#cdb9e2;margin:2px 0 10px;font-size:12px;line-height:1.4}
#rh-duel-invite{border:1px solid #9b57bb;padding:10px;border-radius:9px;background:#1c1125;margin:10px 0}
#rh-duel-invite button{margin-right:5px}
#rh-duel .rh-duel-bars{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#rh-duel .rh-fighter{border:1px solid #533d56;padding:8px;border-radius:8px;min-width:0}
#rh-duel .rh-fighter.me{border-color:#ac83cb}
#rh-duel .rh-fighter strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#e4d097;margin-bottom:9px}
#rh-duel .rh-stat{margin:5px 0}#rh-duel .rh-stat-text{font:10px Arial,sans-serif;color:#c7b4d7;margin-bottom:4px}
#rh-duel .rh-stat-bg{height:7px;background:#171017;border-radius:30px;overflow:hidden}
#rh-duel .rh-stat-fill{height:100%;transition:width .12s linear}#rh-duel .health{background:linear-gradient(90deg,#81202f,#e0576c)}
#rh-duel .stamina{background:linear-gradient(90deg,#23575b,#76cebd)}
#rh-duel .rh-rounds{font:10px Arial,sans-serif;color:#e2b98c;margin-top:8px}
#rh-duel .rh-duel-controls{font:11px Arial,sans-serif;line-height:1.5;color:#baaacb}
#rh-duel-forfeit{background:#2a121b!important;border-color:#a45557!important;width:100%}
@media(max-width:760px){#rh-duel{top:60px;width:min(260px,calc(100vw - 20px));font-size:11px}#rh-duel .rh-duel-bars{grid-template-columns:1fr}}

/* during a duel: fighting-game layout, bars across the top centre so the fighters stay visible */
#rh-duel-roster[hidden]{display:none!important}
#rh-duel.in-duel{left:50%;right:auto;top:64px;transform:translateX(-50%);width:min(620px,calc(100vw - 24px));background:linear-gradient(180deg,rgba(16,10,25,.88),rgba(5,7,11,.7))}
#rh-duel.in-duel .rh-title{padding:6px 12px;font-size:11px}
#rh-duel.in-duel #rh-duel-content{padding:8px 12px}
#rh-duel.in-duel #rh-duel-status{text-align:center;font-size:15px;color:#f0dca8;letter-spacing:1px;margin:0 0 6px}
#rh-duel.in-duel .rh-fighter{padding:6px 8px}
#rh-duel.in-duel .rh-fighter strong{margin-bottom:4px}
#rh-duel.in-duel .rh-duel-controls{text-align:center;margin:6px 0 4px;font-size:10px}
#rh-duel.in-duel #rh-duel-forfeit{width:auto;display:block;margin:0 auto;padding:4px 12px;font-size:11px}
#rh-duel.in-duel .rh-title{display:none}
#rh-duel.in-duel .rh-duel-bars{grid-template-columns:1fr 1fr!important;gap:8px}
#rh-duel.in-duel .rh-stat{margin:2px 0}#rh-duel.in-duel .rh-stat-text{font-size:9px;margin-bottom:2px}
#rh-duel.in-duel .rh-rounds{margin-top:3px}
@media(max-width:760px){#rh-duel.in-duel{top:56px}#rh-duel.in-duel .rh-duel-controls{display:none}}

/* touch fight buttons (bottom right), shown only on touch screens during your duel */
#rh-duel-touch{position:fixed;right:14px;bottom:96px;z-index:1000;display:grid;grid-template-columns:repeat(2,64px);gap:10px}
#rh-duel-touch[hidden]{display:none!important}
#rh-duel-touch button{height:64px;border-radius:50%;border:1px solid #9b7a4c;background:rgba(33,21,43,.85);color:#f0dca8;font:700 11px Georgia,serif;letter-spacing:.5px;touch-action:none;user-select:none}
#rh-duel-touch button.big{background:rgba(90,30,120,.9);border-color:#d4a865}
#rh-duel-touch button.on{background:rgba(160,120,50,.9)}

/* ================= V2 duel UI: unit frames (you left, opponent right), banner, footer ================= */
#rh-frames{position:fixed;top:96px;left:0;right:0;z-index:1001;display:grid;grid-template-columns:1fr auto 1fr;align-items:start;gap:14px;padding:0 18px;pointer-events:none;font-family:Georgia,'Times New Roman',serif}
#rh-frames[hidden]{display:none!important}
.rh-unit{--ring:#c9a35d;display:flex;align-items:center;gap:0;max-width:360px;filter:drop-shadow(0 6px 14px rgba(0,0,0,.65))}
.rh-unit.left{justify-self:start}
.rh-unit.right{justify-self:end;flex-direction:row-reverse}
.rh-portrait{position:relative;width:84px;height:84px;flex:0 0 84px;z-index:2}
.rh-portrait img{position:absolute;inset:7px;width:70px;height:70px;border-radius:50%;object-fit:cover;background:radial-gradient(circle at 50% 35%,#3a2752,#0b0710 70%)}
.rh-ring{position:absolute;inset:0;border-radius:50%;
  background:conic-gradient(from 210deg,color-mix(in srgb,var(--ring) 55%,#000),var(--ring),#fff6d8 18%,var(--ring) 30%,color-mix(in srgb,var(--ring) 45%,#000) 50%,var(--ring) 70%,#fff2c8 82%,var(--ring));
  -webkit-mask:radial-gradient(circle,transparent 34px,#000 35px);mask:radial-gradient(circle,transparent 34px,#000 35px);
  box-shadow:0 0 14px color-mix(in srgb,var(--ring) 55%,transparent),inset 0 0 6px rgba(0,0,0,.8)}
.rh-ring::after{content:'';position:absolute;inset:-5px;border-radius:50%;border:2px solid color-mix(in srgb,var(--ring) 70%,#000);opacity:.8}
.rh-state{position:absolute;left:50%;bottom:-9px;transform:translateX(-50%);font:700 9px/1 Georgia,serif;letter-spacing:1px;color:#fff;background:rgba(10,6,16,.9);border:1px solid var(--ring);padding:2px 5px;border-radius:3px;white-space:nowrap}
.rh-state:empty{display:none}
.rh-info{position:relative;width:250px;margin-left:-12px;padding:6px 10px 6px 20px;background:linear-gradient(180deg,rgba(26,16,34,.94),rgba(8,6,12,.9));border:1px solid color-mix(in srgb,var(--ring) 65%,#000);border-radius:0 8px 8px 0;box-shadow:inset 0 1px 0 rgba(255,240,200,.12)}
.rh-unit.right .rh-info{margin-left:0;margin-right:-12px;padding:6px 20px 6px 10px;border-radius:8px 0 0 8px}
.rh-plate{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:4px}
.rh-unit.right .rh-plate{flex-direction:row-reverse}
.rh-name{color:#f6e7bd;font-weight:700;font-size:14px;letter-spacing:.5px;text-shadow:0 1px 2px #000;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px}
.rh-armor{color:var(--ring);font-size:9px;letter-spacing:1.5px;text-transform:uppercase;white-space:nowrap}
.rh-bar{position:relative;height:16px;margin:3px 0;background:#0a0a0c;border:1px solid #000;box-shadow:0 0 0 1px color-mix(in srgb,var(--ring) 35%,#000);overflow:hidden;border-radius:2px}
.rh-bar.sp{height:11px}
.rh-bar .fill,.rh-bar .lag{position:absolute;left:0;top:0;bottom:0;transition:width .12s linear}
.rh-unit.right .rh-bar .fill,.rh-unit.right .rh-bar .lag{left:auto;right:0}
.rh-bar.hp .fill{background:linear-gradient(180deg,#5bf06a 0%,#1fbf33 45%,#0d7a1c 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.35)}
.rh-bar.hp .lag{background:#f3e3b0;opacity:.85;transition:none}
.rh-unit.low .rh-bar.hp .fill{background:linear-gradient(180deg,#ff8a6a,#d8281e 50%,#7a0d0d);animation:rhLow .7s ease-in-out infinite alternate}
@keyframes rhLow{from{filter:brightness(1)}to{filter:brightness(1.5)}}
.rh-bar.sp .fill{background:linear-gradient(180deg,#7fb2ff 0%,#2a6bff 50%,#163fa8 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.35)}
.rh-bar span{position:absolute;top:50%;transform:translateY(-50%);z-index:2;font:700 10px/1 Arial,sans-serif;color:#fff;text-shadow:0 1px 1px #000,0 0 3px #000}
.rh-bar.sp span{font-size:8px;letter-spacing:.5px}
.rh-bar .l{left:6px}.rh-bar .r{right:6px}
.rh-pips{display:flex;gap:4px;margin-top:3px}
.rh-unit.right .rh-pips{justify-content:flex-end}
.rh-pips i{font-style:normal;font-size:12px;color:#3c3346;text-shadow:0 1px 1px #000}
.rh-pips i.on{color:#ffd76a;text-shadow:0 0 6px #ffb52e,0 1px 1px #000}
.rh-unit.blocking .rh-portrait{filter:drop-shadow(0 0 8px #ffd27a)}
.rh-center{text-align:center;padding:6px 14px;min-width:110px;background:linear-gradient(180deg,rgba(26,16,34,.9),rgba(8,6,12,.82));border:1px solid #7a5a32;border-radius:0 0 10px 10px;margin-top:-6px;box-shadow:0 6px 14px rgba(0,0,0,.6)}
.rh-round{color:#d9b56a;font-size:10px;letter-spacing:2px}
.rh-timer{color:#f6e7bd;font-size:22px;font-weight:700;letter-spacing:1px;text-shadow:0 0 8px rgba(255,200,120,.35)}
.rh-timer.hurry{color:#ff6a5a;animation:rhLow .5s ease-in-out infinite alternate}
.rh-sub:empty{display:none}
#rh-banner{position:fixed;left:50%;top:34%;transform:translate(-50%,-50%) scale(.6);z-index:1003;pointer-events:none;opacity:0;font:900 64px/1 Georgia,serif;letter-spacing:6px;color:#f6e7bd;text-shadow:0 0 18px rgba(180,90,255,.85),0 4px 0 #2a1638,0 8px 24px #000;white-space:nowrap}
#rh-banner.show{animation:rhBanner 1.2s cubic-bezier(.2,1.4,.4,1) forwards}
#rh-banner.count{font-size:96px}
#rh-banner.fight{color:#ffe38a;text-shadow:0 0 22px #ff9a2e,0 4px 0 #4a2208,0 8px 24px #000}
#rh-banner.good,#rh-banner.victory{color:#ffe38a;text-shadow:0 0 22px #ffc040,0 4px 0 #4a3208,0 8px 24px #000}
#rh-banner.bad,#rh-banner.defeat{color:#ff8a8a;text-shadow:0 0 22px #ff2a4a,0 4px 0 #3a0810,0 8px 24px #000}
#rh-banner.sudden{color:#ff6a5a}
#rh-banner.victory,#rh-banner.defeat{font-size:84px}
@keyframes rhBanner{0%{opacity:0;transform:translate(-50%,-50%) scale(1.8)}18%{opacity:1;transform:translate(-50%,-50%) scale(1)}75%{opacity:1;transform:translate(-50%,-50%) scale(1.04)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.1)}}
#rh-duel-foot{position:fixed;left:50%;bottom:92px;transform:translateX(-50%);z-index:1001;display:flex;gap:12px;align-items:center;padding:5px 10px;background:rgba(8,6,12,.72);border:1px solid #4a3a5a;border-radius:6px;color:#bfb0d0;font:11px Georgia,serif;white-space:nowrap}
#rh-duel-foot[hidden]{display:none!important}
#rh-duel-foot b{color:#f0dca8;font-weight:700}
#rh-duel-foot button{border:1px solid #9b4a4a;background:rgba(80,20,24,.8);color:#ffd6d6;border-radius:4px;padding:3px 9px;font:11px Georgia,serif;cursor:pointer}
/* overhead bars above each fighter */
.rh-over{position:fixed;left:0;top:0;z-index:999;pointer-events:none;width:110px;transform:translate(-50%,-100%);font:700 10px/1.1 Georgia,serif;text-align:center}
.rh-over .n{color:#f6e7bd;text-shadow:0 1px 2px #000,0 0 4px #000;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rh-over .b{height:7px;background:#0a0a0c;border:1px solid #000;box-shadow:0 0 0 1px rgba(201,163,93,.55);margin-bottom:2px;position:relative;overflow:hidden}
.rh-over .b.s{height:4px}
.rh-over .b i{position:absolute;left:0;top:0;bottom:0;transition:width .12s linear}
.rh-over .b.h i{background:linear-gradient(180deg,#5bf06a,#13992a)}
.rh-over.low .b.h i{background:linear-gradient(180deg,#ff8a6a,#c0201a)}
.rh-over .b.s i{background:linear-gradient(180deg,#7fb2ff,#1f55d8)}
.rh-over.me .n{color:#c9f7a8}
@media(max-width:760px){#rh-frames{top:60px;padding:0 6px;gap:4px}.rh-portrait{width:56px;height:56px;flex-basis:56px}.rh-portrait img{inset:5px;width:46px;height:46px}.rh-ring{-webkit-mask:radial-gradient(circle,transparent 22px,#000 23px);mask:radial-gradient(circle,transparent 22px,#000 23px)}.rh-info{width:120px;padding:4px 6px 4px 14px}.rh-unit.right .rh-info{padding:4px 14px 4px 6px}.rh-armor{display:none}.rh-name{font-size:11px}.rh-bar{height:11px}.rh-center{min-width:60px;padding:4px 6px}.rh-timer{font-size:16px}#rh-duel-foot span{display:none}#rh-banner{font-size:40px}#rh-banner.count{font-size:64px}}

/* ================= V3: frames hug the round timer, everything bigger ================= */
#rh-frames{top:10px;gap:12px;grid-template-columns:1fr auto 1fr;padding:0 12px}
.rh-unit.left{justify-self:end}
.rh-unit.right{justify-self:start}
.rh-unit{max-width:none}
.rh-portrait{width:118px;height:118px;flex:0 0 118px}
.rh-portrait img{inset:9px;width:100px;height:100px}
.rh-ring{-webkit-mask:radial-gradient(circle,transparent 49px,#000 50px);mask:radial-gradient(circle,transparent 49px,#000 50px)}
.rh-ring::after{inset:-6px;border-width:3px}
.rh-state{font-size:12px;padding:3px 8px;bottom:-12px}
.rh-info{width:360px;margin-left:-18px;padding:9px 14px 10px 28px;border-width:2px}
.rh-unit.right .rh-info{margin-right:-18px;padding:9px 28px 10px 14px}
.rh-name{font-size:21px;max-width:230px}
.rh-armor{font-size:12px;letter-spacing:2px}
.rh-bar{height:26px;margin:5px 0}
.rh-bar.sp{height:16px}
.rh-bar span{font-size:14px}
.rh-bar.sp span{font-size:11px}
.rh-bar .shield{position:absolute;top:0;bottom:0;z-index:1;background:repeating-linear-gradient(135deg,rgba(220,240,255,.95) 0 6px,rgba(150,200,255,.85) 6px 12px);box-shadow:0 0 8px rgba(160,210,255,.9);transition:width .12s linear,left .12s linear,right .12s linear}
.rh-pips i{font-size:18px}
.rh-center{min-width:150px;padding:8px 18px 10px;margin-top:0;border-radius:10px;border-width:2px;align-self:center}
.rh-round{font-size:13px;letter-spacing:3px}
.rh-timer{font-size:40px}
#rh-duel-foot{font-size:14px;padding:8px 14px;bottom:96px}
#rh-duel-foot button{font-size:14px;padding:5px 12px}
.rh-over{width:150px;font-size:14px}
.rh-over .b{height:10px}.rh-over .b.s{height:5px}
.rh-over .b .sh{position:absolute;top:0;bottom:0;background:rgba(200,230,255,.95);box-shadow:0 0 6px #9fd0ff}
@media(max-width:1650px){#rh-frames{top:64px}}
@media(max-width:1100px){.rh-info{width:250px}.rh-portrait{width:90px;height:90px;flex-basis:90px}.rh-portrait img{inset:7px;width:76px;height:76px}.rh-ring{-webkit-mask:radial-gradient(circle,transparent 37px,#000 38px);mask:radial-gradient(circle,transparent 37px,#000 38px)}.rh-name{font-size:16px}.rh-timer{font-size:30px}.rh-center{min-width:110px}}
@media(max-width:760px){#rh-frames{top:60px}.rh-info{width:130px;padding:4px 6px 4px 16px}.rh-unit.right .rh-info{padding:4px 16px 4px 6px}.rh-portrait{width:58px;height:58px;flex-basis:58px}.rh-portrait img{inset:5px;width:48px;height:48px}.rh-ring{-webkit-mask:radial-gradient(circle,transparent 23px,#000 24px);mask:radial-gradient(circle,transparent 23px,#000 24px)}.rh-name{font-size:12px}.rh-bar{height:13px}.rh-bar span{font-size:9px}.rh-bar.sp{height:8px}.rh-bar.sp span{display:none}.rh-timer{font-size:20px}.rh-center{min-width:64px;padding:4px 8px}.rh-pips i{font-size:12px}}
