/* ============================================================
   Mythic+ Replay — custom replay interface
   ============================================================ */
:root {
  --bg: #070a0f;
  --bg-2: #0b0f16;
  --bg-3: #10161f;
  --panel: rgba(12, 17, 24, 0.86);
  --panel-solid: #0d131b;
  --panel-2: rgba(16, 23, 32, 0.92);
  --line: rgba(231, 224, 207, 0.10);
  --line-strong: rgba(231, 224, 207, 0.18);
  --text: #ece7db;
  --text-2: #b9b7ae;
  --muted: #7f888b;
  --gold: #d4b475;
  --gold-2: #f0d79c;
  --green: #77d36d;
  --red: #e15d5d;
  --red-2: #ff7b72;
  --blue: #6ea8fe;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --mono: "Cascadia Mono", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --tl-label-w: 156px;
  --tl-lane-h: 33px;
  --tl-ruler-h: 18px;
  --rad: 5px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(50, 63, 80, 0.22), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
svg { display: block; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.svg-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
.ico { width: 16px; height: 16px; fill: currentColor; flex: 0 0 auto; }
:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 2px; }

/* ---------------- app frame ---------------- */
.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  min-height: 0;
  background: linear-gradient(180deg, #090c12 0%, #070a0f 100%);
}
.stage {
  display: grid;
  grid-template-rows: minmax(250px, 1fr) 62px 258px;
  min-height: 0;
  position: relative;
}

/* ---------------- top bar ---------------- */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(212, 180, 117, 0.22);
  background:
    linear-gradient(180deg, rgba(19, 25, 34, 0.98), rgba(9, 13, 19, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 120px, rgba(255,255,255,.012) 120px 121px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.38);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 215, 156, .55) 20%, rgba(240, 215, 156, .16) 60%, transparent);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 290px; }
.brand-mark {
  width: 34px; height: 34px;
  color: var(--gold);
  filter: drop-shadow(0 0 9px rgba(212, 180, 117, .28));
}
.brand-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.brand-mark svg path:last-child { fill: currentColor; stroke: none; opacity: .9; }
.brand-copy { min-width: 0; }
.brand-kicker {
  display: flex; align-items: center; gap: 6px;
  font-size: 9px; letter-spacing: .18em; font-weight: 700;
  color: #8e968f; text-transform: uppercase; white-space: nowrap;
}
.brand-sep { color: rgba(255,255,255,.2); }
.live-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(119, 211, 109, .10), 0 0 8px rgba(119, 211, 109, .8);
  animation: livePulse 2.4s ease-in-out infinite;
}
.brand-title {
  margin: 1px 0 0;
  font-size: 20px; line-height: 1.05; font-weight: 650; letter-spacing: .02em;
  color: #f4efe4; white-space: nowrap;
}
.key-badge {
  display: inline-block; margin-left: 3px; padding: 1px 5px 2px;
  border: 1px solid rgba(212, 180, 117, .38); border-radius: 3px;
  color: var(--gold-2); background: rgba(212, 180, 117, .08);
  font: 700 13px/1 var(--mono); vertical-align: 2px;
}
.run-meta {
  display: flex; align-items: stretch; height: 34px; min-width: 0;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.run-meta-item { padding: 0 15px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); }
