:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #181a20;
  --surface-2: #20232b;
  --line: #313641;
  --text: #eef0f5;
  --muted: #9ca6b7;
  --accent: #e6b756;
  --accent-2: #67c6a3;
  --danger: #e47972;
  --focus: #86a8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.96);
  padding: 12px 20px;
  backdrop-filter: blur(12px);
}

.top-nav h1 {
  font-size: 22px;
}

.view-tabs {
  display: flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.account-bar button,
.login-card button,
.admin-form button,
.admin-user-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

.view-tabs button,
.builder-actions button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
}

.view-tabs button.active,
.builder-actions button:hover,
.view-tabs button:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.login-view {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(230, 183, 86, 0.08), transparent 36%),
    linear-gradient(225deg, rgba(103, 198, 163, 0.08), transparent 34%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  font-size: 34px;
}

.login-note,
.form-message {
  color: var(--muted);
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.admin-view {
  min-height: calc(100vh - 72px);
  padding: 20px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
}

.admin-form,
.admin-users {
  display: grid;
  gap: 12px;
}

.admin-users-card {
  min-width: 0;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11141a;
  padding: 12px;
}

.admin-user-row.disabled {
  opacity: 0.58;
}

.admin-user-row strong,
.admin-user-row span {
  display: block;
}

.admin-user-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-user-actions select {
  width: 110px;
  min-height: 34px;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  min-height: calc(100vh - 72px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #14161b;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

.side-header,
.detail-header,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.side-header {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.1;
}

h2 {
  font-size: 30px;
  line-height: 1.1;
}

h3 {
  font-size: 16px;
}

.count,
.panel-header span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.panel-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-header-controls select {
  max-width: 150px;
  min-height: 28px;
  padding: 4px 26px 4px 8px;
  font-size: 12px;
}

.filters {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.field,
.range-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(134, 168, 255, 0.2);
}

.weapon-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.weapon-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.weapon-row:hover,
.weapon-row.active {
  background: var(--surface);
  border-color: var(--line);
}

.weapon-row.active {
  border-left-color: var(--accent);
}

.mini-icon,
.item-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0d0f13;
  object-fit: contain;
}

.weapon-name {
  display: block;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.weapon-id,
.item-id {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.type-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.details {
  min-width: 0;
  padding: 24px;
}

.empty-state {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: calc(100vh - 48px);
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
}

.hidden {
  display: none;
}

.detail-panel {
  display: grid;
  gap: 18px;
}

.detail-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.identity .item-icon {
  width: 58px;
  height: 58px;
}

.source-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 0 12px;
  text-decoration: none;
}

.source-link:hover {
  border-color: var(--accent);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  align-items: end;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.level-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.level-buttons button {
  width: 36px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111318;
  color: var(--muted);
  cursor: pointer;
}

.level-buttons button.active {
  border-color: var(--accent);
  color: var(--text);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.summary-item {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.summary-label {
  color: var(--muted);
  font-size: 12px;
}

.summary-value {
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel:first-child {
  grid-row: span 2;
}

.panel-header {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.stat-table {
  display: grid;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  overflow-x: hidden;
}

.stat-row,
.list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, max-content);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 10px;
}

.stat-row:last-child,
.list-row:last-child {
  border-bottom: 0;
}

.stat-row.text-row,
.list-row.text-row {
  grid-template-columns: 1fr;
  align-items: start;
}

.stat-name {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.stat-value {
  min-width: 0;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-weight: 750;
  text-align: right;
  overflow-wrap: normal;
}

.text-row .stat-value {
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}

.stat-source-tooltip {
  position: fixed;
  z-index: 9999;
  left: var(--floating-tooltip-left, 12px);
  top: var(--floating-tooltip-top, 12px);
  display: none;
  width: var(--floating-tooltip-width, min(420px, calc(100vw - 32px)));
  max-height: 70vh;
  overflow: auto;
  border: 1px solid rgba(230, 183, 86, 0.7);
  border-radius: 8px;
  background: #0f1014;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.75);
  padding: 10px;
  color: var(--text);
}

.stat-row:hover > .stat-source-tooltip,
.stat-row:focus-within > .stat-source-tooltip,
.stat-source-tooltip.floating-tooltip-visible {
  display: grid;
  gap: 8px;
}

.stat-source-head,
.stat-source-total,
.stat-source-list > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: baseline;
}

.stat-source-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 7px;
}

.stat-source-head strong {
  color: var(--accent);
  font-size: 13px;
}

.stat-source-head em,
.stat-source-total em,
.stat-source-list em {
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-style: normal;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.stat-source-list {
  display: grid;
  gap: 4px;
}

.stat-source-formula {
  border: 1px solid rgba(98, 226, 178, 0.16);
  border-radius: 6px;
  background: rgba(98, 226, 178, 0.08);
  color: var(--muted);
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.stat-source-list i,
.stat-source-total i {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat-source-total {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 7px;
}

.stat-source-total i {
  color: var(--text);
  font-weight: 900;
}

.stacked-list {
  max-height: 340px;
  overflow: auto;
}

.loading,
.no-results {
  color: var(--muted);
  padding: 18px;
}

.builder-view {
  padding: 20px;
}

.builder-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.builder-actions {
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto auto;
  gap: 8px;
}

.builder-actions button {
  border-color: var(--line);
  background: var(--surface);
}

.builder-layout {
  display: grid;
  grid-template-columns: 260px minmax(520px, 1fr) 300px;
  align-items: start;
  gap: 12px;
  min-height: calc(100vh - 170px);
  padding-top: 12px;
}

.builder-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.builder-left,
.builder-right {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
}

.builder-center {
  min-height: calc(100vh - 190px);
}

.builder-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 0 8px;
}

.builder-mode-tabs button {
  height: 40px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
}

.builder-mode-tabs button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.equipment-ring {
  min-height: 520px;
  margin: 12px;
  border: 1px solid rgba(213, 178, 102, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 54% 36%, rgba(108, 57, 159, 0.36), transparent 24%),
    radial-gradient(circle at 64% 56%, rgba(54, 100, 150, 0.28), transparent 30%),
    linear-gradient(120deg, rgba(19, 14, 28, 0.98), rgba(14, 19, 31, 0.98));
  overflow: hidden;
}

.loadout-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 0.62fr) minmax(390px, 1.35fr) minmax(170px, 0.62fr);
  gap: 14px;
  min-height: 520px;
  padding: 18px;
}

.loadout-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(230, 183, 86, 0.06), transparent 22%, transparent 78%, rgba(230, 183, 86, 0.06)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 38%);
  pointer-events: none;
}

.loadout-column,
.character-stage {
  position: relative;
  z-index: 1;
}

.loadout-column {
  display: grid;
  align-content: center;
  gap: 8px;
}

.loadout-slot {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 70px;
  border: 1px solid rgba(213, 178, 102, 0.22);
  border-radius: 8px;
  background: rgba(12, 13, 18, 0.72);
  color: var(--text);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.loadout-slot:hover,
.loadout-slot:focus-visible,
.loadout-slot.active {
  border-color: var(--accent);
  background: rgba(35, 29, 39, 0.88);
}

.loadout-slot.active {
  box-shadow: inset 0 0 0 1px rgba(230, 183, 86, 0.22), 0 0 24px rgba(151, 80, 220, 0.18);
}

.loadout-slot.equipped .loadout-icon-frame {
  border-color: rgba(230, 183, 86, 0.78);
  box-shadow: 0 0 18px rgba(151, 80, 220, 0.28);
}

.loadout-icon-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(149, 73, 196, 0.65), rgba(31, 23, 45, 0.94) 62%),
    #111318;
}

.loadout-icon-frame img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.loadout-icon-frame em {
  position: absolute;
  right: -4px;
  bottom: -5px;
  min-width: 24px;
  border: 1px solid rgba(230, 183, 86, 0.8);
  border-radius: 4px;
  background: #171014;
  color: var(--accent);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.loadout-slot-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.loadout-slot-text strong {
  color: var(--accent);
  font-size: 12px;
}

.loadout-slot-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.character-stage {
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
  min-height: 480px;
  padding-top: 84px;
}

.character-aura {
  position: absolute;
  width: min(34vw, 360px);
  aspect-ratio: 1;
  border: 1px solid rgba(230, 183, 86, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(129, 64, 196, 0.46), rgba(129, 64, 196, 0.12) 44%, transparent 68%);
  box-shadow: inset 0 0 50px rgba(230, 183, 86, 0.08);
}

.character-silhouette {
  position: relative;
  display: grid;
  place-items: center;
  width: min(28vw, 250px);
  min-width: 190px;
  aspect-ratio: 0.48;
  align-self: center;
  opacity: 0.22;
}

.character-silhouette::before,
.character-silhouette::after,
.character-silhouette span {
  content: "";
  position: absolute;
  display: block;
  background: linear-gradient(180deg, rgba(240, 235, 220, 0.78), rgba(92, 77, 112, 0.7));
  filter: drop-shadow(0 0 18px rgba(164, 96, 255, 0.3));
}

.character-silhouette::before {
  top: 3%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.character-silhouette span {
  top: 18%;
  width: 46%;
  height: 48%;
  border-radius: 40% 40% 14% 14%;
}

.character-silhouette::after {
  bottom: 2%;
  width: 76%;
  height: 42%;
  clip-path: polygon(32% 0, 68% 0, 90% 100%, 58% 100%, 50% 42%, 42% 100%, 10% 100%);
}

.combat-medallion {
  position: absolute;
  top: 20px;
  display: grid;
  place-items: center;
  min-width: 132px;
  min-height: 72px;
  border: 1px solid rgba(230, 183, 86, 0.55);
  border-radius: 8px;
  background: rgba(12, 13, 18, 0.76);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.24);
}

.combat-medallion strong {
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.combat-medallion span,
.weapon-readout span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.weapon-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.weapon-readout div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(12, 13, 18, 0.72);
  padding: 10px;
}

.weapon-readout strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.active-equipment-editor {
  position: absolute;
  inset: 96px 10px 16px;
  z-index: 2;
  display: grid;
  gap: 10px;
  width: auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(230, 183, 86, 0.26);
  border-radius: 8px;
  background: rgba(13, 15, 21, 0.9);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
  padding: 10px;
}

.active-equipment-editor .slot-card {
  border-color: rgba(230, 183, 86, 0.18);
  background: rgba(18, 20, 27, 0.94);
}

.active-equipment-editor .weapon-readout {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(13, 15, 21, 0.2), rgba(13, 15, 21, 0.96) 28%);
  padding-top: 8px;
}

.ring-slot {
  --ring-radius: 170px;
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  transform:
    rotate(calc(var(--slot-index) * 17.142deg - 90deg))
    translate(var(--ring-radius))
    rotate(calc((var(--slot-index) * -17.142deg) + 90deg));
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #171a21;
  color: var(--muted);
  cursor: pointer;
}

.ring-slot:hover,
.ring-slot:focus-visible {
  border-color: var(--accent);
  outline: 0;
  transform:
    rotate(calc(var(--slot-index) * 17.142deg - 90deg))
    translate(var(--ring-radius))
    rotate(calc((var(--slot-index) * -17.142deg) + 90deg))
    scale(1.06);
}

.ring-slot.equipped {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(230, 183, 86, 0.18);
}

.ring-slot img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.ring-slot span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ring-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.ring-core div {
  color: var(--accent-2);
  font-size: 34px;
  font-weight: 900;
}

.ring-core span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.slot-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.builder-subpanel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.builder-filter-note {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #12151b;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
}

.skill-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
}

.mastery-boards {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.mastery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.mastery-side {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.mastery-empty {
  display: grid;
  gap: 6px;
  min-height: 240px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
  color: var(--muted);
  text-align: center;
}

.mastery-empty strong {
  color: var(--text);
  font-size: 18px;
}

.mastery-board {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(230, 183, 86, 0.08), transparent 18%),
    radial-gradient(circle at center, rgba(99, 117, 148, 0.16), transparent 58%),
    #101218;
  overflow: hidden;
}

.mastery-weapon-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mastery-weapon-switch button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151922;
  color: var(--muted);
  padding: 5px 9px;
  text-align: left;
  cursor: pointer;
}

.mastery-weapon-switch button.active {
  border-color: rgba(230, 183, 86, 0.72);
  background: rgba(230, 183, 86, 0.1);
  color: var(--text);
}

.mastery-weapon-switch img {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: grayscale(0.35);
}

.mastery-weapon-switch span,
.mastery-weapon-switch strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mastery-weapon-switch span {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mastery-weapon-switch strong {
  color: var(--accent);
  font-size: 13px;
}

.mastery-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.mastery-board-head h4 {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

.mastery-board-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mastery-rule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 0;
}

.mastery-rule-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.mastery-rule-strip span.unlocked {
  border-color: rgba(102, 217, 171, 0.45);
  color: var(--accent-2);
}

.mastery-rule-strip button {
  border: 1px solid rgba(230, 183, 86, 0.45);
  border-radius: 999px;
  background: rgba(230, 183, 86, 0.1);
  color: var(--accent);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.mastery-rule-strip button:hover,
.mastery-rule-strip button.active {
  background: rgba(230, 183, 86, 0.22);
  border-color: rgba(230, 183, 86, 0.72);
  color: #ffe9a6;
}

.mastery-tree {
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 7;
  height: auto;
  min-height: 460px;
  max-height: 820px;
  margin: 0 auto;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background:
    radial-gradient(ellipse at 50% 52%, rgba(216, 209, 196, 0.13), transparent 15%),
    radial-gradient(ellipse at 50% 50%, rgba(48, 56, 70, 0.34), transparent 48%),
    linear-gradient(90deg, rgba(65, 36, 94, 0.16), rgba(20, 24, 31, 0.7) 34%, rgba(20, 24, 31, 0.7) 66%, rgba(96, 45, 50, 0.15));
}

.mastery-tree.layout-editing {
  cursor: crosshair;
}

.mastery-nav {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 44px;
  height: min(50%, 300px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(27, 31, 40, 0.82);
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  transform: translateY(-50%);
  cursor: pointer;
}

.mastery-nav:hover {
  border-color: rgba(102, 217, 171, 0.6);
  color: var(--accent-2);
}

.mastery-nav-prev { left: 8px; }
.mastery-nav-next { right: 8px; }

.mastery-scroll-hint {
  position: absolute;
  right: 12px;
  bottom: 8px;
  z-index: 2;
  margin: 0;
  color: rgba(215, 205, 186, 0.58);
  font-size: 12px;
  font-style: italic;
}

.mastery-web {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mastery-web-ring,
.mastery-web-line,
.mastery-web-spoke,
.mastery-web-panel,
.mastery-web-gate {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.mastery-web-panel {
  fill: rgba(16, 20, 27, 0.22);
  stroke: rgba(118, 80, 174, 0.2);
  stroke-width: 2;
}

.mastery-web-ring {
  stroke: rgba(83, 129, 172, 0.26);
  stroke-width: 2;
}

.mastery-web-ring-outer { stroke: rgba(118, 80, 174, 0.3); }
.mastery-web-ring-mid { stroke: rgba(91, 169, 101, 0.25); }
.mastery-web-ring-high { stroke: rgba(219, 187, 122, 0.2); }
.mastery-web-ring-inner { stroke: rgba(216, 209, 196, 0.18); }

.mastery-web-line {
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.54;
}

.mastery-node-link {
  stroke-width: 2.25;
  stroke-linecap: round;
  opacity: 0.42;
}

.mastery-web-util { stroke: rgba(180, 131, 255, 0.82); }
.mastery-web-defense { stroke: rgba(83, 169, 229, 0.78); }
.mastery-web-attack { stroke: rgba(241, 93, 112, 0.82); }
.mastery-web-tactic { stroke: rgba(230, 183, 86, 0.82); }
.mastery-web-hybrid { stroke: rgba(216, 209, 196, 0.2); stroke-width: 3; }
.mastery-web-util-defense { stroke: rgba(113, 176, 216, 0.38); }
.mastery-web-defense-tactic { stroke: rgba(176, 178, 126, 0.38); }
.mastery-web-tactic-attack { stroke: rgba(236, 139, 96, 0.38); }
.mastery-web-attack-util { stroke: rgba(199, 112, 184, 0.38); }
.mastery-web-primary { stroke: rgba(216, 209, 196, 0.54); stroke-width: 4; }

.mastery-web-spoke {
  stroke: rgba(255, 255, 255, 0.11);
  stroke-width: 2;
}

.mastery-web-spoke-soft {
  opacity: 0.48;
}

.mastery-web-gate {
  fill: rgba(10, 12, 17, 0.9);
  stroke: rgba(216, 209, 196, 0.32);
  stroke-width: 2.5;
  opacity: 0.62;
}

.mastery-web-gate-spine {
  fill: rgba(18, 18, 21, 0.92);
  stroke: rgba(216, 209, 196, 0.36);
}

.mastery-web-gate-util { stroke: rgba(180, 131, 255, 0.36); }
.mastery-web-gate-defense { stroke: rgba(83, 169, 229, 0.36); }
.mastery-web-gate-attack { stroke: rgba(241, 93, 112, 0.36); }
.mastery-web-gate-tactic { stroke: rgba(230, 183, 86, 0.36); }

.mastery-web-center path {
  fill: rgba(216, 209, 196, 0.16);
  stroke: rgba(216, 209, 196, 0.5);
  stroke-width: 3;
}

.mastery-center-emblem {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(216, 209, 196, 0.5);
  border-radius: 8px;
  background: rgba(15, 17, 23, 0.86);
  box-shadow:
    0 0 0 6px rgba(0, 0, 0, 0.22),
    0 0 24px rgba(230, 183, 86, 0.16);
  transform: translate(-50%, -50%) rotate(45deg);
}

.mastery-center-emblem img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transform: rotate(-45deg);
}

.mastery-center-emblem span {
  position: absolute;
  left: 50%;
  top: calc(100% + 11px);
  min-width: 110px;
  color: rgba(215, 205, 186, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-45deg);
}

.mastery-compact-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  overflow: hidden;
}

.mastery-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
  background: #161a21;
  padding: 6px 8px;
}

.mastery-compact-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.mastery-compact-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.mastery-passive-grid,
.mastery-passive-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
}

.mastery-passive-icon {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.mastery-passive-icon:hover {
  transform: scale(1.05);
}

.mastery-passive-icon.active {
  border-color: rgba(230, 183, 86, 0.9);
  box-shadow:
    0 0 0 1px rgba(230, 183, 86, 0.25),
    0 0 14px rgba(230, 183, 86, 0.32);
}

.mastery-passive-icon:disabled {
  cursor: default;
  filter: grayscale(0.9);
  opacity: 0.38;
}

.mastery-passive-icon:disabled:hover {
  transform: none;
}

.mastery-passive-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mastery-passive-icon span {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff3c3;
  font-size: 10px;
  font-weight: 900;
}

.mastery-stat-panels {
  display: grid;
  gap: 10px;
}

.mastery-stat-list {
  display: grid;
}

.mastery-stat-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.mastery-stat-list div:first-child {
  border-top: 0;
}

.mastery-stat-list strong {
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.mastery-muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}

.skill-section {
  display: grid;
  gap: 8px;
}

.skill-section h4 {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.unassigned-skill-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.generator-panel {
  gap: 14px;
}

.generator-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: end;
}

.generator-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.generator-stack-control {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  padding: 8px;
}

.generator-stack-control summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  list-style: none;
  cursor: pointer;
}

.generator-stack-control summary::-webkit-details-marker {
  display: none;
}

.generator-stack-control summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.generator-stack-control summary strong {
  color: var(--accent-2);
  font-size: 12px;
  white-space: nowrap;
}

.generator-stack-toolbar {
  position: fixed;
  left: 50%;
  top: 78px;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: min(980px, calc(100vw - 40px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #0f1218;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.generator-stack-control:not([open]) .generator-stack-toolbar,
.generator-stack-control:not([open]) .generator-stack-options {
  display: none;
}

.generator-stack-toolbar button {
  min-height: 30px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
}

.generator-stack-options {
  position: fixed;
  left: 50%;
  top: 125px;
  z-index: 10000;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  align-items: start;
  gap: 10px;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 155px);
  overflow: auto;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: #10131a;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.generator-stack-group {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.generator-stack-group h5 {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.generator-stack-group > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 5px;
}

.generator-stack-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.generator-stack-options input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.generator-stack-options span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.generator-controls button {
  min-height: 38px;
  border: 1px solid rgba(230, 183, 86, 0.65);
  border-radius: 8px;
  background: rgba(196, 126, 33, 0.2);
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.generator-controls button[data-generate-build] {
  min-width: 150px;
}

.generator-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
}

.generator-summary article,
.generator-pick {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  padding: 10px;
}

.generator-summary h4 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
}

.generator-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.generator-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.generator-chip-row > span,
.generator-priority-chip {
  border: 1px solid rgba(98, 226, 178, 0.22);
  border-radius: 999px;
  background: rgba(98, 226, 178, 0.08);
  color: var(--accent-2);
  padding: 5px 8px;
  font-size: 12px;
}

.generator-priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  cursor: pointer;
}

.generator-priority-chip span {
  min-width: 0;
}

.generator-priority-chip strong {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.generator-priority-chip:hover {
  border-color: rgba(245, 101, 101, 0.55);
  color: #ffb4b4;
}

.generator-priority-chip:hover strong {
  background: rgba(245, 101, 101, 0.18);
  color: #ffb4b4;
}

.generator-reset-priority {
  min-height: 28px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.generator-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.generator-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  min-width: 0;
}

.generator-pick span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.generator-pick strong,
.generator-pick small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.generator-pick strong {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 13px;
}

.generator-pick em {
  grid-column: 2;
  grid-row: 1;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-style: normal;
  font-weight: 900;
}

.generator-pick small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.generator-decision {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
}

.generator-decision summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.generator-decision-body {
  display: grid;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.generator-decision-body p,
.generator-decision-body ul {
  margin: 0;
}

.generator-decision-body ul {
  display: grid;
  gap: 3px;
  padding-left: 16px;
}

.generator-alternatives {
  display: grid;
  gap: 5px;
}

.generator-alternatives b {
  color: var(--text);
}

.generator-alternatives span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
}

.generator-alternatives strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.generator-alternatives em {
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-style: normal;
  font-weight: 900;
}

.generator-alternatives small {
  grid-column: 1 / -1;
}

.generator-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.generator-preview-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  padding: 10px;
}

.generator-preview-grid h4 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
}

.generator-mini-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.generator-mini-list span,
.generator-mini-list button {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #151820;
  color: var(--text);
  padding: 7px;
  text-align: left;
}

.generator-mini-list button {
  cursor: pointer;
}

.generator-mini-list button:hover,
.generator-mini-list button:focus-visible {
  border-color: rgba(230, 183, 86, 0.6);
}

.generator-mini-list strong,
.generator-mini-list em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.generator-mini-list strong {
  font-size: 12px;
}

.generator-saved-row {
  gap: 6px;
}

.generator-saved-actions,
.build-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.generator-mini-list .generator-saved-actions button,
.build-row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  width: auto;
  border-color: rgba(230, 183, 86, 0.35);
  background: rgba(196, 126, 33, 0.16);
  color: var(--accent);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.generator-mini-list em,
.generator-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.unassigned-skill-group {
  display: grid;
  gap: 8px;
}

.unassigned-skill-group h5 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.unassigned-skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.unassigned-skill-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  padding: 8px;
}

