* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0a0a0a;
  color: #f5f5f5;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

/* ------- Header ------- */

.site-header {
  background: #050505;
  border-bottom: 1px solid #1f1f1f;
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Nav buttons live in their own container so mobile can turn them into a
   drawer without moving the logo. Desktop: inline row, same as before. */
.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger — hidden on desktop, shown in the mobile media query. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: #ddd;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-title {
  margin: 0;
  display: flex;
  align-items: center;
}

.site-logo {
  height: 44px;
  width: auto;
  display: block;
  filter:
    drop-shadow(0 0 4px rgba(184, 136, 255, 0.5))
    drop-shadow(0 0 10px rgba(184, 136, 255, 0.25));
}

.nav-dropdown {
  position: relative;
}

.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

/* Hide the language name in the header button — keep just the flag so the
 * nav row stays compact. The names still appear in the dropdown's lang-items. */
.lang-name {
  display: none;
}

.dropdown-menu-lang {
  min-width: 200px;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.lang-item .flag {
  flex-shrink: 0;
}

.lang-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lang-item.disabled:hover {
  background: transparent;
  color: #ccc;
}

.lang-item .soon {
  margin-left: auto;
  font-size: 10px;
  color: #888;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.nav-button {
  background: transparent;
  border: 1px solid #333;
  color: #ddd;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-button:hover {
  border-color: #666;
  color: #fff;
}

.caret {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.15s;
}

.nav-dropdown.open .caret {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  padding: 4px;
}

.dropdown-menu-lang {
  left: auto;
  right: 0;
}

.nav-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #ccc;
  padding: 8px 12px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.8px;
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
}

.dropdown-item:hover {
  background: #232323;
  color: #fff;
}

.dropdown-item.active {
  background: #2a2a2a;
  color: #fff;
}

.dropdown-item.active::before {
  content: '› ';
  color: #888;
}

/* ------- Container ------- */

.container {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 20px;
}

/* ------- Stats bar (filtro por atributo) ------- */

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  justify-content: center;
  margin-bottom: 10px;
}

.stat-pill {
  --neon-color: #888;
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid color-mix(in srgb, var(--neon-color) 45%, transparent);
  padding: 5px 14px 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: color-mix(in srgb, #fff 70%, transparent);
  cursor: pointer;
  letter-spacing: 1px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  text-transform: uppercase;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0.55;
  -webkit-text-stroke: 0.5px color-mix(in srgb, var(--neon-color) 50%, transparent);
  text-shadow: 0 0 3px color-mix(in srgb, var(--neon-color) 35%, transparent);
  box-shadow: none;
}

.stat-pill .stat-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 1px color-mix(in srgb, var(--neon-color) 50%, transparent));
  opacity: 0.75;
  pointer-events: none;
}

.stat-pill:hover {
  opacity: 0.85;
  border-color: color-mix(in srgb, var(--neon-color) 75%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 0 8px color-mix(in srgb, var(--neon-color) 35%, transparent);
}

.stat-pill.active {
  opacity: 1;
  color: #fff;
  background: color-mix(in srgb, var(--neon-color) 28%, rgba(0,0,0,0.6));
  border: 2px solid var(--neon-color);
  transform: scale(1.06);
  -webkit-text-stroke: 0.7px var(--neon-color);
  text-shadow:
    0 0 5px var(--neon-color),
    0 0 12px var(--neon-color),
    0 0 22px color-mix(in srgb, var(--neon-color) 80%, transparent);
  box-shadow:
    0 0 14px color-mix(in srgb, var(--neon-color) 75%, transparent),
    0 0 30px color-mix(in srgb, var(--neon-color) 45%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--neon-color) 25%, transparent);
}

.stat-pill.active .stat-icon {
  opacity: 1;
  filter: drop-shadow(0 0 3px var(--neon-color)) drop-shadow(0 0 6px color-mix(in srgb, var(--neon-color) 70%, transparent));
}

/* ------- Archetype bar ------- */

.archetype-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  justify-content: center;
}

.archetype-pill {
  --neon-color: #888;
  --neon-gradient: linear-gradient(90deg, var(--neon-color), var(--neon-color));
  background:
    linear-gradient(#060606, #060606) padding-box,
    var(--neon-gradient) border-box;
  border: 1.5px solid transparent;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  letter-spacing: 1px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  text-transform: uppercase;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease, border-width 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  isolation: isolate;
  -webkit-text-stroke: 0.6px var(--neon-color);
  text-shadow:
    0 0 4px var(--neon-color),
    0 0 8px color-mix(in srgb, var(--neon-color) 65%, transparent);
}

.archetype-pill::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: var(--neon-gradient);
  filter: blur(8px);
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
  transition: inset 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.archetype-pill .sig-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  pointer-events: none;
}

.archetype-pill:hover {
  transform: translateY(-1px);
}

.archetype-pill:hover::before {
  opacity: 0.6;
  filter: blur(10px);
}

.archetype-pill.matched,
.archetype-pill.active {
  border-width: 2px;
  text-shadow:
    0 0 4px var(--neon-color),
    0 0 10px var(--neon-color),
    0 0 18px color-mix(in srgb, var(--neon-color) 70%, transparent);
}

.archetype-pill.matched::before {
  inset: -5px;
  filter: blur(12px);
  opacity: 0.75;
}

.archetype-pill.active {
  text-shadow:
    0 0 4px var(--neon-color),
    0 0 12px var(--neon-color),
    0 0 24px color-mix(in srgb, var(--neon-color) 80%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--neon-color) 50%, transparent);
}

.archetype-pill.active::before {
  inset: -6px;
  filter: blur(14px);
  opacity: 0.9;
}

.archetype-pill.dimmed:not(.active) {
  opacity: 0.16;
  filter: saturate(0.35);
}

.archetype-pill.dimmed:not(.active)::before {
  opacity: 0;
}

.archetype-pill.dimmed:not(.active):hover {
  opacity: 0.55;
  filter: saturate(0.85);
}

.archetype-pill.dimmed:not(.active):hover::before {
  opacity: 0.3;
}

/* ------- Archetype info ------- */

.archetype-info {
  margin-top: 16px;
  padding: 18px 20px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  text-align: center;
}

.archetype-info.hidden {
  display: none;
}