.run-meta-item:last-child { border-right: 0; }
.meta-label { font-size: 8px; letter-spacing: .15em; color: #747d80; text-transform: uppercase; font-weight: 700; }
.meta-value { font-size: 11px; color: #d7d2c6; margin-top: 1px; white-space: nowrap; }
.meta-value.ok { color: #9bd28d; }
.run-id .meta-value { color: #8d979a; font-size: 9.5px; }
.topbar-menu { position: relative; display: flex; align-items: center; }
.menu-launcher {
  height: 38px; display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 8px;
  border: 1px solid rgba(212,180,117,.18); border-radius: 3px;
  background: linear-gradient(180deg, rgba(29,37,45,.78), rgba(11,16,23,.72));
  color: #d8d1c0; text-align: left;
  transition: background .16s, border-color .16s;
}
.menu-launcher:hover, .menu-launcher.open { background: linear-gradient(180deg, rgba(40,48,55,.9), rgba(16,22,29,.9)); border-color: rgba(212,180,117,.4); }
.ml-glyph {
  width: 23px; height: 23px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(212,180,117,.25); color: var(--gold); background: rgba(212,180,117,.06);
  font: 12px/1 var(--mono);
}
.ml-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ml-kicker { font: 700 7.5px/1 var(--sans); letter-spacing: .16em; color: #7d8583; }
.ml-title { font-size: 10px; color: #ddd6c7; white-space: nowrap; }
.ml-title em { color: var(--gold); font-style: normal; }
.ml-caret { color: #8d9490; font-size: 12px; margin-left: 3px; transition: transform .16s; }
.menu-launcher.open .ml-caret { transform: rotate(180deg); }

.enemy-menu {
  position: fixed; z-index: 150; top: 58px; left: 50%; transform: translateX(-50%);
  width: min(840px, calc(100vw - 28px)); max-height: calc(100dvh - 76px);
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(15,21,29,.99), rgba(8,12,17,.99));
  border: 1px solid rgba(212,180,117,.32); border-radius: 4px;
  box-shadow: 0 28px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.55);
}
.enemy-menu[hidden] { display: none; }
.enemy-menu-head {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px 8px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(212,180,117,.055), transparent),
    rgba(255,255,255,.015);
}
.enemy-menu-title { min-width: 168px; }
.enemy-menu-title .kicker { font: 700 7.5px/1 var(--sans); letter-spacing: .17em; color: #7d8583; }
.enemy-menu-title .title { margin-top: 2px; font-size: 15px; font-weight: 650; color: #f0e9db; }
.enemy-menu-title .title em { color: var(--gold); font-style: normal; }
.menu-tabs { display: inline-flex; align-items: center; padding: 2px; border: 1px solid var(--line); border-radius: 3px; background: rgba(0,0,0,.22); }
.menu-tabs button {
  height: 24px; padding: 0 9px; border-radius: 2px; color: #8d9590; font-size: 9.5px;
}
.menu-tabs button b { margin-left: 4px; color: #6d7774; font: 8px/1 var(--mono); }
.menu-tabs button:hover { color: #d9d2c2; }
.menu-tabs button.active { color: #171a12; background: linear-gradient(180deg, #e5ce98, #c4a260); }
.menu-tabs button.active b { color: rgba(23,26,18,.6); }
.menu-close { margin-left: auto; }
.menu-search {
  margin-left: auto; width: 155px; height: 25px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 2px; outline: 0;
  background: #0a0f15; color: #d7d0c2; font-size: 9.5px;
}
.menu-search:focus { border-color: rgba(212,180,117,.45); }
.menu-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #353d43 transparent; }
.wave-strip {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 9px 13px 8px; overflow-x: auto;
  border-bottom: 1px solid rgba(255,255,255,.055);
  background: rgba(255,255,255,.012);
}
.wave-strip::-webkit-scrollbar { height: 4px; }
.wave-chip {
  flex: 0 0 auto; width: 132px; height: 42px; padding: 4px 7px;
  display: grid; grid-template-columns: auto minmax(0,1fr); grid-template-rows: auto auto auto; gap: 1px 6px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 2px;
  background: rgba(255,255,255,.025); text-align: left;
}
.wave-chip:hover { border-color: rgba(212,180,117,.35); background: rgba(212,180,117,.055); }
.wave-chip.active { border-color: rgba(212,180,117,.55); background: rgba(212,180,117,.10); box-shadow: inset 0 0 0 1px rgba(212,180,117,.08); }
.wave-chip b { grid-row: 1 / 4; align-self: center; color: var(--gold-2); font: 700 10px/1 var(--mono); }
.wave-chip span { font: 9px/1 var(--sans); color: #d5cfc2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wave-chip em { font: 700 6.5px/1 var(--sans); letter-spacing: .08em; color: #7e8884; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wave-chip.boss em { color: #d58a8f; }
.wave-chip.trash em { color: #a99578; }
.enemy-menu-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px;
  padding: 10px 13px 7px;
}
.enemy-row {
  min-height: 34px; display: grid; grid-template-columns: 27px minmax(0,1fr) auto 12px;
  align-items: center; gap: 7px; padding: 3px 5px;
  border: 1px solid transparent; border-radius: 2px; text-align: left;
}
.enemy-row:hover { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.075); }
.enemy-row.active { background: rgba(212,180,117,.075); border-color: rgba(212,180,117,.22); }
.enemy-badge {
  width: 25px; height: 25px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(210,103,111,.35); border-radius: 2px;
  background: rgba(210,103,111,.08); color: #d58a8f;
}
.enemy-badge.npc { border-color: rgba(178,143,109,.28); background: rgba(178,143,109,.06); color: #be9c76; }
.enemy-badge svg { width: 14px; height: 14px; fill: currentColor; }
.enemy-row-main { min-width: 0; }
.enemy-row-name { font-size: 10px; color: #d7d1c3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enemy-row-sub { margin-top: 1px; font: 8px/1 var(--mono); color: #707a78; display: flex; gap: 6px; }
.enemy-row-sub .pulls { color: #9b8c72; }
.enemy-row-chev { color: #626c6a; font-size: 13px; }
.enemy-menu-empty { padding: 28px 14px; text-align: center; color: #78827f; font-size: 10px; grid-column: 1 / -1; }
.enemy-menu-foot {
  display: flex; align-items: center; gap: 7px; padding: 7px 13px 9px;
  border-top: 1px solid rgba(255,255,255,.055);
  color: #6f7977; font-size: 8.5px;
}
.enemy-menu-foot .rule { flex: 1; height: 1px; background: rgba(255,255,255,.06); }
.enemy-menu-foot .mono { color: #8f948b; }

.topbar-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.ghost-btn {
  height: 30px; display: inline-flex; align-items: center; gap: 7px;
  padding: 0 10px; border: 1px solid var(--line); border-radius: 3px;
  color: #c9c5ba; background: rgba(255, 255, 255, .025);
  font-size: 11px; transition: background .16s, border-color .16s, color .16s;
}
.ghost-btn:hover { background: rgba(255,255,255,.055); border-color: var(--line-strong); color: #fff; }
.ghost-btn .ico { width: 13px; height: 13px; color: var(--gold); }
.ghost-btn.import-link { color: var(--gold-2); border-color: rgba(212,180,117,.26); background: rgba(212,180,117,.06); }
.ghost-btn.import-link:hover { background: rgba(212,180,117,.12); }
.ghost-btn.publish-action { color: #e8cc8c; border-color: rgba(212,180,117,.5); background: rgba(212,180,117,.12); }
.ghost-btn.publish-action:hover { background: rgba(212,180,117,.22); border-color: rgba(240,215,156,.75); }
.ghost-btn.publish-action:disabled { opacity: .55; cursor: wait; }
.import-plus { color: var(--gold); font-size: 14px; line-height: 1; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 3px; color: #aab0ae;
  background: rgba(255, 255, 255, .025);
  transition: background .16s, color .16s, border-color .16s;
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: #fff; border-color: var(--line-strong); }
.icon-btn.small { width: 24px; height: 24px; font-size: 17px; line-height: 1; }

/* ---------------- map shell ---------------- */
.map-shell {
  position: relative; min-height: 0; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 30%, #1a2422 0%, #0b1011 58%, #06090c 100%);
  isolation: isolate;
}
#replayCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#replayCanvas.dragging { cursor: grabbing; }
.map-grade {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(65% 60% at 48% 44%, rgba(92, 116, 86, .05), transparent 68%),
    linear-gradient(180deg, rgba(5, 8, 11, .18), rgba(3, 6, 9, .04) 45%, rgba(3, 6, 9, .48));
}
.map-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(90% 78% at 50% 47%, transparent 44%, rgba(2, 5, 8, .65) 100%),
    linear-gradient(90deg, rgba(2, 5, 8, .38), transparent 18%, transparent 82%, rgba(2, 5, 8, .38));
}
.map-top-left { position: absolute; z-index: 12; top: 12px; left: 12px; max-width: min(660px, calc(100% - 330px)); }
.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  max-height: 62px; overflow: hidden;
  padding: 5px 6px;
  background: linear-gradient(180deg, rgba(12, 17, 24, .88), rgba(9, 13, 19, .82));
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 3px;
  box-shadow: 0 5px 20px rgba(0,0,0,.3);
}
.legend-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; max-width: 130px; padding: 0 6px 0 3px;
  border: 1px solid transparent; border-radius: 2px;
  color: #d5d1c7; font-size: 10.5px; white-space: nowrap;
  transition: background .14s, border-color .14s;
}
.legend-chip:hover { background: rgba(255,255,255,.06); border-color: var(--line); }
.legend-chip.selected { background: color-mix(in srgb, var(--cc) 14%, transparent); border-color: color-mix(in srgb, var(--cc) 45%, transparent); }
.legend-chip img { width: 16px; height: 16px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--cc) 80%, #000); }
.legend-chip.npc { --cc: #b98f6a; }
.legend-chip.npc img { border-radius: 2px; }
.legend-more { color: var(--muted); font-size: 10px; padding: 0 5px; }

.pull-banner {
  position: absolute; z-index: 13; top: 12px; left: 50%; transform: translateX(-50%);
  min-width: 470px; max-width: 580px; min-height: 64px;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 13px 8px 10px;
  background:
    linear-gradient(180deg, rgba(14, 20, 27, .95), rgba(9, 14, 20, .90));
  border: 1px solid rgba(212, 180, 117, .22);
  border-radius: 3px;
  box-shadow: 0 8px 30px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.04);
  transition: width .18s ease, max-width .18s ease;
}
.pull-banner.multi { min-width: 560px; max-width: min(680px, calc(100% - 24px)); }
.pull-index {
  min-width: 48px; padding: 4px 5px; text-align: center;
  border: 1px solid rgba(212,180,117,.32); color: var(--gold-2);
  font: 700 9px/1.2 var(--mono); letter-spacing: .08em;
  background: rgba(212, 180, 117, .07);
}
.pull-copy { min-width: 0; flex: 1; }
.pull-headline { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.pull-name { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; color: #f6f0e2; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-sub { font-size: 9px; color: #939c9d; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-clock { flex: 0 0 auto; font-size: 13px; color: #e8e2d4; letter-spacing: .03em; padding-left: 9px; border-left: 1px solid var(--line); }
.pull-vitals { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.065); }
.pull-vitals[hidden], .pull-single[hidden], .pull-multi[hidden] { display: none; }
.pull-multi { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.pull-target { min-width: 0; padding: 5px 8px 6px; border: 1px solid rgba(255,255,255,.075); background: rgba(255,255,255,.018); }
.pull-target-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.pull-target-name { min-width: 0; color: #e9dfc8; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-target-hp { flex: 0 0 auto; color: #e4dcc8; font: 11px/1 var(--mono); }
.pull-target .pull-vital-track { height: 4px; margin-top: 3px; }
.pull-target .pull-cast-line { gap: 6px; min-height: 12px; margin-top: 3px; }
.pull-target .pull-cast-line > span { max-width: 62%; font-size: 10.5px; }
.pull-target .pull-cast-line > i { height: 3px; }
.pull-vital-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.pull-boss-name { min-width: 0; color: #d9cba8; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-boss-hp { flex: 0 0 auto; color: #f0e7d5; font-size: 11.5px; }
.pull-vital-track { height: 6px; margin-top: 3px; background: rgba(255,255,255,.09); overflow: hidden; }
.pull-vital-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9d3d47, #e06c75); box-shadow: 0 0 7px rgba(224,108,117,.28); transition: width .16s linear; }
.pull-cast-line { display: flex; align-items: center; gap: 7px; min-height: 13px; margin-top: 4px; }
.pull-cast-line > span { max-width: 58%; color: #f0d9a4; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-cast-line > i { flex: 1; height: 4px; background: rgba(240,215,156,.14); overflow: hidden; }
.pull-cast-line > i > b { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #bc9956, #f0d79c); }
.pull-cast-line.idle > span { color: #6e7874; }
.pull-cast-line.idle > i { opacity: .35; }

/* ---------------- glass panels ---------------- */
.panel {
  position: absolute; z-index: 12;
  background:
    linear-gradient(180deg, rgba(13, 19, 27, .92), rgba(9, 14, 20, .88));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.panel::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
.panel-head {
  height: 27px; display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .065);
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent);
}
.panel-title {
  display: flex; align-items: center; gap: 6px;
  font: 700 8.5px/1 var(--sans); letter-spacing: .18em; color: #b8b4a8;
}
.title-rule { width: 2px; height: 11px; background: var(--gold); box-shadow: 0 0 8px rgba(212,180,117,.4); }
.panel-count { margin-left: auto; font: 10px/1 var(--mono); color: #8e9695; }

.boss-frames {
  top: 70px; right: 12px; width: 380px; padding-bottom: 4px;
  max-height: none; overflow: visible;
}
.boss-frames.empty { display: none; }
.boss-frames.many {
  top: 56px;
  width: 500px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
.boss-frames.many ~ .map-tools { right: 524px; }
.boss-frames.many .boss-row { padding: 6px 8px 7px; gap: 7px; grid-template-columns: 30px minmax(0, 1fr) 44px; }
.boss-frames.many .boss-emblem { width: 27px; height: 27px; }
.boss-frames.many .boss-name { font-size: 12.5px; }
.boss-row {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 54px;
  gap: 9px; align-items: center; padding: 7px 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.boss-row:last-child { border-bottom: 0; }
.boss-row:hover { background: rgba(255,255,255,.025); }
.boss-row.selected { background: rgba(212,180,117,.075); box-shadow: inset 2px 0 0 var(--gold); }
.boss-row.selected .boss-name { color: #f2ddb1; }
.boss-count { color: var(--gold-2); font: 700 9.5px/1 var(--mono); }
.boss-row.group .boss-name { color: #d9d1bd; }
.boss-emblem {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(224, 108, 117, .4); border-radius: 2px;
  color: #df8c91; background: rgba(224, 108, 117, .08);
}
.boss-emblem .ico { width: 17px; height: 17px; }
.boss-row.npc .boss-emblem { color: #b59a7d; border-color: rgba(181, 154, 125, .3); background: rgba(181, 154, 125, .06); }
.boss-name { font-size: 13px; color: #e6e0d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boss-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.boss-hp-text { font: 11px/1 var(--mono); color: #b6bcb6; }
.boss-pct { font: 11.5px/1 var(--mono); color: #f2ebdc; }
.boss-bar { height: 5px; margin-top: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.boss-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #a43f46, #e06c75); box-shadow: 0 0 7px rgba(224,108,117,.25); transition: width .2s linear; }
.boss-row.npc .boss-bar > i { background: linear-gradient(90deg, #7f654f, #b99570); }
.boss-cast {
  display: none; margin-top: 4px;
}
.boss-cast.on { display: block; }
.boss-cast span { display: block; font-size: 10.5px; color: #f0d79c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boss-cast i { display: block; height: 3px; margin-top: 2px; background: rgba(240,215,156,.2); }
.boss-cast i b { display: block; height: 100%; background: #d9bb7a; width: 0; }

.meters-panel { left: 12px; bottom: 106px; width: 286px; }
.mini-select {
  margin-left: auto; height: 20px; max-width: 112px;
  padding: 0 19px 0 6px;
  border: 1px solid var(--line); border-radius: 2px;
  background: #0b1118 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='m0 0 4 5 4-5z' fill='%238a9290'/%3E%3C/svg%3E") no-repeat right 6px center;
  color: #b9b5a9; font-size: 9.5px; appearance: none; cursor: pointer;
}
.meter-menu { padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 3px; }
.meter-menu[hidden], .meter-detail[hidden], .meter-back[hidden] { display: none; }
.meter-menu-item {
  --tone: #b9b3a4;
  width: 100%; min-height: 33px; padding: 4px 6px;
  display: grid; grid-template-columns: 32px minmax(0,1fr) 9px; align-items: center; gap: 7px;
  border: 1px solid rgba(255,255,255,.065); border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.008));
  color: #d7d1c3; text-align: left; cursor: pointer;
  transition: background .14s, border-color .14s, transform .14s;
}
.meter-menu-item:hover {
  border-color: color-mix(in srgb, var(--tone) 42%, transparent);
  background: color-mix(in srgb, var(--tone) 8%, rgba(13,19,27,.9));
  transform: translateX(1px);
}
.meter-menu-item[data-tone="damage"] { --tone: #e2776b; }
.meter-menu-item[data-tone="heal"] { --tone: #7bd08f; }
.meter-menu-item[data-tone="taken"] { --tone: #d5a05f; }
.meter-menu-item[data-tone="received"] { --tone: #68c8bb; }
.meter-menu-item[data-tone="interrupt"] { --tone: #72aee8; }
.meter-menu-item[data-tone="death"] { --tone: #a6a29a; }
.meter-menu-tag {
  padding: 3px 2px; border: 1px solid color-mix(in srgb, var(--tone) 34%, transparent);
  border-radius: 2px; color: var(--tone); background: color-mix(in srgb, var(--tone) 7%, transparent);
  font: 700 6.5px/1 var(--mono); letter-spacing: .03em; text-align: center;
}
.meter-menu-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meter-menu-copy b { font: 550 10px/1.1 var(--sans); color: #d8d1c1; }
.meter-menu-copy small { font: 700 6.5px/1 var(--sans); letter-spacing: .14em; color: #697571; }
.meter-menu-arrow { color: #68736f; font-size: 15px; line-height: 1; }
.meter-menu-item:hover .meter-menu-arrow { color: var(--tone); }
.meter-detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px 4px; color: #d7d1c3; font-size: 10px;
}
.meter-detail-head > span:first-child { font-weight: 550; }
.meter-return-hint { font: 7.5px/1 var(--mono); color: #66716e; letter-spacing: .05em; }
.meter-scope-row {
  display: flex; align-items: center; gap: 6px; padding: 2px 8px 5px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}
.meter-scope-row > span { font: 700 7px/1 var(--sans); letter-spacing: .12em; color: #6c7773; white-space: nowrap; }
.meter-scope-select {
  min-width: 0; flex: 1; height: 19px; padding: 0 17px 0 5px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 2px;
  background: #0b1118 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='m0 0 4 5 4-5z' fill='%238a9290'/%3E%3C/svg%3E") no-repeat right 5px center;
  color: #b8b2a4; font: 8.5px/1 var(--sans); appearance: none; cursor: pointer;
}
.meter-back {
  margin-left: auto; height: 19px; padding: 0 7px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 2px;
  background: rgba(255,255,255,.025); color: #aeb5ae; font-size: 8px; cursor: pointer;
}
.meter-back:hover { color: #f0d79c; border-color: rgba(212,180,117,.35); }
.meter-list { padding: 5px 7px 3px; display: flex; flex-direction: column; }
.meter-row { display: grid; grid-template-columns: 14px 16px minmax(0,1fr) 46px 39px; gap: 5px; align-items: center; height: 22px; position: relative; }
.meter-rank { font: 9px/1 var(--mono); color: #6e7777; text-align: right; }
.meter-icon { width: 15px; height: 15px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--cc) 65%, #000); }
.meter-main { min-width: 0; }
.meter-name { font-size: 9.5px; color: #c9c5b9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.meter-track { height: 4px; margin-top: 2px; background: rgba(255,255,255,.055); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 65%, #111), var(--cc)); box-shadow: 0 0 8px color-mix(in srgb, var(--cc) 35%, transparent); transition: width .18s linear; }
.meter-value { font: 9.5px/1 var(--mono); color: #ddd8cc; text-align: right; }
.meter-rate { font: 8.5px/1 var(--mono); color: #7f8989; text-align: right; }
.meter-foot { display: flex; justify-content: space-between; padding: 4px 8px 5px; border-top: 1px solid rgba(255,255,255,.05); font-size: 8px; letter-spacing: .08em; color: #6f7879; text-transform: uppercase; }

.dungeon-panel { right: 12px; bottom: 106px; width: 296px; padding-bottom: 6px; }
.forces-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 9px 2px; font-size: 9px; color: #8b9392; }
.forces-row .mono { color: #d5d0c4; font-size: 10px; }
.force-track { height: 5px; margin: 3px 9px 0; background: rgba(255,255,255,.07); overflow: hidden; }
.force-fill { width: 0; height: 100%; background: linear-gradient(90deg, #8b6b3f, var(--gold)); box-shadow: 0 0 9px rgba(212,180,117,.28); transition: width .2s linear; }
.force-percent { text-align: right; font-size: 8.5px; color: #8b9392; margin: 2px 9px 5px; }
.pull-card { display: grid; grid-template-columns: 20px minmax(0,1fr) 20px; align-items: center; gap: 2px; margin: 0 6px; border-top: 1px solid rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.018); }
.pull-nav { width: 20px; height: 48px; color: #9ca3a0; font-size: 20px; line-height: 1; }
.pull-nav:hover { color: #fff; background: rgba(255,255,255,.05); }
.pull-card-body { min-width: 0; padding: 5px 2px 6px; }
.pull-card-kicker { font-size: 8px; letter-spacing: .13em; color: #7d8686; text-transform: uppercase; }
.pull-card-name { margin-top: 1px; font-size: 11px; font-weight: 600; color: #e6e0d3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pull-card-enemies { margin-top: 2px; font-size: 8.5px; line-height: 1.35; color: #8e9693; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dungeon-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px 6px 0; }
.mini-action {
  height: 24px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 2px; color: #aeb2ac;
  font-size: 9.5px; background: rgba(255,255,255,.018);
  transition: background .15s, color .15s, border-color .15s;
}
.mini-action:hover, .mini-action.active { background: rgba(212,180,117,.08); border-color: rgba(212,180,117,.28); color: var(--gold-2); }
.mini-action .ico { width: 11px; height: 11px; }

/* ---------------- party hud ---------------- */
.party-hud {
  position: absolute; z-index: 16; left: 50%; bottom: 11px; transform: translateX(-50%);
  width: min(1240px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px;
  align-items: end;
  transition: opacity .18s, transform .18s;
}
.party-hud.hidden { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }

body.inspector-open .party-hud {
  left: calc((100% - 382px) / 2);
  width: min(1130px, calc(100% - 406px));
  transform: translateX(-50%);
}
body.chart-open .party-hud {
  left: calc((100% - 398px) / 2);
  width: min(1240px, calc(100% - 420px));
  transform: translateX(-50%);
}
body.inspector-open .party-hud.hidden, body.chart-open .party-hud.hidden { transform: translate(-50%, 8px); }
@media (max-width: 1100px) {
  body.inspector-open .party-hud, body.chart-open .party-hud {
    left: 50%; width: calc(100% - 16px); transform: translateX(-50%);
  }
}
.party-card {
  --cc: #8fa;
  position: relative; min-width: 0; height: 64px;
  padding: 6px 7px 5px;
  background:
    linear-gradient(180deg, rgba(17, 24, 33, .94), rgba(9, 14, 20, .93));
  border: 1px solid rgba(255, 255, 255, .08);
  border-top: 2px solid color-mix(in srgb, var(--cc) 78%, #0c1118);
  border-radius: 3px;
  box-shadow: 0 9px 26px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.04);
  cursor: pointer;
  overflow: hidden;
  transition: background .16s, border-color .16s, transform .16s;
}
.party-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 7%, transparent), transparent 42%);
}
.party-card:hover { background: linear-gradient(180deg, rgba(22, 30, 40, .96), rgba(10, 16, 23, .95)); transform: translateY(-1px); }
.party-card.selected { border-color: color-mix(in srgb, var(--cc) 52%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 22%, transparent), 0 10px 28px rgba(0,0,0,.5); }
.party-card.dead { filter: saturate(.32) brightness(.72); }
.party-card.dead::before {
  content: "DEAD"; position: absolute; z-index: 5; top: 7px; right: 7px;
  font: 700 8px/1 var(--mono); letter-spacing: .12em; color: #ffb1a8;
  background: rgba(93, 23, 23, .7); border: 1px solid rgba(255, 120, 110, .35); padding: 2px 4px;
}
.pc-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pc-portrait {
  position: relative; width: 31px; height: 31px; flex: 0 0 auto;
  border-radius: 50%; padding: 1px;
  background: conic-gradient(from 210deg, color-mix(in srgb, var(--cc) 95%, #fff), color-mix(in srgb, var(--cc) 35%, #05080c) 70%, color-mix(in srgb, var(--cc) 95%, #fff));
  box-shadow: 0 0 10px color-mix(in srgb, var(--cc) 18%, transparent);
}
.pc-portrait img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #0b1016; object-fit: cover; }
.pc-role {
  position: absolute; right: -3px; bottom: -3px;
  width: 14px; height: 14px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #0b1118; border: 1px solid rgba(255,255,255,.22);
  font: 700 7px/1 var(--sans); color: #e6dfd0;
}
.pc-role.tank { color: #85b8ff; border-color: rgba(110,168,254,.5); }
.pc-role.healer { color: #9fe2a2; border-color: rgba(119,211,109,.45); }
.pc-id { min-width: 0; flex: 1; }
.pc-name { font-size: 10.5px; font-weight: 650; color: #eee8db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.pc-spec { font-size: 8px; color: #818a89; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.pc-hp-pct { font: 9px/1 var(--mono); color: #cdc8bb; margin-left: auto; flex: 0 0 auto; }
.hp-track {
  position: relative; height: 9px; margin-top: 5px;
  background: rgba(2, 5, 8, .72); border: 1px solid rgba(255,255,255,.055);
  overflow: hidden;
}
.hp-ghost { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 236, 210, .28); transition: width .36s ease-out; }
.hp-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(180deg, #7fe36d, #3c9e47);
  box-shadow: 0 0 8px rgba(90, 210, 100, .20);
  transition: width .09s linear, background .2s;
}
.party-card.low .hp-fill { background: linear-gradient(180deg, #ff8f6b, #c73b34); }
.party-card.critical .hp-fill { background: linear-gradient(180deg, #ff6a6a, #8e1f24); animation: criticalPulse 1.2s ease-in-out infinite; }
.hp-text {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; font: 7.5px/1 var(--mono); color: rgba(255,255,255,.9);
  text-shadow: 0 1px 2px rgba(0,0,0,.8); pointer-events: none;
}
.hp-text .hp-num { opacity: .78; font-size: 7px; }
.pc-cast {
  position: absolute; left: 7px; right: 7px; bottom: 4px; height: 4px;
  background: rgba(255,255,255,.06); opacity: 0; transition: opacity .15s;
}
.pc-cast.on { opacity: 1; }
.pc-cast > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d4b475, #f4dd9e); box-shadow: 0 0 7px rgba(240,215,156,.3); }
.pc-cast > span { position: absolute; left: 0; bottom: 4px; font-size: 7px; color: #f0d79c; text-shadow: 0 1px 2px #000; white-space: nowrap; }

/* ---------------- map tools / misc ---------------- */
.map-tools {
  position: absolute; z-index: 18; right: 322px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 3px;
}
.map-tool {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12); border-radius: 2px;
  color: #c7c2b4; background: rgba(10, 15, 21, .92); font: 16px/1 var(--sans);
}
.map-tool:hover { color: #fff; background: rgba(28, 37, 48, .9); }
.map-tool .ico { width: 12px; height: 12px; }
.map-fallback-note {
  position: absolute; z-index: 14; left: 50%; bottom: 86px; transform: translateX(-50%);
  padding: 4px 8px; border: 1px solid rgba(212,180,117,.22); border-radius: 2px;
  background: rgba(10, 15, 21, .88); color: #b9a77d;
  font: 8px/1.2 var(--mono); letter-spacing: .06em; pointer-events: none;
}
.map-hint {
  position: absolute; z-index: 10; left: 50%; bottom: 182px; transform: translateX(-50%);
  font-size: 9px; color: rgba(214, 208, 193, .48); letter-spacing: .06em;
  text-shadow: 0 1px 3px #000; pointer-events: none;
  transition: opacity 1s;
}
.map-hint.fade { opacity: 0; }
.compass {
  position: absolute; z-index: 9; top: 70px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 34px; opacity: .38; pointer-events: none;
}
.compass span { display: block; text-align: center; font: 8px/1 var(--mono); color: #ded6c3; letter-spacing: .1em; }
.compass i { display: block; width: 1px; height: 22px; margin: 3px auto 0; background: linear-gradient(180deg, #ded6c3, transparent); position: relative; }
.compass i::before { content: ""; position: absolute; top: 0; left: -3px; border: 3px solid transparent; border-bottom-color: #ded6c3; }
.map-tooltip {
  position: absolute; z-index: 25; display: none; pointer-events: none;
  min-width: 210px; max-width: 290px; padding: 8px 9px;
  background: rgba(8, 12, 17, .96); border: 1px solid rgba(255,255,255,.14);
  border-radius: 2px; box-shadow: 0 12px 34px rgba(0,0,0,.6);
  font-size: 10px; color: #d8d3c6;
}
.map-tooltip.show { display: block; }
.map-tooltip .tt-head { display: flex; align-items: center; gap: 7px; }
.map-tooltip .tt-head img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--cc, #888); }
.map-tooltip .tt-name { font-size: 12px; font-weight: 650; color: #f0ebdf; }
.map-tooltip .tt-sub { color: #8d9694; font-size: 9px; margin-top: 1px; }
.map-tooltip .tt-hpbar { height: 5px; background: rgba(255,255,255,.08); margin: 6px 0 3px; overflow: hidden; }
.map-tooltip .tt-hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #4ea95a, #82e070); }
.map-tooltip .tt-hp { font: 9px/1.2 var(--mono); color: #aeb6af; display: flex; justify-content: space-between; }
.map-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 3px; color: #949c98; }
.map-tooltip .tt-row b { color: #d9d3c5; font-weight: 500; }
.map-tooltip .tt-buffs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; }
.map-tooltip .tt-buffs img { width: 16px; height: 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 2px; }
.map-toast {
  position: absolute; z-index: 26; left: 50%; bottom: 184px; transform: translate(-50%, 6px);
  padding: 7px 11px; border: 1px solid rgba(212,180,117,.25); border-radius: 2px;
  background: rgba(10, 15, 21, .94); color: #e4dcc9; font-size: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.map-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- transport ---------------- */
.transport {
  position: relative; z-index: 20;
  background:
    linear-gradient(180deg, rgba(14, 19, 26, .98), rgba(8, 12, 17, .99));
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(0,0,0,.65);
  box-shadow: 0 -10px 28px rgba(0,0,0,.28);
}
.scrub { height: 13px; position: relative; background: rgba(0,0,0,.26); }
.scrub-track {
  position: absolute; left: 16px; right: 16px; top: 3px; height: 7px;
  background: rgba(255,255,255,.055); cursor: pointer;
  border: 1px solid rgba(255,255,255,.04);
}
.scrub-segments, .scrub-highlights, .scrub-deaths, .scrub-progress { position: absolute; inset: 0; pointer-events: none; }
.scrub-range {
  position: absolute; z-index: 2; top: -1px; bottom: -1px; width: 0;
  display: none; pointer-events: none;
  border-left: 1px solid rgba(240,215,156,.85); border-right: 1px solid rgba(240,215,156,.85);
  background: rgba(212,180,117,.16);
}
.scrub-range.show { display: block; }
.scrub-segment { position: absolute; top: 0; bottom: 0; background: rgba(212,180,117,.12); border-right: 1px solid rgba(0,0,0,.55); }
.scrub-segment.current { background: rgba(212,180,117,.25); }
.scrub-segment.kill { background: rgba(119, 211, 109, .10); }
.scrub-highlight { position: absolute; top: 0; bottom: 0; background: rgba(212, 180, 117, .18); border-left: 1px solid rgba(240,215,156,.3); border-right: 1px solid rgba(240,215,156,.3); }
.scrub-highlight.brez { background: rgba(110,168,254,.20); width: 2px !important; border: 0; }
.scrub-death { position: absolute; top: 1px; bottom: 1px; width: 1px; background: rgba(225, 93, 93, .62); }
.scrub-progress { z-index: 3; right: auto; background: linear-gradient(90deg, rgba(103, 87, 54, .55), rgba(212, 180, 117, .38)); border-right: 1px solid rgba(240,215,156,.8); width: 0; mix-blend-mode: screen; }
.scrub-knob {
  position: absolute; top: -1px; width: 9px; height: 9px; margin-left: -4px;
  background: #f0d79c; border: 1px solid #6f5a33; transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(240,215,156,.55); pointer-events: none;
}
.scrub-tip {
  position: absolute; top: -18px; left: 0; padding: 2px 5px; transform: translateX(-50%);
  background: #0a0e14; border: 1px solid rgba(255,255,255,.15); color: #ddd6c6;
  font-size: 8.5px; opacity: 0; pointer-events: none; transition: opacity .12s; white-space: nowrap;
}
.scrub:hover .scrub-tip { opacity: 1; }
.transport-row {
  height: 48px; display: flex; align-items: center; gap: 14px; padding: 0 14px;
}
.transport-left, .transport-center, .transport-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.transport-center { flex: 1; justify-content: center; }
.transport-right { justify-content: flex-end; }
.step { width: 26px; height: 26px; border-color: transparent; background: transparent; color: #9ea6a2; }
.step:hover { background: rgba(255,255,255,.06); color: #fff; }
.step .ico { width: 14px; height: 14px; }
.play-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #10140f;
  background: radial-gradient(circle at 38% 30%, #f7e6b8, #cba962 72%);
  border: 1px solid #f0d79c;
  box-shadow: 0 0 0 3px rgba(212,180,117,.10), 0 4px 12px rgba(0,0,0,.4);
  transition: transform .14s, box-shadow .14s;
}
.play-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(212,180,117,.14), 0 5px 15px rgba(0,0,0,.45); }
.play-btn .ico { width: 15px; height: 15px; }
.play-btn .play-ico { margin-left: 1px; }
.timecode { display: flex; align-items: baseline; gap: 5px; padding-left: 5px; white-space: nowrap; }
#timeCur { color: #f0ebdf; font-size: 12px; }
.time-divider { color: #565f60; font-size: 10px; }
#timeTotal { color: #7f8887; font-size: 10px; }

.segment-editor {
  height: 27px; display: flex; align-items: center; gap: 3px;
  margin-left: 5px; padding: 2px 3px 2px 6px;
  border: 1px solid rgba(255,255,255,.10); border-radius: 3px;
  background: rgba(255,255,255,.025);
  transition: border-color .16s, background .16s;
}
.segment-editor:focus-within { border-color: rgba(212,180,117,.38); background: rgba(212,180,117,.035); }
.segment-editor.active { border-color: rgba(212,180,117,.45); box-shadow: inset 0 0 0 1px rgba(212,180,117,.05); }
.segment-editor.invalid { border-color: rgba(225,93,93,.65); animation: editorShake .25s linear; }
.segment-kicker { font: 700 7px/1 var(--sans); letter-spacing: .12em; color: #707a78; text-transform: uppercase; }
#segmentInput {
  width: 116px; height: 20px; padding: 0 4px; border: 0; outline: 0;
  background: transparent; color: #e3dccd; font-size: 9.5px; text-align: center;
}
#segmentInput::placeholder { color: #5f6967; }
.segment-go {
  height: 20px; padding: 0 7px; border: 1px solid rgba(212,180,117,.25); border-radius: 2px;
  background: rgba(212,180,117,.08); color: var(--gold-2); font-size: 8.5px;
}
.segment-go:hover { background: rgba(212,180,117,.16); }
.segment-loop, .segment-clear {
  width: 19px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 2px; color: #777f7c; font: 12px/1 var(--sans);
}
.segment-loop:hover, .segment-clear:hover { color: #e4dccb; background: rgba(255,255,255,.06); }
.segment-loop.active { color: var(--gold-2); background: rgba(212,180,117,.12); }
@keyframes editorShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.mark-tools {
  height: 27px; display: flex; align-items: center; gap: 4px;
  margin-left: 3px; padding: 2px 3px;
  border: 1px solid rgba(255,255,255,.10); border-radius: 3px;
  background: rgba(255,255,255,.025);
}
.mark-tools:focus-within { border-color: rgba(212,180,117,.3); }
.mark-track {
  position: relative; width: 92px; height: 21px; cursor: ew-resize;
  touch-action: none;
}
.mark-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px;
  background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.04);
}
.mark-pulls { position: absolute; left: 0; right: 0; top: 9px; height: 4px; pointer-events: none; }
.mark-pull { position: absolute; top: 0; height: 4px; background: rgba(212,180,117,.18); border-right: 1px solid rgba(0,0,0,.4); }
.mark-range {
  position: absolute; top: 2px; height: 18px; display: none; pointer-events: none;
  background: rgba(212,180,117,.14); border-left: 1px solid rgba(240,215,156,.65); border-right: 1px solid rgba(240,215,156,.65);
}
.mark-range.show { display: block; }
.mark-pin {
  position: absolute; top: 1px; width: 2px; height: 19px; display: none; pointer-events: none;
  box-shadow: 0 0 5px rgba(240,215,156,.3);
}
.mark-pin.show { display: block; }
.mark-pin.start { background: #7ed36b; }
.mark-pin.end { background: #e15d5d; }
.mark-head {
  position: absolute; top: 0; width: 1px; height: 21px; background: #f0d79c;
  box-shadow: 0 0 6px rgba(240,215,156,.55); pointer-events: none;
}
.mark-head::before {
  content: ""; position: absolute; top: -1px; left: -2px;
  border: 2.5px solid transparent; border-top-color: #f0d79c;
}
.mark-btns { display: flex; gap: 2px; }
.mark-btn {
  width: 20px; height: 21px; padding: 0; border: 1px solid rgba(255,255,255,.10); border-radius: 2px;
  background: rgba(255,255,255,.02); color: #929b97; font: 9px/1 var(--sans);
}
.mark-btn:hover:not(:disabled) { background: rgba(212,180,117,.10); border-color: rgba(212,180,117,.3); color: var(--gold-2); }
.mark-btn.active { background: rgba(212,180,117,.15); border-color: rgba(212,180,117,.45); color: var(--gold-2); }
.mark-btn:disabled { opacity: .32; cursor: not-allowed; }
@media (max-width: 1360px) {
  .mark-track { width: 74px; }
  .transport-left .step { display: none; }
}
@media (max-width: 1180px) {
  .mark-tools { display: none; }
}

.seg-group {
  display: inline-flex; align-items: center; padding: 2px;
  border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.025);
}
.seg-group button {
  min-width: 27px; height: 20px; padding: 0 5px; border-radius: 2px;
  color: #8c9591; font: 9.5px/1 var(--mono);
}
.seg-group button:hover { color: #ddd7c9; }
.seg-group button.active { color: #16190f; background: linear-gradient(180deg, #e6cf99, #c7a661); box-shadow: 0 0 8px rgba(212,180,117,.18); }
.seg-group button:disabled { opacity: .28; cursor: not-allowed; }
.toggle-group { display: inline-flex; align-items: center; gap: 2px; }
.group-label { font-size: 8px; letter-spacing: .12em; color: #626c6d; text-transform: uppercase; margin-right: 2px; }
.toggle-group button {
  height: 21px; padding: 0 6px; border: 1px solid transparent; border-radius: 2px;
  color: #7e8887; font-size: 9.5px;
}
.toggle-group button:hover { color: #c8c4b9; background: rgba(255,255,255,.035); }
.toggle-group button.active { color: #d8d1c0; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.10); }
.toggle-group button.active::before { content: ""; display: inline-block; width: 3px; height: 3px; margin-right: 4px; border-radius: 50%; background: var(--gold); vertical-align: 1px; }
.hud-toggle { height: 26px; padding: 0 8px; gap: 6px; }
.hud-dots { display: inline-flex; gap: 1.5px; }
.hud-dots i { width: 3px; height: 9px; background: currentColor; opacity: .55; }
.hud-toggle.active .hud-dots i:nth-child(1) { background: #C69B6D; opacity: 1; }
.hud-toggle.active .hud-dots i:nth-child(2) { background: #F48CBA; opacity: 1; }
.hud-toggle.active .hud-dots i:nth-child(3) { background: #FFF468; opacity: 1; }
.hud-toggle.active .hud-dots i:nth-child(4) { background: #0070DD; opacity: 1; }
.hud-toggle.active .hud-dots i:nth-child(5) { background: #C41E3A; opacity: 1; }

/* ---------------- timeline ---------------- */
.timeline {
  position: relative; z-index: 18; min-height: 0;
  background:
    linear-gradient(180deg, #0c1118, #080c12);
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column;
}
.tl-head {
  height: 38px; flex: 0 0 38px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent);
}
.tl-heading { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.tl-title { display: flex; align-items: center; gap: 7px; font: 700 10px/1 var(--sans); letter-spacing: .16em; color: #d6d0c3; white-space: nowrap; }
.tl-sub { display: flex; align-items: center; gap: 5px; font-size: 9px; color: #737d7d; white-space: nowrap; }
.sync-dot { width: 4px; height: 4px; border-radius: 50%; background: #7ac176; box-shadow: 0 0 6px rgba(119,211,109,.6); }
.tl-right { display: flex; align-items: center; gap: 7px; margin-left: auto; min-width: 0; }
.tl-legend { display: flex; align-items: center; gap: 2px; padding-right: 4px; }
.tl-legend .tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 5px color-mix(in srgb, var(--cc) 30%, transparent); }
.inline-check { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: #89928f; white-space: nowrap; cursor: pointer; }
.inline-check input { width: 11px; height: 11px; accent-color: #c8a761; }
.follow-btn {
  height: 22px; padding: 0 7px; display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 2px; color: #89928f; font-size: 9px;
}
.follow-btn .follow-dot { width: 4px; height: 4px; border-radius: 50%; background: #687270; }
.follow-btn.active { color: #dfd5bd; border-color: rgba(212,180,117,.25); background: rgba(212,180,117,.07); }
.follow-btn.active .follow-dot { background: var(--gold); box-shadow: 0 0 5px rgba(212,180,117,.5); }
.seg-group.small button { min-width: 31px; height: 19px; font-size: 9px; }
.tl-right .icon-btn { width: 22px; height: 22px; font-size: 14px; }

.tl-overview { height: 30px; flex: 0 0 30px; padding: 3px 12px 4px; border-bottom: 1px solid rgba(255,255,255,.045); }
.tl-overview-track { position: relative; height: 21px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.055); cursor: pointer; }
.ov-pulls, .ov-heroism, .ov-deaths { position: absolute; inset: 0; pointer-events: none; }
.ov-pull { position: absolute; top: 0; bottom: 0; border-right: 1px solid rgba(0,0,0,.6); background: rgba(212,180,117,.08); }
.ov-pull:nth-child(odd) { background: rgba(212,180,117,.045); }
.ov-pull.kill { background: rgba(119,211,109,.075); }
.ov-pull.current { background: rgba(212,180,117,.18); }
.ov-pull-label { position: absolute; left: 3px; top: 4px; font: 7px/1 var(--mono); color: rgba(230,222,204,.55); }
.ov-hero { position: absolute; top: 0; bottom: 0; background: rgba(212, 180, 117, .18); border-left: 1px solid rgba(240,215,156,.35); }
.ov-death { position: absolute; top: 2px; bottom: 2px; width: 1px; background: rgba(225,93,93,.42); }
.ov-viewport {
  position: absolute; top: -1px; bottom: -1px; border: 1px solid rgba(240,215,156,.44);
  background: rgba(240,215,156,.055); pointer-events: none;
}
.ov-segment {
  position: absolute; z-index: 2; top: 0; bottom: 0; width: 0; display: none;
  border-left: 1px solid rgba(240,215,156,.9); border-right: 1px solid rgba(240,215,156,.9);
  background: rgba(212,180,117,.22); pointer-events: none;
}
.ov-segment.show { display: block; }
.ov-head { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #f2d99e; box-shadow: 0 0 8px rgba(240,215,156,.6); pointer-events: none; }
.ov-head::before { content: ""; position: absolute; top: -2px; left: -3px; border: 3px solid transparent; border-top-color: #f2d99e; }

.tl-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.tl-labels { width: var(--tl-label-w); flex: 0 0 var(--tl-label-w); border-right: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.13); }
.tl-label-spacer { height: var(--tl-ruler-h); padding: 0 9px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.05); }
.tl-ruler-label { font: 700 7.5px/1 var(--sans); letter-spacing: .14em; color: #5d6768; text-transform: uppercase; }
.tl-label {
  height: var(--tl-lane-h); display: flex; align-items: center; gap: 6px; padding: 0 7px;
  border-bottom: 1px solid rgba(255,255,255,.045);
  position: relative; cursor: pointer;
}
.tl-label:hover { background: rgba(255,255,255,.035); }
.tl-label.selected { background: color-mix(in srgb, var(--cc) 10%, transparent); }
.tl-label img { width: 20px; height: 20px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--cc) 75%, #000); }
.tl-label-body { min-width: 0; flex: 1; }
.tl-label-name { font-size: 9px; color: #cbc6ba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label-sub { display: flex; align-items: center; gap: 3px; font-size: 7px; color: #717b7b; margin-top: 1px; }
.tl-label-role { color: var(--cc); font-weight: 700; }
.tl-label-hp { width: 100%; height: 2px; background: rgba(255,255,255,.06); margin-top: 2px; }
.tl-label-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3e8e48, #7ed36b); transition: width .2s linear; }
.tl-label-chart { flex: 0 0 auto; color: #64706c; font-size: 9px; opacity: .55; }
.tl-label:hover .tl-label-chart { color: var(--gold-2); opacity: 1; }
.tl-label.dead { opacity: .55; }
.tl-label.dead img { filter: grayscale(1); }
.tl-scroll { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.tl-tracks { position: absolute; inset: 0; overflow: hidden; user-select: none; }
.tl-ruler { position: absolute; left: 0; right: 0; top: 0; height: var(--tl-ruler-h); border-bottom: 1px solid rgba(255,255,255,.05); background: rgba(0,0,0,.10); overflow: hidden; }
.tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.055); }
.tl-tick span { position: absolute; left: 4px; top: 5px; font: 8px/1 var(--mono); color: #5f6969; white-space: nowrap; }
.tl-grid { position: absolute; left: 0; right: 0; top: var(--tl-ruler-h); bottom: 0; pointer-events: none; }
.tl-gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.032); }
.tl-band-layer, .tl-lane-layer, .tl-mark-layer { position: absolute; left: 0; right: 0; top: var(--tl-ruler-h); bottom: 0; pointer-events: none; }
.tl-segment-band {
  position: absolute; z-index: 2; top: var(--tl-ruler-h); bottom: 0; left: 0; width: 0;
  display: none; pointer-events: none;
  background: rgba(212,180,117,.065);
  border-left: 1px solid rgba(240,215,156,.55); border-right: 1px solid rgba(240,215,156,.55);
}
.tl-segment-band.show { display: block; }
.tl-segment-band span {
  position: absolute; top: 2px; left: 4px; padding: 1px 4px;
  background: rgba(10,14,20,.8); border: 1px solid rgba(212,180,117,.25);
  color: #d9c18a; font: 7px/1.4 var(--mono); white-space: nowrap;
}
.tl-pull-band { position: absolute; top: 0; bottom: 0; background: rgba(212,180,117,.035); border-left: 1px solid rgba(212,180,117,.10); border-right: 1px solid rgba(0,0,0,.3); }
.tl-pull-band.active { background: rgba(212,180,117,.07); }
.tl-band { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.tl-band.hero { background: rgba(240,215,156,.11); border-left: 1px solid rgba(240,215,156,.28); }
.tl-lane {
  position: relative; height: var(--tl-lane-h); border-bottom: 1px solid rgba(255,255,255,.043);
}
.tl-lane:nth-child(even) { background: rgba(255,255,255,.012); }
.tl-lane.current { background: color-mix(in srgb, var(--cc) 4%, transparent); }
.tl-lane:hover { background: rgba(255,255,255,.025); }
.cast {
  position: absolute; top: 7px; width: 20px; height: 20px; margin-left: 0;
  border: 1px solid rgba(255,255,255,.22); border-radius: 2px; overflow: visible;
  background: #111922;
  cursor: pointer; transform: translateX(-1px); pointer-events: auto;
}
.cast img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }
.cast:hover { border-color: #f0d79c; box-shadow: 0 0 0 1px rgba(240,215,156,.4), 0 0 9px rgba(240,215,156,.18); z-index: 4; }
.cast.important { border-color: rgba(240,215,156,.52); }
.cast.auto {
  width: 4px; height: 10px; top: 19px; border: 0; border-radius: 1px;
  background: var(--cc); opacity: .38; box-shadow: none; transform: translateX(-2px);
}
.cast.auto img { display: none; }
.cast.auto:hover { opacity: 1; box-shadow: 0 0 6px color-mix(in srgb, var(--cc) 45%, transparent); }
.cast.auto::after { content: ""; position: absolute; inset: -6px -4px; }
.cast-dur { position: absolute; left: 0; bottom: -2px; height: 2px; background: rgba(240,215,156,.65); min-width: 2px; }
.tl-death-mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; opacity: .8; color: #e15d5d; }
.tl-death-mark .ico { width: 12px; height: 12px; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 1px; background: #f0d79c; box-shadow: 0 0 9px rgba(240,215,156,.5); pointer-events: none; z-index: 6; }
.tl-playhead::after { content: ""; position: absolute; top: -1px; left: -3px; border: 3px solid transparent; border-top-color: #f0d79c; }
.tl-time-bubble {
  position: absolute; top: 1px; left: 4px; padding: 1px 4px;
  background: #0b0f15; border: 1px solid rgba(240,215,156,.35);
  color: #f0d79c; font-size: 8px; white-space: nowrap;
}
.tl-hover { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.18); display: none; pointer-events: none; z-index: 3; }
.tl-hover.show { display: block; }

/* ---------------- tooltip ---------------- */
.tooltip {
  position: fixed; z-index: 1000; display: none; pointer-events: none;
  min-width: 180px; max-width: 300px; padding: 7px 9px;
  background: rgba(7, 10, 14, .97); border: 1px solid rgba(255,255,255,.14);
  border-radius: 2px; box-shadow: 0 14px 34px rgba(0,0,0,.55);
  color: #ddd7c9; font-size: 10px; line-height: 1.45;
}
.tooltip.show { display: block; }
.tt-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; color: #f1ecdf; }
.tt-title img { width: 18px; height: 18px; border-radius: 2px; border: 1px solid rgba(255,255,255,.18); }
.tt-sub { color: #8f9894; font-size: 9px; margin-top: 1px; }
.tt-kv { display: flex; justify-content: space-between; gap: 12px; margin-top: 3px; color: #949d99; }
.tt-kv b { color: #ded7c8; font-weight: 500; }
.tt-hint { color: #6f7877; font-size: 8.5px; margin-top: 4px; }

/* ---------------- inspector ---------------- */
.inspector {
  position: fixed; z-index: 55; top: 58px; right: 0; bottom: 0; width: 382px;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(13,19,26,.99), rgba(8,12,17,.99));
  border-left: 1px solid rgba(212,180,117,.18);
  box-shadow: -18px 0 50px rgba(0,0,0,.46);
  transform: translateX(102%); transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.inspector.open { transform: translateX(0); }
.inspector-head { height: 38px; flex: 0 0 38px; display: flex; align-items: center; padding: 0 10px 0 13px; border-bottom: 1px solid var(--line); }
.inspector-label { font: 700 8.5px/1 var(--sans); letter-spacing: .17em; color: #a9a499; }
.inspector-head .icon-btn { margin-left: auto; }
.inspector-body { flex: 1; overflow: auto; padding: 13px; scrollbar-width: thin; scrollbar-color: #343c42 transparent; }
.inspector-hero { display: flex; align-items: center; gap: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.inspector-portrait { width: 54px; height: 54px; border-radius: 50%; padding: 2px; background: conic-gradient(from 210deg, var(--cc), #1a2128 75%, var(--cc)); }
.inspector-portrait img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #0b1016; }
.inspector-name { font-size: 16px; font-weight: 700; color: #f2ecdf; }
.inspector-sub { font-size: 9.5px; color: #8f9894; margin-top: 2px; }
.inspector-hp { margin-top: 10px; }
.inspector-hp .hp-big { display: flex; justify-content: space-between; font: 10px/1.2 var(--mono); color: #cdc6b8; }
.inspector-section { margin-top: 14px; }
.inspector-section h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 700 8.5px/1 var(--sans); letter-spacing: .15em; color: #8e9692; text-transform: uppercase; }
.inspector-section h3 .line { flex: 1; height: 1px; background: var(--line); }
.aura-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.aura-card {
  position: relative; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.15); border-radius: 2px; background: #111820;
}
.aura-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }
.aura-card.debuff { border-color: rgba(225,93,93,.6); }
.aura-card .stacks { position: absolute; right: 0; bottom: 0; padding: 0 2px; background: rgba(0,0,0,.8); font: 700 7px/1.2 var(--mono); color: #fff; }
.aura-empty { color: #6f7877; font-size: 9px; }
.cast-list { display: flex; flex-direction: column; gap: 2px; }
.cast-list-row { display: grid; grid-template-columns: 18px minmax(0,1fr) 52px; gap: 6px; align-items: center; padding: 3px 4px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 9.5px; color: #b9b5a9; }
.cast-list-row img { width: 17px; height: 17px; border-radius: 2px; border: 1px solid rgba(255,255,255,.14); }
.cast-list-row .time { font: 8.5px/1 var(--mono); color: #7d8785; text-align: right; }
.cast-list-row .tt-target { color: #798380; font-size: 8px; }
.inspector-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.inspector-stat { padding: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.inspector-stat .k { font-size: 8px; color: #7b8584; letter-spacing: .1em; text-transform: uppercase; }
.inspector-stat .v { font: 13px/1.2 var(--mono); color: #e4ddcf; margin-top: 2px; }
.hp-graph { width: 100%; height: 66px; display: block; margin-top: 3px; border: 1px solid var(--line); background: rgba(255,255,255,.015); }

/* ---------------- cast chart drawer ---------------- */
.chart-drawer {
  position: fixed; z-index: 56; top: 58px; right: 0; bottom: 0; width: 398px;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(13,19,27,.995), rgba(7,11,16,.995));
  border-left: 1px solid rgba(212,180,117,.24);
  box-shadow: -22px 0 60px rgba(0,0,0,.52);
  transform: translateX(102%); transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.chart-drawer.open { transform: translateX(0); }
.chart-head {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center; padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(212,180,117,.055), transparent);
}
.chart-kicker { font: 700 7.5px/1 var(--sans); letter-spacing: .18em; color: #867e6d; }
.chart-title { margin-top: 2px; font-size: 14px; font-weight: 650; color: #f0e9db; }
.chart-head .icon-btn { margin-left: auto; }
.chart-body { flex: 1; overflow: auto; padding: 12px 14px 20px; scrollbar-width: thin; scrollbar-color: #343c42 transparent; }
.chart-player {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.075); background: rgba(255,255,255,.018);
}
.chart-player-portrait { width: 38px; height: 38px; border-radius: 50%; padding: 1px; background: conic-gradient(from 210deg, var(--cc), #161d24 75%, var(--cc)); }
.chart-player-portrait img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #0b1016; }
.chart-player-main { min-width: 0; flex: 1; }
.chart-player-name { font-size: 12px; font-weight: 650; color: #f0e9dc; }
.chart-player-sub { margin-top: 1px; font-size: 8.5px; color: #89928e; }
.chart-player select {
  height: 22px; max-width: 94px; padding: 0 3px; border: 1px solid var(--line); border-radius: 2px;
  background: #0a0f15; color: #cfc8b9; font-size: 9px;
}
.chart-range-row { display: flex; align-items: center; gap: 7px; margin-top: 11px; }
.chart-range { flex: 1; min-width: 0; font: 9.5px/1.3 var(--mono); color: #d6cfbf; }
.chart-range small { display: block; margin-top: 2px; color: #737d7a; font: 8px/1.3 var(--sans); letter-spacing: .05em; }
.chart-options { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.chart-hint { font-size: 8px; color: #6f7976; flex: 1; }
.chart-wrap {
  position: relative; height: 190px; margin-top: 9px;
  border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.014);
}
#castChart { width: 100%; height: 100%; display: block; }
.chart-tip {
  position: absolute; z-index: 4; display: none; pointer-events: none;
  padding: 4px 6px; background: rgba(6,9,13,.97); border: 1px solid rgba(240,215,156,.25);
  color: #e3d7bd; font: 8.5px/1.4 var(--mono); white-space: nowrap;
}
.chart-tip.show { display: block; }
.chart-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 9px; }
.chart-stat { padding: 7px 8px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.chart-stat .k { font: 700 7.5px/1 var(--sans); letter-spacing: .12em; color: #77817e; text-transform: uppercase; }
.chart-stat .v { margin-top: 3px; font: 14px/1.1 var(--mono); color: #e8e0d0; }
.chart-stat .v small { font: 8px/1 var(--sans); color: #7d8783; margin-left: 2px; }
.chart-section { margin-top: 13px; }
.chart-section h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 5px; font: 700 8px/1 var(--sans); letter-spacing: .15em; color: #8a938f; text-transform: uppercase; }
.chart-section h3 span { flex: 1; height: 1px; background: var(--line); }
.chart-ab-grid { display: flex; flex-direction: column; gap: 2px; }
.chart-ab-row { display: grid; grid-template-columns: 17px minmax(0,1fr) 38px 32px; gap: 5px; align-items: center; padding: 3px 4px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 9px; color: #b9b3a6; cursor: pointer; }
.chart-ab-row:hover { background: rgba(255,255,255,.035); }
.chart-ab-row img { width: 16px; height: 16px; border-radius: 2px; border: 1px solid rgba(255,255,255,.14); }
.chart-ab-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-ab-count { text-align: right; font: 8.5px/1 var(--mono); color: #ddd5c5; }
.chart-ab-pct { text-align: right; font: 8px/1 var(--mono); color: #7d8783; }
.chart-note { margin-top: 10px; color: #697371; font-size: 8.5px; line-height: 1.5; }
.chart-note b { color: #a69d89; font-weight: 500; }

/* ---------------- modal ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 5, 8, .72); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(720px, 100%); max-height: min(780px, calc(100dvh - 60px));
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #121922, #0b1016);
  border: 1px solid rgba(212,180,117,.22); border-radius: 4px;
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
}
.modal-head { display: flex; align-items: center; min-height: 48px; padding: 0 13px 0 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 14px; font-weight: 650; color: #ede7da; letter-spacing: .02em; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px; overflow: auto; color: #bcb8ad; font-size: 11px; line-height: 1.6; scrollbar-width: thin; scrollbar-color: #343c42 transparent; }
.modal-body h3 { margin: 16px 0 6px; font-size: 12px; color: #e7e1d4; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 5px 0; }
.modal-body kbd { display: inline-block; min-width: 18px; padding: 1px 5px; margin: 0 1px; border: 1px solid rgba(255,255,255,.18); border-bottom-color: rgba(255,255,255,.28); border-radius: 2px; background: #0b1016; color: #e6dfd1; font: 9px/1.5 var(--mono); text-align: center; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.04); color: #aeb2ab; }
.shortcut-row span { font-size: 10px; }
.modal-actions { display: flex; gap: 7px; margin-top: 15px; }
.primary-btn { height: 31px; padding: 0 14px; border: 1px solid #d6b878; border-radius: 2px; background: linear-gradient(180deg, #ecd9a9, #cdaa64); color: #15180f; font-size: 11px; font-weight: 650; }
.secondary-btn { height: 31px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px; color: #c6c1b4; background: rgba(255,255,255,.025); font-size: 11px; }
.query-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.query-table th { text-align: left; padding: 5px 6px; color: #8d9591; font-weight: 500; border-bottom: 1px solid var(--line); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; }
.query-table td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.04); color: #b9b5a9; }
.query-table td.time { font-family: var(--mono); color: #7f8987; white-space: nowrap; }
.query-table img { width: 16px; height: 16px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.source-card { padding: 10px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }

/* ---------------- loader ---------------- */
.loader {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(600px 380px at 50% 44%, rgba(43, 55, 49, .35), transparent 70%),
    #070a0f;
  transition: opacity .45s, visibility .45s;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark { width: 54px; height: 54px; color: var(--gold); filter: drop-shadow(0 0 18px rgba(212,180,117,.30)); }
.loader-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.loader-mark svg path:last-child { fill: currentColor; stroke: none; }
.loader-title { margin-top: 15px; font-size: 15px; letter-spacing: .12em; color: #eae3d3; font-weight: 600; }
.loader-sub { margin-top: 5px; font-size: 10px; color: #7b8582; }
.loader-track { width: 230px; height: 2px; margin-top: 17px; background: rgba(255,255,255,.08); overflow: hidden; }
.loader-fill { width: 0; height: 100%; background: linear-gradient(90deg, #b8924f, #f2dba5); transition: width .25s; box-shadow: 0 0 10px rgba(240,215,156,.4); }
.loader-meta { margin-top: 11px; font-size: 8px; color: #5e6867; letter-spacing: .12em; }
.noscript { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: #070a0f; color: #ccc; }

/* ---------------- scrollbars / selection ---------------- */
::selection { background: rgba(212,180,117,.28); color: #fff; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c343b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3b454d; }

/* ---------------- animations ---------------- */
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes criticalPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.32); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- responsive ---------------- */
@media (max-width: 1500px) {
  .run-id { display: none; }
  .topbar { gap: 11px; }
  .brand { min-width: 255px; }
  .party-card { height: 82px; }
  .ml-kicker { display: none; }
  .ml-title { font-size: 9.5px; }
  #segmentInput { width: 100px; }
  .segment-kicker { display: none; }
}
@media (max-width: 1280px) {
  .run-meta-item:nth-child(2), .run-meta-item:nth-child(3) { display: none; }
  .meters-panel { width: 260px; }
  .dungeon-panel { width: 272px; }
  .toggle-group.features .group-label, .toggle-group.filters .group-label { display: none; }
  .transport-row { gap: 8px; padding: 0 10px; }
  .tl-legend { display: none; }
  .party-hud { width: calc(100% - 16px); gap: 5px; }
  .party-card { padding: 5px 6px; }
  .pc-spec { display: none; }
  .pc-portrait { width: 27px; height: 27px; }
  .pc-name { font-size: 9.5px; }
  #segmentInput { width: 86px; }
  .segment-loop { display: none; }
}
@media (max-width: 1100px) {
  .map-tools { right: 274px; }
  .source-link span { display: none; }
  .import-link span:last-child { display: none; }
  .run-meta { display: none; }
  .brand { min-width: 0; }
  .meters-panel { display: none; }
  .dungeon-panel { width: 250px; }
  .party-hud { left: 8px; right: 8px; transform: none; width: auto; }
  .party-hud.hidden { transform: translateY(8px); }
  .tl-right .inline-check, .follow-btn { display: none; }
  .tl-heading .tl-sub { display: none; }
  .segment-editor { margin-left: 0; }
  #segmentInput { width: 76px; }
  .segment-go { padding: 0 5px; }
}
@media (max-height: 860px) {
  .boss-frames { top: 62px; width: 330px; }
  .boss-frames .boss-row { grid-template-columns: 34px minmax(0, 1fr) 48px; padding-top: 5px; padding-bottom: 6px; }
  .meters-panel, .dungeon-panel { bottom: 98px; }
  .meters-panel { width: 256px; }
  .dungeon-panel { width: 272px; }
  .party-hud { bottom: 7px; }
  .party-card { height: 62px; }
  .map-hint { display: none; }
}
@media (max-height: 790px) {
  .boss-frames { display: none !important; }
  .meters-panel, .dungeon-panel { bottom: 90px; }
}
@media (max-height: 740px) {
  .boss-frames { display: none !important; }
  .stage { grid-template-rows: minmax(220px, 1fr) 58px 240px; }
  .timeline { --tl-lane-h: 31px; }
  .party-hud { display: none; }
  .meters-panel, .dungeon-panel { bottom: 12px; }
}
@media (max-width: 760px) {
  .enemy-menu-head { flex-wrap: wrap; gap: 7px; }
  .enemy-menu-title { min-width: 0; flex: 1; }
  .menu-tabs { order: 5; width: 100%; justify-content: space-between; }
  .menu-search { order: 4; width: 100%; margin-left: 0; }
  .enemy-menu-foot .mono { display: none; }
}
@media (max-width: 860px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-title { font-size: 16px; }
  .brand-kicker { font-size: 8px; }
  .topbar-actions .source-link { display: none; }
  .transport-center { justify-content: flex-start; overflow: auto; }
  .toggle-group.features { display: none; }
  .tl-right .seg-group.small { display: none; }
  .tl-heading { display: none; }
  .dungeon-panel { display: none; }
  .party-hud { grid-template-columns: repeat(5, minmax(92px, 1fr)); overflow-x: auto; }
  .inspector, .chart-drawer { width: 100%; }
  .map-tools { display: none; }
  .ml-copy { display: none; }
  .menu-launcher { width: 34px; padding: 0; justify-content: center; }
  .ml-caret { display: none; }
  .enemy-menu-grid { grid-template-columns: 1fr; }
  .wave-chip { min-width: 70px; }
  .segment-editor { display: none; }
}
/* With the taller five-player dock, move side panels above it on narrower
   viewports so the buff rail and cards never sit on top of meters / dungeon. */
@media (max-width: 1860px), (max-height: 900px) {
  .boss-frames { display: none !important; }
  .meters-panel, .dungeon-panel { top: 58px; bottom: auto; }
}
@media (max-width: 1860px) and (max-height: 740px) {
  .meters-panel, .dungeon-panel { top: 54px; }
}
body.chart-open .meters-panel, body.chart-open .dungeon-panel,
body.inspector-open .meters-panel, body.inspector-open .dungeon-panel {
  top: 62px; bottom: auto;
}
body.chart-open .boss-frames, body.inspector-open .boss-frames { display: none !important; }
@media (max-width: 1500px) {
  body.chart-open .meters-panel, body.inspector-open .meters-panel { top: 46px; }
  body.chart-open .dungeon-panel, body.inspector-open .dungeon-panel { display: none; }
}

/* On wide desktops keep the five-player dock visually centered even with a
   right drawer open: only shrink it enough to clear the drawer. */
@media (min-width: 1900px) {
  body.chart-open .party-hud {
    left: 50%; width: min(1090px, calc(100% - 24px)); transform: translateX(-50%);
  }
  body.inspector-open .party-hud {
    left: 50%; width: min(1130px, calc(100% - 24px)); transform: translateX(-50%);
  }
  body.chart-open .party-hud.hidden, body.inspector-open .party-hud.hidden {
    transform: translate(-50%, 8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
