:root {
  --bg: #070b10;
  --panel: rgba(8, 10, 14, 0.82);
  --panel-solid: #0c1016;
  --line: #3a2a12;
  --gold: #c9a227;
  --gold-bright: #f0d060;
  --text: #f2e6c9;
  --muted: #9a8b6a;
  --hp: #2ecc40;
  --hp-low: #c0392b;
  --boss: #e67e22;
  --player-hp: #1a9c3c;
  --accent: #d4a017;
  --frame-bg: linear-gradient(180deg, rgba(20, 16, 10, 0.92), rgba(8, 8, 10, 0.88));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

#viewport {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.lobby {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: auto;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(230, 126, 34, 0.22), transparent 55%),
    radial-gradient(900px 500px at 90% 110%, rgba(40, 90, 140, 0.18), transparent 50%),
    linear-gradient(165deg, #0a1018 0%, #070b10 45%, #120e0a 100%);
}

.lobby[hidden], .hud[hidden], .screen[hidden], .ready-overlay[hidden] {
  display: none !important;
}

.screen { min-height: 100%; padding: 1.5rem 1rem 2rem; }

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.steps.compact { margin-bottom: 0.55rem; }
.step {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.step.on {
  color: var(--gold-bright);
  border-color: #5a4218;
  background: rgba(60, 40, 12, 0.45);
}

.auth-shell {
  width: min(920px, 96vw);
  margin: 4vh auto 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; margin-top: 1.5vh; }
}

.auth-brand {
  padding: 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  margin: 0 0 0.5rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e67e22;
}
.auth-brand h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: 0.03em;
  color: var(--gold-bright);
  line-height: 1.05;
}
.lead {
  margin: 1rem 0 0;
  max-width: 28ch;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #d8cdb0;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.raid-public-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
  margin-top: 1.35rem;
  max-width: 280px;
}

.raid-public-stats .rps-item {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(201, 168, 74, 0.28);
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.55);
}

.raid-public-stats strong {
  display: block;
  font: 800 1.15rem/1.1 "Segoe UI", system-ui, sans-serif;
  color: #ffe8a0;
  font-variant-numeric: tabular-nums;
}

.raid-public-stats span {
  display: block;
  margin-top: 0.2rem;
  font: 600 0.68rem/1.2 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a89878;
}

.auth-card {
  padding: 1.35rem 1.3rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.auth-card label,
.auth-card fieldset {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
}
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card select,
.create-box input,
.rooms-side select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #0d141d;
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}
.register-details {
  margin: 0 0 0.85rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--muted);
}
.register-details summary {
  cursor: pointer;
  margin-bottom: 0.55rem;
  color: var(--gold);
}
.auth-actions {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sub { color: var(--muted); margin: 0.35rem 0 1rem; font-family: "Segoe UI", system-ui, sans-serif; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
}

.role {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0.75rem 0.25rem 0 !important;
  color: var(--text) !important;
  cursor: pointer;
}

button {
  border: 1px solid #5a4218;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(180deg, #3a2a12, #1a1408);
  color: var(--gold-bright);
  cursor: pointer;
  font-weight: 700;
  font-family: "Segoe UI", system-ui, sans-serif;
  text-shadow: 0 1px 0 #000;
}

button.accent {
  background: linear-gradient(180deg, #6a4a14, #3a2808);
  border-color: var(--gold);
  color: #fff6d0;
}
button.ghost {
  background: transparent;
  border: 1px solid #4a3a1a;
  color: var(--muted);
}
button.wide { width: 100%; margin-top: 0.4rem; }
button:hover { filter: brightness(1.12); }

.error { color: #ff7b7b; min-height: 1.2em; font-size: 0.85rem; font-family: "Segoe UI", system-ui, sans-serif; }

.profile-stats, .leaderboard {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.rooms-shell {
  width: min(1100px, 96vw);
  margin: 0 auto;
}
.rooms-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.rooms-top h1 {
  margin: 0.15rem 0 0.25rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--gold-bright);
}
.rooms-profile {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--muted);
  font-size: 0.88rem;
}
.rooms-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 860px) {
  .rooms-grid { grid-template-columns: 1fr; }
}
.rooms-side,
.rooms-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.82);
  padding: 1rem;
}
.rooms-side h2,
.rooms-main h2,
.rooms-list-head h2 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  color: var(--gold);
}
.rooms-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.rooms-hint { margin: 0 0 0.75rem; }
.create-box {
  display: grid;
  gap: 0.45rem;
  margin: 0.85rem 0 1rem;
}

