:root {
  --bg: #0c0805;
  --panel: rgba(14, 10, 7, 0.88);
  --gold: #e4c078;
  --gold-bright: #ffe9b4;
  --gold-dim: #9a7440;
  --blood: #9a1c1c;
  --ice: #6ec4ff;
  --text: #f3e6c8;
  --muted: #b89a70;
  --frame: #4a3418;
  --ink: #120c08;
  --parchment: #c4aa7a;
  --ui-font: "Cormorant Garamond", Palatino Linotype, Palatino, Georgia, serif;
  --ui-display: "Cinzel Decorative", "Cinzel", Palatino, serif;
  --ui-label: "Cinzel", Palatino, serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#app, .screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
.screen { display: flex; }

#screen-login, #screen-post {
  align-items: center; justify-content: center;
  z-index: 30;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(120, 70, 24, 0.32), transparent 46%),
    radial-gradient(ellipse at 50% 100%, rgba(40, 16, 8, 0.55), transparent 50%),
    linear-gradient(180deg, rgba(10,6,4,0.22), rgba(6,4,3,0.78)),
    url("../textures/sky.jpg") center/cover no-repeat,
    #100804;
}
.login-card {
  width: min(540px, 92vw);
  padding: 8px 18px 22px;
  background-color: #3a2818;
  border: 72px solid transparent;
  border-image-source: url("../textures/ui/login_panel.jpg");
  border-image-slice: 168 fill;
  border-image-repeat: stretch;
  filter: drop-shadow(0 28px 56px rgba(0,0,0,0.72));
}
.crest {
  width: 96px; height: 96px; margin: 2px auto 6px;
  border-radius: 50%;
  background: url("../textures/ui/crest.jpg") center/128% no-repeat;
  box-shadow:
    0 0 0 2px #1a1208,
    0 0 0 4px #d4b46a,
    0 0 0 6px #3a2810,
    0 0 28px rgba(180, 36, 18, 0.45),
    0 10px 22px rgba(0,0,0,0.5);
}
h1 {
  text-align: center; letter-spacing: 0.14em; font-weight: 700;
  margin: 6px 0 2px; text-transform: uppercase; font-size: 26px;
  font-family: var(--ui-display);
  color: var(--gold-bright);
  text-shadow: 0 2px 0 #3a2a10, 0 0 22px rgba(224, 180, 80, 0.4);
}
.login-card h1::after {
  content: "";
  display: block;
  width: 92px; height: 1px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, #e0c070, transparent);
}
.tagline, .hint { text-align: center; color: var(--muted); }
.tagline { font-size: 16px; font-style: italic; font-weight: 500; margin: 8px 0 4px; }
.hint { font-size: 13px; line-height: 1.45; margin-top: 14px; opacity: 0.9; }
label {
  display: block; margin: 12px 0 6px; color: var(--gold);
  font-family: var(--ui-label);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
}
input, select {
  width: 100%; padding: 10px 12px;
  background: linear-gradient(#16100a, #100c08);
  color: var(--text);
  border: 1px solid #5a4024;
  border-radius: 3px;
  box-shadow: inset 0 2px 7px rgba(0,0,0,0.5);
  font: inherit;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: inset 0 2px 7px rgba(0,0,0,0.5), 0 0 0 1px rgba(224,180,80,0.28);
}
button {
  cursor: pointer; font: inherit;
  background: linear-gradient(#4a341c, #24180e);
  color: var(--text);
  border: 1px solid #7a5a30;
  border-radius: 3px;
  padding: 8px 14px;
  box-shadow: inset 0 1px 0 rgba(255,220,150,0.16), 0 2px 0 #140e08;
  transition: filter 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
button.gold {
  background: linear-gradient(180deg, #d4b060 0%, #a07830 42%, #6a4a16 56%, #3e2a0c 100%);
  color: #fff6d8; border-color: #f0d48a; width: 100%;
  margin-top: 16px; letter-spacing: 0.12em; text-transform: uppercase;
  font-family: var(--ui-label);
  font-size: 13px;
  text-shadow: 0 1px 0 #3a2a10;
  box-shadow:
    0 2px 0 #1a1208,
    inset 0 1px 0 rgba(255,240,200,0.5),
    inset 0 -3px 6px rgba(0,0,0,0.35),
    0 0 18px rgba(224,180,80,0.18);
}
button.gold.large { padding: 13px 16px; font-size: 15px; }
button.ghost {
  background: transparent; width: 100%; margin-top: 8px;
  color: var(--muted); border-color: transparent; box-shadow: none;
}
button:hover { filter: brightness(1.1); }
button.gold:hover {
  filter: none;
  color: #fffdf0;
  box-shadow:
    0 2px 0 #1a1208,
    inset 0 1px 0 rgba(255,240,200,0.65),
    0 0 26px rgba(255,210,100,0.42);
}
button.ghost:hover { color: var(--gold-bright); filter: none; }
.class-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.class-pick {
  min-width: 0; text-align: center; padding: 12px 6px 10px;
  border: 1px solid rgba(180,140,70,0.35);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(42,28,14,0.72), rgba(12,8,6,0.72));
  cursor: pointer; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,230,180,0.1), 0 4px 12px rgba(0,0,0,0.28);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.class-pick::before {
  content: "";
  display: block;
  width: 9px; height: 9px;
  margin: 0 auto 7px;
  border-radius: 50%;
  background: var(--gem, #c4a050);
  box-shadow: 0 0 8px var(--gem, #c4a050), inset 0 1px 0 rgba(255,255,255,0.5);
}
.class-pick.cls-blade { --gem: #d05048; }
.class-pick.cls-arcanist { --gem: #5a88e0; }
.class-pick.cls-aegis { --gem: #e0c060; }
.class-pick.cls-warrior { --gem: #e07030; }
.class-pick.sel {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(212,180,106,0.32), rgba(40,28,10,0.55));
  box-shadow: 0 0 18px rgba(224,180,80,0.38), inset 0 1px 0 rgba(255,230,180,0.28);
}
.class-pick .role { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 2px; }

.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 220px 0 22px;
  border-bottom: 1px solid #e0c070;
  background:
    linear-gradient(180deg, rgba(255,220,150,0.08), transparent 40%),
    linear-gradient(180deg, rgba(42,28,14,0.96), rgba(12,8,5,0.94));
  box-shadow: 0 10px 26px rgba(0,0,0,0.48), inset 0 -1px 0 rgba(255,220,150,0.22);
  z-index: 4;
}
.brand {
  color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase;
  font-size: 13px; font-family: var(--ui-display);
  text-shadow: 0 0 14px rgba(224,180,80,0.4);
}
.who-wrap {
  position: relative;
  z-index: 6;
  max-width: min(240px, 36vw);
  flex-shrink: 1;
  pointer-events: auto;
}
#hub-who.who {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 6px 12px;
  color: var(--gold-bright);
  font-size: 15px;
  font-family: var(--ui-font);
  letter-spacing: 0.02em;
  text-transform: none;
  text-shadow: 0 1px 2px #000;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hub-who.who::after {
  content: "▾";
  display: inline-block;
  margin-left: 7px;
  font-size: 11px;
  opacity: 0.72;
}
#hub-who.who:hover,
#hub-who.who[aria-expanded="true"] {
  color: #fff6d8;
  filter: none;
  border-color: rgba(196, 160, 80, 0.55);
  background: linear-gradient(180deg, rgba(42, 28, 14, 0.55), rgba(12, 8, 5, 0.45));
}
#screen-hub { flex-direction: column; background: #100c08; }
#hub-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hub-grid {
  margin-top: 54px; flex: 1; display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 14px; padding: 14px 14px 72px;
  min-height: 0;
  position: relative; z-index: 2; pointer-events: none;
}
.hub-stage { pointer-events: none; }
.hub-grid .panel, .hub-grid .queue-card, .hub-grid input, .hub-grid button, .hub-grid select, .hub-grid .class-pick, .hub-grid .talent {
  pointer-events: auto;
}
.panel {
  background-color: #1a120c;
  border: 28px solid transparent;
  border-image-source: url("../textures/ui/panel.jpg");
  border-image-slice: 24%;
  border-image-width: 28px;
  border-image-repeat: round;
  padding: 6px 10px 10px;
  overflow: auto;
  box-shadow:
    0 12px 24px rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(196, 160, 80, 0.28);
}
.queue-panel {
  background: transparent; border: none; padding: 0;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  overflow: auto;
  pointer-events: none;
  padding-top: 2px;
  gap: 12px;
  min-height: 0;
}
.live-matches-card {
  max-height: min(32vh, 280px);
  overflow: auto;
}
.live-match {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(28,18,10,0.7), rgba(12,8,6,0.7));
  border: 1px solid rgba(180,140,70,0.22);
  border-radius: 3px;
}
.live-match .live-title {
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.live-match .live-sub {
  color: var(--muted);
  font-size: 13px;
}
.live-match button {
  margin-top: 4px;
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 13px;
}
.queue-card {
  width: 100%;
  background-color: #1a120c;
  border: 28px solid transparent;
  border-image-source: url("../textures/ui/panel.jpg");
  border-image-slice: 24%;
  border-image-width: 28px;
  border-image-repeat: round;
  padding: 6px 10px 10px;
  pointer-events: auto;
  box-shadow:
    0 16px 32px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(196, 160, 80, 0.28);
}
.queue-card h2, .panel h2 {
  margin: 2px 0 12px; font-size: 13px; color: var(--gold);
  letter-spacing: 0.14em; text-transform: uppercase;
  font-family: var(--ui-display);
  padding-bottom: 8px;
  background: linear-gradient(90deg, transparent, rgba(224,180,80,0.5), transparent) left bottom / 100% 1px no-repeat;
}
.list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.row { display: flex; gap: 6px; }
.row input { flex: 1; }
.member, .quest, .friend {
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(28,18,10,0.7), rgba(12,8,6,0.7));
  border: 1px solid rgba(180,140,70,0.22);
  border-radius: 3px;
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.member.offline, .friend.offline { opacity: 0.78; color: var(--muted); }
.member-who, .friend-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.disc-ico {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #e07070;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(180, 50, 50, 0.5);
  vertical-align: middle;
}
.disc-ico::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 3px;
  width: 14px;
  height: 2px;
  background: #e07070;
  transform: rotate(-45deg);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(180, 40, 40, 0.7);
}
.ready-ico {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1f6a32;
  border: 2px solid #7de08a;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 7px rgba(70, 200, 90, 0.55);
  vertical-align: middle;
}
.ready-ico::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 7px;
  border: solid #eaffea;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.member.pending { opacity: 0.7; font-style: italic; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.invite-row .invite-from { flex: 1; min-width: 0; }
.invite-row button {
  padding: 3px 9px;
  font-size: 11px;
  min-width: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.invite-row .accept {
  color: #d8f5d8;
  border-color: rgba(80, 160, 90, 0.65);
  background: linear-gradient(180deg, rgba(28, 80, 36, 0.95), rgba(12, 36, 16, 0.95));
}
button.gold:disabled,
button.gold.large:disabled {
  opacity: 0.42;
  filter: none;
  cursor: not-allowed;
  box-shadow: 0 2px 0 #1a1208, inset 0 1px 0 rgba(255,240,200,0.2);
}
#queue-hint {
  min-height: 1.1em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.member .status-wrap { margin-left: auto; }
.member .kick,
.member .lead-pass {
  margin-left: 0;
  padding: 3px 9px;
  font-size: 11px;
  min-width: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.member .kick {
  margin-left: auto;
  color: #f0c8c8;
  border-color: rgba(180, 70, 70, 0.6);
  background: linear-gradient(180deg, rgba(90, 28, 20, 0.95), rgba(36, 12, 10, 0.95));
}
.member .lead-pass {
  color: #f0e0b0;
  border-color: rgba(180, 140, 70, 0.55);
}
.brackets { display: flex; gap: 8px; margin: 10px 0; }
.brackets button { flex: 1; }
.brackets button.sel { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 12px rgba(224,180,80,0.22); }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 10px 0; font-size: 15px; }
.check input { width: auto; }
.err { color: #e07070; min-height: 1.2em; transition: opacity 0.7s ease; }
.err.err-fade { opacity: 0; }
#btn-leave-party { margin: 2px 0 8px; }
.party-invite-row { margin-bottom: 8px; }
#party-err { margin: 0 0 6px; }
#friends-fold { margin-top: 18px; }
#blocked-fold { margin-top: 12px; }
h2.fold {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
h2.fold:hover { color: var(--gold-bright); }
h2.fold .fold-mark { color: var(--gold-bright); font-size: 14px; letter-spacing: 0; }
#social-pop {
  position: fixed;
  z-index: 80;
  width: 168px;
  max-width: 180px;
  pointer-events: auto;
}
.talent-tree { display: none; }
.talent { display: none; }

#hub-dock {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 16;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
#screen-hub.hidden #hub-dock { display: none !important; }
.hub-dock-btn {
  width: auto !important;
  min-width: 118px;
  margin-top: 0 !important;
  padding: 8px 16px;
  font-size: 12px;
}
#xp-bar {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 4px;
  height: 16px;
  z-index: 16;
  background: linear-gradient(180deg, #1a1008, #0c0804);
  border: 1px solid #c4a050;
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 0 0 1px #1a1208, 0 4px 12px rgba(0,0,0,0.45);
}
#xp-bar.hidden { display: none !important; }
#xp-fill {
  display: block;
  height: 100%;
  width: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28) 0%, transparent 45%),
    linear-gradient(90deg, #5a8a22, #b4e050);
}
#xp-level {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #fff6d8;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
  font-family: var(--ui-label);
}
#screen-match #xp-bar { left: 18%; right: 18%; bottom: 4px; }
#screen-match #action-bar { bottom: 24px; }

.wow-frame-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 2, 0.55);
  pointer-events: auto;
}
.wow-frame-overlay.hidden { display: none !important; }
.wow-frame {
  width: min(980px, 94vw);
  max-height: 86vh;
  overflow: auto;
  padding: 12px 16px 16px;
  background:
    linear-gradient(180deg, rgba(28, 18, 10, 0.96), rgba(10, 8, 6, 0.97)),
    #1a120c;
  border: 2px solid #c4a050;
  border-radius: 4px;
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(90, 64, 24, 0.9),
    0 24px 48px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255, 220, 150, 0.2);
}
.wow-frame-narrow { width: min(520px, 92vw); }
.wow-frame-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(196, 160, 80, 0.35);
}
.wow-frame-head h2 {
  margin: 0;
  font-family: var(--ui-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-size: 16px;
}
#tp-count { color: #ffe08a; font-size: 13px; }
.wow-frame-x {
  margin-left: auto;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 4px 10px;
  background: #2a1810;
}
.talent-spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.talent-spec {
  background: radial-gradient(ellipse at 50% 0%, rgba(80, 50, 16, 0.35), rgba(8, 6, 4, 0.9));
  border: 1px solid rgba(180, 140, 70, 0.4);
  border-radius: 4px;
  padding: 10px;
  min-height: 340px;
}
.talent-spec h3 {
  margin: 0 0 10px;
  text-align: center;
  color: var(--gold);
  font-family: var(--ui-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}
.talent-spec.offense { box-shadow: inset 0 0 40px rgba(140, 40, 20, 0.18); }
.talent-spec.defense { box-shadow: inset 0 0 40px rgba(40, 70, 140, 0.16); }
.talent-grid-wrap {
  position: relative;
  width: max-content;
  margin: 0 auto;
  overflow: visible;
}
.talent-arrows {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.talent-arrow-outline {
  fill: none;
  stroke: #120e08;
  stroke-width: 6.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.talent-arrow {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.talent-arrow.dim { stroke: #9a9578; }
.talent-arrow.lit {
  stroke: #ffd24a;
  filter: drop-shadow(0 0 2.5px rgba(255, 210, 74, 0.9));
}
.talent-grid {
  display: grid;
  grid-template-columns: repeat(4, 52px);
  grid-template-rows: repeat(4, 64px);
  justify-content: center;
  gap: 10px 12px;
  position: relative;
  z-index: 2;
}
.talent-icon {
  width: 48px;
  height: 48px;
  position: relative;
  z-index: 2;
  justify-self: center;
  align-self: center;
  border: 2px solid #5a4018;
  border-radius: 4px;
  background: #100a06;
  color: #fff8e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 0 1px #1a1208, inset 0 1px 0 rgba(255,230,180,0.2);
  user-select: none;
}
.talent-icon .rank {
  position: absolute;
  right: -4px;
  bottom: -6px;
  font-size: 10px;
  background: #1a1208;
  border: 1px solid #c4a050;
  color: #ffe08a;
  padding: 0 3px;
  border-radius: 2px;
  font-family: var(--ui-label);
}
.talent-icon.available { border-color: #4ae05a; box-shadow: 0 0 10px rgba(80, 220, 90, 0.45); }
.talent-icon.on { border-color: #ffe08a; box-shadow: 0 0 12px rgba(255, 224, 138, 0.55); }
.talent-icon.maxed { border-color: #ffe08a; filter: saturate(1.15); }
.talent-icon.lock { filter: grayscale(0.8) brightness(0.55); cursor: default; }
.talent-icon.empty { visibility: hidden; pointer-events: none; }
.talent-reset { width: auto; min-width: 180px; margin: 12px auto 0; display: block; }
.quest-board { display: flex; flex-direction: column; gap: 8px; }
.quest-item {
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(28,18,10,0.86), rgba(12,8,6,0.9));
  border: 1px solid rgba(180,140,70,0.35);
  border-radius: 3px;
  cursor: default;
}
.quest-item.done { border-color: #4ae05a; }
.quest-item b { color: var(--gold-bright); display: block; margin-bottom: 4px; }
.quest-item .q-meta { color: var(--muted); font-size: 13px; }
.talent.on { border-color: var(--gold); box-shadow: 0 0 12px rgba(224,180,80,0.28); }
.talent.lock { opacity: 0.45; cursor: not-allowed; }
.talent .rank { color: var(--gold); float: right; }
.talent .req { color: var(--muted); font-size: 12px; }

#screen-lobby { background: #070605; }
#lobby-canvas, #match-canvas, #hub-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
#screen-match::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at 50% 40%, transparent 46%, rgba(6,4,2,0.5) 100%);
}
#combat-sides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  --combat-a: 0.42;
  --combat-w: 1;
}
#combat-sides.hidden { display: none !important; }
#combat-sides .side {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(620px, 46vw);
  opacity: var(--combat-a, 0.42);
  pointer-events: none;
  overflow: visible;
  filter: blur(22px);
}
#combat-sides .side::before,
#combat-sides .side::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#combat-sides .side.left {
  left: 0;
  transform-origin: 28% center;
  background: radial-gradient(ellipse 70% 62% at 28% 50%, rgba(255, 58, 34, 0.8) 0%, rgba(220, 28, 14, 0.42) 24%, rgba(160, 14, 10, 0.16) 48%, rgba(90, 8, 6, 0.05) 70%, transparent 92%);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, rgba(0,0,0,0.28) 10%, #000 22%, #000 40%, rgba(0,0,0,0.4) 62%, rgba(0,0,0,0.1) 82%, transparent 100%),
    radial-gradient(ellipse 88% 72% at 30% 50%, #000 0%, #000 42%, transparent 80%);
  mask-image:
    linear-gradient(to right, transparent 0%, rgba(0,0,0,0.28) 10%, #000 22%, #000 40%, rgba(0,0,0,0.4) 62%, rgba(0,0,0,0.1) 82%, transparent 100%),
    radial-gradient(ellipse 88% 72% at 30% 50%, #000 0%, #000 42%, transparent 80%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  animation: combatDriftL 1.35s ease-in-out infinite;
}
#combat-sides .side.right {
  right: 0;
  transform-origin: 72% center;
  background: radial-gradient(ellipse 70% 62% at 72% 50%, rgba(255, 58, 34, 0.8) 0%, rgba(220, 28, 14, 0.42) 24%, rgba(160, 14, 10, 0.16) 48%, rgba(90, 8, 6, 0.05) 70%, transparent 92%);
  -webkit-mask-image:
    linear-gradient(to left, transparent 0%, rgba(0,0,0,0.28) 10%, #000 22%, #000 40%, rgba(0,0,0,0.4) 62%, rgba(0,0,0,0.1) 82%, transparent 100%),
    radial-gradient(ellipse 88% 72% at 70% 50%, #000 0%, #000 42%, transparent 80%);
  mask-image:
    linear-gradient(to left, transparent 0%, rgba(0,0,0,0.28) 10%, #000 22%, #000 40%, rgba(0,0,0,0.4) 62%, rgba(0,0,0,0.1) 82%, transparent 100%),
    radial-gradient(ellipse 88% 72% at 70% 50%, #000 0%, #000 42%, transparent 80%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  animation: combatDriftR 1.35s ease-in-out infinite;
}
#combat-sides .side.left::after {
  background: radial-gradient(ellipse 44% 40% at 28% 50%, rgba(255, 96, 52, 0.5) 0%, transparent 76%);
  animation: combatBloom 0.9s ease-in-out infinite;
}
#combat-sides .side.right::after {
  background: radial-gradient(ellipse 44% 40% at 72% 50%, rgba(255, 96, 52, 0.5) 0%, transparent 76%);
  animation: combatBloom 0.9s ease-in-out infinite;
}
@keyframes combatDriftL {
  0%, 100% { transform: translateX(0) scale(var(--combat-w, 1), 1); }
  50% { transform: translateX(4%) scale(calc(var(--combat-w, 1) * 1.05), 1.02); }
}
@keyframes combatDriftR {
  0%, 100% { transform: translateX(0) scale(var(--combat-w, 1), 1); }
  50% { transform: translateX(-4%) scale(calc(var(--combat-w, 1) * 1.05), 1.02); }
}
@keyframes combatBloom {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.12); }
}
.lobby-chrome {
  position: absolute; top: 20px; left: 0; right: 0; z-index: 2; text-align: center;
  pointer-events: none;
}
.lobby-chrome h2 {
  margin: 0; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  font-family: var(--ui-display); text-shadow: 0 2px 0 #000, 0 0 16px rgba(224,180,80,0.35);
}
.lobby-chrome p { color: var(--muted); font-style: italic; }
.lobby-roster { display: flex; justify-content: center; gap: 16px; margin-top: 10px; pointer-events: auto; }
.lobby-roster button { min-width: 120px; }
.lobby-roster button.sel { border-color: var(--gold); color: var(--gold-bright); }

#hud { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
#hud button, #action-bar, #action-bar .slot,
#player-frame, #target-frame, #party-frames, #enemy-frames,
.aura-row, .aura { pointer-events: auto; }
#spectate-chrome {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
#spectate-chrome.hidden { display: none !important; }
#spectate-banner {
  font-family: var(--ui-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-size: 13px;
  text-shadow: 0 2px 0 #000, 0 0 14px rgba(120, 200, 255, 0.35);
  padding: 6px 14px;
  background: linear-gradient(180deg, rgba(16, 28, 40, 0.86), rgba(8, 10, 16, 0.9));
  border: 1px solid rgba(140, 190, 220, 0.45);
  border-radius: 4px;
}
#btn-leave-spectate {
  min-width: 140px;
  pointer-events: auto;
}
#ghost-banner {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 14;
  pointer-events: none;
  font-family: var(--ui-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ececec;
  font-size: 28px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
  padding: 0;
  background: none;
  border: none;
}
#ghost-banner.hidden { display: none !important; }
#screen-match.dead-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 18, 0.32);
  pointer-events: none;
  z-index: 8;
}
.unit-frame.spirit {
  border-color: #9ad8ff;
  box-shadow:
    0 0 0 1px #0a1420,
    0 0 0 3px rgba(90, 140, 190, 0.9),
    0 0 18px rgba(140, 210, 255, 0.4),
    inset 0 1px 0 rgba(200, 230, 255, 0.28);
}
#screen-match.spectating #action-bar,
#screen-match.spectating #gcd-bar,
#screen-match.spectating #cast-bar,
#screen-match.spectating #player-frame,
#screen-match.spectating #player-auras {
  display: none !important;
}

.unit-frame {
  position: absolute; top: 16px; left: 16px; width: 268px;
  display: flex; gap: 10px; align-items: stretch;
  background: linear-gradient(180deg, rgba(28,18,10,0.94), rgba(10,7,5,0.94));
  border: 1px solid #c4a050;
  border-radius: 6px;
  padding: 8px 10px 9px;
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(90, 64, 24, 0.85),
    0 10px 22px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,220,150,0.22);
}
.unit-frame.target {
  left: 38%; transform: translateX(-50%); top: 16px;
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(90, 64, 24, 0.9),
    0 0 22px rgba(232,192,112,0.38),
    inset 0 1px 0 rgba(255,220,150,0.28);
}
.unit-frame { cursor: pointer; }
.unit-frame:hover {
  filter: brightness(1.08);
  border-color: var(--gold-bright);
}
.unit-frame.sel {
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(232, 192, 112, 0.95),
    0 0 18px rgba(232,192,112,0.45),
    inset 0 1px 0 rgba(255,220,150,0.28);
}
.uf-port {
  width: 52px; height: 52px; min-height: 52px; flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--cls, #3a1c14);
  background-size: cover;
  background-position: center 12%;
  background-repeat: no-repeat;
  box-shadow:
    0 0 0 2px #1a1208,
    0 0 0 3px #e0c070,
    0 0 0 5px #5a4018,
    0 0 0 6px #1a1208,
    inset 0 2px 3px rgba(255,230,180,0.28),
    0 4px 10px rgba(0,0,0,0.45);
}
.uf-port.port-blade { background-image: url("../textures/ui/port_blade.jpg"); }
.uf-port.port-warrior { background-image: url("../textures/ui/port_warrior.jpg"); }
.uf-port.port-arcanist { background-image: url("../textures/ui/port_arcanist.jpg"); }
.uf-port.port-aegis { background-image: url("../textures/ui/port_aegis.jpg"); }
.uf-body { flex: 1; min-width: 0; }
.unit-frame .name {
  font-size: 15px; color: var(--gold-bright);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.15;
}
.uf-class {
  font-family: var(--ui-label);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1px 0 2px;
}
.bar {
  position: relative; height: 15px; margin-top: 4px; overflow: hidden;
  background: linear-gradient(#0c0706, #1a0c0c);
  border: 1px solid #2a1c10;
  border-radius: 2px;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.75);
}
.bar > i {
  display: block; height: 100%; position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.04) 38%, rgba(0,0,0,0.22) 100%),
    linear-gradient(180deg, #e87870, #b02020 48%, #6a1010);
}
.bar > i::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 42%;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent);
  pointer-events: none;
}
.bar > span {
  position: absolute; right: 5px; top: 0; font-size: 11px;
  color: #fff6d8; line-height: 15px; text-shadow: 0 1px 2px #000;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.bar.mana > i {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 40%, rgba(0,0,0,0.22) 100%),
    linear-gradient(180deg, #7aa4ee, #1e4a9a 50%, #122a62);
}
.bar.energy > i {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 40%, rgba(0,0,0,0.22) 100%),
    linear-gradient(180deg, #efe08a, #c4a040 50%, #6a5010);
}
.bar.rage > i {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28) 0%, transparent 40%, rgba(0,0,0,0.22) 100%),
    linear-gradient(180deg, #e87848, #a03018 50%, #5a1008);
}
.bar.cast { height: 11px; margin-top: 3px; }
.bar.cast > i {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 40%),
    linear-gradient(90deg, #8a6020, #ffe08a);
}

