﻿.timeline-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px;
  border: 1px solid rgba(105, 146, 185, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(8, 18, 28, 0.94), rgba(8, 17, 27, 0.9)),
    var(--bg-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: grab;
}

.timeline-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.timeline-wrap.is-dragging * {
  cursor: grabbing;
}

.timeline {
  min-width: 1400px;
  position: relative;
}

.track {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: none;
  z-index: 0;
}

.timeline-grid-line {
  position: absolute;
  z-index: 0;
  width: 1px;
  background: rgba(105, 146, 185, 0.08);
  pointer-events: none;
}

.timeline-grid-line.five {
  background: rgba(105, 146, 185, 0.14);
}

.timeline-grid-line.ten {
  background: rgba(123, 198, 255, 0.2);
}

.lane-guide-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(105, 146, 185, 0.26), rgba(105, 146, 185, 0.16), transparent);
  pointer-events: none;
}

.lane-guide-line.a {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.3), rgba(105, 146, 185, 0.16), transparent);
}

.lane-guide-line.b {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.3), rgba(105, 146, 185, 0.16), transparent);
}

.lane-guide-line.synergy {
  height: 1px;
  background: linear-gradient(90deg, rgba(242, 207, 122, 0.44), rgba(110, 231, 216, 0.24), transparent);
}

.player-label {
  position: absolute;
  left: 8px;
  box-sizing: border-box;
  width: 48px;
  z-index: 2;
  overflow: hidden;
  padding: 2px 4px;
  border: 1px solid rgba(123, 198, 255, 0.2);
  border-radius: 999px;
  background: rgba(18, 43, 72, 0.68);
  color: #d7ecff;
  font-size: 11px;
  font-weight: bold;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-label-a {
  border-color: rgba(56, 189, 248, 0.34);
  color: #7dd3fc;
}

.player-label-b {
  border-color: rgba(249, 115, 22, 0.34);
  color: #fdba74;
}

.lane-label {
  position: absolute;
  left: 8px;
  z-index: 2;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}

.player-divider {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(123, 198, 255, 0.34) 0%, rgba(105, 146, 185, 0.16) 50%, transparent 100%);
}

.event {
  position: absolute;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(123, 198, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 26, 39, 0.96), rgba(8, 15, 24, 0.96));
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.event:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(123, 198, 255, 0.42);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.32);
}

.event img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.event span {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.event[title] {
  cursor: pointer;
}

.burst-overlay {
  position: absolute;
  z-index: 0;
  border-radius: 10px;
  pointer-events: none;
}

.burst-label {
  position: absolute;
  top: 2px;
  left: 6px;
  font-size: 9px;
  font-weight: bold;
  opacity: 0.8;
  white-space: nowrap;
}

.synergy-window {
  position: absolute;
  z-index: 3;
  height: 42px;
  overflow: hidden;
  border: 1px solid;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.synergy-window span {
  display: block;
  padding: 11px 10px 0;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.synergy-lane-name {
  position: absolute;
  left: 8px;
  z-index: 2;
  max-width: 56px;
  overflow: hidden;
  font-size: 9px;
  font-weight: 700;
  line-height: 11px;
  opacity: 0.9;
  pointer-events: none;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.synergy-segment {
  position: absolute;
  z-index: 3;
  height: 7px;
  border: 1px solid var(--synergy-color);
  border-radius: 999px;
  background: var(--synergy-color);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.28);
  opacity: 0.72;
  pointer-events: auto;
}

.synergy-start {
  position: absolute;
  z-index: 4;
  width: 16px;
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--synergy-color);
  border-radius: 5px;
  background: rgba(8, 15, 24, 0.95);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(0, 0, 0, 0.28);
}

.synergy-start-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.synergy-start-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}

.boss-cast-lane-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.28), rgba(105, 146, 185, 0.12), transparent);
  pointer-events: none;
}

.boss-cast-lane-label {
  color: rgba(253, 224, 71, 0.80);
  font-size: 10px;
}