.unassigned-skill-card button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1b1f28;
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
}

.unassigned-skill-card button:disabled {
  opacity: 0.4;
  cursor: default;
}

.skill-card {
  min-width: 0;
}

.mastery-node {
  position: absolute;
  left: calc(var(--mastery-x) * 0.1%);
  top: calc(var(--mastery-y) * 0.1428571429%);
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 58px;
  min-width: 58px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  text-align: center;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.mastery-node.active {
  box-shadow: none;
}

.mastery-node.disabled {
  opacity: 0.52;
}

.mastery-layout-draggable {
  cursor: grab;
}

.mastery-layout-draggable.dragging {
  z-index: 12;
  cursor: grabbing;
}

.mastery-layout-draggable.dragging .mastery-node-orb {
  box-shadow:
    0 0 0 2px rgba(230, 183, 86, 0.45),
    0 0 24px currentColor,
    inset 0 0 12px rgba(0, 0, 0, 0.62);
}

.mastery-node strong {
  position: absolute;
  top: calc(100% + 2px);
  z-index: 5;
  max-width: 160px;
  border: 1px solid rgba(230, 183, 86, 0.28);
  border-radius: 6px;
  background: #0f1117;
  padding: 4px 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mastery-node small {
  display: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.mastery-node-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid color-mix(in srgb, currentColor 72%, #20170b);
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 35%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle, rgba(28, 30, 38, 0.96), rgba(4, 5, 8, 0.92));
  color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.45),
    inset 0 0 12px rgba(0, 0, 0, 0.72);
}

.mastery-node.active .mastery-node-orb {
  box-shadow:
    0 0 0 2px rgba(230, 183, 86, 0.18),
    0 0 18px currentColor,
    inset 0 0 12px rgba(0, 0, 0, 0.62);
}

.mastery-node-orb img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.mastery-node-orb span {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 20px;
  min-height: 18px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: #111318;
  color: #fff3c3;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
}

.mastery-node-orb span:empty {
  display: none;
}

.mastery-node.disabled .mastery-node-orb {
  filter: grayscale(0.85);
}

.mastery-hero-anchor {
  width: 72px;
  min-width: 72px;
}

.mastery-hero-anchor .mastery-node-orb {
  width: 64px;
  height: 64px;
  border-width: 3px;
}

.mastery-hero-anchor .mastery-node-orb img {
  width: 46px;
  height: 46px;
}

.mastery-synergy-node {
  z-index: 4;
}

.mastery-synergy-node .mastery-node-orb {
  width: 50px;
  height: 50px;
  border-radius: 9px;
  border-color: color-mix(in srgb, currentColor 65%, #d8d1c4);
  background:
    linear-gradient(135deg, color-mix(in srgb, currentColor 20%, transparent), rgba(22, 25, 32, 0.96)),
    #111318;
}

.mastery-synergy-node .mastery-node-orb img {
  width: 40px;
  height: 40px;
  border-radius: 7px;
}

.mastery-attack { color: #f15d70; }
.mastery-tactic { color: #e6b756; }
.mastery-defense { color: #53a9e5; }
.mastery-util { color: #b483ff; }
.mastery-primary { color: #d8d1c4; }

.mastery-node-controls {
  position: absolute;
  left: 50%;
  top: calc(100% + 28px);
  z-index: 6;
  display: grid;
  grid-template-columns: 20px minmax(26px, auto) 20px;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: #111318;
  padding: 3px;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.mastery-node:hover,
.mastery-node:focus-within {
  z-index: 3;
}

.mastery-node:hover strong,
.mastery-node:focus-within strong,
.mastery-node:hover .mastery-node-controls,
.mastery-node:focus-within .mastery-node-controls {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mastery-node-controls button {
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.mastery-node-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.mastery-node-controls em {
  color: var(--accent-2);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.compact-field {
  display: grid;
  grid-template-columns: auto minmax(64px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-field input {
  min-height: 34px;
  text-align: center;
}

.skill-trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.skill-trait-list > span {
  flex-basis: 100%;
  color: var(--accent-2);
}

.skill-trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101318;
  color: var(--muted);
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.2;
}

.skill-trait-chip.selected {
  border-color: rgba(230, 183, 86, 0.7);
  color: var(--text);
  background: rgba(230, 183, 86, 0.08);
}

.skill-trait-chip em {
  color: var(--accent-2);
  font-style: normal;
  font-weight: 900;
}

.skill-trait-chip input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.mastery-node-stats {
  display: none;
  gap: 3px;
  width: 100%;
  color: var(--accent-2);
  font-size: 10px;
  line-height: 1.2;
}

.mastery-node-stats span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.description-panel {
  padding: 12px;
}

.description-panel textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  color: var(--text);
  padding: 12px;
}

.slot-section {
  display: grid;
  gap: 8px;
}

.slot-section h4 {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.slot-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.slot-card {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13161c;
  padding: 9px;
}

.slot-rune-summary {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
}

.slot-rune-summary div {
  display: grid;
  gap: 3px;
}

.slot-rune-summary span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.slot-rune-summary small {
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.has-item-tooltip {
  position: relative;
}

.item-tooltip {
  position: fixed;
  z-index: 9998;
  left: var(--floating-tooltip-left, 12px);
  top: var(--floating-tooltip-top, 12px);
  display: none;
  width: var(--floating-tooltip-width, min(380px, calc(100vw - 32px)));
  max-height: 72vh;
  overflow: auto;
  border: 1px solid rgba(230, 183, 86, 0.7);
  border-radius: 8px;
  background: #0f1014;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.75);
  padding: 10px;
  color: var(--text);
  text-align: left;
  pointer-events: none;
}

.has-item-tooltip:hover > .item-tooltip,
.loadout-slot.has-item-tooltip:focus-visible > .item-tooltip,
.item-tooltip.floating-tooltip-visible {
  display: grid;
  gap: 9px;
}

.item-tooltip-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.item-tooltip-head img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: #101318;
}

.item-tooltip-head strong,
.item-tooltip-head small {
  display: block;
  min-width: 0;
}

.item-tooltip-head strong {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.2;
}

.item-tooltip-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.item-tooltip-section {
  display: grid;
  gap: 4px;
}

.item-tooltip-section b {
  color: var(--accent-2);
  font-size: 11px;
  text-transform: uppercase;
}

.item-tooltip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, max-content);
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.item-tooltip-row.text-row {
  grid-template-columns: 1fr;
  gap: 3px;
}

.item-tooltip-name,
.item-tooltip-value {
  min-width: 0;
  font-style: normal;
}

.item-tooltip-name {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.item-tooltip-value {
  color: var(--accent-2);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.item-tooltip-row.text-row .item-tooltip-value {
  color: var(--text);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.item-tooltip-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.slot-rune-controls {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
}

.slot-perk-controls {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
}

.perk-control-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.perk-control-row span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.perk-control-row select {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 6px;
  font-size: 12px;
}

.slot-perk-summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(230, 183, 86, 0.12);
  border-radius: 6px;
  background: rgba(230, 183, 86, 0.05);
  padding: 7px;
}

.slot-perk-summary .mini-icon {
  width: 32px;
  height: 32px;
}

.slot-perk-summary strong,
.slot-perk-summary span {
  display: block;
  min-width: 0;
}

.slot-perk-summary strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.slot-perk-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slot-heroic-controls {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
}

.slot-heroic-controls > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.heroic-control-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(56px, auto);
  align-items: center;
  gap: 6px;
}

.heroic-control-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.heroic-control-row select {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 6px;
  font-size: 12px;
}

.heroic-control-row em {
  color: var(--accent-2);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.slot-trait-controls {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 8px;
}

.trait-control-group {
  display: grid;
  gap: 6px;
}

.trait-control-group > span {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.trait-control-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.25fr) minmax(78px, 0.75fr);
  align-items: center;
  gap: 6px;
}

.trait-control-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.trait-control-row select {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 6px;
  font-size: 12px;
}

.rune-control-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.35fr) minmax(0, 1fr) 64px;
  align-items: center;
  gap: 6px;
}

.rune-control-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.rune-control-row select,
.rune-control-row input {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 6px;
  font-size: 12px;
}

.slot-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.slot-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.attribute-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.attribute-control {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 76px;
  border-radius: 6px;
  background: #151820;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.attribute-control span {
  text-align: center;
}

.attribute-control em {
  color: var(--accent-2);
  font-style: normal;
}

.attribute-control::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 20px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.attribute-control > img {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 64px;
  height: 64px;
  transform: translateX(-50%);
  opacity: 0.12;
  filter: grayscale(1);
  pointer-events: none;
}

.attribute-stepper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attribute-stepper button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1b1f28;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.attribute-stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.attribute-stepper strong {
  flex: 1;
  text-align: center;
  color: var(--text);
  font-size: 24px;
}

.attribute-bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #10131a;
}

.attribute-bars i {
  display: block;
  min-width: 0;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.attribute-bars i:first-child {
  background: var(--accent);
}

.attribute-bars i:nth-child(2) {
  background: rgba(121, 203, 167, 0.25);
}

.attribute-bars i:last-child {
  border-right: 0;
  background: rgba(142, 166, 204, 0.18);
}

.build-list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.build-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111318;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.build-row.active {
  border-color: var(--accent);
  background: var(--surface-2);
}

.build-row p {
  font-weight: 800;
}

.build-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.build-row .build-row-actions {
  grid-column: 1 / -1;
  display: flex;
  margin-top: 2px;
}

.stat-section {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 0;
}

.stat-section:first-child {
  padding-top: 0;
}

.stat-section h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  background: #13161c;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat-section-rows {
  display: grid;
  gap: 2px;
}

.build-row strong {
  color: var(--accent);
}

@media (max-width: 980px) {
  .mastery-layout {
    grid-template-columns: 1fr;
  }

  .mastery-tree {
    min-height: 420px;
  }

  .mastery-node strong {
    font-size: 11px;
  }

  .app-shell,
  .content-grid,
  .toolbar,
  .builder-layout,
  .builder-actions {
    grid-template-columns: 1fr;
  }

  .builder-view {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    padding: 16px;
  }

  .builder-layout,
  .builder-card {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .builder-center,
  .builder-left,
  .builder-right,
  .builder-actions input,
  .builder-actions button {
    width: 100%;
    max-width: 100%;
  }

  .attribute-stepper,
  .attribute-bars {
    width: 100%;
    max-width: calc(100vw - 72px);
  }

  .attribute-stepper {
    display: block;
    height: 34px;
  }

  .attribute-stepper button,
  .attribute-stepper strong {
    position: absolute;
    top: 0;
  }

  .attribute-stepper button:first-child {
    left: 0;
  }

  .attribute-stepper button[data-delta="1"] {
    left: 42px;
  }

  .attribute-stepper strong {
    left: calc((100vw - 34px) / 2);
    min-width: 44px;
    transform: translateX(-50%);
  }

  .builder-left,
  .builder-right {
    position: static;
  }

  .builder-layout {
    min-height: auto;
  }

  .builder-mode-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .builder-mode-tabs button {
    flex: 0 0 auto;
  }

  .equipment-ring {
    min-height: 360px;
  }

  .loadout-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .loadout-column {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-content: start;
  }

  .character-stage {
    min-height: 360px;
    order: -1;
  }

  .active-equipment-editor {
    position: relative;
    inset: auto;
    width: 100%;
    max-height: none;
  }

  .weapon-readout {
    grid-template-columns: 1fr;
  }

  .ring-slot {
    --ring-radius: 132px;
    width: 48px;
    height: 48px;
  }

  .ring-slot img {
    width: 32px;
    height: 32px;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .weapon-list {
    max-height: 38vh;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details {
    padding: 16px;
  }

  .builder-header,
  .top-nav {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .mastery-board-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mastery-tree {
    min-height: 360px;
  }

  .mastery-weapon-switch {
    grid-template-columns: 1fr;
  }

  .mastery-nav {
    width: 34px;
    height: 160px;
  }

  .mastery-node-stats {
    display: none;
  }

  .side-header,
  .detail-header,
  .identity {
    align-items: flex-start;
  }

  .detail-header {
    flex-direction: column;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 24px;
  }

  .attribute-grid {
    grid-template-columns: 1fr;
  }
}