#party-frames { position: absolute; top: 126px; left: 16px; width: 228px; right: auto; }
#enemy-frames { position: absolute; top: 16px; right: 16px; width: 228px; left: auto; }
#enemy-frames .unit-frame, #party-frames .unit-frame {
  position: relative; top: auto; left: auto; width: 100%; margin-bottom: 8px; transform: none;
}
#enemy-frames .unit-frame { border-color: #a04848; }
#party-frames .unit-frame { border-color: #4a8a48; }
#party-frames .uf-port, #enemy-frames .uf-port { width: 42px; height: 42px; min-height: 42px; }

#match-meta {
  position: absolute; top: 18px; left: 50%; right: auto; transform: translateX(-50%);
  color: var(--gold-bright);
  letter-spacing: 0.1em; font-size: 13px;
  font-family: var(--ui-display);
  padding: 6px 14px;
  background: linear-gradient(180deg, rgba(28,18,8,0.86), rgba(10,6,4,0.86));
  border: 1px solid rgba(212,180,106,0.5);
  border-radius: 4px;
  text-shadow: 0 1px 0 #000;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,220,150,0.2);
}
#match-clock {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  font-family: var(--ui-display);
  font-size: 40px;
  line-height: 1;
  color: #ffe08a;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(212,180,106,0.5), 0 3px 0 #3a2a10;
}
#match-clock.hidden { display: none !important; }
#match-clock.urgent {
  color: #ffc070;
  animation: matchClockPulse 0.9s ease-in-out infinite;
}
@keyframes matchClockPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