.add-cast-lane-label {
  color: rgba(148, 163, 184, 0.70);
  font-size: 10px;
}

.boss-cast-bar {
  position: absolute;
  z-index: 3;
  height: 24px;
  min-width: 18px;
  overflow: hidden;
  border: 1px solid rgba(250, 204, 21, 0.50);
  border-radius: 5px;
  background: rgba(250, 204, 21, 0.22);
  color: #fefce8;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  pointer-events: auto;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.boss-cast-bar.b {
  border-color: rgba(249, 115, 22, 0.50);
  background: rgba(249, 115, 22, 0.22);
}

.boss-cast-bar.add {
  border-color: rgba(148, 163, 184, 0.40);
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.boss-cast-bar.add.b {
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(148, 163, 184, 0.10);
}

.boss-cast-bar span {
  display: block;
  overflow: hidden;
  padding: 0 6px;
  text-overflow: ellipsis;
}

.player-debuff-segment {
  position: absolute;
  z-index: 3;
  height: 18px;
  min-width: 28px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--debuff-color, #f87171) 62%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--debuff-color, #f87171) 18%, transparent);
  color: #fee2e2;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  pointer-events: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-debuff-segment span {
  display: block;
  overflow: hidden;
  padding: 0 6px;
  text-overflow: ellipsis;
}

.legend {
  margin-top: 10px;
  color: var(--blue-light);
  font-size: 12px;
}

.ruler {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
}

.tick {
  position: absolute;
  z-index: 2;
  top: 0;
  width: 1px;
  background: var(--border-default);
}

.tick.one {
  height: 6px;
  opacity: 0.5;
}

.tick.five {
  height: 10px;
  opacity: 0.8;
}

.tick.ten {
  height: 14px;
  opacity: 1;
}

.tick span {
  position: absolute;
  top: -1px;
  left: 6px;
  color: var(--text-primary);
  font-size: 10px;
}

.boss-cast {
  position: absolute;
  z-index: 2;
  height: 20px;
  overflow: hidden;
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.boss-cast-name {
  position: absolute;
  top: 2px;
  left: 7px;
  color: #fecaca;
  font-size: 9px;
  pointer-events: none;
  white-space: nowrap;
}

.debuff-bar {
  position: absolute;
  z-index: 2;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.debuff-label {
  position: absolute;
  top: 1px;
  left: 7px;
  color: #fff5f5;
  font-size: 8px;
  pointer-events: none;
  white-space: nowrap;
}

.phase-divider {
  position: absolute;
  z-index: 4;
  width: 2px;
  background: rgba(168, 85, 247, 0.5);
  pointer-events: none;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.18);
}

.phase-divider-label {
  position: absolute;
  top: 0;
  left: 8px;
  color: #a855f7;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.phase-divider.a {
  background: rgba(56, 189, 248, 0.65);
}

.phase-divider.a .phase-divider-label {
  color: #38bdf8;
}

.phase-divider.b {
  background: rgba(249, 115, 22, 0.65);
}

.phase-divider.b .phase-divider-label {
  color: #fb923c;
}

.kill-divider {
  position: absolute;
  z-index: 5;
  width: 2px;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.14);
}

.kill-divider-label {
  position: absolute;
  top: 0;
  left: 8px;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.kill-divider.a {
  background: rgba(56, 189, 248, 0.9);
}

.kill-divider.a .kill-divider-label {
  color: #7dd3fc;
}

.kill-divider.b {
  background: rgba(249, 115, 22, 0.9);
}

.kill-divider.b .kill-divider-label {
  color: #fdba74;
}

.dps-graph-svg text {
  font-family: Bahnschrift, "Yu Gothic UI", sans-serif;
}

.pt-control-label {
  grid-column: 1 / -1;
  align-self: center;
  color: #7c95ad;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.pt-filter-controls {
  position: absolute;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 10px 28px;
  align-content: center;
  gap: 4px;
  box-sizing: border-box;
  padding: 5px 6px;
  border: 1px solid rgba(123, 198, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.pt-filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  border: 1px solid rgba(123, 198, 255, 0.16);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #b8c7d8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.pt-filter-btn:hover {
  color: #d7ecff;
}

.pt-filter-btn.active {
  border-color: rgba(56, 189, 248, 0.52);
  background: rgba(56, 189, 248, 0.2);
  color: #e5f7ff;
}

.pt-custom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(2, 6, 12, 0.42);
}

.pt-custom-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: 640px;
  border: 1px solid rgba(123, 198, 255, 0.26);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.98);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48);
  color: #d7ecff;
  overscroll-behavior: contain;
}