.archetype-info-title {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  -webkit-text-stroke: 0;
  /* --neon-outline: 8 sombras coloridas em volta do glifo simulando contorno multicolor. */
  text-shadow:
    var(--neon-outline, 0 0 0 transparent),
    0 0 6px var(--neon-color, #888),
    0 0 14px color-mix(in srgb, var(--neon-color, #888) 70%, transparent),
    0 0 28px color-mix(in srgb, var(--neon-color, #888) 40%, transparent);
}

.archetype-info-title .info-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--neon-color, #888));
}

.archetype-info-description {
  margin: 0;
  color: #bbb;
  font-size: 14px;
  line-height: 1.5;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ------- Chart ------- */

h1 {
  text-align: center;
  margin: 0 0 30px;
  font-weight: 300;
  letter-spacing: 2px;
  color: #fff;
}

.chart-wrapper {
  background: #000;
  border-radius: 8px;
  padding: 0;
  border: 1px solid #1f1f1f;
  margin-top: 16px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}

.chart-wrapper.hidden {
  display: none;
}

#radar {
  padding: 16px 20px 8px;
}

svg#radar {
  width: 100%;
  height: auto;
  display: block;
}

.grid-hex {
  fill: none;
  stroke: #3a3a3a;
  stroke-width: 0.6;
}

.spoke {
  stroke: #3a3a3a;
  stroke-width: 0.6;
}

.value-line {
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.95;
}

.label {
  fill: #e0e0e0;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
}

.data-triangle {
  fill-opacity: 0.5;
  stroke: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin: 0;
  background: #0a0a0a;
  border-top: 1px solid #1f1f1f;
}

.stat {
  text-align: center;
  padding: 12px 6px;
  border-right: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
}

.stat:last-child {
  border-right: none;
}

.stat label {
  display: block;
  font-size: 14px;
  color: #ccc;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: none;
  line-height: 1.25;
  min-height: 2.5em;
}

.stat input {
  margin-top: auto;
  width: 100%;
  background: transparent;
  border: none;
  text-align: center;
  font-size: 32px;
  font-weight: bold;
  font-family: inherit;
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.stat input::-webkit-inner-spin-button,
.stat input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stat[data-stat="dano"] input         { color: #e74c3c; }
.stat[data-stat="sobrevivencia"] input { color: #3498db; }
.stat[data-stat="suporte"] input      { color: #2ecc71; }
.stat[data-stat="controle"] input     { color: #f39c12; }
.stat[data-stat="furtividade"] input  { color: #9b59b6; }
.stat[data-stat="complexidade"] input { color: #ffffff; }

/* ------- Warframe grid ------- */

.grid-wrapper {
  margin-top: 24px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  padding: 12px;
}

.grid-hint {
  font-size: 16px;
  color: #777;
  text-align: center;
  margin: 0 0 12px;
  letter-spacing: 0.3px;
}

.warframe-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
}

.warframe-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
  user-select: none;
}

.warframe-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  filter: grayscale(1) brightness(0.55);
  transition: filter 0.3s ease;
  pointer-events: none;
}

.warframe-card.in-archetype img {
  filter: none;
}

.warframe-card .name {
  font-size: 13px;
  color: #555;
  margin-top: 6px;
  text-align: center;
  letter-spacing: 0.2px;
  line-height: 1.2;
  pointer-events: none;
  transition: color 0.2s ease;
}

.warframe-card.in-archetype .name {
  color: #ccc;
}

.warframe-card:hover {
  background: #1a1a1a;
}

.warframe-card.selected {
  background: #2a2a2a;
  outline: 2px solid #f0be12;
}

.warframe-card.selected .name {
  color: #f0be12;
  font-weight: 600;
}

/* ------- Warframe detail ------- */

.warframe-detail {
  margin-top: 16px;
  padding: 22px 24px 24px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
}

.warframe-detail.hidden {
  display: none;
}

.warframe-detail-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.warframe-detail-main {
  flex: 1;
  min-width: 0;
}

.warframe-detail-header {
  margin: 0;
}

.warframe-detail-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 34px;
  margin: 0;
  color: #d4b25a;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 14px rgba(212, 178, 90, 0.25);
}

.warframe-detail-subtitle {
  margin: 4px 0 0;
  font-size: 16px;
  color: #aaa;
  font-style: italic;
  font-weight: 500;
}

.warframe-detail-sep {
  border: 0;
  border-top: 1px solid #2a2a2a;
  margin: 14px 0 14px;
}

.warframe-detail-description {
  margin: 0 0 20px;
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.55;
}

/* ----- Portrait + variant tabs ----- */
.warframe-portrait-wrapper {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
}

.variant-tabs {
  display: flex;
  gap: 2px;
}

.variant-tab {
  appearance: none;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: #888;
  padding: 7px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex: 1;
}

.variant-tab:hover { background: #1d1d1d; color: #ccc; }

.variant-tab.active {
  background: #1a1a1a;
  color: #d4b25a;
  border-color: #2a2a2a;
}

.form-tabs {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.form-tabs:empty { display: none; }

.form-tab {
  appearance: none;
  background: #121212;
  border: 1px solid #242424;
  color: #6a6a6a;
  padding: 5px 10px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex: 1;
  border-radius: 4px;
}

.form-tab:hover { background: #1a1a1a; color: #b0b0b0; }

.form-tab.active {
  background: #1c1c1c;
  color: #d4b25a;
  border-color: #3a3a3a;
}

.warframe-portrait {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 0 6px 6px 6px;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
}

.warframe-portrait .portrait-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}
.warframe-portrait.is-variant .portrait-layer {
  object-fit: contain;
}
.warframe-portrait .portrait-layer.active {
  opacity: 1;
}

/* ----- Ability tabs ----- */
.ability-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.ability-tab {
  appearance: none;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: #888;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  top: 1px;
}

.ability-tab:hover {
  background: #1d1d1d;
  color: #ccc;
}

.ability-tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #2a2a2a;
  border-bottom: 1px solid #1a1a1a;
}

.ability-tab.passive { font-style: italic; }

.ability-panel {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-top: none;
  border-radius: 0 6px 6px 6px;
  padding: 18px 20px;
  min-height: 80px;
}

.ability-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ability-icon {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  display: grid;
  place-items: center;
  padding: 10px;
}

.ability-icon img {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.1));
}

.ability-text {
  flex: 1;
  min-width: 0;
}

.ability-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
}

.ability-description {
  margin: 0;
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.55;
}

.ability-empty {
  margin: 0;
  color: #777;
  font-size: 13px;
  font-style: italic;
}

.ability-augments {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a;
}

.augments-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #f2c94c;
  margin: 0 0 14px;
}

.augments-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.augment-card {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.augment-image {
  width: 220px;
  height: auto;
  display: block;
  border-radius: 6px;
}

.augment-caption {
  margin: 0;
  width: 100%;
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

/* ------- Tabs (top-level pages) ------- */

.tab-content.hidden { display: none; }

.nav-button.active {
  border-color: var(--neon-color, #888);
  color: #fff;
  text-shadow:
    0 0 4px var(--neon-color, #888),
    0 0 10px color-mix(in srgb, var(--neon-color, #888) 60%, transparent);
  box-shadow:
    0 0 4px color-mix(in srgb, var(--neon-color, #888) 50%, transparent),
    0 0 10px color-mix(in srgb, var(--neon-color, #888) 25%, transparent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.65;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
  transition: opacity 0.15s ease, filter 0.15s ease;
  pointer-events: none;
}
.nav-button:hover .nav-icon {
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
}
.nav-button.active .nav-icon {
  opacity: 1;
  filter:
    drop-shadow(0 0 3px var(--neon-color, #fff))
    drop-shadow(0 0 8px color-mix(in srgb, var(--neon-color, #fff) 65%, transparent));
}

/* ------- Glossary ------- */

.glossary-intro {
  padding: 18px 20px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  text-align: center;
  margin-top: 18px;
}
.glossary-intro-title {
  margin: 0 0 8px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 22px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 6px rgba(127, 209, 59, 0.6),
    0 0 14px rgba(127, 209, 59, 0.3);
}
.glossary-intro-text {
  margin: 0 auto;
  max-width: 760px;
  color: #bbb;
  font-size: 14px;
  line-height: 1.55;
}

.glossary-search {
  position: relative;
  margin: 16px 0 12px;
}
.glossary-search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #eee;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.glossary-search-input:focus {
  outline: none;
  border-color: #7fd13b;
  box-shadow: 0 0 0 2px rgba(127, 209, 59, 0.18);
}
.glossary-search-input::placeholder {
  color: #666;
}
.glossary-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #aaa;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.glossary-search-clear:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.glossary-empty {
  padding: 24px;
  text-align: center;
  color: #888;
  font-size: 14px;
  background: #111;
  border: 1px dashed #2a2a2a;
  border-radius: 6px;
  margin-top: 8px;
}

.glossary-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.glossary-section {
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  overflow: hidden;
}
.glossary-section[open] {
  border-color: #2a2a2a;
}
.glossary-section-header {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
  transition: background 0.12s ease;
}
.glossary-section-header::-webkit-details-marker { display: none; }
.glossary-section-header:hover {
  background: rgba(255, 255, 255, 0.025);
}
.glossary-section-title {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #eee;
  letter-spacing: 0.5px;
}
.glossary-section-caret {
  color: #888;
  font-size: 14px;
  transition: transform 0.18s ease;
}
.glossary-section[open] > .glossary-section-header .glossary-section-caret {
  transform: rotate(180deg);
  color: #7fd13b;
}
.glossary-section-body {
  padding: 4px 18px 18px;
  color: #c2c2c2;
  font-size: 14px;
  line-height: 1.6;
  border-top: 1px solid #1a1a1a;
}
.glossary-section-body p {
  margin: 12px 0;
}
.glossary-section-body strong {
  color: #fff;
}
.glossary-section-intro {
  color: #aaa;
  font-size: 13px;
  font-style: italic;
  margin: 12px 0 16px;
}

/* ------- Status Effects (inside Glossary section) ------- */

.status-intro {
  padding: 18px 20px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 16px;
}

.status-intro-title {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 28px;
  margin: 0 0 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 6px #e0e0e0,
    0 0 14px rgba(224, 224, 224, 0.5);
}

.status-intro-text {
  margin: 0;
  color: #bbb;
  font-size: 14px;
  line-height: 1.55;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.status-group {
  margin-top: 14px;
}

.status-group-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
  margin: 0 0 8px 4px;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  justify-content: center;
}

.status-bar-hint {
  font-size: 15px;
  color: #666;
  text-align: center;
  margin: 6px 0 0;
  letter-spacing: 0.3px;
  font-style: italic;
}

.status-pill {
  --neon-color: #888;
  --neon-gradient: linear-gradient(90deg, var(--neon-color), var(--neon-color));
  background:
    linear-gradient(#060606, #060606) padding-box,
    var(--neon-gradient) border-box;
  border: 1.5px solid transparent;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  letter-spacing: 1px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  text-transform: uppercase;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease, border-width 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  isolation: isolate;
  -webkit-text-stroke: 0.6px var(--neon-color);
  text-shadow:
    0 0 4px var(--neon-color),
    0 0 8px color-mix(in srgb, var(--neon-color) 65%, transparent);
}

.status-pill::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: var(--neon-gradient);
  filter: blur(8px);
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
  transition: inset 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.status-pill .status-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 2px var(--neon-color));
}

.status-pill:hover { transform: translateY(-1px); }
.status-pill:hover::before { opacity: 0.6; filter: blur(10px); }

.status-pill.active {
  border-width: 2px;
  text-shadow:
    0 0 4px var(--neon-color),
    0 0 12px var(--neon-color),
    0 0 24px color-mix(in srgb, var(--neon-color) 80%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--neon-color) 50%, transparent);
}

.status-pill.active::before {
  inset: -6px;
  filter: blur(14px);
  opacity: 0.9;
}

.status-pill.dimmed:not(.active) {
  opacity: 0.22;
  filter: saturate(0.4);
}

.status-pill.dimmed:not(.active)::before { opacity: 0; }

.status-pill.dimmed:not(.active):hover {
  opacity: 0.6;
  filter: saturate(0.9);
}

.status-pill.dimmed:not(.active):hover::before { opacity: 0.3; }

/* Status info block (mirrors archetype-info) */

.status-info {
  margin-top: 16px;
  padding: 22px 22px 20px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  text-align: center;
}

.status-info.hidden { display: none; }

.status-info-title {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #fff;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  -webkit-text-stroke: 0;
  text-shadow:
    0 0 6px var(--neon-color, #888),
    0 0 14px color-mix(in srgb, var(--neon-color, #888) 70%, transparent),
    0 0 28px color-mix(in srgb, var(--neon-color, #888) 40%, transparent);
}

.status-info-title .info-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--neon-color, #888));
}

.status-info-description {
  margin: 0 0 14px;
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.55;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.status-info-proc {
  margin: 0 auto 18px;
  padding: 12px 16px;
  max-width: 760px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #d8d8d8;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

/* Inline keyword highlight inside status descriptions/procs/intro */
.hl {
  font-weight: 700;
  color: var(--neon-color, #f0c97a);
  text-shadow: 0 0 6px color-mix(in srgb, var(--neon-color, #f0c97a) 55%, transparent);
}
.status-intro-text .hl {
  color: #f0c97a;
  text-shadow: 0 0 6px rgba(240, 201, 122, 0.5);
}
/* Effects whose neon color is too pale for inline highlights — opt into neon white.
   Add more slugs here if needed (e.g. tau, true). */
.status-info[data-slug="magnetic"] .hl {
  color: #fff;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.85),
    0 0 10px rgba(255, 255, 255, 0.45);
}

.status-info-proc-label {
  display: block;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--neon-color, #aaa);
  margin: 0 0 4px;
  text-shadow:
    0 0 4px color-mix(in srgb, var(--neon-color, #888) 60%, transparent);
}

.status-faction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.status-faction-col {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 12px 14px;
}

.status-faction-col.empty {
  opacity: 0.45;
}

.status-faction-col-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 8px;
  text-align: center;
}

.status-faction-col.vuln .status-faction-col-label { color: #2ecc71; }
.status-faction-col.resist .status-faction-col-label { color: #e74c3c; }

.status-faction-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.status-faction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
  background: rgba(0,0,0,0.4);
}

.status-faction-col.vuln .status-faction-chip {
  color: #d4f7d8;
  border-color: rgba(46, 204, 113, 0.55);
}

.status-faction-col.resist .status-faction-chip {
  color: #fad6d0;
  border-color: rgba(231, 76, 60, 0.55);
}

.status-faction-chip-mult {
  font-weight: 700;
  font-size: 11px;
  opacity: 0.85;
}

.status-faction-empty {
  text-align: center;
  font-size: 12px;
  color: #555;
  font-style: italic;
  padding: 6px 0;
}

/* ------- Responsive ------- */

@media (max-width: 960px) {
  .warframe-grid { grid-template-columns: repeat(8, 1fr); }
  .warframe-detail-body { flex-direction: column-reverse; }
  .warframe-portrait-wrapper { flex: 0 0 auto; width: 100%; max-width: 320px; align-self: center; }
}
@media (max-width: 600px) {
  .status-pill { font-size: 10px; padding: 5px 12px; }
  .status-pill .status-icon { width: 14px; height: 14px; }
  .status-info-title { font-size: 24px; gap: 10px; }
  .status-info-title .info-icon { width: 26px; height: 26px; }
  .status-faction-grid { grid-template-columns: 1fr; }
  .status-intro-title { font-size: 22px; }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat {
    border-bottom: 1px solid #1f1f1f;
  }
  .stat:nth-child(3) {
    border-right: none;
  }
  .stat input {
    font-size: 26px;
  }
  .warframe-grid { grid-template-columns: repeat(6, 1fr); }
  .warframe-card .name { font-size: 11px; }
  .site-logo { height: 32px; }
  .archetype-pill { font-size: 9px; padding: 5px 10px; }
  .archetype-pill .sig-icon { width: 12px; height: 12px; }
  .archetype-info-title { font-size: 26px; gap: 10px; }
  .archetype-info-title .info-icon { width: 28px; height: 28px; }
  .stat-pill { font-size: 10px; padding: 4px 10px 4px 8px; gap: 5px; }
  .stat-pill .stat-icon { width: 14px; height: 14px; }
  /* Mobile header: ☰ (left) · logo (center) · lang+credits (right). The nav
     becomes a full-width drawer below the header, toggled by the hamburger.
     Horizontal padding moves from .site-header to .header-inner so the drawer
     can bleed edge-to-edge. Desktop is unaffected (all scoped to this query). */
  .site-header { padding-left: 0; padding-right: 0; }
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    padding: 0 16px;
  }
  .nav-toggle { display: flex; justify-self: start; }
  .header-left { gap: 8px; justify-self: center; }
  .header-right { justify-self: end; }
  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #050505;
    border-bottom: 1px solid #1f1f1f;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
    padding: 6px 0;
    display: none;
  }
  .header-nav.open { display: flex; }
  .header-nav .nav-button {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    padding: 13px 20px;
    border-radius: 0;
    font-size: 15px;
  }
  .lang-name { display: none; }
}

/* ========================================================================
   Rivens
   ======================================================================== */

.riven-intro {
  padding: 18px 20px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  text-align: center;
  margin-top: 18px;
}

.riven-intro-title {
  margin: 0 0 8px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 22px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 6px rgba(184, 136, 255, 0.6),
    0 0 14px rgba(184, 136, 255, 0.3);
}

.riven-intro-text {
  margin: 0 auto;
  max-width: 760px;
  color: #bbb;
  font-size: 14px;
  line-height: 1.55;
}

.page-intro {
  padding: 18px 20px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  text-align: center;
  margin-top: 18px;
}
.page-intro-title {
  margin: 0 0 8px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 22px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 6px var(--neon-color, rgba(255, 255, 255, 0.4)),
    0 0 14px color-mix(in srgb, var(--neon-color, #fff) 30%, transparent);
}
.page-intro-text {
  margin: 0 auto;
  max-width: 760px;
  color: #bbb;
  font-size: 14px;
  line-height: 1.55;
}

.riven-section {
  margin-top: 20px;
}

.riven-section-label {
  margin: 0 0 10px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
}

.riven-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.riven-pill {
  --neon-color: #b888ff;
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid color-mix(in srgb, var(--neon-color) 45%, transparent);
  padding: 8px 18px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: color-mix(in srgb, #fff 70%, transparent);
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
  min-width: 56px;
}

.riven-pill:hover {
  opacity: 0.9;
  border-color: color-mix(in srgb, var(--neon-color) 75%, transparent);
}

.riven-pill.active {
  opacity: 1;
  color: #fff;
  background: color-mix(in srgb, var(--neon-color) 25%, rgba(0,0,0,0.6));
  border: 2px solid var(--neon-color);
  text-shadow: 0 0 5px var(--neon-color), 0 0 12px var(--neon-color);
  box-shadow:
    0 0 12px color-mix(in srgb, var(--neon-color) 70%, transparent),
    0 0 24px color-mix(in srgb, var(--neon-color) 35%, transparent);
}

.riven-stat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.riven-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 280px) 120px 32px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: fit-content;
  max-width: 100%;
}
.riven-stat-row.is-negative {
  border-color: rgba(209, 69, 69, 0.4);
  background: rgba(60, 25, 25, 0.4);
}

.riven-stat-value-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 4px 10px;
  transition: border-color 0.15s;
}
.riven-stat-value-wrap:focus-within {
  border-color: #b888ff;
  box-shadow: 0 0 4px rgba(184, 136, 255, 0.4);
}

.riven-stat-value-wrap .riven-stat-value {
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
  color: #ddd;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 13px;
  text-align: right;
  flex: 1;
  width: auto;
  min-width: 0;
}
.riven-stat-row.is-negative .riven-stat-value { color: #ff8585; }

.riven-stat-unit {
  color: #888;
  font-size: 13px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  pointer-events: none;
  min-width: 12px;
  text-align: center;
}

.riven-stat-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #444;
  background: transparent;
  color: #888;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}
.riven-stat-remove:hover {
  border-color: #d14545;
  color: #d14545;
  background: rgba(209, 69, 69, 0.08);
}

.riven-add-stat-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px dashed rgba(184, 136, 255, 0.45);
  border-radius: 999px;
  color: #b888ff;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.riven-add-stat-btn:hover {
  background: rgba(184, 136, 255, 0.08);
  border-style: solid;
  border-color: #b888ff;
  text-shadow: 0 0 4px rgba(184, 136, 255, 0.5);
}
.riven-add-stat-btn.hidden { display: none; }
.riven-add-stat-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}

.riven-stat-select {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ddd;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.riven-stat-select:focus {
  border-color: #b888ff;
  box-shadow: 0 0 4px rgba(184, 136, 255, 0.4);
}
.riven-stat-row.is-negative .riven-stat-select {
  border-color: rgba(209, 69, 69, 0.35);
}

.riven-evaluate-wrap {
  margin-top: 24px;
  text-align: center;
}

.riven-evaluate-btn {
  --neon-color: #b888ff;
  background: color-mix(in srgb, var(--neon-color) 25%, rgba(0,0,0,0.7));
  border: 2px solid var(--neon-color);
  color: #fff;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 12px 36px;
  border-radius: 999px;
  cursor: pointer;
  text-shadow: 0 0 6px var(--neon-color), 0 0 14px var(--neon-color);
  box-shadow:
    0 0 16px color-mix(in srgb, var(--neon-color) 70%, transparent),
    0 0 30px color-mix(in srgb, var(--neon-color) 40%, transparent);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.riven-evaluate-btn:hover { transform: scale(1.04); }
.riven-evaluate-btn:active { transform: scale(0.97); }

.riven-result {
  margin-top: 26px;
  padding: 22px 24px;
  background: #0e0e0e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  --neon-color: #b888ff;
}

.riven-score-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
}

.riven-score-number {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 78px;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 8px var(--neon-color),
    0 0 22px var(--neon-color),
    0 0 40px color-mix(in srgb, var(--neon-color) 70%, transparent);
}

.riven-score-meta { display: flex; flex-direction: column; gap: 4px; }
.riven-score-verdict {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 6px currentColor;
}
.riven-score-outof {
  color: #666;
  font-size: 14px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
}

.riven-breakdown-label {
  margin: 0 0 12px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}

.riven-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.riven-breakdown-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.5);
  border-radius: 4px;
}

.riven-breakdown-sign {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
}
.riven-breakdown-row.pos .riven-breakdown-sign { color: #4ec3ea; text-shadow: 0 0 4px #4ec3ea; }
.riven-breakdown-row.neg .riven-breakdown-sign { color: #d14545; text-shadow: 0 0 4px #d14545; }

.riven-breakdown-name { font-size: 14px; color: #ddd; }

.riven-breakdown-tier {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.riven-breakdown-tier[data-tier="S"]         { color: #f0c97a; text-shadow: 0 0 4px rgba(240,201,122,0.6); }
.riven-breakdown-tier[data-tier="A"]         { color: #a3d142; text-shadow: 0 0 4px rgba(163,209,66,0.6); }
.riven-breakdown-tier[data-tier="B"]         { color: #4ec3ea; text-shadow: 0 0 4px rgba(78,195,234,0.6); }
.riven-breakdown-tier[data-tier="C"]         { color: #bbbbbb; }
.riven-breakdown-tier[data-tier="D"]         { color: #777; }
.riven-breakdown-tier[data-neg="beneficial"] { color: #a3d142; text-shadow: 0 0 4px rgba(163,209,66,0.6); }
.riven-breakdown-tier[data-neg="neutral"]    { color: #bbbbbb; }
.riven-breakdown-tier[data-neg="mild"]       { color: #e6a14a; }
.riven-breakdown-tier[data-neg="harmful"]    { color: #d14545; text-shadow: 0 0 4px rgba(209,69,69,0.6); }

.riven-breakdown-value {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #ccc;
  min-width: 60px;
  text-align: right;
}

.riven-shape-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(184, 136, 255, 0.08);
  border-left: 3px solid var(--neon-color, #b888ff);
  border-radius: 4px;
  color: #c9c9c9;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
}

/* Per-stat rationale row (sits under each breakdown row). */
.riven-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.5);
  border-radius: 4px;
}
.riven-breakdown-item .riven-breakdown-row {
  background: transparent;
  padding: 0;
}
.riven-breakdown-rationale {
  color: #989898;
  font-size: 12px;
  line-height: 1.45;
  padding-left: 36px; /* aligns with the stat name (after sign+gap) */
  font-style: italic;
}
.riven-breakdown-override {
  color: #e6a14a;
  font-style: normal;
  font-weight: 600;
}

/* Recommended panel — header + grid of sections. */
.riven-rec-header {
  margin: 24px 0 12px;
  padding-top: 14px;
  border-top: 1px solid #222;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f0c97a;
  text-shadow: 0 0 5px rgba(240, 201, 122, 0.4);
}

.riven-rec-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.riven-rec-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.riven-rec-section-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
}

.riven-rec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.45);
  border-radius: 4px;
  border-left: 2px solid transparent;
}
.riven-rec-item .riven-rec-row { padding: 0; background: transparent; }

.riven-rec-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 12px;
}

.riven-rec-item.wasted { border-left-color: #e6a14a; background: rgba(230, 161, 74, 0.05); }
.riven-rec-item.avoid  { border-left-color: #d14545; background: rgba(209, 69, 69, 0.05); }

.riven-rec-sign {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  color: #4ec3ea;
}
.riven-rec-row.pos .riven-rec-sign { color: #4ec3ea; text-shadow: 0 0 4px #4ec3ea; }
.riven-rec-row.neg .riven-rec-sign { color: #a3d142; text-shadow: 0 0 4px #a3d142; }
.riven-rec-row.wasted .riven-rec-sign { color: #e6a14a; text-shadow: 0 0 4px #e6a14a; }
.riven-rec-row.avoid  .riven-rec-sign { color: #d14545; text-shadow: 0 0 4px #d14545; }

.riven-rec-name {
  font-size: 14px;
  color: #ddd;
}

.riven-rec-tier {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.riven-rec-tier[data-tier="S"]         { color: #f0c97a; text-shadow: 0 0 4px rgba(240,201,122,0.6); }
.riven-rec-tier[data-tier="A"]         { color: #a3d142; text-shadow: 0 0 4px rgba(163,209,66,0.6); }
.riven-rec-tier[data-tier="B"]         { color: #4ec3ea; text-shadow: 0 0 4px rgba(78,195,234,0.6); }
.riven-rec-tier[data-tier="C"]         { color: #bbbbbb; }
.riven-rec-tier[data-tier="D"]         { color: #777; }
.riven-rec-tier[data-neg="beneficial"] { color: #a3d142; text-shadow: 0 0 4px rgba(163,209,66,0.6); }
.riven-rec-tier[data-neg="neutral"]    { color: #bbbbbb; }
.riven-rec-tier[data-neg="mild"]       { color: #e6a14a; }
.riven-rec-tier[data-neg="harmful"]    { color: #d14545; text-shadow: 0 0 4px rgba(209,69,69,0.6); }

.riven-rec-rationale {
  color: #989898;
  font-size: 12px;
  line-height: 1.45;
  padding-left: 36px;
  font-style: italic;
}

.riven-image-section { margin-top: 20px; }

/* All riven sub-sections honor `.hidden` (no global rule for it). */
.riven-section.hidden,
.riven-image-section.hidden,
.riven-evaluate-wrap.hidden,
.riven-result.hidden,
.riven-upload-zone.hidden,
.riven-image-preview.hidden,
.riven-ocr-status.hidden,
.riven-ocr-banner.hidden {
  display: none;
}

.riven-upload-zone {
  border: 2px dashed #3a3a3a;
  border-radius: 8px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  background: rgba(20, 20, 20, 0.4);
}
.riven-upload-zone:hover,
.riven-upload-zone.dragging {
  border-color: #b888ff;
  background: rgba(184, 136, 255, 0.07);
  transform: translateY(-1px);
}

.riven-upload-icon {
  font-size: 44px;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 8px rgba(184, 136, 255, 0.5));
}
.riven-upload-prompt-text {
  margin: 4px 0 6px;
  color: #ddd;
  font-size: 15px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
}
.riven-upload-hint {
  margin: 0;
  color: #777;
  font-size: 12px;
}

.riven-image-preview {
  margin-top: 14px;
  padding: 14px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  text-align: center;
}
.riven-image-preview img {
  max-width: 300px;
  max-height: 360px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid #2a2a2a;
}
.riven-image-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.riven-image-change-btn,
.riven-image-remove-btn {
  background: transparent;
  border: 1px solid #444;
  color: #bbb;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.riven-image-change-btn:hover { border-color: #b888ff; color: #fff; }
.riven-image-remove-btn:hover {
  border-color: #d14545;
  color: #fff;
  background: rgba(209, 69, 69, 0.10);
}

.riven-ocr-status {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(184, 136, 255, 0.07);
  border: 1px solid rgba(184, 136, 255, 0.35);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 18px 1fr;
  grid-template-areas: 'spinner text' 'progress progress';
  gap: 8px 10px;
  align-items: center;
}
.riven-ocr-spinner {
  grid-area: spinner;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(184, 136, 255, 0.25);
  border-top-color: #b888ff;
  border-radius: 50%;
  animation: riven-spin 0.9s linear infinite;
}
.riven-ocr-status-text {
  grid-area: text;
  color: #ddd;
  font-size: 13px;
}
.riven-ocr-progress-bar {
  grid-area: progress;
  height: 4px;
  background: rgba(184, 136, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
.riven-ocr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b888ff, #d4b2ff);
  box-shadow: 0 0 8px rgba(184, 136, 255, 0.6);
  width: 0%;
  transition: width 0.2s ease;
}
@keyframes riven-spin { to { transform: rotate(360deg); } }

.riven-ocr-banner {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(163, 209, 66, 0.08);
  border-left: 3px solid #a3d142;
  border-radius: 4px;
  color: #c9e08e;
  font-size: 13px;
}
.riven-ocr-banner.error {
  background: rgba(209, 69, 69, 0.08);
  border-left-color: #d14545;
  color: #e89898;
}
.riven-ocr-banner.success {
  background: rgba(163, 209, 66, 0.08);
  border-left-color: #a3d142;
  color: #c9e08e;
}

.riven-ocr-disclaimer {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(235, 180, 52, 0.10);
  border-left: 3px solid #ebb434;
  border-radius: 4px;
  color: #f0d486;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.riven-ocr-disclaimer-icon {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .riven-intro-title { font-size: 18px; }
  .riven-stat-row { grid-template-columns: 32px 1fr; gap: 8px; }
  .riven-stat-row { grid-template-columns: 1fr 100px 28px; }
  .riven-score-number { font-size: 60px; }
  .riven-score-verdict { font-size: 18px; }
  .riven-upload-zone { padding: 24px 16px; }
  .riven-upload-icon { font-size: 36px; }
  .riven-image-preview img { max-width: 100%; }
}

/* ========================================================================
   Weapon picker
   ======================================================================== */

.riven-weapon-row { display: flex; gap: 10px; }

.riven-weapon-btn {
  --neon-color: #b888ff;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(10, 10, 10, 0.7);
  border: 1.5px dashed color-mix(in srgb, var(--neon-color) 45%, transparent);
  border-radius: 8px;
  color: #bbb;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  text-align: left;
}
.riven-weapon-btn:hover {
  border-color: var(--neon-color);
  color: #fff;
  background: rgba(184, 136, 255, 0.07);
}
.riven-weapon-btn.has-weapon {
  border-style: solid;
  border-color: var(--neon-color);
  color: #fff;
  background: rgba(184, 136, 255, 0.08);
}
.riven-weapon-btn .weapon-btn-icon { font-size: 18px; flex-shrink: 0; }
.riven-weapon-btn .weapon-btn-icon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(184, 136, 255, 0.35));
}
.riven-weapon-btn .weapon-btn-main { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.riven-weapon-btn .weapon-btn-name {
  font-weight: 700;
  letter-spacing: 0.6px;
  font-size: 15px;
}
.riven-weapon-btn .weapon-btn-meta {
  color: #999;
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.riven-weapon-btn .weapon-btn-meta .dots {
  letter-spacing: 1px;
  color: var(--neon-color);
  text-shadow: 0 0 4px var(--neon-color);
}
.riven-weapon-btn .weapon-btn-auto {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid #a3d142;
  color: #a3d142;
  border-radius: 999px;
  text-shadow: 0 0 4px rgba(163, 209, 66, 0.5);
}
.riven-weapon-btn .weapon-btn-clear {
  margin-left: auto;
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.riven-weapon-btn .weapon-btn-clear:hover { border-color: #d14545; color: #d14545; }

/* Modal */

.weapon-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.weapon-modal.hidden { display: none; }

.weapon-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.weapon-modal-content {
  position: relative;
  width: min(960px, 100%);
  max-height: 88vh;
  background: #0c0c10;
  border: 1px solid rgba(184, 136, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(184, 136, 255, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.weapon-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1f1f22;
}

.weapon-modal-title {
  margin: 0;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 5px rgba(184, 136, 255, 0.6);
}

.weapon-modal-close {
  background: transparent;
  border: 1px solid #333;
  color: #ccc;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.weapon-modal-close:hover { border-color: #d14545; color: #d14545; }

.weapon-modal-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 8px;
}
.weapon-cat-tab {
  --neon-color: #b888ff;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid color-mix(in srgb, var(--neon-color) 35%, transparent);
  padding: 6px 16px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ccc;
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.15s ease;
}
.weapon-cat-tab:hover { opacity: 0.9; }
.weapon-cat-tab.active {
  opacity: 1;
  color: #fff;
  background: color-mix(in srgb, var(--neon-color) 25%, rgba(0,0,0,0.5));
  border-color: var(--neon-color);
  text-shadow: 0 0 4px var(--neon-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--neon-color) 50%, transparent);
}
.weapon-cat-tab.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.weapon-modal-search {
  padding: 6px 20px 12px;
}
.weapon-modal-search input {
  width: 100%;
  background: #06060a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 9px 14px;
  color: #fff;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.weapon-modal-search input:focus { border-color: #b888ff; box-shadow: 0 0 6px rgba(184, 136, 255, 0.35); }

.weapon-modal-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 0;
  flex: 1;
  border-top: 1px solid #1f1f22;
}

.weapon-list {
  border-right: 1px solid #1f1f22;
  overflow-y: auto;
  padding: 6px 0;
}
.weapon-list-empty {
  padding: 18px 16px;
  color: #777;
  font-size: 13px;
  text-align: center;
}

.weapon-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.weapon-list-item:hover { background: rgba(184, 136, 255, 0.05); }
.weapon-list-item.active {
  background: rgba(184, 136, 255, 0.1);
  border-left-color: #b888ff;
}
.weapon-list-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #ddd;
  flex: 1;
}
.weapon-list-item.active .weapon-list-name { color: #fff; }
.weapon-list-dots {
  color: #b888ff;
  font-size: 10px;
  letter-spacing: 1px;
  text-shadow: 0 0 3px rgba(184, 136, 255, 0.6);
}

.weapon-list-family {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #f0c97a;
  background: rgba(240, 201, 122, 0.1);
  border: 1px solid rgba(240, 201, 122, 0.4);
  padding: 2px 9px;
  border-radius: 999px;
  text-shadow: 0 0 3px rgba(240, 201, 122, 0.5);
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* Visual grouping: thin separator between families + indent on non-base variants */
.weapon-list-family-sep {
  height: 1px;
  margin: 4px 14px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(184, 136, 255, 0.18) 30%,
    rgba(184, 136, 255, 0.18) 70%,
    transparent 100%
  );
}

/* Collapsible family header row — same padding/alignment as a regular item
   so the weapon name lines up with the rest of the list. */
.weapon-list-family-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
}
.weapon-list-family-header:hover {
  background: rgba(184, 136, 255, 0.06);
}
.weapon-list-family-header.expanded {
  background: rgba(184, 136, 255, 0.04);
}
.weapon-list-family-header.has-selection {
  border-left-color: #b888ff;
}
.weapon-list-family-header .weapon-list-name {
  flex: 1;
  font-weight: 700;
  color: #e8d49a;
}
.weapon-list-family-header.expanded .weapon-list-name { color: #f0c97a; }

/* Variant rows under an expanded family header */
.weapon-list-item.is-variant {
  padding-left: 36px;
  position: relative;
  background: rgba(184, 136, 255, 0.025);
}
.weapon-list-item.is-variant::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(184, 136, 255, 0.5);
}
.weapon-list-item.is-variant.active::before {
  background: #b888ff;
}

.weapon-family-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(240, 201, 122, 0.5);
  background: rgba(240, 201, 122, 0.07);
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  color: #e8d49a;
  text-shadow: 0 0 3px rgba(240, 201, 122, 0.4);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.weapon-family-chip:hover {
  background: rgba(240, 201, 122, 0.15);
  border-color: rgba(240, 201, 122, 0.8);
}

.weapon-detail {
  padding: 22px 24px;
  overflow-y: auto;
}
.weapon-detail-empty {
  color: #666;
  text-align: center;
  margin-top: 60px;
  font-size: 14px;
}

.weapon-detail-name {
  margin: 0 0 6px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 8px rgba(184, 136, 255, 0.55);
}
.weapon-detail-subtitle { color: #888; font-size: 13px; margin: 0 0 16px; letter-spacing: 0.5px; }

.weapon-detail-image-wrap {
  margin: 0 0 16px;
  padding: 12px;
  background: rgba(184, 136, 255, 0.04);
  border: 1px solid rgba(184, 136, 255, 0.18);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.weapon-detail-image-wrap.hidden { display: none; }
.weapon-detail-image {
  max-width: 260px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(184, 136, 255, 0.35));
}

.weapon-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 18px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: rgba(20, 20, 26, 0.6);
  border: 1px solid #1f1f22;
  border-radius: 6px;
}
.weapon-detail-grid-row { display: flex; gap: 8px; align-items: baseline; }
.weapon-detail-grid-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #777;
  min-width: 110px;
}
.weapon-detail-grid-value { color: #ddd; font-size: 14px; }
.weapon-detail-grid-value.disp-dots { color: #b888ff; letter-spacing: 2px; text-shadow: 0 0 4px rgba(184, 136, 255, 0.5); }

.weapon-detail-section { margin: 14px 0; }
.weapon-detail-section-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  margin: 0 0 6px;
}
.weapon-detail-stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.weapon-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
}
.weapon-stat-chip[data-tier="S"]         { color: #f0c97a; text-shadow: 0 0 4px rgba(240,201,122,0.5); }
.weapon-stat-chip[data-tier="A"]         { color: #a3d142; text-shadow: 0 0 4px rgba(163,209,66,0.5); }
.weapon-stat-chip[data-tier="B"]         { color: #4ec3ea; text-shadow: 0 0 4px rgba(78,195,234,0.5); }
.weapon-stat-chip[data-tier="C"]         { color: #bbbbbb; }
.weapon-stat-chip[data-tier="D"]         { color: #777; }
.weapon-stat-chip[data-neg="beneficial"] { color: #a3d142; }
.weapon-stat-chip[data-neg="neutral"]    { color: #bbbbbb; }
.weapon-stat-chip[data-neg="mild"]       { color: #e6a14a; }
.weapon-stat-chip[data-neg="harmful"]    { color: #d14545; }

.weapon-detail-notes {
  margin: 12px 0 18px;
  padding: 10px 14px;
  border-left: 3px solid #b888ff;
  background: rgba(184, 136, 255, 0.06);
  border-radius: 4px;
  color: #c9c9c9;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
}

.weapon-detail-use-btn {
  --neon-color: #b888ff;
  display: block;
  margin: 20px auto 0;
  background: color-mix(in srgb, var(--neon-color) 25%, rgba(0,0,0,0.7));
  border: 2px solid var(--neon-color);
  color: #fff;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 30px;
  border-radius: 999px;
  cursor: pointer;
  text-shadow: 0 0 5px var(--neon-color);
  box-shadow: 0 0 14px color-mix(in srgb, var(--neon-color) 60%, transparent);
  transition: transform 0.1s;
}
.weapon-detail-use-btn:hover { transform: scale(1.04); }

@media (max-width: 700px) {
  .weapon-modal-content { max-height: 95vh; }
  .weapon-modal-body { grid-template-columns: 1fr; }
  .weapon-list { max-height: 220px; border-right: none; border-bottom: 1px solid #1f1f22; }
  .weapon-detail-grid { grid-template-columns: 1fr; }
  .weapon-detail-name { font-size: 20px; }
}

/* ========================================================================
   Credits — header button + modal
   ======================================================================== */

.credits-button {
  --neon-color: #b888ff;
  gap: 6px;
  padding: 8px 12px;
}
.credits-button:hover {
  border-color: var(--neon-color);
  color: #fff;
}
.credits-button .credits-icon {
  font-size: 16px;
  line-height: 1;
  color: var(--neon-color);
  text-shadow: 0 0 4px var(--neon-color);
}

.credits-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.credits-modal.hidden { display: none; }

.credits-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.credits-modal-content {
  position: relative;
  width: min(720px, 100%);
  max-height: 88vh;
  background: #0c0c10;
  border: 1px solid rgba(184, 136, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(184, 136, 255, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.credits-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #1f1f22;
}
.credits-modal-title {
  margin: 0;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 5px rgba(184, 136, 255, 0.6);
}
.credits-modal-close {
  background: transparent;
  border: 1px solid #333;
  color: #ccc;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.credits-modal-close:hover { border-color: #d14545; color: #d14545; }

.credits-body {
  overflow-y: auto;
  padding: 20px 26px 26px;
  color: #ccc;
  font-size: 14px;
  line-height: 1.55;
}

.credits-section {
  margin-bottom: 22px;
}
.credits-section:last-child { margin-bottom: 0; }

/* Disclaimer da Digital Extremes — destacado no topo do modal */
.credits-disclaimer {
  margin: 0 0 24px;
  padding: 14px 18px;
  background: linear-gradient(
    135deg,
    rgba(184, 136, 255, 0.10) 0%,
    rgba(240, 201, 122, 0.07) 100%
  );
  border: 1px solid rgba(240, 201, 122, 0.45);
  border-left: 3px solid #f0c97a;
  border-radius: 6px;
  box-shadow:
    0 0 12px rgba(240, 201, 122, 0.15),
    inset 0 0 20px rgba(184, 136, 255, 0.05);
}
.credits-disclaimer-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f0c97a;
  text-shadow: 0 0 5px rgba(240, 201, 122, 0.6);
  margin-bottom: 6px;
}
.credits-disclaimer p {
  margin: 0;
  color: #e0e0e0;
  font-size: 13.5px;
  line-height: 1.55;
  font-style: italic;
}
.credits-disclaimer-link {
  margin-top: 8px !important;
  font-style: normal !important;
  font-size: 12.5px !important;
  text-align: right;
}
.credits-disclaimer-link a {
  color: #f0c97a;
  border-bottom-color: rgba(240, 201, 122, 0.5);
  letter-spacing: 0.5px;
}
.credits-disclaimer-link a:hover {
  color: #ffdb9a;
  border-bottom-color: #ffdb9a;
  text-shadow: 0 0 5px rgba(255, 219, 154, 0.55);
}

.credits-section-label {
  margin: 0 0 6px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f0c97a;
  text-shadow: 0 0 4px rgba(240, 201, 122, 0.45);
}

.credits-section p { margin: 0; }

.credits-subref {
  margin-top: 4px !important;
  padding-left: 12px;
  font-size: 12.5px;
  color: #888;
}

.credits-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 0 4px rgba(184, 136, 255, 0.5),
    0 0 12px rgba(184, 136, 255, 0.25);
  letter-spacing: 0.5px;
}

.credits-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.credits-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(184, 136, 255, 0.08);
}
.credits-list li:last-child { border-bottom: none; }

.credits-body a {
  color: #b888ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(184, 136, 255, 0.5);
  transition: color 0.12s, border-color 0.12s, text-shadow 0.12s;
}
.credits-body a:hover {
  color: #d4b2ff;
  border-bottom-color: #d4b2ff;
  text-shadow: 0 0 4px rgba(212, 178, 255, 0.55);
}

@media (max-width: 600px) {
  .credits-button .credits-text { display: none; }
  .credits-modal-content { max-height: 95vh; }
  .credits-name { font-size: 16px; }
}

/* ========================================================================
   Warframe acquisition box (abaixo das habilidades)
   ======================================================================== */

.warframe-acquisition {
  margin-top: 18px;
  padding: 16px 20px;
  background: linear-gradient(
    135deg,
    rgba(20, 20, 26, 0.85) 0%,
    rgba(184, 136, 255, 0.04) 100%
  );
  border: 1px solid #2a2a2a;
  border-left: 3px solid #b888ff;
  border-radius: 6px;
}
.warframe-acquisition.hidden { display: none; }

.acquisition-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(184, 136, 255, 0.12);
}

.acquisition-title {
  margin: 0;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f0c97a;
  text-shadow: 0 0 4px rgba(240, 201, 122, 0.45);
}

.acquisition-source-badge {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: #b888ff;
  background: rgba(184, 136, 255, 0.08);
  text-shadow: 0 0 3px rgba(184, 136, 255, 0.5);
}
/* Cores temáticas por tipo de fonte */
.acquisition-source-badge[data-source="boss_drop"]        { color: #d14545; background: rgba(209, 69, 69, 0.08); }
.acquisition-source-badge[data-source="quest_reward"]     { color: #4ec3ea; background: rgba(78, 195, 234, 0.08); }
.acquisition-source-badge[data-source="dojo_research"]    { color: #a3d142; background: rgba(163, 209, 66, 0.08); }
.acquisition-source-badge[data-source="syndicate"]        { color: #f0c97a; background: rgba(240, 201, 122, 0.08); }
.acquisition-source-badge[data-source="cetus_offerings"],
.acquisition-source-badge[data-source="fortuna_offerings"]{ color: #e6a14a; background: rgba(230, 161, 74, 0.08); }
.acquisition-source-badge[data-source="nightwave"]        { color: #e040a8; background: rgba(224, 64, 168, 0.08); }
.acquisition-source-badge[data-source="enemy_drop"]       { color: #b888ff; background: rgba(184, 136, 255, 0.08); }
.acquisition-source-badge[data-source="railjack"]         { color: #4ec3a0; background: rgba(78, 195, 160, 0.08); }
.acquisition-source-badge[data-source="duviri"]           { color: #c47c4a; background: rgba(196, 124, 74, 0.08); }

.acquisition-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(184, 136, 255, 0.06);
}
.acquisition-row:first-of-type { border-top: none; }

.acquisition-row-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  padding-top: 2px;
}

.acquisition-row-text {
  color: #ccc;
  font-size: 13.5px;
  line-height: 1.55;
}

.acquisition-recommended {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(240, 201, 122, 0.08);
  border-left: 2px solid #f0c97a;
  border-radius: 4px;
}

.acquisition-recommended-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #f0c97a;
  margin-bottom: 4px;
}

.acquisition-recommended-text {
  color: #e0e0e0;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
}

/* §16.6 — Craft cost (aggregated resource shopping list) */
.acquisition-craft-cost {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(94, 192, 232, 0.04);
  border: 1px solid rgba(94, 192, 232, 0.18);
  border-radius: 6px;
}
.acquisition-craft-cost-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.acquisition-craft-cost-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #8ed3ed;
}
.acquisition-craft-cost-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 900px) {
  .acquisition-craft-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .acquisition-craft-cost-grid { grid-template-columns: 1fr; }
}
.craft-cost-pill {
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid var(--rarity-color, #444);
  border-radius: 4px;
  color: #ddd;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  min-width: 0;
}
.craft-cost-pill:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--rarity-color, #888);
  color: #fff;
}
.craft-cost-pill:disabled {
  cursor: default;
  opacity: 0.5;
}
.craft-cost-pill-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}
.craft-cost-pill-icon-fallback {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: #222;
  border-radius: 3px;
}
.craft-cost-pill-name {
  flex: 1 1 auto;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.craft-cost-pill-qty {
  flex: 0 0 auto;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--rarity-color, #ccc);
  background: color-mix(in srgb, var(--rarity-color, #888) 10%, transparent);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--rarity-color, #888) 40%, transparent);
}

/* §16.6 — Cross-frame parts (Chroma case) */
.acquisition-requires-parts {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(232, 152, 92, 0.3);
}
.acquisition-requires-parts-header {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #e8985c;
  margin-bottom: 10px;
}
.acquisition-donor-part {
  margin-bottom: 14px;
}
.acquisition-donor-part:last-child {
  margin-bottom: 0;
}
.acquisition-donor-part-title {
  width: 100%;
  background: rgba(232, 152, 92, 0.06);
  border: 1px solid rgba(232, 152, 92, 0.25);
  border-radius: 6px;
  color: #ddd;
  padding: 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.acquisition-donor-part-title:hover {
  background: rgba(232, 152, 92, 0.14);
  border-color: rgba(232, 152, 92, 0.55);
  color: #fff;
}
.acquisition-donor-part-icon {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.acquisition-donor-part-label-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.acquisition-donor-part-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acquisition-donor-part-meta {
  font-size: 9.5px;
  letter-spacing: 0.5px;
  color: #aaa;
  text-transform: uppercase;
}
.acquisition-donor-part-qty {
  flex: 0 0 auto;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #e8985c;
  background: rgba(232, 152, 92, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(232, 152, 92, 0.4);
}
.acquisition-donor-part-arrow {
  flex: 0 0 auto;
  font-size: 13px;
  color: #e8985c;
  opacity: 0.7;
}
.acquisition-donor-part-stub {
  font-size: 11px;
  color: #888;
  font-style: italic;
  padding: 6px 12px;
}

/* §16.6 — Sub-frames (Equinox case) */
.acquisition-sub-frames {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(184, 136, 255, 0.3);
}
.acquisition-sub-frames-header {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #b888ff;
  margin-bottom: 10px;
}
.acquisition-sub-frame {
  margin-bottom: 14px;
}
.acquisition-sub-frame:last-child {
  margin-bottom: 0;
}
.acquisition-sub-frame-title {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #ddd;
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 2px solid #b888ff;
}

.acquisition-star-chart-link {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(94, 192, 232, 0.08);
  border: 1px solid rgba(94, 192, 232, 0.35);
  border-radius: 6px;
  color: #5ec0e8;
  cursor: pointer;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.08s;
}
.acquisition-star-chart-link:hover {
  border-color: #5ec0e8;
  background: rgba(94, 192, 232, 0.14);
  color: #fff;
  transform: translateY(-1px);
}
.acquisition-star-chart-link-icon {
  font-size: 16px;
  line-height: 1;
}
.acquisition-star-chart-link-label {
  font-weight: 600;
  text-shadow: 0 0 4px rgba(94, 192, 232, 0.4);
}
.acquisition-star-chart-link-target {
  margin-left: auto;
  color: #c9e0e8;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: none;
  font-weight: 500;
}
.acquisition-star-chart-link:hover .acquisition-star-chart-link-target {
  color: #fff;
}

/* §20.5 — Alternative farms in Railjack. Same shape as the Star Chart link
   above but tinted purple (Railjack tab theme) and rendered as a stacked
   list of links since a frame can have multiple Proxima sources. */
.acquisition-railjack-farms {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(184, 136, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acquisition-railjack-farms-header {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #b888ff;
  margin-bottom: 2px;
}
.acquisition-railjack-farm-link {
  padding: 8px 12px;
  background: rgba(184, 136, 255, 0.06);
  border: 1px solid rgba(184, 136, 255, 0.3);
  border-radius: 6px;
  color: #ddd;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.08s;
}
.acquisition-railjack-farm-link:hover {
  border-color: rgba(184, 136, 255, 0.65);
  background: rgba(184, 136, 255, 0.14);
  color: #fff;
  transform: translateY(-1px);
}
.acquisition-railjack-farm-arrow {
  font-size: 14px;
  line-height: 1.4;
  color: #b888ff;
  flex-shrink: 0;
}
.acquisition-railjack-farm-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.acquisition-railjack-farm-target {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #d4c5f0;
}
.acquisition-railjack-farm-link:hover .acquisition-railjack-farm-target {
  color: #fff;
  text-shadow: 0 0 6px rgba(184, 136, 255, 0.5);
}
.acquisition-railjack-farm-note {
  font-size: 11.5px;
  letter-spacing: 0.2px;
  color: #aaa;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .acquisition-row { grid-template-columns: 1fr; gap: 4px; }
  .acquisition-row-label { padding-top: 0; }
  .acquisition-star-chart-link {
    flex-wrap: wrap;
  }
  .acquisition-star-chart-link-target {
    margin-left: 26px;
    width: 100%;
  }
}

/* ========================================================================
   Star Chart (v1)
   ======================================================================== */

.star-chart-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 14px;
  align-items: center;
  margin: 16px 0 14px;
}

.star-chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* §20.5 — Mission filter chips moved inside each tab section, centered between
   the tab buttons row and the planet grid. */
.star-chart-filters-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 16px;
  max-width: 100%;
}

.star-chart-filter-chip {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #aaa;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.star-chart-filter-chip:hover { color: #fff; border-color: #444; }
.star-chart-filter-chip.active {
  color: #fff;
  border-color: var(--chip-color, #5ec0e8);
  background: color-mix(in srgb, var(--chip-color, #5ec0e8) 14%, transparent);
  text-shadow: 0 0 4px color-mix(in srgb, var(--chip-color, #5ec0e8) 50%, transparent);
}
.star-chart-filter-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip-color, #5ec0e8);
  flex-shrink: 0;
}

/* Spoiler protection toggle — in its own centered row between the filter
 * toolbar and the planet grid, styled differently to flag it as a content
 * gate rather than a mission filter. */
.star-chart-spoiler-row {
  display: flex;
  justify-content: center;
  margin: 14px 0 16px;
}

/* §20.5 — Three top-level Star Chart tab buttons (Origin System / Railjack /
   Special). Rectangular cards centered as a row, each with a placeholder image
   on the left and a left→right gradient fade so the label stays legible. */
.star-chart-top-tabs {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 20px;
  flex-wrap: wrap;
}
.star-chart-top-tab {
  --tab-color: #5ec0e8;
  position: relative;
  overflow: hidden;
  width: 220px;
  height: 72px;
  padding: 0;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #0a0a0a;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  align-items: stretch;
}
.star-chart-top-tab[data-theme="origin"]   { --tab-color: #5ec0e8; }
.star-chart-top-tab[data-theme="empyrean"] { --tab-color: #b888ff; }
.star-chart-top-tab[data-theme="special"]  { --tab-color: #e89c4a; }

.star-chart-top-tab-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.star-chart-top-tab[data-theme="origin"]   .star-chart-top-tab-image { background-image: url('assets/backgrounds/OriginSystem.jpg'); }
.star-chart-top-tab[data-theme="empyrean"] .star-chart-top-tab-image { background-image: url('assets/backgrounds/Railjack.jpg'); }
.star-chart-top-tab[data-theme="special"]  .star-chart-top-tab-image { background-image: url('assets/backgrounds/Special.png'); }
.star-chart-top-tab-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.92) 100%
  );
}
.star-chart-top-tab-label {
  position: relative;
  z-index: 1;
  margin-left: auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #d8d8d8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.star-chart-top-tab:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: color-mix(in srgb, var(--tab-color) 60%, transparent);
}
.star-chart-top-tab:hover .star-chart-top-tab-label {
  color: #fff;
}
.star-chart-top-tab.active {
  border-color: var(--tab-color);
  box-shadow:
    0 0 0 1px var(--tab-color),
    0 0 18px color-mix(in srgb, var(--tab-color) 55%, transparent),
    inset 0 0 16px color-mix(in srgb, var(--tab-color) 18%, transparent);
}
.star-chart-top-tab.active .star-chart-top-tab-label {
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.8),
    0 0 8px color-mix(in srgb, var(--tab-color) 70%, transparent);
}
@media (max-width: 720px) {
  .star-chart-top-tab {
    width: 160px;
    height: 60px;
  }
  .star-chart-top-tab-label {
    font-size: 12px;
    letter-spacing: 1px;
    padding: 0 10px;
  }
}
.star-chart-spoiler-toggle {
  background: transparent;
  border: 1px dashed #555;
  color: #999;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.star-chart-spoiler-toggle:hover { color: #fff; border-color: #888; }
.star-chart-spoiler-toggle.active {
  color: #fff;
  border-color: #e8a85a;
  border-style: solid;
  background: rgba(232, 168, 90, 0.12);
  text-shadow: 0 0 4px rgba(232, 168, 90, 0.5);
}
.spoiler-toggle-icon {
  font-size: 14px;
  line-height: 1;
}

.star-chart-search-wrap {
  position: relative;
}
.star-chart-search-input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #eee;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.star-chart-search-input:focus {
  outline: none;
  border-color: #5ec0e8;
  box-shadow: 0 0 0 2px rgba(94, 192, 232, 0.18);
}
.star-chart-search-input::placeholder { color: #666; }
.star-chart-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #aaa;
  font-size: 16px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.star-chart-search-clear:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* ----- Planet grid ----- */

.star-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.star-chart-planet-card {
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #1f1f1f;
  border-left: 4px solid var(--faction-color, #5ec0e8);
  border-radius: 6px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  min-height: 150px;
  isolation: isolate;
}
/* Dark gradient overlay so text stays readable on top of the planet image. */
.star-chart-planet-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(15, 15, 20, 0.55) 0%,
    rgba(15, 15, 20, 0.75) 55%,
    rgba(10, 10, 14, 0.92) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.star-chart-planet-card > * {
  position: relative;
  z-index: 1;
}
.star-chart-planet-card:hover {
  border-color: #444;
  border-left-color: var(--faction-color, #5ec0e8);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5),
              0 0 24px color-mix(in srgb, var(--faction-color, #5ec0e8) 18%, transparent);
}
/* For planets without a wiki image (Void, Zariman) — solid faction-tinted bg. */
.star-chart-planet-card.no-image {
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--faction-color, #5ec0e8) 25%, #111) 0%,
    #0c0c10 100%
  );
}
.star-chart-planet-card.no-image::before {
  display: none;
}
.star-chart-planet-card.dimmed {
  opacity: 0.35;
  filter: grayscale(0.4);
}

.star-chart-planet-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.star-chart-planet-card-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}
.star-chart-planet-card-level {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

.star-chart-planet-card-faction {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--faction-color, #5ec0e8);
}

.star-chart-planet-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
}
.star-chart-planet-card-count {
  font-weight: 500;
}
.star-chart-planet-card-boss {
  font-size: 11px;
  color: #e87878;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Warframe drop badge — pinned to the bottom-right corner of the compact card,
 * icon on top + warframe name in red below. Multiple drops stack horizontally. */
.star-chart-planet-card-wf-wrap {
  position: absolute;
  bottom: 10px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.star-chart-planet-card-wf-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.star-chart-planet-card-wf-badge:hover {
  opacity: 0.75;
}
.star-chart-planet-card-wf-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(232, 120, 120, 0.6);
  background: #1a1a1a;
  box-shadow: 0 0 8px rgba(232, 120, 120, 0.35);
}
.star-chart-planet-card-wf-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #e87878;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.3px;
}

/* ----- Planet detail (drill-down view) ----- */

.star-chart-back-btn {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #bbb;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.star-chart-back-btn:hover { border-color: #5ec0e8; color: #fff; }

.star-chart-planet-detail-header {
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #1f1f1f;
  border-left: 4px solid var(--faction-color, #5ec0e8);
  border-radius: 6px;
  padding: 28px 28px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Bottom-up dark fade so the title remains readable over the planet image. */
.star-chart-planet-detail-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(8, 8, 12, 0.30) 0%,
    rgba(8, 8, 12, 0.55) 55%,
    rgba(8, 8, 12, 0.92) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.star-chart-planet-detail-header > * {
  position: relative;
  z-index: 1;
}
.star-chart-planet-detail-header.no-image {
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--faction-color, #5ec0e8) 22%, #111) 0%,
    #0c0c10 100%
  );
  min-height: 140px;
}
.star-chart-planet-detail-header.no-image::before {
  display: none;
}
.star-chart-planet-detail-title {
  font-size: 30px;
  text-shadow:
    0 0 14px rgba(0, 0, 0, 0.85),
    0 2px 6px rgba(0, 0, 0, 0.85);
}
.star-chart-planet-detail-faction {
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

/* ----- Expanded planet card (in-place, replaces drill-down detail view) ----- */

/* Card collapsed because another card is expanded — fade out & shrink to 0
 * height. Override min-height too, otherwise the base rule's 150px wins. */
.star-chart-planet-card.is-collapsed-by-other {
  opacity: 0;
  min-height: 0;
  max-height: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    max-height 0.28s ease,
    margin 0.28s ease,
    padding 0.28s ease;
}

/* When a card is expanded, kill the grid gap so the collapsed cards don't
 * create empty rows of dead space around the expanded one. */
.star-chart-grid:has(.star-chart-planet-card.is-expanded) {
  gap: 0;
  margin-bottom: 0;
}

/* Expanded card spans full grid width and grows into the detail layout. */
.star-chart-planet-card.is-expanded {
  grid-column: 1 / -1;
  cursor: zoom-out;
  min-height: 500px;
  padding: 18px 22px 14px;
  background-color: #0c0c10;
  background-image: none !important;
  text-align: left;
  display: block;
  overflow: hidden;
  isolation: isolate;
}
.star-chart-planet-card.is-expanded::before {
  display: none;
}
.star-chart-planet-card.is-expanded:hover {
  transform: none;
  box-shadow: none;
  border-color: #2a2a2a;
}
.star-chart-planet-card.is-expanded .planet-detail-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.star-chart-planet-card.is-expanded > .star-chart-planet-card-header,
.star-chart-planet-card.is-expanded > .star-chart-planet-card-faction,
.star-chart-planet-card.is-expanded > .star-chart-card-detail {
  position: relative;
  z-index: 1;
}
.star-chart-planet-card.is-expanded > .star-chart-planet-card-header {
  margin-bottom: 2px;
  justify-content: flex-start;
  gap: 14px;
}
.star-chart-planet-card.is-expanded .star-chart-planet-card-name {
  font-size: 26px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}
.star-chart-planet-card.is-expanded .star-chart-planet-card-faction {
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  font-weight: 600;
  letter-spacing: 1.2px;
}
.star-chart-card-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* Section header inside the node list (e.g., Albrecht's Laboratories on Deimos) */
.star-chart-node-section-header {
  padding: 8px 12px 6px;
  margin: 8px 0 2px;
  border-top: 1px solid color-mix(in srgb, var(--section-color, #b888ff) 30%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--section-color, #b888ff) 18%, transparent);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--section-color, #b888ff) 12%, transparent) 0%,
    color-mix(in srgb, var(--section-color, #b888ff) 4%, transparent) 60%,
    transparent 100%
  );
  border-radius: 4px;
}
.star-chart-node-section-header:first-child {
  margin-top: 0;
}
.star-chart-node-section-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--section-color, #b888ff);
  text-shadow: 0 0 6px color-mix(in srgb, var(--section-color, #b888ff) 50%, transparent);
}
.star-chart-node-section-note {
  font-size: 10.5px;
  color: #888;
  font-style: italic;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* Compact node rows inside the expanded card — port of layout-v2 styles. */
.star-chart-planet-card.is-expanded .star-chart-node-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.star-chart-planet-card.is-expanded .star-chart-node-row {
  background: rgba(8, 8, 12, 0.18);
  backdrop-filter: blur(2px);
  border: 1px solid color-mix(in srgb, var(--mission-color, #5ec0e8) 55%, transparent);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 12px;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--mission-color, #5ec0e8) 25%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--mission-color, #5ec0e8) 6%, transparent);
  display: inline-grid;
  width: fit-content;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    'name  type drop'
    'level type drop';
  column-gap: 14px;
  row-gap: 0;
  align-items: center;
}
.star-chart-planet-card.is-expanded .star-chart-node-name {
  grid-area: name;
  align-self: end;
  font-size: 13px;
  line-height: 1;
  margin: 0;
  padding: 0;
}
.star-chart-planet-card.is-expanded .star-chart-node-level {
  grid-area: level;
  align-self: start;
  font-size: 10.5px;
  line-height: 1;
  margin: 2px 0 0;
  padding: 0;
  color: #888;
}
.star-chart-planet-card.is-expanded .star-chart-node-type {
  grid-area: type;
  font-size: 11.5px;
  justify-self: start;
}
.star-chart-planet-card.is-expanded .star-chart-node-row > .star-chart-node-drop,
.star-chart-planet-card.is-expanded .star-chart-node-row > .star-chart-node-drop-wrap,
.star-chart-planet-card.is-expanded .star-chart-node-row > .star-chart-node-drop-filler {
  grid-area: drop;
}
.star-chart-planet-card.is-expanded .star-chart-node-drop {
  font-size: 10.5px;
  padding: 2px 8px;
}
.star-chart-planet-card.is-expanded .star-chart-node-drop-wrap { gap: 6px; }
.star-chart-planet-card.is-expanded .star-chart-node-warframe { font-size: 12px; gap: 5px; cursor: pointer; }
.star-chart-planet-card.is-expanded .star-chart-node-warframe:hover { opacity: 0.75; }
.star-chart-planet-card.is-expanded .star-chart-node-warframe-icon {
  width: 30px;
  height: 30px;
}

/* View Transitions API — modern browsers morph the card automatically when
 * its size/position changes. Customize the animation easing here. */
@supports (view-transition-name: none) {
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.32s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ----- Planet detail v2: full-bleed planet bg + overlay content ----- */

.star-chart-planet-detail-header.layout-v2 {
  display: block;
  padding: 18px 22px 14px;
  min-height: 500px;
  background-color: #0c0c10;
  background-image: none;
  position: relative;
  overflow: hidden;
}
.star-chart-planet-detail-header.layout-v2::before {
  display: none;
}

/* Planet image as full-bleed background layer. `contain` scales the whole
 * planet to fit within the box (no cropping). The box's min-height controls
 * how large the planet appears. Opacity dims it so foreground content reads. */
.planet-detail-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.star-chart-planet-detail-header.layout-v2 .planet-detail-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.star-chart-planet-detail-header.layout-v2 .planet-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-planet-detail-title {
  font-size: 26px;
  margin: 0;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}
.star-chart-planet-detail-header.layout-v2 .star-chart-planet-detail-faction {
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}

/* Compact node rows: very low-opacity bg + neon border tinted by mission type. */
.star-chart-planet-detail-header.layout-v2 .star-chart-node-list {
  gap: 5px;
  align-items: flex-start;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-row {
  background: rgba(8, 8, 12, 0.18);
  backdrop-filter: blur(2px);
  border: 1px solid color-mix(in srgb, var(--mission-color, #5ec0e8) 55%, transparent);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 12px;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--mission-color, #5ec0e8) 25%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--mission-color, #5ec0e8) 6%, transparent);

  /* Compact 3-col grid: name+level | type | drop — all sit next to each other,
   * row shrinks to content width so each row only takes the space it needs. */
  display: inline-grid;
  width: fit-content;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    'name  type drop'
    'level type drop';
  column-gap: 14px;
  row-gap: 0;
  align-items: center;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-name {
  grid-area: name;
  align-self: end;
  font-size: 13px;
  line-height: 1;
  margin: 0;
  padding: 0;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-level {
  grid-area: level;
  align-self: start;
  font-size: 10.5px;
  line-height: 1;
  margin: 2px 0 0;
  padding: 0;
  color: #888;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-type {
  grid-area: type;
  font-size: 11.5px;
  justify-self: start;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-row > .star-chart-node-drop,
.star-chart-planet-detail-header.layout-v2 .star-chart-node-row > .star-chart-node-drop-wrap,
.star-chart-planet-detail-header.layout-v2 .star-chart-node-row > .star-chart-node-drop-filler {
  grid-area: drop;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-drop {
  font-size: 10.5px;
  padding: 2px 8px;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-drop-wrap {
  gap: 6px;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-warframe {
  font-size: 12px;
  gap: 5px;
}
.star-chart-planet-detail-header.layout-v2 .star-chart-node-warframe-icon {
  width: 22px;
  height: 22px;
}

@media (max-width: 720px) {
  .planet-detail-bg-image { opacity: 0.35; }
  .star-chart-planet-detail-header.layout-v2 .star-chart-node-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      'name  level'
      'type  drop'
      'type  drop';
  }
}
.star-chart-planet-detail-title {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: 1px;
}
.star-chart-planet-detail-faction {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faction-color, #5ec0e8);
}
.star-chart-planet-detail-level {
  font-size: 12px;
  color: #888;
  margin-left: 10px;
}

.star-chart-node-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.star-chart-node-row {
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 160px 1fr auto auto;
  gap: 14px;
  align-items: center;
  transition: border-color 0.12s, background 0.12s;
}
.star-chart-node-row:hover {
  border-color: #2a2a2a;
  background: #161616;
}
.star-chart-node-row.is-assassination {
  border-left: 3px solid #e87878;
  padding-left: 14px;
}
.star-chart-node-row.is-dark-sector::after {
  content: 'DARK SECTOR';
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #d4b25a;
  padding: 2px 6px;
  border: 1px solid rgba(212, 178, 90, 0.5);
  border-radius: 4px;
}

.star-chart-node-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #eee;
}

.star-chart-node-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #ccc;
}
.star-chart-node-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--type-color, #888);
  flex-shrink: 0;
}
/* Archwing indicator: white glyph with a neon glow tinted by the node's
   mission-type color — same treatment as the active nav-tab icons (no border
   ring). brightness(0) invert(1) forces the glyph white; the drop-shadows add
   the colored glow on top. */
.star-chart-node-archwing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.star-chart-node-archwing img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter:
    brightness(0) invert(1)
    drop-shadow(0 0 2px var(--mission-color, #5ec0e8))
    drop-shadow(0 0 6px color-mix(in srgb, var(--mission-color, #5ec0e8) 65%, transparent));
}

.star-chart-node-level {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

.star-chart-node-drop-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.star-chart-node-drop {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #c9e08e;
  background: rgba(163, 209, 66, 0.08);
  border: 1px solid rgba(163, 209, 66, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
}
.star-chart-node-warframe {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #fff;
}
.star-chart-node-warframe strong {
  font-weight: 600;
}
.star-chart-node-warframe-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1a1a1a;
  flex-shrink: 0;
}

.star-chart-empty {
  padding: 24px;
  text-align: center;
  color: #888;
  font-size: 14px;
  background: #111;
  border: 1px dashed #2a2a2a;
  border-radius: 6px;
}

@media (max-width: 700px) {
  .star-chart-toolbar { grid-template-columns: 1fr; }
  .star-chart-node-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'name level'
      'type drop';
    gap: 8px;
  }
  .star-chart-node-name { grid-area: name; }
  .star-chart-node-level { grid-area: level; }
  .star-chart-node-type { grid-area: type; }
  .star-chart-node-drop { grid-area: drop; }
  .star-chart-all-resources-header { grid-template-columns: 1fr; }
}

/* ----- Resources section (inside planet detail + global list) ----- */

.star-chart-resources,
.star-chart-all-resources {
  margin-top: 4px;
  padding: 12px 16px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  margin-bottom: 18px;
  width: fit-content;
  max-width: 100%;
}
/* The 3-column grid needs full container width — applies to both the planet
   detail "Resources on this planet" and the global all-resources list. */
.star-chart-all-resources:has(.resource-list.is-grid-3col),
.star-chart-resources:has(.resource-list.is-grid-3col) {
  width: 100%;
}
.star-chart-resources-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #888;
  margin: 0 0 6px;
}

.star-chart-all-resources-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.star-chart-all-resources-header .star-chart-resources-label {
  margin: 0;
  flex: 0 0 auto;
}
.star-chart-all-resources-header .star-chart-resource-search-wrap {
  flex: 0 1 280px;
}
.star-chart-resource-search-wrap {
  position: relative;
}
.star-chart-resource-search-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #eee;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.star-chart-resource-search-input:focus {
  outline: none;
  border-color: #5ec0e8;
  box-shadow: 0 0 0 2px rgba(94, 192, 232, 0.18);
}
.star-chart-resource-search-input::placeholder { color: #666; }
.star-chart-resource-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #aaa;
  font-size: 14px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.star-chart-resource-search-clear:hover { color: #fff; background: rgba(255,255,255,0.12); }

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 3-column grid variant for the global all-resources list (alphabetical fill). */
.resource-list.is-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 10px;
}
@media (max-width: 900px) {
  .resource-list.is-grid-3col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .resource-list.is-grid-3col { grid-template-columns: 1fr; }
}

/* Three-row filter group above the all-resources list. */
.star-chart-resource-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 14px;
}
.star-chart-resource-filter-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: start;
  gap: 8px;
}
.star-chart-resource-filter-row-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #888;
  padding-top: 6px;
  text-align: right;
}
@media (max-width: 700px) {
  .star-chart-resource-filter-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .star-chart-resource-filter-row-label {
    text-align: left;
    padding-top: 0;
    color: #666;
  }
}

/* Category filter chips above the all-resources list. */
.star-chart-resource-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.star-chart-resource-cat-chip {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #aaa;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.star-chart-resource-cat-chip:hover { color: #fff; border-color: #444; }
.star-chart-resource-cat-chip.active {
  color: #fff;
  border-color: var(--chip-color, #5ec0e8);
  background: color-mix(in srgb, var(--chip-color, #5ec0e8) 14%, transparent);
  text-shadow: 0 0 4px color-mix(in srgb, var(--chip-color, #5ec0e8) 50%, transparent);
}

.resource-list-item {
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid var(--rarity-color, #444);
  border-radius: 4px;
  color: #ddd;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.resource-list-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  border-left-color: var(--rarity-color, #888);
  color: #fff;
}
.resource-list-item-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}
.resource-list-item-icon-fallback {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: #222;
  border-radius: 4px;
}
.resource-list-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}
.resource-list-item-name {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.resource-list-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.resource-list-item-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.5;
}
.resource-list-item-tag.is-rarity {
  border: 1px solid var(--rarity-color, #888);
  color: var(--rarity-color, #888);
  background: color-mix(in srgb, var(--rarity-color, #888) 8%, transparent);
}
.resource-list-item-tag.is-location {
  border: 1px solid color-mix(in srgb, var(--location-color, #5ec0e8) 50%, transparent);
  background: color-mix(in srgb, var(--location-color, #5ec0e8) 10%, transparent);
  color: var(--location-color, #5ec0e8);
}
.resource-list-item-tag.is-source {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aaa;
}
/* Hide legacy rarity span (kept for back-compat) */
.resource-list-item-rarity { display: none; }

/* ----- Resource modal ----- */

.resource-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.resource-modal.hidden { display: none; }

.resource-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.resource-modal-content {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  background: #0c0c10;
  border: 1px solid rgba(94, 192, 232, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(94, 192, 232, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resource-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #1f1f22;
  gap: 12px;
}
.resource-modal-title {
  margin: 0;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 5px var(--rarity-color, rgba(94, 192, 232, 0.6));
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.resource-modal-rarity {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rarity-color, #5ec0e8);
  border: 1px solid var(--rarity-color, #5ec0e8);
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rarity-color, #5ec0e8) 10%, transparent);
}
.resource-modal-close {
  background: transparent;
  border: 1px solid #333;
  color: #ccc;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.resource-modal-close:hover { border-color: #d14545; color: #d14545; }

.resource-modal-body {
  overflow-y: auto;
  padding: 20px 26px 26px;
  color: #ccc;
  font-size: 14px;
  line-height: 1.55;
}

/* Big resource icon at the top of the modal, above the description. */
.resource-modal-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.resource-modal-icon {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(0, 0, 0, 0.6));
}

.resource-modal-section {
  margin-bottom: 18px;
}
.resource-modal-section:last-child { margin-bottom: 0; }

.resource-modal-section-label {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #888;
  margin: 0 0 6px;
}
.resource-modal-section-text {
  margin: 0;
  color: #d0d0d0;
}

.resource-modal-farm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(94, 192, 232, 0.05);
  border: 1px solid rgba(94, 192, 232, 0.25);
  border-radius: 6px;
}
.resource-modal-farm-link {
  background: transparent;
  border: none;
  color: #5ec0e8;
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  padding: 0;
  text-shadow: 0 0 4px rgba(94, 192, 232, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.12s;
}
.resource-modal-farm-link:hover {
  color: #fff;
  text-shadow: 0 0 6px rgba(94, 192, 232, 0.7);
}
.resource-modal-farm-link::after {
  content: '→';
  font-size: 16px;
}
.resource-modal-farm-note {
  margin: 0;
  font-size: 13px;
  color: #aaa;
  font-style: italic;
}

/* ── Patch notes inside credits modal ── */
.credits-patchnotes-link-row {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #1f1f1f;
  text-align: center;
}
.credits-patchnotes-btn {
  background: none;
  border: 1px solid #444;
  border-radius: 6px;
  color: #aaa;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.credits-patchnotes-btn:hover {
  color: #d4b25a;
  border-color: #d4b25a;
}
.credits-body.hidden { display: none; }
.credits-patchnotes-view.hidden { display: none; }
.credits-patchnotes-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
  height: 100%;
  box-sizing: border-box;
}
.credits-patchnotes-back {
  background: none;
  border: none;
  color: #aaa;
  font-family: inherit;
  font-size: 13px;
  padding: 0 0 16px 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
  flex-shrink: 0;
}
.credits-patchnotes-back:hover {
  color: #d4b25a;
}
.credits-patchnotes-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.patchnotes-entry {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.patchnotes-entry-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
.patchnotes-date {
  font-size: 11px;
  color: #666;
  letter-spacing: 0.05em;
}
.patchnotes-title {
  font-size: 14px;
  font-weight: 600;
  color: #d4b25a;
}
.patchnotes-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.patchnotes-list li {
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
}