#gcd-bar {
  position: absolute; bottom: 188px; left: 50%; transform: translateX(-50%);
  width: min(720px, 88vw); height: 6px;
  background: #140e0a; border: 1px solid #6a4e28;
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 2px rgba(0,0,0,0.6);
  z-index: 9;
  overflow: hidden;
}
#gcd-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #8a7040, #ffe08a); width: 0; }

#cast-bar {
  position: absolute; bottom: 208px; left: 50%; transform: translateX(-50%);
  width: 430px; display: flex; align-items: stretch; gap: 8px;
  background: linear-gradient(180deg, rgba(22,14,8,0.95), rgba(8,6,4,0.95));
  border: 1px solid var(--gold);
  border-radius: 5px;
  padding: 7px 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,220,150,0.22);
  z-index: 9; pointer-events: none;
}
#cast-bar.hidden { display: none !important; }
#target-cast-bar {
  position: absolute; top: 92px; left: 50%; transform: translateX(-50%);
  width: 360px; display: flex; align-items: stretch; gap: 6px;
  background: linear-gradient(180deg, rgba(28,10,8,0.96), rgba(12,6,6,0.96));
  border: 1px solid #e05040;
  border-radius: 5px;
  padding: 7px 9px; box-shadow: 0 10px 28px rgba(0,0,0,0.7);
  z-index: 20; pointer-events: none;
}
#target-cast-bar.hidden { display: none !important; }
#target-cast-bar.friendly { border-color: #4aaa55; }
#target-cast-bar .cast-track > i { background: linear-gradient(90deg, #6a1818, #ff6840); }
#target-cast-bar.friendly .cast-track > i { background: linear-gradient(90deg, #2a5a28, #7adf6a); }
.cast-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 4px;
  background: #6ec4ff;
  box-shadow: 0 0 0 1px #1a1208, 0 0 0 2px #e0c070, inset 0 0 8px rgba(0,0,0,0.35);
}
.cast-body { flex: 1; min-width: 0; }
.cast-name { font-size: 14px; color: #fff6d8; margin-bottom: 4px; letter-spacing: 0.03em; }
.cast-track {
  height: 16px; background: #1a1008; border: 1px solid #5a4020; overflow: hidden; border-radius: 2px;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.65);
}
.cast-track > i {
  display: block; height: 100%; width: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 42%),
    linear-gradient(90deg, #8a6020, #ffe08a);
}
.cast-time { width: 36px; text-align: right; color: #ffe08a; font-size: 15px; align-self: center; font-variant-numeric: tabular-nums; }

.aura-row {
  position: absolute; top: 100px; left: 16px; display: flex; gap: 4px; z-index: 6;
}
.aura-row.target-auras { left: 38%; transform: translateX(-50%); top: 100px; }
.aura {
  width: 32px; height: 32px; border: 1px solid #d4b46a; position: relative;
  border-radius: 4px;
  background: radial-gradient(circle at 30% 25%, #5a4020, #1a1008);
  color: #fff6d8; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,230,180,0.2);
  cursor: pointer;
}
.aura.harm { background: radial-gradient(circle at 30% 25%, #4a1818, #1a0808); }
.aura.aura-magic { border-color: #4a9fff; box-shadow: 0 0 8px rgba(74, 159, 255, 0.7), inset 0 1px 0 rgba(180, 220, 255, 0.35); }
.aura.aura-curse { border-color: #b070ff; box-shadow: 0 0 8px rgba(176, 112, 255, 0.7), inset 0 1px 0 rgba(220, 190, 255, 0.35); }
.aura.aura-poison { border-color: #3dcc5a; box-shadow: 0 0 8px rgba(61, 204, 90, 0.7), inset 0 1px 0 rgba(180, 255, 190, 0.35); }
.aura.aura-disease { border-color: #c4a040; box-shadow: 0 0 8px rgba(196, 160, 64, 0.7), inset 0 1px 0 rgba(255, 230, 150, 0.35); }
.aura.aura-bleed { border-color: #e05050; box-shadow: 0 0 8px rgba(224, 80, 80, 0.75), inset 0 1px 0 rgba(255, 180, 180, 0.35); }
.aura.aura-enrage { border-color: #e07828; box-shadow: 0 0 8px rgba(224, 120, 40, 0.75), inset 0 1px 0 rgba(255, 200, 140, 0.35); }
.aura.aura-physical { border-color: #d4b46a; box-shadow: 0 0 8px rgba(212, 180, 106, 0.45), inset 0 1px 0 rgba(255, 230, 180, 0.25); }
.aura .ad { position: absolute; bottom: 0; right: 2px; font-size: 9px; color: #ffe08a; }

#action-bar {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 7px;
  width: max-content; max-width: 96vw;
  padding: 10px 14px 12px;
  background:
    linear-gradient(180deg, rgba(16,10,6,0.12), rgba(8,4,2,0.2)),
    url("../textures/ui/action_tray.jpg") center/100% 100% no-repeat;
  border: 1px solid #c4a050;
  border-radius: 2px;
  box-shadow: 0 16px 28px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,220,150,0.12);
  z-index: 12;
  pointer-events: auto;
  overflow: visible;
}
.bar-break { flex-basis: 100%; height: 0; margin: 0; padding: 0; pointer-events: none; }
.slot {
  width: 62px; height: 62px; overflow: visible;
  border: 1px solid #1a1008;
  border-radius: 4px;
  background: #100a06;
  color: #efe4c8;
  display: block;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  flex: 0 0 62px;
  box-shadow:
    0 0 0 1px #c9a35a,
    0 0 0 2px #5a4018,
    inset 0 2px 4px rgba(0,0,0,0.65),
    0 3px 8px rgba(0,0,0,0.4);
  transition: filter 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}
.slot:hover {
  filter: brightness(1.12);
  z-index: 2;
  box-shadow:
    0 0 0 1px #ffe9a8,
    0 0 0 2px #8a6828,
    0 0 14px rgba(255, 224, 138, 0.5),
    inset 0 2px 4px rgba(0,0,0,0.5);
}
.slot:active {
  transform: translateY(1px) scale(0.97);
  filter: brightness(0.92);
}
.slot .key {
  position: absolute; top: 3px; left: 5px; z-index: 3;
  color: var(--gold-bright); font-size: 11px; font-weight: 700;
  font-family: var(--ui-label);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
  pointer-events: none;
}
.slot .icon {
  position: absolute; inset: 3px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
  color: #fff8e8;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", sans-serif;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55), 0 0 12px rgba(255,255,255,0.22);
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.38), transparent 42%),
    linear-gradient(165deg, var(--icon-hi, #8a6840) 0%, var(--icon-mid, #4a3018) 48%, var(--icon-lo, #1a1008) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -10px 14px rgba(0,0,0,0.45);
}
.slot .icon::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, transparent 38%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}
.slot.school-frost { --icon-hi: #9ad4ff; --icon-mid: #2a6aa8; --icon-lo: #0c2848; }
.slot.school-fire { --icon-hi: #ff9a4a; --icon-mid: #c04018; --icon-lo: #4a1008; }
.slot.school-holy { --icon-hi: #ffe9a0; --icon-mid: #c4a040; --icon-lo: #4a3410; }
.slot.school-shadow { --icon-hi: #c090ff; --icon-mid: #5a2a9a; --icon-lo: #1a0838; }
.slot.school-arcane { --icon-hi: #e0b0ff; --icon-mid: #7a40b8; --icon-lo: #2a1048; }
.slot.school-physical { --icon-hi: #d8c090; --icon-mid: #6a4a28; --icon-lo: #24180c; }
.slot .tip { display: none; }
.slot .cd-sweep, .slot .gcd-sweep {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: conic-gradient(rgba(0,0,0,0.72) calc(var(--p, 0) * 1%), transparent 0);
  border-radius: 4px;
}
.slot .gcd-sweep { background: conic-gradient(rgba(10,16,36,0.5) calc(var(--p, 0) * 1%), transparent 0); }
.slot .cd-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; text-shadow: 0 2px 3px #000, 0 0 8px #000; font-weight: 700;
  pointer-events: none; z-index: 4;
}
.slot.flash { box-shadow: 0 0 0 1px #ffe08a, 0 0 16px rgba(255,224,138,0.75); }
.slot.fail { box-shadow: 0 0 0 1px #e04040, 0 0 14px rgba(224,64,64,0.7); }
.slot.cd .icon { filter: brightness(0.55); }
.slot.oom .icon { filter: grayscale(0.25) brightness(0.7) sepia(0.35) hue-rotate(-20deg); }
.slot.oom { cursor: pointer; }

#combat-log {
  position: absolute; bottom: 188px; right: 16px; width: 300px; height: 148px;
  overflow: hidden; font-size: 13px; color: #d8c8a8; text-align: right;
  text-shadow: 0 1px 2px #000;
  mask-image: linear-gradient(180deg, transparent, #000 18%);
}
.serve-note {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 20; background: #2a1808; border: 1px solid var(--gold);
  padding: 8px 12px; font-size: 13px; max-width: 90vw;
  border-radius: 4px;
}
code { color: var(--gold); }
#post-stats, #post-awards { margin: 12px 0; font-size: 15px; color: var(--muted); }
.post-card { text-align: center; }
.post-stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0 10px;
  text-align: left;
}
.post-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(28,18,10,0.78), rgba(12,8,6,0.82));
  border: 1px solid rgba(180,140,70,0.28);
  border-radius: 4px;
  color: var(--muted);
  font-size: 15px;
}
.post-stat b {
  color: var(--gold-bright);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
#btn-post-hub { margin-top: 8px; min-width: 200px; }

#nameplates {
  position: absolute; inset: 0; pointer-events: none; z-index: 7;
  overflow: visible;
  transform: translateZ(0);
}
.nameplate {
  position: absolute; transform: translate(-50%, -100%);
  min-width: 148px; text-align: center;
  pointer-events: auto;
  cursor: pointer;
  padding: 10px 16px 14px;
  z-index: 1;
}
#nameplates.look-held .nameplate {
  pointer-events: none;
  cursor: inherit;
}
.nameplate::before {
  content: "";
  position: absolute;
  inset: -18px -32px -16px;
}
.nameplate:hover {
  filter: drop-shadow(0 0 7px #ffe08a);
}
.nameplate .np-name {
  font-size: 15px; color: #fff6d8;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
  letter-spacing: 0.02em; white-space: nowrap;
  pointer-events: none;
}
.nameplate .np-bar {
  height: 11px; background: #140808; border: 1px solid #5a4020; margin-top: 3px; overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 1px 3px #000, inset 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}
.nameplate .np-bar > i { display: block; height: 100%; background: linear-gradient(#e06058, #8a1818); }
.nameplate.ally .np-bar > i { background: linear-gradient(#5aba62, #2f8a3a); }
.nameplate.sel { filter: drop-shadow(0 0 8px #ffe08a); transform: translate(-50%, -100%) scale(1.12); }
.nameplate.sel .np-name { color: #ffe08a; font-size: 16px; }
.np-cast {
  height: 6px; background: #140808; border: 1px solid #c09040; margin-top: 3px; overflow: hidden; border-radius: 2px;
  pointer-events: none;
}
.np-cast > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c07020, #ffe08a); }
.nameplate:not(.ally) .np-cast > i { background: linear-gradient(90deg, #8a1818, #ff6040); }
.np-cast.hidden { display: none !important; }

#prep-overlay {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 11vh; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,6,4,0.35), transparent 42%);
}
#prep-overlay.hidden { display: none !important; }
#prep-count {
  font-size: 92px; line-height: 1; color: #ffe08a;
  font-family: var(--ui-display);
  text-shadow: 0 0 24px rgba(212,180,106,0.55), 0 4px 0 #3a2a10;
  font-variant-numeric: tabular-nums;
}
#prep-label {
  margin-top: 6px; letter-spacing: 0.32em; text-transform: uppercase;
  color: #d4c06a; font-size: 14px;
  font-family: var(--ui-label);
}

#ui-error {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  z-index: 6; pointer-events: none;
  color: #ffd24a; font-size: 22px; letter-spacing: 0.04em;
  text-shadow: 0 2px 0 #000, 0 0 12px #000;
  white-space: nowrap;
}
#ui-error.hidden { display: none !important; }
#ui-error.pop { animation: errpop 0.85s ease-out; }
@keyframes errpop {
  0% { opacity: 0; transform: translate(-50%, -40%); }
  12% { opacity: 1; transform: translate(-50%, -50%); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -62%); }
}

#fct-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.fct {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 22px; font-weight: 700; pointer-events: none;
  text-shadow: 0 2px 0 #000, 0 0 8px #000;
  animation: fctup 1.05s ease-out forwards;
  white-space: nowrap;
}
.fct.heal { color: #5adf6a; font-size: 20px; }
.fct.dmg { color: #ffe8c0; }
.fct.crit { color: #ffb020; font-size: 28px; }
.fct.school-frost { color: #8ad4ff; }
.fct.school-fire { color: #ff8040; }
.fct.school-holy { color: #ffe08a; }
.fct.school-shadow { color: #c090ff; }
@keyframes fctup {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -130%) scale(1); }
}

.cc-mark,
.cc-stars {
  display: none !important;
}
.cc-mark-legacy {
  position: absolute; left: 50%; top: -8px; transform: translate(-50%, -100%);
  width: 92px; height: 92px; pointer-events: none;
  background: no-repeat center/contain;
  filter: drop-shadow(0 4px 6px #000);
  animation: ccpulse 0.7s ease-in-out infinite alternate;
  z-index: 8;
}
.cc-mark.stun { background-image: url("../textures/cc_stun.jpg"); }
.cc-mark.silence { background-image: url("../textures/cc_silence.jpg"); }
.cc-mark.fear { background-image: url("../textures/cc_fear.jpg"); }
.cc-mark.root { background-image: url("../textures/cc_root.jpg"); }
.cc-mark.disorient { background-image: url("../textures/cc_disorient.jpg"); animation: ccspin 1.1s linear infinite; }
.cc-stars {
  position: absolute; left: 50%; top: -10px; transform: translate(-50%, -100%);
  width: 110px; height: 70px; pointer-events: none; z-index: 9;
}
.cc-stars i {
  position: absolute; color: #ffe14a; font-size: 34px;
  text-shadow: 0 0 10px #ff0, 0 2px 0 #000;
  animation: starorbit 0.9s linear infinite;
}
.cc-stars i:nth-child(2) { animation-delay: -0.3s; font-size: 28px; }
.cc-stars i:nth-child(3) { animation-delay: -0.6s; font-size: 30px; }
@keyframes ccpulse { from { transform: translate(-50%, -100%) scale(0.92); } to { transform: translate(-50%, -100%) scale(1.08); } }
@keyframes ccspin { from { transform: translate(-50%, -100%) rotate(0deg); } to { transform: translate(-50%, -100%) rotate(360deg); } }
@keyframes starorbit {
  0% { left: 8px; top: 28px; }
  25% { left: 42px; top: 0; }
  50% { left: 78px; top: 28px; }
  75% { left: 42px; top: 48px; }
  100% { left: 8px; top: 28px; }
}

#top-actions {
  position: fixed; top: 12px; right: 16px; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  pointer-events: auto;
}
#top-actions.on-match { right: 258px; top: 16px; }
.settings-gear {
  position: relative; top: auto; right: auto;
  width: auto; margin: 0;
  padding: 7px 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--ui-label);
  font-size: 11px;
  color: var(--gold-bright);
  border-color: #c4a050;
  background: linear-gradient(180deg, rgba(42,28,14,0.96), rgba(12,8,5,0.94));
  pointer-events: auto;
}
.settings-gear:hover { color: #fff6d8; border-color: var(--gold-bright); }
#btn-status.status-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  text-transform: none;
}
#btn-status .status-dot {
  width: 14px;
  height: 14px;
}
#btn-invite:disabled,
#btn-add-friend:disabled,
#btn-block:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: none;
  box-shadow: 0 2px 0 #140e08, inset 0 1px 0 rgba(255,220,150,0.12);
}
.status-wrap { position: relative; }
.float-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(36,24,12,0.98), rgba(10,7,5,0.98));
  border: 1px solid #c4a050;
  border-radius: 4px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.5);
  z-index: 60;
}
.float-menu button {
  width: 100%;
  margin: 0;
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.float-menu button.sel { border-color: var(--gold); color: var(--gold-bright); }
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 5px currentColor;
}
.status-dot.online {
  background: #3dcc5a;
  color: #3dcc5a;
  animation: statusGlow 2.6s ease-in-out infinite;
}
.status-dot.away {
  background: #e0c040;
  color: #e0c040;
  animation: statusGlow 2.6s ease-in-out infinite;
}
.status-dot.offline { background: #6a4a4a; color: #6a4a4a; box-shadow: none; }
@keyframes statusGlow {
  0%, 100% { box-shadow: 0 0 2px currentColor, 0 0 5px currentColor; }
  50% { box-shadow: 0 0 4px currentColor, 0 0 10px currentColor; }
}
.friend { position: relative; }
.friend-menu-btn {
  margin-left: auto;
  padding: 5px 12px 6px;
  min-width: 38px;
  min-height: 28px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  color: #fff6d8;
  border: 1px solid #f0d48a;
  border-radius: 3px;
  background: linear-gradient(180deg, #d4b060 0%, #a07830 42%, #6a4a16 56%, #3e2a0c 100%);
  text-shadow: 0 1px 0 #3a2a10;
  box-shadow:
    0 2px 0 #1a1208,
    inset 0 1px 0 rgba(255,240,200,0.5),
    inset 0 -2px 4px rgba(0,0,0,0.35);
}
.friend-menu-btn:hover {
  filter: brightness(1.12);
  border-color: var(--gold-bright);
}
.friend.pending { opacity: 0.75; }
.brackets.locked { pointer-events: none; opacity: 0.5; }
.queue-locked select,
.queue-locked input { pointer-events: none; opacity: 0.55; }
#settings-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,4,2,0.55);
  pointer-events: auto;
}
#settings-overlay.hidden { display: none !important; }
#settings-card {
  width: min(380px, 92vw);
  padding: 8px 18px 18px;
  background: linear-gradient(180deg, rgba(36,24,12,0.97), rgba(10,7,5,0.97));
  border: 1px solid #c4a050;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px #1a1208,
    0 0 0 3px rgba(90, 64, 24, 0.85),
    0 18px 40px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,220,150,0.22);
}
#settings-card h2 {
  margin: 10px 0 2px;
  text-align: center;
  font-family: var(--ui-display);
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.settings-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 10px;
}
.vol-row {
  display: flex;
  justify-content: space-between;
  margin: 12px 0 4px;
}
#settings-card input[type="range"] {
  width: 100%;
  padding: 0;
  height: 8px;
  accent-color: #d4b060;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: pointer;
}
#settings-card #btn-settings-close { margin-top: 18px; }

.panel::-webkit-scrollbar, .queue-card::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb, .queue-card::-webkit-scrollbar-thumb {
  background: linear-gradient(#8a6828, #4a3414);
  border-radius: 4px;
}
.panel::-webkit-scrollbar-track, .queue-card::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); }

.wow-tip {
  position: fixed;
  z-index: 90;
  min-width: 228px;
  max-width: 320px;
  padding: 8px 12px 10px;
  background: linear-gradient(180deg, rgba(20, 16, 28, 0.97), rgba(8, 8, 14, 0.98));
  border: 1px solid #c4a050;
  border-radius: 4px;
  color: #fff6d8;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(0,0,0,0.65), 0 0 0 1px #1a1208;
  text-shadow: 0 1px 1px #000;
  font-family: var(--ui-font);
  line-height: 1.35;
}
.wow-tip .tip-name {
  color: #ffe08a;
  font-family: var(--ui-label);
  font-size: 15px;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.wow-tip .tip-school {
  font-size: 12px;
  margin-bottom: 4px;
  color: #d4b46a;
}
.wow-tip .tip-school.school-frost, .wow-tip .tip-school.aura-magic { color: #6ec4ff; }
.wow-tip .tip-school.school-fire { color: #ff9a4a; }
.wow-tip .tip-school.school-holy { color: #ffe9a0; }
.wow-tip .tip-school.school-shadow { color: #c090ff; }
.wow-tip .tip-school.school-arcane { color: #e0b0ff; }
.wow-tip .tip-school.school-physical, .wow-tip .tip-school.aura-physical { color: #d4b46a; }
.wow-tip .tip-school.aura-poison { color: #3dcc5a; }
.wow-tip .tip-school.aura-bleed { color: #e05050; }
.wow-tip .tip-school.aura-enrage { color: #e07828; }
.wow-tip .tip-school.aura-curse { color: #b070ff; }
.wow-tip .tip-school.aura-disease { color: #c4a040; }
.wow-tip .tip-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  font-size: 12px;
  margin-bottom: 2px;
}
.wow-tip .tip-body {
  color: #fff6d8;
  font-size: 13px;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .topbar { padding: 0 188px 0 14px; }
  .who-wrap { max-width: min(100px, 26vw); }
  #hub-who.who { font-size: 13px; padding: 5px 8px; }
  .hub-grid { grid-template-columns: 1fr; }
  .talent-spec-row { grid-template-columns: 1fr; }
  .unit-frame { width: 210px; }
  .unit-frame.target { left: 50%; }
  .aura-row.target-auras { left: 50%; }
  .slot { width: 52px; height: 52px; flex-basis: 52px; }
  .slot .icon { font-size: 22px; }
  #gcd-bar { bottom: 168px; }
  #cast-bar { bottom: 186px; }
  #combat-log { bottom: 168px; }
  #top-actions.on-match { right: 16px; top: auto; bottom: 168px; }
  .login-card { border-width: 42px; padding: 4px 10px 14px; }
  h1 { font-size: 20px; letter-spacing: 0.08em; }
}