.pt-custom-head,
.pt-custom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(123, 198, 255, 0.12);
}

.pt-custom-actions {
  justify-content: flex-end;
  border-top: 1px solid rgba(123, 198, 255, 0.12);
  border-bottom: 0;
}

.pt-custom-title {
  font-size: 14px;
  font-weight: 800;
}

.pt-custom-sub {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

.pt-custom-close,
.pt-custom-secondary,
.pt-custom-primary {
  height: 30px;
  border: 1px solid rgba(123, 198, 255, 0.2);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.76);
  color: #d7ecff;
  cursor: pointer;
  font-weight: 700;
}

.pt-custom-close {
  width: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.pt-custom-secondary,
.pt-custom-primary {
  padding: 0 12px;
  font-size: 12px;
}

.pt-custom-primary {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.2);
}

.pt-custom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-height: 380px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.pt-custom-side {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pt-custom-side-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
}

.pt-custom-side-title.a {
  color: #7dd3fc;
}

.pt-custom-side-title.b {
  color: #fdba74;
}

.pt-custom-player {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 7px;
  border: 1px solid rgba(123, 198, 255, 0.12);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.58);
  cursor: pointer;
}

.pt-custom-player input {
  width: 14px;
  height: 14px;
  accent-color: #38bdf8;
}

.pt-custom-job {
  grid-column: 2;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.pt-custom-name {
  grid-column: 2;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-group-label {
  position: absolute;
  left: 6px;
  z-index: 2;
  padding: 3px 8px;
  border: 1px solid rgba(123, 198, 255, 0.2);
  border-radius: 999px;
  background: rgba(18, 43, 72, 0.72);
  color: #d7ecff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}

.pt-group-label.a {
  border-color: rgba(56, 189, 248, 0.34);
  color: #7dd3fc;
}

.pt-group-label.b {
  border-color: rgba(249, 115, 22, 0.34);
  color: #fdba74;
}

.pt-row-label {
  position: absolute;
  left: 8px;
  z-index: 2;
  width: 146px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-row-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(105, 146, 185, 0.22), rgba(105, 146, 185, 0.12), transparent);
  pointer-events: none;
}

.pt-row-line.a {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.28), rgba(105, 146, 185, 0.12), transparent);
}

.pt-row-line.b {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.28), rgba(105, 146, 185, 0.12), transparent);
}

.pt-event {
  position: absolute;
  z-index: 3;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid rgba(123, 198, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 15, 24, 0.96);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28);
}

.pt-event img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}

.pt-event span {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 700;
}

.debug-log {
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(105, 146, 185, 0.16);
  border-radius: 14px;
  background: rgba(5, 11, 19, 0.88);
  color: var(--text-secondary);
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.error-log {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.timeline-wrap::-webkit-scrollbar,
.debug-log::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.timeline-wrap::-webkit-scrollbar-track,
.debug-log::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.timeline-wrap::-webkit-scrollbar-thumb,
.debug-log::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(123, 198, 255, 0.24);
  background-clip: padding-box;
}

.timeline-wrap::-webkit-scrollbar-thumb:hover,
.debug-log::-webkit-scrollbar-thumb:hover {
  background: rgba(123, 198, 255, 0.38);
  background-clip: padding-box;
}

