.battle-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 8px 12px;
  background: linear-gradient(#1d1710, #120e09); border: 1px solid var(--edge); border-radius: 6px; }
.battle-top h2 { font-size: 26px; margin-right: auto; }
.battle-top .clock { font-size: 18px; color: var(--gold); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.45); border: 1px solid #2c2318; border-radius: 14px; padding: 3px 10px; }
.arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.vs { align-self: center; font-family: var(--font-body); font-weight: bold; letter-spacing: .08em; font-size: 30px; color: var(--gold); text-shadow: 0 0 12px rgba(255,140,0,.6), 0 2px 0 #000; }
.fighter { position: relative; display: flex; flex-direction: column; align-items: stretch; }
.fighter .board-wrap { align-self: center; margin: auto 0; padding: 14px; }
.fighter .who + .floaters + .bar { margin-top: 0; }
.board.cropped { background-image: none; }
.fighter .who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.portrait { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none;
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge-hi), 0 0 12px color-mix(in srgb, var(--cc) 50%, transparent); }
.portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
.fighter .id { display: flex; flex-direction: column; line-height: 1.1; }
.fighter .id b { font-family: var(--font-head); font-size: 22px; font-weight: normal; text-shadow: 0 2px 0 #000; }
.fighter .id .muted { font-size: 13px; }
.bar { position: relative; height: 26px; background: linear-gradient(#2a0805, #140302); border: 1px solid #000; border-radius: 4px; overflow: hidden; margin-bottom: 4px;
  box-shadow: 0 0 0 1px #4a3b26; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#4fe05a, #1f9a2a 55%, #127a1d); transition: width .12s linear;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.bar .blk { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(45deg, rgba(170,200,255,.55) 0 6px, rgba(120,160,240,.4) 6px 12px); transition: width .12s linear; }
.bar span { position: relative; display: block; text-align: center; font-size: 14px; line-height: 26px; text-shadow: 1px 1px 0 #000, 0 0 3px #000; }
.bar.stam { height: 7px; background: #0d0b08; box-shadow: 0 0 0 1px #2c2318; }
.bar.stam .fill { background: linear-gradient(#ffd34a, #c98a00); box-shadow: none; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid #000; background: rgba(0,0,0,.6); box-shadow: 0 0 0 1px #2c2318; }
.chip.block { color: #a9c4ff; } .chip.poison { color: #7dff6b; } .chip.regen { color: #4aff9e; }
.chip.burn { color: #ff7a3a; } .chip.curse { color: #c58bff; } .chip.seal { color: #ffe9a0; } .chip.shards { color: #d58cff; } .chip.pulse, .chip.totem { color: #7fd3ff; }
.chip.empower { color: #ff9a4a; } .chip.haste { color: #ffe36b; } .chip.thorns { color: #e0a070; }
.floaters { position: absolute; left: 0; right: 0; top: 70px; height: 0; pointer-events: none; z-index: 20; }
.floater { position: absolute; left: 50%; font-size: 22px; font-family: var(--font-head); text-shadow: 2px 2px 0 #000, 0 0 6px #000;
  animation: floatup 1s ease-out forwards; white-space: nowrap; }
.floater.dmg { color: #ff5a4a; } .floater.crit { color: #ffcc33; font-size: 32px; } .floater.heal { color: #4aff6b; } .floater.miss { color: #ccc; font-size: 16px; }
@keyframes floatup { 0% { transform: translate(-50%, 0) scale(.7); opacity: 0; } 15% { transform: translate(-50%, -6px) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -56px) scale(1); opacity: 0; } }

.banner { text-align: center; margin: 18px auto 6px; padding: 14px 20px 18px; max-width: 560px; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,209,0,.12), transparent 70%); animation: pop .35s ease-out; }
.banner h1 { font-size: clamp(42px, 9vw, 72px); }
.banner p { margin: 4px 0 14px; }
.banner.win h1 { color: var(--gold); text-shadow: 0 0 24px rgba(255,170,0,.5), 0 3px 0 #000; }
.banner.loss { background: radial-gradient(ellipse at 50% 0%, rgba(224,68,58,.14), transparent 70%); }
.banner.loss h1 { color: var(--red); } .banner.draw { background: radial-gradient(ellipse at 50% 0%, rgba(214,170,80,.16), transparent 70%); }
.banner.draw h1 { color: #e6c46a; text-shadow: 0 0 20px rgba(230,196,106,.4), 0 3px 0 #000; letter-spacing: .08em; }
.banner.draw h1::before, .banner.draw h1::after { content: "="; margin: 0 .35em; opacity: .55; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.log-panel { margin-top: 14px; }
.combat-log { max-height: 190px; overflow-y: auto; font-size: 13px; line-height: 1.55; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #4a3b26 transparent; }
.combat-log .ll { padding: 1px 6px; border-radius: 3px; }
.combat-log .ll:first-child { background: rgba(255,209,0,.06); }
.combat-log .ll i { font-style: normal; color: #6f6551; display: inline-block; width: 40px; font-variant-numeric: tabular-nums; }
.combat-log .ll.a { color: #b9d8ff; } .combat-log .ll.b { color: #ffb4a8; } .combat-log .ll.sys { color: var(--gold); }
.combat-log .ll.crit { font-weight: bold; }

@media (max-width: 760px) {
  .arena { grid-template-columns: 1fr; }
  .vs { justify-self: center; font-size: 22px; }
  .fighter .board-wrap { padding: 4px; }
}

/* hero stage: the class toon stands beside its backpack; floaters pop over the hero */
.fight-body { display: flex; align-items: flex-end; gap: 10px; justify-content: center; }
.fighter:nth-child(3) .fight-body { flex-direction: row-reverse; }
.stage { position: relative; width: 120px; height: 190px; flex: none; }
.stage .floaters { top: 20px; }
.hero { position: absolute; inset: 0; transform-origin: 50% 100%; animation: idle 2.4s ease-in-out infinite; }
.hero svg { overflow: visible; }
.hero .glow { animation: glowp 1.8s ease-in-out infinite; }
@keyframes idle { 50% { transform: translateY(-3px) scaleY(1.015); } }
@keyframes glowp { 50% { opacity: .55; } }
/* attack lunge + hit knock are model3d rig nudges driven by js/ui/fx (both sides alike); fight FX styles live in css/fx.css */
.floater.dmg, .floater.crit { animation-name: popup; }
@keyframes popup { 0% { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -6px) scale(1.35); opacity: 1; }
  30% { transform: translate(-50%, -10px) scale(1); } 100% { transform: translate(-50%, -60px) scale(1); opacity: 0; } }
@media (max-width: 760px) { .stage { width: 74px; height: 118px; } }
.stage .floater { font-size: 30px; } .stage .floater.crit { font-size: 40px; }

/* battlefield layout: backpacks on top, heroes in the bottom corners, status cards between them, log in a drop-down */
.battlefield { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; min-height: 640px; padding: 12px 16px 0; border-radius: 8px; overflow: hidden;
  background:
    linear-gradient(180deg, transparent 62%, rgba(0,0,0,.3) 62.3%, transparent 63%),
    radial-gradient(ellipse at 50% 120%, #3a5a22 0 30%, transparent 31%),
    linear-gradient(180deg, #2a3446 0%, #3d4a5a 40%, #4a5a3a 62%, #2e3a1c 100%);
  box-shadow: inset 0 0 0 3px #1a0f06, inset 0 0 0 6px #5a3d22, inset 0 0 0 7px #000, inset 0 0 90px rgba(0,0,0,.6); }
.bf-top { display: flex; justify-content: center; align-items: flex-start; gap: 14px; position: relative; z-index: 5; }
.bf-ctrl { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 0 0 8px 8px; margin-top: -12px; color: #3a2410;
  background: linear-gradient(#ead6ae, #cdb282); box-shadow: inset 0 0 0 2px #8a6d3b, 0 4px 8px rgba(0,0,0,.6); }
.bf-ctrl b { font-family: var(--font-head); font-size: 18px; }
.bf-ctrl .clock { font-size: 18px; min-width: 52px; text-align: center; color: #3a2410; background: none; box-shadow: none; }
.log-btn { position: absolute; left: calc(50% + 170px); top: 0; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 10px; border: 0; cursor: pointer;
  font-size: 12px; color: #3a2410; border-radius: 4px; background: linear-gradient(#ead6ae, #cdb282); box-shadow: inset 0 0 0 2px #8a6d3b, 0 3px 6px rgba(0,0,0,.6); transform: rotate(-3deg); }
.log-btn .book { font-size: 20px; }
.log-btn.open { transform: rotate(0); box-shadow: inset 0 0 0 2px var(--gold), 0 3px 6px rgba(0,0,0,.6); }
.log-drop { position: absolute; z-index: 30; left: 50%; top: 64px; transform: translateX(-50%); width: min(560px, 92%); max-height: 320px; overflow: auto; padding: 12px;
  border-radius: 6px; background: linear-gradient(#1c1710, #120f0a); box-shadow: 0 0 0 1px var(--edge), 0 12px 30px rgba(0,0,0,.8); }
.log-drop[hidden] { display: none; }
.bf-boards { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.bf-boards .board-wrap { background: none; box-shadow: none; padding: 0; }
.bf-ground { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-bottom: 10px; }
.bf-ground .stage { width: 170px; height: 260px; }
.bf-status { display: flex; gap: 0; align-self: flex-end; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.status-card { width: 250px; padding: 0 12px 12px; color: #3a2410; background: linear-gradient(#ead6ae, #c9ad7a); box-shadow: inset 0 0 0 2px #8a6d3b; }
.status-card:first-child { border-radius: 6px 0 0 6px; } .status-card:last-child { border-radius: 0 6px 6px 0; border-left: 1px solid #8a6d3b; }
.status-name { display: flex; align-items: center; gap: 8px; margin: 0 -12px 8px; padding: 6px 12px; color: #fff; font-family: var(--font-head); font-size: 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 75%, #000), color-mix(in srgb, var(--cc) 45%, #000)); text-shadow: 0 2px 0 #000; }
.status-name img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #000; }
.status-name span { margin-left: auto; font-size: 12px; opacity: .85; font-family: inherit; }
.srow2 { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; }
.srow2 .bar { margin: 0; height: 18px; }
.srow2 .chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.srow2.buffs { background: linear-gradient(90deg, rgba(90,160,60,.25), transparent); border-radius: 3px; padding: 2px 4px; }
.srow2.debuffs { background: linear-gradient(90deg, rgba(190,50,40,.25), transparent); border-radius: 3px; padding: 2px 4px; }
.bf-result { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 20; text-align: center; }
.bf-result:empty { display: none; }
@media (max-width: 900px) {
  .battlefield { min-height: 0; padding: 10px 8px 0; }
  .bf-boards { flex-direction: column; align-items: center; }
  .bf-ground .stage { width: 70px; height: 112px; }
  .bf-status { flex: 1; min-width: 0; }
  .status-card { width: auto; flex: 1; min-width: 0; padding: 0 6px 8px; }
  .srow2 { grid-template-columns: 1fr; gap: 2px; }
  .log-btn { position: static; }
  .bf-top { flex-wrap: wrap; }
}
.srow2 .bar span { color: #fff; font-size: 12px; line-height: 18px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }   /* owner 11-06: the 26px line sat low in the 18px bar */

/* hero life: aura pulse, class particles, rays */
.hero-svg .aura { animation: aurap 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes aurap { 50% { opacity: .55; transform: scale(1.08); } }
.hero-svg .mote { transform-box: fill-box; transform-origin: center; opacity: 0; animation: rise 2.6s ease-out infinite; }
.hero-svg .mote.arcane { animation-duration: 3s; }
.hero-svg .mote.drip { animation: drip 3s ease-in infinite; }
@keyframes rise { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -150px) scale(1.2) rotate(180deg); } }
@keyframes drip { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .95; } 100% { opacity: 0; transform: translateY(110px) scaleY(1.4); } }
.hero-svg .smoke { transform-box: fill-box; transform-origin: center; animation: smoke 3.6s ease-out infinite; }
@keyframes smoke { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: .55; } 100% { opacity: 0; transform: translateY(-40px) scale(1.6); } }
.hero-svg .rays { transform-box: view-box; transform-origin: 100px 150px; animation: spin 24s linear infinite; }
.hero-svg .runes { transform-box: fill-box; transform-origin: center; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bf-ground .stage { width: 200px; height: 310px; }
@media (prefers-reduced-motion: reduce) { .hero-svg .mote, .hero-svg .smoke, .hero-svg .rays, .hero-svg .runes, .hero-svg .aura { animation: none; } }

/* WoW 3D bodies (js/ui/model3d.js): the canvas replaces the SVG once the GLB loads */
.m3d { position: absolute; inset: 0; }
.m3d > svg { width: 100%; height: 100%; }
.m3d-canvas { width: 100%; height: 100%; display: block; }
.m3d.live::before { content: ''; position: absolute; left: 18%; right: 18%; bottom: 4%; height: 7%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0)); pointer-events: none; }
.hero:has(.m3d.live), .me:has(.m3d.live), .merchant:has(.m3d.live) { animation: none; }
.me, .merchant { position: relative; }
.bf-ground .stage .hero { overflow: visible; }
.npc3d.live::before { display: none; } /* npc bodies draw their own floor shadow in WebGL */
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-10px); } 100% { transform: translateY(0); } }

/* stamina: segmented gold bar (one notch per point), numeric readout, spend pulse, empty flash */
.srow2 .bar.stam { height: 16px; overflow: visible; background: #0d0b08; box-shadow: 0 0 0 1px #2c2318; }
.bar.stam .fill { transition: width .08s linear; border-radius: 3px; }
.bar.stam .segs { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--segs) - 1px), rgba(0,0,0,.75) calc(100% / var(--segs) - 1px) calc(100% / var(--segs))); }
.srow2 .bar.stam span { position: relative; font-size: 11px; line-height: 16px; color: #fff3c4; }
.bar.stam .spend { position: absolute; right: -4px; top: -15px; font-style: normal; font-weight: bold; font-size: 12px; color: #ffd34a; text-shadow: 0 1px 0 #000, 0 0 4px #000; opacity: 0; }
.bar.stam.spent .spend { animation: stamspend .6s ease-out; }
.bar.stam.spent .fill { filter: brightness(1.5); }
@keyframes stamspend { 0% { opacity: 1; transform: translateY(4px); } 100% { opacity: 0; transform: translateY(-8px); } }
.bar.stam.low .fill { background: linear-gradient(#ff9a4a, #b54a00); }
.bar.stam.empty { animation: stamempty .5s ease-out; }
@keyframes stamempty { 0%, 60% { box-shadow: 0 0 0 2px #e0443a, 0 0 12px #e0443a; } 100% { box-shadow: 0 0 0 1px #2c2318; } }

/* weapons on the battle boards: stamina cost badge; tired = waiting for stamina */
.piece .stam-cost { position: absolute; left: 2px; bottom: 2px; z-index: 6; pointer-events: none; font-size: 10px; font-weight: bold; line-height: 13px;
  padding: 0 3px; border-radius: 3px; color: #ffe27a; background: rgba(20,14,4,.85); box-shadow: 0 0 0 1px #8a6200; }
.piece.tired .frame, .piece.tired .icon, .piece.tired .cell.fill { filter: saturate(.2) brightness(.55); }
.piece.tired .stam-cost { color: #fff; background: #a3241c; box-shadow: 0 0 0 1px #ff6a5a, 0 0 8px #e0443a; animation: tiredpulse .8s ease-in-out infinite; }
@keyframes tiredpulse { 50% { transform: scale(1.2); } }

/* combat log: the acting item's icon, hover for its tooltip */
.combat-log .log-ico { width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; border-radius: 3px; cursor: help;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--qc); }
@media (hover: hover) { .combat-log .log-ico:hover { filter: brightness(1.25); } }

/* zone backdrop: Blizzard loading-screen art under a tinted vignette so boards, heroes and status cards stay readable */
.battlefield.zoned { background:
    radial-gradient(ellipse at 50% 45%, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--zone-tint) 70%, transparent) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.6) 100%),
    var(--zone-bg) center / cover no-repeat, #1a1a1a; }
.zone-banner { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 6; padding: 1px 14px 2px; pointer-events: none;
  font: 600 12px/1.4 Georgia, 'Times New Roman', serif; letter-spacing: .12em; text-transform: uppercase; color: #f1d58a; white-space: nowrap;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.62) 20%, rgba(0,0,0,.62) 80%, transparent); text-shadow: 0 1px 2px #000; }
.battlefield.zoned { padding-top: 30px; }
