:root {
  color-scheme: dark;
  --bg-1: #0b0b10;
  --bg-2: #101018;
  --panel: #151521;
  --panel-2: #1b1b2b;
  --border: rgba(255, 255, 255, 0.08);
  --muted: #9a9aac;
  --text: #f4f4ff;
  --accent: #9f6bff;
  --accent-2: #6a4bff;
  --accent-3: #b05bff;
  --blue: #4ea4ff;
  --green: #38d39f;
  --glow: rgba(159, 107, 255, 0.35);
  --danger: #ff5d8f;
  --success: #5ee6a0;
  --metric-damage: #f5a524;
  --metric-heal: #2fd3c5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(159, 107, 255, 0.18), transparent 60%),
    radial-gradient(1000px 700px at 110% -20%, rgba(78, 164, 255, 0.12), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 35%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #d2b7ff;
}

.app-shell {
  padding: 2.5rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 100%;
  margin: 0;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1200px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.analysis-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analysis-sidebar .hero-card {
  min-height: 80vh;
  height: calc(100vh - 170px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.analysis-sidebar .collapsible {
  margin-bottom: 0;
}

.analysis-sidebar .collapsible__header,
.analysis-sidebar .collapsible__hint {
  display: none;
}

.analysis-sidebar .layout-two-col {
  grid-template-columns: 1fr;
}

.analysis-sidebar .compare-btn {
  width: 100%;
  min-width: 0;
}

.menu-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  height: 100%;
  flex: 1;
}

.menu-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  flex-shrink: 0;
}

.analysis-sidebar .menu-section > .card {
  height: auto;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.menu-actions .primary-btn,
.menu-actions .compare-btn {
  width: 100%;
  margin: 0;
}

.analysis-sidebar .card {
  padding: 1.1rem;
}

.analysis-sidebar .pill-toggle {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.input-row .input-with-icon {
  flex: 1;
}

.btn-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1;
  min-height: unset;
}

.menu-section.top-players-section {
  min-height: auto;
}

#topPlayersPanel {
  display: flex;
  flex-direction: column;
}

#topPlayersList {
  margin: 0.85rem 0 0;
  padding-left: 2.25rem;
  padding-right: 0.4rem;
}

#topPlayersList li {
  margin-bottom: 0.55rem;
}

#topPlayersList li::marker {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.top-player-item {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(159, 107, 255, 0.28);
  color: var(--text);
  font-size: 0.9rem;
  user-select: text;
  -webkit-user-select: text;
}