.lfr-loadout {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
}
.lfr-loadout .loadout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.lfr-loadout .loadout-class {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.rooms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(58vh, 520px);
  overflow: auto;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.rooms-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  margin-bottom: 0.4rem;
  border: 1px solid #3a2a12;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}
.rooms-list li.full { opacity: 0.55; }
.rooms-list li.fighting { border-color: #8a3a12; }
.rooms-list li.staging { border-color: #2a6a8a; }

.room-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.rooms-list .btn-room-join,
.rooms-list .btn-room-open {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 7.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.room-meta { min-width: 0; }
.room-meta strong {
  display: block;
  color: var(--gold-bright);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-meta span { font-size: 0.75rem; color: var(--muted); }
.room-meta .count { color: #7dff9a; font-weight: 700; }
.role-tag { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

.my-room {
  padding: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid #2a6a3a;
  border-radius: 8px;
  background: rgba(10, 30, 16, 0.55);
  font-family: "Segoe UI", system-ui, sans-serif;
}
.my-room[hidden] { display: none !important; }
.my-room h3 {
  margin: 0 0 0.35rem;
  color: #7dff9a;
  font-size: 1.05rem;
}
.my-room .members {
  margin: 0.45rem 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: #d8cdb0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.2rem 0.75rem;
}
.my-room .members li {
  padding: 0.2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.my-room .members .leader { color: #ffe066; }
.leader-pick {
  display: inline-flex !important;
  align-items: center;
  gap: 0.25rem;
  margin: 0 !important;
  font-size: 0.7rem;
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
}
.leader-hint {
  margin: 0.25rem 0 0.45rem !important;
  font-size: 0.75rem !important;
}

.nameplate {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(6, 8, 12, 0.72);
  border: 1px solid rgba(90, 66, 24, 0.65);
  font: 700 0.72rem/1.2 "Segoe UI", system-ui, sans-serif;
  color: #e8dcc0;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.nameplate.local {
  border-color: #3a8a40;
  color: #9fe07a;
}
.nameplate.leader {
  border-color: #c9a227;
}
.nameplate .np-leader {
  color: #ffe066;
  font-size: 0.85rem;
}
.nameplate .np-role {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.05rem 0.22rem;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.nameplate .np-role.tank {
  color: #8ab4ff;
  border-color: #3a5a8a;
}
.nameplate .np-role.healer {
  color: #7dff9a;
  border-color: #2a6a3a;
}
.nameplate .np-role.dps {
  color: #ffb070;
  border-color: #6a3a1a;
}
.nameplate[hidden] { display: none !important; }
.my-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.5rem;
}

.lobby-chat {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid #2a4a30;
}

.lobby-chat .chat-title {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.chat-log {
  margin: 0;
  padding: 0.35rem 0.4rem;
  list-style: none;
  overflow: auto;
  max-height: 140px;
  min-height: 72px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2a3a28;
  border-radius: 3px;
  font: 600 0.78rem/1.35 "Segoe UI", system-ui, sans-serif;
  color: #d8cdb0;
}

.chat-log li {
  padding: 0.12rem 0;
  border-bottom: 1px solid rgba(90, 66, 24, 0.2);
  word-break: break-word;
}

.chat-log li.system {
  color: #8a9a80;
  font-style: italic;
  font-weight: 500;
}

.chat-log li .chat-name {
  color: #7dff9a;
  font-weight: 700;
}

.chat-log li.mine .chat-name {
  color: #ffe066;
}

.chat-form {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid #3a4a38;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  color: #e8dcc0;
  font: 600 0.82rem/1.2 "Segoe UI", system-ui, sans-serif;
}

.chat-form input:focus {
  outline: 1px solid #5a9a60;
  border-color: #5a9a60;
}

.chat-form button {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  min-width: 2.4rem;
}

.reward-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: auto;
  background: rgba(5, 8, 14, 0.72);
}
.reward-overlay[hidden] { display: none !important; }
.reward-card {
  width: min(720px, 96vw);
  max-height: min(82vh, 640px);
  overflow: auto;
  padding: 1.2rem 1.25rem;
  border: 1px solid #5a4218;
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.98);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  text-align: center;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.reward-card h2 {
  margin: 0 0 0.35rem;
  color: var(--gold-bright);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}
.reward-wave {
  margin: 0 0 0.45rem;
  color: #7dff9a;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.reward-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 0.5rem;
  text-align: left;
}
@media (max-width: 700px) {
  .reward-choices { grid-template-columns: 1fr; }
}
.reward-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.75rem;
  border: 1px solid #5a4218;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(40, 28, 12, 0.85), rgba(12, 10, 8, 0.9));
  color: #e8dcc0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.reward-pick:hover:not(:disabled) {
  border-color: #c9a227;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.reward-pick:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.reward-pick.picking {
  border-color: #c9a227;
  outline: 2px solid rgba(201, 162, 39, 0.45);
}
.reward-pick strong {
  color: var(--gold-bright);
  font-size: 0.95rem;
}
.reward-pick span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.coins-display {
  margin: 0.25rem 0 0;
  color: #ffe066;
  font-weight: 700;
  font-size: 0.9rem;
}

.ready-overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  background: rgba(5, 8, 12, 0.52);
}
.ready-top-menu {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  max-width: min(440px, 92vw);
  pointer-events: auto;
}
.ready-top-menu button {
  padding: 0.42rem 0.72rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.ready-layout {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.85rem;
  width: min(920px, 96vw);
  max-height: min(82vh, 680px);
  pointer-events: none;
}
.ready-confirm-card {
  flex: 0 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.35rem 1.25rem 1.1rem;
  border: 1px solid #4a3820;
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(18, 12, 8, 0.97), rgba(10, 8, 6, 0.98));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 210, 120, 0.08);
  pointer-events: auto;
  font-family: "Segoe UI", system-ui, sans-serif;
  text-align: center;
}
.ready-info-panel {
  flex: 0 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.05rem;
  border: 1px solid #2a4a62;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(6, 14, 24, 0.97), rgba(4, 10, 18, 0.98));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(120, 180, 220, 0.1);
  pointer-events: auto;
  text-align: left;
  overflow: hidden;
}
.ready-info-head {
  margin: 0 0 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(90, 140, 180, 0.35);
  color: #9ec8e8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ready-info-abilities {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin-bottom: 0;
}
.ready-count-block {
  margin: 0.35rem 0 0.85rem;
  padding: 0.65rem 1.2rem;
  border: 1px solid rgba(125, 255, 154, 0.25);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
}
.ready-count-value {
  color: #7dff9a;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.ready-count-label {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ready-primary-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 0.65rem;
}
.ready-btn-wide {
  width: 100%;
  max-width: 13rem;
  padding: 0.58rem 1rem;
}
.ready-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.ready-hint {
  margin: 0.65rem 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 18rem;
}
.ready-card {
  width: min(520px, 94vw);
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 1.15rem 1.25rem;
  border: 1px solid #3a5a7a;
  border-radius: 10px;
  background: rgba(8, 14, 22, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  font-family: "Segoe UI", system-ui, sans-serif;
  text-align: center;
}
.ready-boss-name {
  margin: 0 0 0.35rem;
  color: #ffd27a;
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.25;
}
.ready-boss-blurb {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
}
.boss-ability-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 0.4rem;
  max-height: 28vh;
  overflow: auto;
}
.boss-ability-list li {
  padding: 0.4rem 0.5rem;
  border: 1px solid #2a3a4a;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
}
.boss-ability-list .ab-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.15rem;
}
.boss-ability-list .ab-name {
  color: #e8d5a3;
  font-weight: 700;
  font-size: 0.82rem;
}
.boss-ability-list .ab-dmg {
  color: #ff8a6a;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
}
.boss-ability-list .ab-desc,
.boss-ability-list .ab-tactic {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.boss-ability-list .ab-tactic {
  color: #8ec8a0;
  margin-top: 0.12rem;
}
.boss-ability-list.compact {
  max-height: 18vh;
}
.boss-ability-list.compact li {
  padding: 0.28rem 0.4rem;
}
.boss-guide {
  margin-top: 0.35rem;
  text-align: left;
  border-top: 1px solid #3a2a12;
  padding-top: 0.3rem;
  font-size: 0.72rem;
}
.boss-guide summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 700;
  list-style: none;
}
.boss-guide summary::-webkit-details-marker { display: none; }
.boss-guide-blurb {
  margin: 0.3rem 0 0.35rem;
  color: var(--muted);
  line-height: 1.35;
}
.ready-card h2,
.ready-confirm-card h2 {
  margin: 0 0 0.35rem;
  color: var(--gold-bright);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 1.15rem;
}
.ready-summary {
  margin: 0 0 0.55rem;
  color: #7dff9a;
  font-weight: 700;
}
.ready-members {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  width: 100%;
  max-height: 140px;
  overflow: auto;
  font-size: 0.82rem;
}
.ready-members li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.32rem 0.45rem;
  border-bottom: 1px solid rgba(58, 42, 18, 0.45);
  text-align: left;
  border-radius: 4px;
}
.ready-members li:nth-child(odd) {
  background: rgba(0, 0, 0, 0.18);
}
.ready-members .ok { color: #7dff9a; font-weight: 600; }
.ready-members .wait { color: #c9a227; }
.ready-fight-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 4.5rem;
}
.ready-fight-btn {
  min-width: 11.5rem;
  width: 100%;
  max-width: 13rem;
  padding: 0.68rem 1rem 0.55rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  line-height: 1.1;
}
.ready-fight-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.ready-fight-label {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ready-fight-kbd {
  font-size: 0.68rem;
  opacity: 0.78;
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ready-fight-status {
  margin: 0;
  min-height: 1.15rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.ready-actions button:disabled,
.ready-secondary-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}

@media (max-width: 720px) {
  .ready-layout {
    flex-direction: column;
    max-height: min(90vh, 780px);
    overflow: auto;
    pointer-events: auto;
  }
  .ready-confirm-card,
  .ready-info-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }
  .ready-info-abilities {
    max-height: 28vh;
  }
}

.profile-stats h2, .leaderboard h2 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--gold);
}

.profile-stats p, .leaderboard li, #recent-kills li {
  font-size: 0.82rem;
  color: #c5d0db;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#recent-kills, #leaderboard {
  margin: 0;
  padding-left: 1.1rem;
}

/* ——— WoW HUD ——— */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.raid-top-menu {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  max-width: min(440px, 50vw);
  pointer-events: auto;
}

.raid-top-menu button {
  padding: 0.42rem 0.72rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.hud button,
.hud .skill,
.hud .panel-actions,
.hud .raid-top-menu,
.hud .combat-feed,
.hud .chat-form,
.hud .vuhdo {
  pointer-events: auto;
}

.unit-frames {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: min(280px, 42vw);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.raid-hud-left {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: min(420px, 56vw);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
  z-index: 3;
}

.boss-anchor {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 52vw);
  z-index: 3;
  pointer-events: none;
}

.raid-frames-wrap {
  padding: 0.15rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.raid-frames-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  font: 700 0.68rem/1 "Segoe UI", system-ui, sans-serif;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.raid-ornament {
  width: 48px;
  height: 10px;
  opacity: 0.85;
}

.raid-frames {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
  align-items: flex-start;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.1rem;
}

.raid-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
  flex: 0 0 auto;
}

.raid-group-label {
  font-size: 0.55rem;
  color: #8a7a50;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.raid-cell {
  position: relative;
  width: 88px;
  height: 40px;
  padding: 1px 3px 2px;
  background: rgba(20, 24, 18, 0.28);
  border: 1px solid rgba(90, 110, 70, 0.45);
  border-radius: 2px;
  overflow: hidden;
}

.raid-cell.tank { border-color: #3a5a8a; }
.raid-cell.healer { border-color: #2a6a3a; }
.raid-cell.dps { border-color: #6a3a1a; }
.raid-cell.local { box-shadow: inset 0 0 0 1px #7dff9a; }
.raid-cell.has-aggro { border-color: #ff5533; box-shadow: inset 0 0 8px rgba(255, 60, 30, 0.35); }
.raid-cell.dead { opacity: 0.4; filter: grayscale(0.6); }
.raid-cell.dead .raid-hp-fill { width: 0 !important; }

.raid-cell-top {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.raid-role-icon {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
}

.raid-role-tag {
  flex: 0 0 auto;
  font: 800 0.48rem/1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.raid-role-tag.tank { color: #8ab4ff; }
.raid-role-tag.healer { color: #7dff9a; }
.raid-role-tag.dps { color: #ffb070; }

.raid-cell-name {
  flex: 1;
  min-width: 0;
  font: 700 0.55rem/1 "Segoe UI", system-ui, sans-serif;
  color: #e8dcc0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.raid-cell-name.tank { color: #8ab4ff; }
.raid-cell-name.healer { color: #7dff9a; }
.raid-cell-name.dps { color: #ffb070; }

.raid-aggro-icon {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
}

.raid-hp {
  position: relative;
  height: 11px;
  margin-top: 1px;
  background: #0a0c10;
  border: 1px solid #1a1810;
  overflow: hidden;
}

.raid-hp-fill {
  height: 100%;
  background: linear-gradient(180deg, #4adf60, #1a9c3c 55%, #0d5a20);
}

.raid-hp-fill.low {
  background: linear-gradient(180deg, #ff6a4a, #c0392b 55%, #6a1808);
}

.raid-hp-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 0.5rem/1 "Segoe UI", system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 1px 1px #000;
}

.raid-hp-nums {
  margin-top: 1px;
  font: 700 0.48rem/1.1 "Segoe UI", system-ui, sans-serif;
  color: #e8dcc0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
}

.raid-hp-nums .raid-hp-max {
  color: #8a7a50;
  font-weight: 600;
}

.unit-frame {
  padding: 0.45rem 0.55rem 0.5rem;
  background: var(--frame-bg);
  border: 2px solid #5a4218;
  box-shadow:
    0 0 0 1px #1a1004,
    inset 0 0 18px rgba(0, 0, 0, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.45);
  border-radius: 3px;
}

.boss-frame { border-color: #8a3a12; }
.player-frame { border-color: #2a5a28; }

.frame-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.unit-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-frame .unit-name { color: #9fe07a; }

.unit-level {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  flex-shrink: 0;
}

.frame-sub {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.hp-bar {
  position: relative;
  height: 16px;
  background: #0a0c10;
  border: 1px solid #2a2210;
  border-radius: 2px;
  overflow: hidden;
}

.hp-bar.boss { border-color: #6a3010; }
.hp-bar.player { border-color: #1a4a20; }

.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #f0a040, var(--boss) 45%, #8a3a08);
  transition: width 0.2s linear;
}

.hp-bar.player .hp-fill {
  background: linear-gradient(180deg, #4adf60, var(--player-hp) 50%, #0d5a20);
}

.hp-bar.player .hp-fill.low,
.member .fill.low {
  background: linear-gradient(180deg, #ff6a4a, var(--hp-low) 50%, #6a1808);
}

.hp-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 0.72rem/1 "Segoe UI", system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
  pointer-events: none;
}

.shield-chip {
  margin-top: 0.3rem;
  font: 700 0.72rem/1 "Segoe UI", system-ui, sans-serif;
  color: #7ec8ff;
  text-shadow: 0 1px 2px #000;
}

.shield-chip[hidden] { display: none !important; }

.diff-chip {
  margin-top: 0.35rem;
  font: 700 0.68rem/1.2 "Segoe UI", system-ui, sans-serif;
  color: #c8d6e5;
  text-shadow: 0 1px 2px #000;
  letter-spacing: 0.02em;
}
.diff-chip[data-mood="mercy"] { color: #7dffb2; }
.diff-chip[data-mood="ease"] { color: #a8e6cf; }
.diff-chip[data-mood="calm"] { color: #c8d6e5; }
.diff-chip[data-mood="steady"] { color: #ffd28a; }
.diff-chip[data-mood="push"] { color: #ff8a7a; }
.diff-chip[hidden] { display: none !important; }

.party-frames {
  padding: 0.4rem 0.45rem 0.5rem;
  background: var(--frame-bg);
  border: 1px solid #3a2a12;
  border-radius: 3px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

/* Тайминги босса — справа по центру */
.boss-timings {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: min(260px, 38vw);
  z-index: 4;
  pointer-events: none;
  padding: 0.35rem 0.45rem 0.4rem;
  background: rgba(8, 8, 12, 0.82);
  border: 1px solid #4a3420;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.boss-timings[hidden] {
  display: none !important;
}

.bt-head {
  color: #c9a84a;
  font: 700 0.68rem/1 "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.28rem;
  opacity: 0.95;
}

.bt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.bt-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: start;
  font: 600 0.72rem/1.15 "Segoe UI", system-ui, sans-serif;
  color: #d8d0c4;
}

.bt-list .bt-main {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.bt-list .bt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-list .bt-action {
  font: 650 0.62rem/1.2 "Segoe UI", system-ui, sans-serif;
  color: #ffcc88;
  letter-spacing: 0.01em;
}

.bt-list li.urgent .bt-action {
  color: #ffdd99;
}

.bt-list .bt-in {
  font-variant-numeric: tabular-nums;
  color: #a89878;
  white-space: nowrap;
}

.bt-list li.active {
  color: #ffe8a0;
}

.bt-list li.active .bt-name {
  color: #ffcc66;
}

.bt-list li.active .bt-in {
  color: #ff8844;
  font-weight: 800;
}

.bt-list li.urgent .bt-in {
  color: #ff4422;
  animation: btBlink 0.45s ease-in-out infinite alternate;
}

.bt-list li.ready .bt-in {
  color: #88cc66;
}

@keyframes btBlink {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* VuhDo — узкая компактная панель; ширину и высоту тянут за угол */
.vuhdo {
  position: absolute;
  right: 1rem;
  bottom: 9.75rem;
  top: auto;
  left: auto;
  width: min(96px, 14vw);
  height: min(240px, 42vh);
  max-height: none;
  min-width: 72px;
  min-height: 100px;
  overflow: auto;
  padding: 0.25rem;
  padding-bottom: 0.45rem;
  background: var(--frame-bg);
  border: 2px solid #2a6a3a;
  border-radius: 3px;
  box-shadow: 0 0 0 1px #0a1810, 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  z-index: 3;
  font-family: "Segoe UI", system-ui, sans-serif;
  touch-action: none;
  resize: none;
  box-sizing: border-box;
}

.vuhdo.expanded {
  width: min(280px, 42vw);
  height: min(420px, 65vh);
}

.vuhdo.dragging {
  opacity: 0.92;
  box-shadow: 0 0 0 1px #3a8a4a, 0 8px 28px rgba(0, 0, 0, 0.55);
  user-select: none;
}

.vuhdo[hidden] { display: none !important; }

.vuhdo-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -0.25rem -0.25rem 0.2rem;
  padding: 0.22rem 0.28rem;
  font-size: 0.58rem;
  color: #7dff9a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: grab;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid #2a4a30;
  gap: 0.2rem;
}

.vuhdo-title-left {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.vuhdo-expand {
  border: 1px solid #2a6a3a;
  background: rgba(0, 40, 20, 0.55);
  color: #9dffb0;
  font-size: 0.55rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  border-radius: 2px;
  cursor: pointer;
}

.vuhdo-expand:hover {
  border-color: #66ff88;
  color: #fff;
}

.vuhdo-title:active {
  cursor: grabbing;
}

.vuhdo-charges {
  color: #ffdd66;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.55rem;
}

.vuhdo-grid {
  display: flex;
  flex-direction: row;
  gap: 0.15rem;
  align-items: flex-start;
}

.vuhdo-group {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1 1 0;
  min-width: 0;
}

.vuhdo-group-label {
  display: none;
}

.vuhdo-cell {
  position: relative;
  padding: 0.1rem 0.15rem 0.12rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #2a3a28;
  border-radius: 1px;
  cursor: pointer;
  min-height: 0;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
  text-align: left;
  width: 100%;
}

.vuhdo-cell:hover {
  border-color: #66ff88;
  background: rgba(20, 50, 28, 0.75);
}

.vuhdo-cell.selected {
  border-color: #ffe066;
  box-shadow: 0 0 0 1px #ffe066;
}

.vuhdo-cell.has-aggro {
  border-color: #ff6644;
}

.vuhdo-cell.dead {
  opacity: 0.35;
  cursor: not-allowed;
}

.vuhdo-cell .vn {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.52rem;
  color: #d8cdb0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.05rem;
  line-height: 1.1;
  min-width: 0;
}

.vuhdo-cell .vn .role {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0 0.12rem;
  border-radius: 1px;
  line-height: 1.2;
}

.vuhdo-cell .vn .role.tank {
  color: #8ab4ff;
  background: rgba(40, 70, 120, 0.45);
}

.vuhdo-cell .vn .role.healer {
  color: #7dff9a;
  background: rgba(30, 90, 50, 0.45);
}

.vuhdo-cell .vn .role.dps {
  color: #ffb070;
  background: rgba(100, 50, 20, 0.45);
}

.vuhdo-cell .vn .nm {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vuhdo-cell .vbar {
  position: relative;
  height: 7px;
  background: #0a0c10;
  border: 1px solid #1a2818;
  overflow: hidden;
}

.vuhdo-cell .vfill {
  height: 100%;
  background: linear-gradient(180deg, #4adf60, #1a9c3c 50%, #0d5a20);
}

.vuhdo-cell .vfill.low {
  background: linear-gradient(180deg, #ff6a4a, #c0392b 50%, #6a1808);
}

.vuhdo-cell .vhp,
.vuhdo-cell .tbar,
.vuhdo-cell .tlabel {
  display: none !important;
}

.vuhdo-target {
  display: none !important;
}

.vuhdo-resize {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 50%, #3a7a4a 50%, #3a7a4a 62%, transparent 62%),
    linear-gradient(135deg, transparent 70%, #3a7a4a 70%, #3a7a4a 82%, transparent 82%);
  opacity: 0.75;
  z-index: 2;
}

.vuhdo-resize-h {
  position: absolute;
  left: 8px;
  right: 14px;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
  opacity: 0.35;
  z-index: 1;
}

.vuhdo-resize-h:hover {
  background: linear-gradient(180deg, transparent, rgba(61, 160, 90, 0.45));
  opacity: 1;
}

.vuhdo-resize-w {
  position: absolute;
  top: 22px;
  right: 0;
  bottom: 14px;
  width: 8px;
  cursor: ew-resize;
  opacity: 0.35;
  z-index: 1;
}

.vuhdo-resize-w:hover {
  background: linear-gradient(90deg, transparent, rgba(61, 160, 90, 0.45));
  opacity: 1;
}

.party-title {
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.party { display: flex; flex-direction: column; gap: 0.3rem; }

.member {
  padding: 0.2rem 0.3rem 0.3rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2a2210;
  border-radius: 2px;
}

.member.hero { border-color: #3a6a30; }
.member.dead { opacity: 0.45; }
.member.has-aggro {
  border-color: #ff6644;
  box-shadow: inset 0 0 8px rgba(255, 80, 40, 0.2);
}

.member .label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #d8cdb0;
}

.member.hero .label span:first-child { color: #9fe07a; }
.role-tag { color: var(--muted); font-size: 0.65rem; }

.member .bar {
  height: 10px;
  background: #0a0c10;
  border: 1px solid #1a1810;
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.member .threat-bar {
  height: 4px;
  margin-top: 2px;
  background: #0a0c10;
  border: 1px solid #281818;
  overflow: hidden;
}

.member .threat-fill {
  height: 100%;
  background: linear-gradient(90deg, #c45a20, #ff8844);
}

.member .threat-label {
  font-size: 0.58rem;
  color: #ffaa66;
  margin-top: 1px;
}

.member .fill {
  height: 100%;
  background: linear-gradient(180deg, #4adf60, #1a9c3c 50%, #0d5a20);
  transition: width 0.2s linear;
}

.member .npc-hp-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 0.58rem/1 "Segoe UI", system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 1px 1px #000;
}

/* Raid warnings — center top */
.raid-warnings {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 80vw);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  pointer-events: none;
  z-index: 3;
}

.raid-warning {
  margin: 0;
  width: 100%;
  padding: 0.55rem 0.9rem;
  text-align: center;
  font: 800 1.05rem/1.2 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.06em;
  color: #fff8e0;
  background: linear-gradient(90deg, transparent, rgba(180, 40, 10, 0.85), transparent);
  border-top: 2px solid #ffcc44;
  border-bottom: 2px solid #ffcc44;
  text-shadow: 0 2px 4px #000, 0 0 12px #ff4400;
  animation: warnPulse 0.35s ease-in-out infinite alternate;
}

.raid-warning.wave {
  background: linear-gradient(90deg, transparent, rgba(160, 20, 20, 0.9), transparent);
  border-color: #ff8844;
}

.raid-warning.mech-cleave {
  background: linear-gradient(90deg, transparent, rgba(200, 60, 0, 0.92), transparent);
  border-color: #ffcc44;
  text-shadow: 0 2px 4px #000, 0 0 16px #ff6600;
}
.raid-warning.mech-sector {
  background: linear-gradient(90deg, transparent, rgba(10, 90, 40, 0.9), transparent);
  border-color: #66ff99;
  color: #e8ffe8;
  text-shadow: 0 2px 4px #000, 0 0 14px #33ff88;
}
.raid-warning.mech-pull {
  background: linear-gradient(90deg, transparent, rgba(20, 80, 160, 0.92), transparent);
  border-color: #66ccff;
  color: #e8f6ff;
  text-shadow: 0 2px 4px #000, 0 0 14px #44aaff;
}
.raid-warning.mech-beam {
  background: linear-gradient(90deg, transparent, rgba(90, 20, 140, 0.92), transparent);
  border-color: #cc88ff;
  color: #f8e8ff;
  text-shadow: 0 2px 4px #000, 0 0 14px #aa66ff;
}
.raid-warning.mech-slow {
  background: linear-gradient(90deg, transparent, rgba(60, 20, 90, 0.9), transparent);
  border-color: #9966cc;
}

.raid-warning[hidden] { display: none !important; }

.death-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(40, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 75%);
}

.death-overlay[hidden] {
  display: none !important;
}

.death-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
  max-width: min(90vw, 520px);
  padding: 0 1rem;
}

.death-overlay-text {
  font: 900 clamp(2.8rem, 9vw, 5.5rem)/1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff2a2a;
  text-shadow:
    0 0 24px rgba(255, 40, 40, 0.7),
    0 4px 0 #4a0000,
    0 8px 28px rgba(0, 0, 0, 0.85);
  animation: deathPulse 1.4s ease-in-out infinite;
}

.death-overlay-detail {
  font: 650 clamp(0.95rem, 2.4vw, 1.25rem)/1.35 "Segoe UI", system-ui, sans-serif;
  color: #f0d8c8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.02em;
}

.death-overlay-detail:empty {
  display: none;
}

@keyframes deathPulse {
  0%, 100% { opacity: 0.88; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.mech-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.35) 100%);
}
.mech-vignette[data-mech="cleave"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(180, 40, 0, 0.45) 100%);
  animation: vigPulse 0.4s ease-in-out infinite alternate;
}
.mech-vignette[data-mech="sector"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 80, 30, 0.4) 100%);
}
.mech-vignette[data-mech="pull"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, rgba(40, 120, 200, 0.12) 20%, rgba(10, 40, 90, 0.5) 100%);
  animation: vigPulse 0.35s ease-in-out infinite alternate;
}
.mech-vignette[data-mech="beam"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(80, 20, 120, 0.48) 100%);
}
.mech-vignette[data-mech="wave"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(160, 30, 0, 0.5) 100%);
  animation: vigPulse 0.3s ease-in-out infinite alternate;
}
.mech-vignette[data-mech="slow"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(50, 10, 80, 0.4) 100%);
}
.mech-vignette[hidden] { display: none !important; }

@keyframes vigPulse {
  from { filter: brightness(0.95); }
  to { filter: brightness(1.15); }
}

@keyframes warnPulse {
  from { opacity: 0.88; letter-spacing: 0.05em; }
  to { opacity: 1; letter-spacing: 0.08em; }
}

/* Bottom action panel */
.action-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 420px) minmax(160px, 1fr);
  gap: 0.75rem;
  align-items: end;
  padding: 0.65rem 0.85rem 0.85rem;
  background:
    linear-gradient(180deg, transparent 0%, rgba(6, 6, 8, 0.55) 28%, rgba(8, 8, 12, 0.92) 100%);
  border-top: 2px solid #5a4218;
  box-shadow: inset 0 1px 0 #2a1e0a;
  pointer-events: none;
}

.action-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  pointer-events: none;
}

.action-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 0;
  pointer-events: none;
}

.recount {
  pointer-events: auto;
  width: min(240px, 100%);
  padding: 0.2rem 0.28rem 0.28rem;
  background: rgba(8, 8, 12, 0.88);
  border: 1px solid #3a2a12;
  border-radius: 2px;
  max-height: 160px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.recount-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.12rem;
  color: #c9a84a;
  font: 700 0.62rem/1 "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.recount-meta {
  color: #8a8070;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.58rem;
}
.recount-modes {
  display: flex;
  gap: 0.12rem;
  margin-bottom: 0.18rem;
}
.rc-mode {
  flex: 1;
  padding: 0.14rem 0.12rem;
  border: 1px solid #2a2418;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.35);
  color: #7a7060;
  font: 700 0.52rem/1.1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
}
.rc-mode.on {
  color: #f0d080;
  border-color: #5a4218;
  background: rgba(40, 28, 8, 0.7);
}
.rc-mode:hover {
  color: #d8c9a0;
}
.recount-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: grid;
  gap: 0.1rem;
}
.recount-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.06rem 0.25rem;
  align-items: center;
  font: 600 0.58rem/1.15 "Segoe UI", system-ui, sans-serif;
}
.recount-list .rc-name {
  color: #c8b890;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recount-list .rc-name.mine {
  color: #ffe08a;
}
.recount-list .rc-nums {
  color: #e09070;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.55rem;
}
.recount-list .rc-bar {
  grid-column: 1 / -1;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0;
  overflow: hidden;
}
.recount-list .rc-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7a3010, #d06028);
}
.recount[data-mode="taken"] .rc-bar > i {
  background: linear-gradient(90deg, #6a1010, #d04040);
}
.recount[data-mode="healing"] .rc-bar > i {
  background: linear-gradient(90deg, #145030, #3ecf7a);
}
.recount[data-mode="absorb"] .rc-bar > i {
  background: linear-gradient(90deg, #2a3a6a, #6a90e0);
}
.recount-list li.role-healer .rc-bar > i { /* keep mode color */ }
.recount-list li.role-tank .rc-bar > i { }

.combat-feed {
  pointer-events: auto;
  max-height: 220px;
  padding: 0.35rem 0.45rem 0.45rem;
  background: rgba(6, 6, 10, 0.75);
  border: 1px solid #3a2a12;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.feed-tabs {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.3rem;
}

.feed-tab {
  flex: 1;
  padding: 0.28rem 0.4rem;
  border: 1px solid #3a2a12;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font: 700 0.68rem/1 "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.feed-tab.on {
  color: var(--gold);
  border-color: #5a4218;
  background: rgba(40, 28, 8, 0.65);
}

.feed-tab.feed-debug {
  flex: 0 0 auto;
  min-width: 2.6rem;
  color: #9ec8ff;
  border-color: #2a4060;
  letter-spacing: 0.04em;
}

.feed-tab.feed-debug:hover {
  color: #d0e8ff;
  border-color: #4a70a0;
  background: rgba(20, 36, 60, 0.7);
}

.debug-toast {
  position: fixed;
  left: 50%;
  bottom: 7.5rem;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 28rem);
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  border: 1px solid #3a5070;
  background: rgba(8, 14, 24, 0.92);
  color: #c8dcff;
  font: 600 0.78rem/1.35 "Segoe UI", system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.feed-tab.has-new::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: #ff6644;
  vertical-align: middle;
}

.feed-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.feed-pane[hidden] {
  display: none !important;
}

.feed-pane[data-pane="chat"] .chat-log {
  max-height: 100px;
  min-height: 64px;
}

.feed-title {
  font-size: 0.68rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.combat-log {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  max-height: 130px;
  font: 600 0.72rem/1.35 "Segoe UI", system-ui, sans-serif;
  color: #d8cdb0;
}

.combat-log li {
  padding: 0.05rem 0;
  border-bottom: 1px solid rgba(90, 66, 24, 0.25);
}

.combat-log li.dmg { color: #ffb070; }
.combat-log li.heal { color: #6adf7a; }
.combat-log li.warn { color: #ffdd66; }

.float-dmg {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  width: min(360px, 70vw);
  height: 140px;
  pointer-events: none;
  z-index: 4;
}

.float-dmg .fnum {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font: 800 1.35rem/1 "Segoe UI", system-ui, sans-serif;
  color: #ffdd66;
  text-shadow: 0 2px 3px #000, 0 0 8px #aa4400;
  animation: floatUp 1.1s ease-out forwards;
  white-space: nowrap;
}

.float-dmg .fnum.deal {
  color: #ffe066;
}

.float-dmg .fnum.taken {
  color: #ff6655;
  font-size: 1.5rem;
}

.float-dmg .fnum.heal {
  color: #66ff88;
}

/* Урон над моделью (босс / герой) */
.world-float {
  position: fixed;
  z-index: 45;
  pointer-events: none;
  font: 800 1.55rem/1 "Segoe UI", system-ui, sans-serif;
  color: #ffe066;
  text-shadow: 0 2px 4px #000, 0 0 10px rgba(255, 160, 0, 0.7);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.world-float.deal {
  color: #ffe066;
  font-size: 1.7rem;
}

.world-float.taken {
  color: #ff6655;
  font-size: 1.6rem;
}

.world-float.heal {
  color: #66ff88;
}

.world-float.shieldbreak {
  color: #9ad8ff;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px #000, 0 0 14px #48b0ff;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateX(calc(-50% + var(--jx, 0px))) translateY(-70px) scale(0.9); }
}

.spectator-banner {
  position: absolute;
  top: auto;
  bottom: 7.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 1rem;
  pointer-events: none;
  text-align: center;
  background: linear-gradient(180deg, rgba(18, 28, 42, 0.92), rgba(8, 12, 18, 0.88));
  border: 1px solid #3a5a78;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  color: #c8d8ea;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.spectator-banner[hidden] {
  display: none !important;
}

.spectator-banner strong {
  font-size: 0.92rem;
  color: #8ec8ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spectator-banner span {
  opacity: 0.85;
  max-width: 28rem;
}

.hud.spectator-mode .skill-bar,
.hud.spectator-mode #vuhdo,
.hud.spectator-mode .player-frame {
  opacity: 0.35;
  pointer-events: none;
}

.action-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: auto;
}

.skill-bar {
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  background: linear-gradient(180deg, #1a140c, #0a0806);
  border: 2px solid #5a4218;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 0 0 1px #1a1004;
}

.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 64px;
  height: 64px;
  padding: 0.25rem;
  font-size: 0.7rem;
  border: 2px solid #6a5218;
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 220, 120, 0.15), transparent 55%),
    linear-gradient(180deg, #2a1e0c, #120c06);
  color: var(--gold-bright);
}

.skill kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.1rem;
  border-radius: 2px;
  border: 1px solid #5a4a20;
  background: #0d0a06;
  font: 700 0.68rem/1 "Segoe UI", system-ui, sans-serif;
  color: #fff;
}

.skill:hover { border-color: var(--gold-bright); filter: brightness(1.1); }

.skill.on-cd {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.skill .cd {
  position: absolute;
  font-style: normal;
  font: 800 0.85rem/1 "Segoe UI", system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}

.skill .cd.charges {
  top: 4px;
  right: 6px;
  color: #ffe066;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  padding: 0.1rem 0.25rem;
  font-size: 0.75rem;
}

.skill {
  position: relative;
}

.cast-bar {
  width: min(320px, 80vw);
  padding: 0.25rem 0.4rem 0.35rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #5a4218;
  border-radius: 3px;
}

.cast-bar .bar {
  height: 12px;
  background: #0a0c10;
  border: 1px solid #2a2210;
  border-radius: 2px;
  overflow: hidden;
}

.cast-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #6a3a9a, #c070ff);
  transition: none;
}

#cast-label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  color: #e0c0ff;
  text-align: center;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.cast-bar[hidden] { display: none !important; }

.panel-actions {
  display: flex;
  gap: 0.4rem;
}

.loadout-panel {
  pointer-events: auto;
  width: min(320px, 86vw);
  margin: 0.15rem 0 0.35rem;
  padding: 0.45rem 0.55rem;
  background: rgba(8, 8, 12, 0.85);
  border: 1px solid #5a4218;
  border-radius: 4px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.loadout-panel[hidden] { display: none !important; }

.loadout-title {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.loadout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.4rem;
}

.loadout-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
}

.loadout-class {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.loadout-class select {
  flex: 1;
  padding: 0.3rem 0.4rem;
  border: 1px solid #5a4218;
  border-radius: 3px;
  background: #0d0a06;
  color: var(--gold-bright);
  font: 600 0.78rem/1.2 "Segoe UI", system-ui, sans-serif;
}

.hint-panel {
  pointer-events: auto;
  position: relative;
  align-self: end;
  justify-self: end;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.hint-toggle {
  display: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #5a4218;
  background: linear-gradient(180deg, #3a2a12, #1a1408);
  color: var(--gold-bright);
  font: 800 1rem/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.hint-panel.collapsed .hint-toggle {
  display: grid;
  place-items: center;
}

.hint-panel.collapsed .hint-body {
  display: none;
}

.hint-body {
  width: min(220px, 36vw);
  padding: 0.45rem 0.5rem 0.5rem;
  background: rgba(6, 6, 10, 0.82);
  border: 1px solid #3a2a12;
  border-radius: 3px;
}

.hint-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.hint-head strong {
  font-size: 0.72rem;
  color: var(--gold);
}

.hint-close {
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid #4a3a1a;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.hint-close:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.hint-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.hint-panel p.warn {
  margin-top: 0.25rem;
  color: #ffb070;
}

.bomb-timer {
  position: fixed;
  z-index: 40;
  transform: translate(-50%, -120%);
  pointer-events: none;
  font: 800 16px/1 "Segoe UI", system-ui, sans-serif;
  color: #ffe08a;
  text-shadow: 0 0 8px #000, 0 1px 2px #000;
  background: rgba(20, 8, 0, 0.75);
  border: 2px solid rgba(255, 180, 40, 0.9);
  border-radius: 4px;
  padding: 0.25rem 0.55rem;
}

.bomb-timer.urgent {
  color: #ff6b4a;
  border-color: #ff4a2a;
  animation: bombPulse 0.25s ease-in-out infinite alternate;
}

@keyframes bombPulse {
  from { transform: translate(-50%, -120%) scale(1); }
  to { transform: translate(-50%, -120%) scale(1.12); }
}

@media (max-width: 900px) {
  .action-panel {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .hint-panel {
    position: absolute;
    right: 0.75rem;
    bottom: calc(100% + 0.35rem);
  }

  .vuhdo {
    bottom: 12.5rem;
    width: min(88px, 22vw);
    height: min(220px, 40vh);
  }

  .vuhdo.expanded {
    width: min(220px, 48vw);
    height: min(360px, 55vh);
  }

  .raid-hud-left {
    width: min(96vw, 360px);
  }

  .boss-anchor {
    width: min(90vw, 300px);
    top: auto;
    bottom: calc(100% - 7.5rem);
    left: 50%;
  }

  .raid-cell {
    width: 68px;
    height: 40px;
  }

  .combat-feed { max-height: 100px; }
}