.top-player-item:hover {
  border-color: rgba(159, 107, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(159, 107, 255, 0.2);
}

.top-player-item.is-selected {
  background: rgba(159, 107, 255, 0.18);
  border-color: rgba(159, 107, 255, 0.7);
  color: #f1e8ff;
}

.analysis-main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1.25rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.version {
  margin-left: 0.75rem;
  font-size: 0.75rem;
  color: var(--accent-3);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.topbar-links a {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(10, 10, 16, 0.55)),
    radial-gradient(circle at top right, rgba(159, 107, 255, 0.16), transparent 60%);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
  display: grid;
  gap: 0.35rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #dac2ff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: #f0e4ff;
}

.section {
  margin-bottom: 2.5rem;
}

.section-title {
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.collapsible {
  margin-bottom: 2.5rem;
}

.card .collapsible {
  margin-bottom: 0;
}

.collapsible__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.collapsible__toggle {
  background: transparent;
  border: 1px solid rgba(159, 107, 255, 0.5);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.collapsible__toggle .toggle-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.collapsible__hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.collapsible__body {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  max-height: 2000px;
  opacity: 1;
}

.collapsible.is-collapsed .collapsible__body {
  max-height: 0;
  opacity: 0;
}

.hero-title {
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  margin: 0;
}

.hero-sub {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.card {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-card {
  border-color: rgba(159, 107, 255, 0.5);
  background: radial-gradient(120% 140% at 20% 0%, rgba(159, 107, 255, 0.16), transparent 60%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.04), rgba(10, 10, 16, 0.6));
  box-shadow: 0 0 0 1px rgba(159, 107, 255, 0.12), 0 20px 55px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  border: 1px solid rgba(159, 107, 255, 0.35);
  box-shadow: 0 0 22px rgba(159, 107, 255, 0.35);
  pointer-events: none;
}

.card-stack .card + .card {
  margin-top: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.layout-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.35rem;
}

.input-with-icon {
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  gap: 0.5rem;
}

.hero-card .input-with-icon {
  background: rgba(15, 15, 24, 0.85);
  border-color: rgba(78, 164, 255, 0.35);
}

.input-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

select option {
  background-color: #14141d;
  color: var(--text);
}

select optgroup {
  background-color: #14141d;
  color: var(--text);
}

input[type="text"]::placeholder {
  color: #5f5f6f;
}

select {
  padding-right: 1.5rem;
  color-scheme: dark;
}

.input-with-icon:focus-within,
.field:focus-within {
  border-color: rgba(159, 107, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(159, 107, 255, 0.2);
}

.field {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}

.button-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(106, 75, 255, 0.35);
}

.primary-btn:hover {
  box-shadow: 0 0 20px var(--glow);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}

.ghost-btn:hover {
  box-shadow: 0 0 16px rgba(159, 107, 255, 0.25);
}

.danger-btn {
  background: #3a2130;
  box-shadow: none;
}

.danger-btn:hover {
  box-shadow: 0 0 16px rgba(255, 93, 143, 0.25);
}

.compare-btn {
  margin: 1.5rem auto 0;
  display: block;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  min-width: 280px;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
}

.compare-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.compare-btn .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-btn .btn-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.compare-btn .btn-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.6;
  animation: pulse 1.2s infinite ease-in-out;
}

.compare-btn .btn-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.compare-btn .btn-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.analysis-placeholder {
  margin-top: 2rem;
}

.analysis-placeholder:empty {
  margin-top: 0;
  height: 0;
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-line {
  height: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.skeleton-card {
  border-radius: 14px;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 18, 0.6);
}

.load-card {
  display: grid;
  gap: 1.25rem;
  align-items: end;
}

.load-card .button-row {
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.combat-toggle-row {
  margin-top: 0.75rem;
  justify-content: flex-start;
  grid-column: 1 / -1;
}

.combat-toggle {
  padding: 0.4rem 1.05rem;
  font-size: 0.72rem;
  border-color: rgba(159, 107, 255, 0.65);
  background: rgba(159, 107, 255, 0.08);
}

.combat-toggle:hover {
  box-shadow: 0 0 16px var(--glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(159, 107, 255, 0.5);
  color: var(--accent);
  box-shadow: none;
}

.btn-outline:hover {
  box-shadow: 0 0 16px var(--glow);
}

@media (max-width: 980px) {
  .analysis-layout {
    grid-template-columns: 1fr;
  }

  .analysis-sidebar .hero-card {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .load-card {
    grid-template-columns: 1fr;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  background: rgba(159, 107, 255, 0.18);
  color: #e0d4ff;
}

.badge-blue {
  background: rgba(78, 164, 255, 0.18);
  color: #bfe1ff;
}

.badge-green {
  background: rgba(56, 211, 159, 0.2);
  color: #b6f0db;
}

.accent-bar {
  position: relative;
}

.accent-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
}

.accent-blue::before {
  background: linear-gradient(180deg, #6bb8ff, #2d7cff);
}

.accent-green::before {
  background: linear-gradient(180deg, #47e2a8, #1ea375);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.15rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.comparison-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-menu {
  position: relative;
}

.filter-menu summary {
  cursor: pointer;
  list-style: none;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(320px, 80vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.filter-menu[open] .filter-menu__panel {
  animation: slideIn 0.12s ease-out;
}

.filter-menu__title {
  font-size: 0.8rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-menu__list {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.filter-menu__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.filter-menu__row input {
  accent-color: var(--accent);
}

.filter-menu__name {
  flex: 1;
  color: var(--text);
  text-decoration: none;
}

.filter-menu__name:hover {
  color: var(--accent);
}

.filter-menu__count {
  color: var(--muted);
  font-size: 0.75rem;
}

.filter-menu__actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.filter-menu__submit {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  box-shadow: none;
}

.ability-filtered {
  display: none !important;
}

.ability-grouped {
  display: none !important;
}

.rotation-stash {
  display: none;
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
}

.pill-toggle input {
  accent-color: var(--accent);
}

.spec-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.spec-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(159, 107, 255, 0.45);
  background: rgba(159, 107, 255, 0.12);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.spec-pill:hover {
  border-color: rgba(159, 107, 255, 0.8);
  box-shadow: 0 0 18px rgba(159, 107, 255, 0.2);
}

.debug-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 93, 143, 0.5);
  background: rgba(255, 93, 143, 0.12);
  color: #ff9fbc;
  font-size: 0.7rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

.debug-toggle-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.debug-panel {
  margin-top: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 15, 24, 0.6);
  color: var(--muted);
  font-size: 0.8rem;
}

.debug-panel summary {
  cursor: pointer;
  color: var(--accent);
}

.debug-block {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.debug-title {
  font-size: 0.7rem;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.debug-row {
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.debug-line {
  font-size: 0.78rem;
  line-height: 1.4;
}

.debug-list {
  margin: 0.35rem 0 0.5rem 1rem;
  padding: 0;
  color: var(--muted);
}

.debug-raw summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.debug-raw pre {
  background: rgba(10, 10, 18, 0.9);
  border: 1px solid var(--border);
  padding: 0.6rem;
  border-radius: 8px;
  overflow: auto;
  font-size: 0.72rem;
  color: #c9c9df;
}

.debug-sample-list {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.76rem;
}

.debug-details-hidden .debug-details {
  display: none;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.compare-side {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: #d6d6e3;
}

.column-header .filter-menu {
  margin-left: auto;
}

.column-header .pill-toggle {
  font-size: 0.7rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
}

.filter-menu--header .filter-menu__panel {
  min-width: 260px;
}

.column-header-blue {
  border-left: 3px solid var(--blue);
}

.column-header-green {
  border-left: 3px solid var(--green);
}

.stats-detail-row {
  margin-top: 0.75rem;
}

.stats-detail {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
  color: #d6d6e3;
}

.stats-detail--source {
  border-left: 3px solid var(--blue);
}

.stats-detail--target {
  border-left: 3px solid var(--green);
}

.stats-detail summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.14rem;
  font-size: 0.7rem;
  color: #f1f1f7;
}

.stats-detail summary::-webkit-details-marker {
  display: none;
}

.stats-detail summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease;
}

.stats-detail[open] summary::after {
  transform: rotate(180deg);
}

.stats-detail__list {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-detail__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.stats-detail__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stats-detail__label {
  color: rgba(214, 214, 227, 0.78);
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.stats-detail__value {
  font-weight: 600;
  color: #f2f2f8;
}

.stats-detail__value--diff {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.stats-detail--source .stats-detail__value--diff {
  color: var(--blue);
}

.stats-detail--target .stats-detail__value--diff {
  color: var(--green);
}

.stats-detail__delta {
  margin-left: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.8;
}

.iterations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.iter-cell {
  display: flex;
}

.iter-card {
  width: 100%;
  margin-bottom: 0;
}

.iter-card.placeholder {
  opacity: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.compare-side h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
}

.window-card {
  background: rgba(10, 10, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.iter-detail {
  padding: 0;
  border-color: rgba(78, 164, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(78, 164, 255, 0.08), 0 0 24px rgba(78, 164, 255, 0.12);
}

.iter-detail > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem;
  display: block;
  background: linear-gradient(120deg, rgba(78, 164, 255, 0.08), rgba(10, 10, 18, 0.2));
}

.iter-detail > summary::-webkit-details-marker {
  display: none;
}

.iter-detail > summary:hover {
  background: linear-gradient(120deg, rgba(78, 164, 255, 0.14), rgba(10, 10, 18, 0.25));
}

.iter-summary__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.iter-summary__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.iter-summary__actions .window-metrics {
  justify-content: flex-end;
}

.iter-summary__chevron {
  color: #bfe1ff;
  font-size: 0.8rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(78, 164, 255, 0.5);
  background: rgba(13, 18, 30, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-90deg);
  transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.iter-summary__chevron svg {
  width: 12px;
  height: 12px;
  display: block;
}

.iter-detail[open] .iter-summary__chevron {
  color: #e9f4ff;
  transform: rotate(0deg);
  box-shadow: 0 0 14px rgba(78, 164, 255, 0.35);
}

.iter-detail__body {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.9rem;
}

.window-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 28px);
  gap: 0.7rem;
  margin-top: 0.65rem;
  justify-content: start;
}

.window-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 0;
  border: none;
  background: transparent;
  text-decoration: none;
  font-size: 0;
  padding: 2px;
}

.window-icon__count {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: rgba(122, 83, 255, 0.9);
  color: #fff;
  font-size: 0.6rem;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.window-icon--fallback {
  font-size: 0.6rem;
  line-height: 1.1;
  color: var(--muted);
  padding: 0 0.2rem;
}

.window-icons__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--muted);
  font-size: 0.75rem;
}

.window-icons a[data-wowhead] img,
.window-icons a[data-wowhead] .wh-icon,
.window-icons a[data-wowhead] .icon {
  width: 22px;
  height: 22px;
  margin: 0;
}

.rotation-group {
  border: none;
  padding: 0.15rem 0;
  display: block;
  width: 100%;
}

.rotation-group__summary {
  list-style: none;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(123, 84, 255, 0.18), rgba(123, 84, 255, 0));
  width: 100%;
  position: relative;
}

.rotation-group__summary::-webkit-details-marker {
  display: none;
}

.rotation-group[open] .rotation-group__summary {
  background: linear-gradient(90deg, rgba(123, 84, 255, 0.28), rgba(123, 84, 255, 0));
}

.rotation-group__summary::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: rgba(123, 84, 255, 0.9);
}

.rotation-group__time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}

.rotation-group__time-sep {
  font-size: 0.6rem;
  opacity: 0.7;
}

.rotation-group__count {
  margin-left: 0.45rem;
  font-size: 0.65rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(122, 83, 255, 0.9);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.rotation-group__pill {
  margin-left: 0.4rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(123, 84, 255, 0.18);
  color: #cbb6ff;
}

.rotation-group__summary .rotation-group__target {
  display: none;
}

.rotation-group__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.rotation-group[open] .rotation-group__toggle {
  transform: rotate(45deg);
  color: var(--accent);
  border-color: rgba(159, 107, 255, 0.6);
}

.rotation-group__body {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 10px;
}

.iter-detail[open] .window-icons {
  display: none;
}

.window-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.window-header span {
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.damage-total {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--metric-damage);
}

.window-metrics {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.metric-pill--damage {
  color: var(--metric-damage);
  border-color: rgba(245, 165, 36, 0.5);
}

.metric-pill--heal {
  color: var(--metric-heal);
  border-color: rgba(47, 211, 197, 0.5);
}

.window-meta {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 0.8rem;
  color: #c6c6d6;
}

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 0.85rem;
  color: #c6c6d6;
}

.target-list,
.rotation-list {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: #d7d7ea;
}

.cast-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.cast-row + .cast-row {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.cast-time {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

.cast-spell a.wh-spell,
.cast-spell .wh-spell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}


.cast-target {
  margin-top: 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.cast-target-id {
  color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 720px) {
  .cast-row {
    grid-template-columns: 70px 1fr;
  }
}

.subtle-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin: 1rem 0;
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.cooldown-group {
  margin-top: 1rem;
}

.cooldown-group__title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.cooldown-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cooldown-row {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(20, 20, 30, 0.4);
  padding: 0.75rem 1rem;
}

.cooldown-row[open] {
  box-shadow: 0 0 22px rgba(159, 107, 255, 0.15);
}

.cooldown-summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.cooldown-summary::-webkit-details-marker {
  display: none;
}

.cooldown-name {
  font-size: 0.95rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.cooldown-meta {
  margin-top: 0.35rem;
}

.cooldown-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cooldown-body {
  margin-top: 1rem;
}

.collapsible__summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.error-text {
  color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.field.error {
  border-color: rgba(255, 93, 143, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 93, 143, 0.15);
}

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  background: rgba(20, 20, 30, 0.96);
  border: 1px solid rgba(255, 93, 143, 0.6);
  border-left: 3px solid var(--danger);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.toast-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: #ffd1e0;
  margin-bottom: 0.35rem;
}

.toast-body {
  font-size: 0.9rem;
  color: #f3e8ee;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  float: right;
  margin-left: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
  vertical-align: top;
}

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--muted);
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.wowhead-icon a img,
a[data-wowhead] img,
a.wowhead-link img,
a[href*="wowhead.com/spell="] img {
  width: 22px;
  height: 22px;
  vertical-align: -4px;
  margin-right: 8px;
}

a[data-wowhead] .wh-icon,
a[data-wowhead] .icon {
  width: 22px;
  height: 22px;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .site-footer {
    padding: 0.95rem 1rem;
    font-size: 0.8rem;
    line-height: 1.5;
  }
}

.admin-cooldowns-shell {
  --admin-red: #ff5757;
  --admin-green: #3ddc97;
  --admin-blue: #3a9dff;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

.admin-cooldowns-nav {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(10, 10, 16, 0.6));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 4rem);
  overflow: auto;
}

.admin-cooldowns-nav__title {
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.admin-cooldowns-nav__class {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  margin-bottom: 0.9rem;
}

.admin-cooldowns-nav__class.is-active {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 87, 87, 0.2);
}

.admin-cooldowns-nav__class-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.admin-cooldowns-nav__specs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-cooldowns-nav__spec {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-cooldowns-nav__spec.is-active {
  color: var(--text);
  border-color: rgba(255, 87, 87, 0.4);
  background: rgba(255, 87, 87, 0.12);
}

.admin-cooldowns-main {
  min-width: 0;
}

.admin-cooldowns-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-cooldowns-breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.admin-cooldowns-title {
  font-size: 2rem;
  margin: 0;
}

.admin-cooldowns-sub {
  color: var(--muted);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.admin-cooldowns-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-cooldowns-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
}

.admin-cooldowns-column {
  min-width: 0;
}

.admin-add-card {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(12, 12, 18, 0.6);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-add-card__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
}

.admin-add-card__summary::-webkit-details-marker {
  display: none;
}

.admin-add-card__summary::marker {
  display: none;
}

.admin-add-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-add-card__body {
  margin-top: 1.2rem;
}

.admin-cooldown-section {
  background: rgba(12, 12, 18, 0.4);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.admin-cooldown-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.admin-cooldown-section__title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-cooldown-section__title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.admin-cooldown-section.is-offensive .admin-cooldown-section__title::before {
  background: var(--admin-red);
  box-shadow: 0 0 10px rgba(255, 87, 87, 0.6);
}

.admin-cooldown-section.is-defensive .admin-cooldown-section__title::before {
  background: var(--admin-green);
  box-shadow: 0 0 10px rgba(61, 220, 151, 0.6);
}

.admin-cooldown-section.is-healing .admin-cooldown-section__title::before {
  background: var(--admin-blue);
  box-shadow: 0 0 10px rgba(58, 157, 255, 0.6);
}

.admin-cooldown-section__hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-cooldown-group__title {
  text-transform: uppercase;
  letter-spacing: 0.14rem;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 1.2rem;
}

.admin-cooldown-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.admin-cooldown-item {
  background: rgba(15, 15, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.admin-cooldown-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.admin-cooldown-summary::-webkit-details-marker {
  display: none;
}

.admin-cooldown-summary::marker {
  display: none;
}

.admin-cooldown-summary__main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.admin-cooldown-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-cooldown-section.is-offensive .admin-cooldown-icon {
  border-color: rgba(255, 87, 87, 0.4);
  background: linear-gradient(140deg, rgba(255, 87, 87, 0.35), rgba(255, 87, 87, 0.08));
}

.admin-cooldown-section.is-defensive .admin-cooldown-icon {
  border-color: rgba(61, 220, 151, 0.4);
  background: linear-gradient(140deg, rgba(61, 220, 151, 0.35), rgba(61, 220, 151, 0.08));
}

.admin-cooldown-section.is-healing .admin-cooldown-icon {
  border-color: rgba(58, 157, 255, 0.4);
  background: linear-gradient(140deg, rgba(58, 157, 255, 0.35), rgba(58, 157, 255, 0.08));
}

.admin-cooldown-name {
  font-size: 1rem;
  font-weight: 600;
}

.admin-cooldown-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-cooldown-summary__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-cooldown-pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: var(--muted);
}

.admin-cooldown-pill.is-enabled {
  border-color: rgba(61, 220, 151, 0.45);
  color: #baf4db;
  background: rgba(61, 220, 151, 0.12);
}

.admin-cooldown-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

.admin-panel {
  position: sticky;
  top: 1.5rem;
}

.admin-panel__title {
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

@media (max-width: 1100px) {
  .admin-cooldowns-shell {
    grid-template-columns: 1fr;
  }

  .admin-cooldowns-nav {
    position: static;
    max-height: none;
  }

  .admin-cooldowns-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    position: static;
  }
}
