:root,
html[data-theme="classic"] {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0a0a0a;
  --panel-soft: #101010;
  --line: #252525;
  --line-strong: #343434;
  --text: #f7f8fa;
  --muted: #9aa0a8;
  --subtle: #68707a;
  --green: #00e477;
  --green-mid: #00b866;
  --accent-rgb: 0, 228, 119;
  --accent-bright: #2dff9c;
  --accent-contrast: #03150d;
  --secondary-rgb: 46, 134, 255;
  --success: #45d483;
  --gold: #ffdc63;
  --blue: #2e86ff;
  --red: #ff365b;
  --orange: #ff9d00;
  --cyan: #11d4ff;
  --mastery-purple: #c9a7ff;
  --shell-bg: #030504;
  --shell-surface: #080b0a;
  --shell-surface-raised: #0d1110;
  --shell-surface-strong: #121715;
  --shell-line: rgba(255, 255, 255, 0.1);
  --shell-line-strong: rgba(255, 255, 255, 0.18);
  --shell-green-line: rgba(var(--accent-rgb), 0.38);
  --shell-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --body-gradient-start: #020403;
  --body-gradient-mid: #070a09;
  --body-gradient-end: #030504;
  --topbar-rgb: 3, 6, 5;
  --panel-start-rgb: 14, 18, 16;
  --panel-end-rgb: 7, 9, 8;
  --button-start: #151917;
  --button-end: #0e110f;
  --button-hover-start: #15231c;
  --button-hover-end: #0d1712;
  --input-bg: #0c100e;
  --track-rest: #272d29;
  --thumb-border: #07110c;
  --sticky-rgb: 7, 10, 9;
  --active-card-bg: #0a0e0c;
  --category-icon-base: #0b1212;
}

html[data-theme="stadium"] {
  --bg: #080d1a;
  --panel: #10182a;
  --panel-soft: #16233a;
  --line: #263653;
  --line-strong: #3a4d6d;
  --text: #f3f6fc;
  --muted: #91a0b7;
  --subtle: #66758f;
  --green: #ffc83d;
  --green-mid: #d89b12;
  --accent-rgb: 255, 200, 61;
  --accent-bright: #ffe27a;
  --accent-contrast: #1c1500;
  --secondary-rgb: 81, 200, 255;
  --blue: #51c8ff;
  --cyan: #51c8ff;
  --shell-bg: #080d1a;
  --shell-surface: #0e1628;
  --shell-surface-raised: #14203a;
  --shell-surface-strong: #1a2946;
  --shell-line: rgba(126, 155, 204, 0.18);
  --shell-line-strong: rgba(126, 155, 204, 0.32);
  --shell-green-line: rgba(var(--accent-rgb), 0.42);
  --shell-shadow: 0 22px 60px rgba(1, 5, 14, 0.42);
  --body-gradient-start: #060a14;
  --body-gradient-mid: #0b1220;
  --body-gradient-end: #080d1a;
  --topbar-rgb: 8, 13, 26;
  --panel-start-rgb: 17, 26, 45;
  --panel-end-rgb: 9, 15, 28;
  --button-start: #1b2941;
  --button-end: #111a2d;
  --button-hover-start: #2a2b32;
  --button-hover-end: #1b2030;
  --input-bg: #111b30;
  --track-rest: #34415a;
  --thumb-border: #11182a;
  --sticky-rgb: 12, 20, 36;
  --active-card-bg: #111a2e;
  --category-icon-base: #10192b;
}

html[data-theme="frost"] {
  --bg: #061218;
  --panel: #0e2029;
  --panel-soft: #16313c;
  --line: #294b5a;
  --line-strong: #3c6677;
  --text: #effbff;
  --muted: #8faab6;
  --subtle: #607e8b;
  --green: #4bdcff;
  --green-mid: #17aacb;
  --accent-rgb: 75, 220, 255;
  --accent-bright: #a5efff;
  --accent-contrast: #03191f;
  --secondary-rgb: 125, 240, 197;
  --blue: #7df0c5;
  --cyan: #4bdcff;
  --shell-bg: #061218;
  --shell-surface: #0b1a22;
  --shell-surface-raised: #102832;
  --shell-surface-strong: #173742;
  --shell-line: rgba(112, 186, 207, 0.2);
  --shell-line-strong: rgba(112, 186, 207, 0.36);
  --shell-green-line: rgba(var(--accent-rgb), 0.42);
  --shell-shadow: 0 22px 60px rgba(0, 8, 12, 0.44);
  --body-gradient-start: #030b0f;
  --body-gradient-mid: #0a1b23;
  --body-gradient-end: #061218;
  --topbar-rgb: 6, 18, 24;
  --panel-start-rgb: 15, 37, 47;
  --panel-end-rgb: 7, 19, 25;
  --button-start: #183743;
  --button-end: #0e252e;
  --button-hover-start: #1d4452;
  --button-hover-end: #12303a;
  --input-bg: #0e252f;
  --track-rest: #31505b;
  --thumb-border: #0c2028;
  --sticky-rgb: 8, 27, 35;
  --active-card-bg: #0d2731;
  --category-icon-base: #0d242d;
}

html[data-theme="plum"] {
  --bg: #130a1c;
  --panel: #21102d;
  --panel-soft: #2c183a;
  --line: #51315f;
  --line-strong: #704780;
  --text: #fff4ff;
  --muted: #b09ab9;
  --subtle: #816b8b;
  --green: #ff5fc7;
  --green-mid: #d53299;
  --accent-rgb: 255, 95, 199;
  --accent-bright: #ff9ee0;
  --accent-contrast: #240015;
  --secondary-rgb: 157, 140, 255;
  --blue: #9d8cff;
  --cyan: #b49cff;
  --shell-bg: #130a1c;
  --shell-surface: #1b0e26;
  --shell-surface-raised: #281436;
  --shell-surface-strong: #351b46;
  --shell-line: rgba(196, 143, 211, 0.2);
  --shell-line-strong: rgba(196, 143, 211, 0.36);
  --shell-green-line: rgba(var(--accent-rgb), 0.42);
  --shell-shadow: 0 22px 60px rgba(11, 1, 16, 0.46);
  --body-gradient-start: #0a0510;
  --body-gradient-mid: #1a0d25;
  --body-gradient-end: #130a1c;
  --topbar-rgb: 19, 10, 28;
  --panel-start-rgb: 38, 19, 51;
  --panel-end-rgb: 20, 10, 29;
  --button-start: #342043;
  --button-end: #24152f;
  --button-hover-start: #492654;
  --button-hover-end: #301a3d;
  --input-bg: #24142f;
  --track-rest: #59405f;
  --thumb-border: #26112f;
  --sticky-rgb: 30, 13, 41;
  --active-card-bg: #261231;
  --category-icon-base: #24132f;
}

html[data-theme="graphite"] {
  --bg: #111317;
  --panel: #1a1e24;
  --panel-soft: #252b33;
  --line: #3b4653;
  --line-strong: #556474;
  --text: #fff7f4;
  --muted: #a7a3a3;
  --subtle: #777b81;
  --green: #ff6b5f;
  --green-mid: #d8443a;
  --accent-rgb: 255, 107, 95;
  --accent-bright: #ffaca5;
  --accent-contrast: #260604;
  --secondary-rgb: 87, 214, 199;
  --blue: #57d6c7;
  --cyan: #6de5d7;
  --shell-bg: #111317;
  --shell-surface: #171b20;
  --shell-surface-raised: #20262d;
  --shell-surface-strong: #2b333c;
  --shell-line: rgba(157, 175, 192, 0.2);
  --shell-line-strong: rgba(157, 175, 192, 0.36);
  --shell-green-line: rgba(var(--accent-rgb), 0.42);
  --shell-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  --body-gradient-start: #0b0d10;
  --body-gradient-mid: #171b20;
  --body-gradient-end: #111317;
  --topbar-rgb: 17, 19, 23;
  --panel-start-rgb: 31, 36, 43;
  --panel-end-rgb: 17, 20, 25;
  --button-start: #30363e;
  --button-end: #22272e;
  --button-hover-start: #413436;
  --button-hover-end: #2d292d;
  --input-bg: #22272e;
  --track-rest: #4b535d;
  --thumb-border: #241719;
  --sticky-rgb: 24, 28, 33;
  --active-card-bg: #23272d;
  --category-icon-base: #20252b;
}

html[data-theme="custom"] {
  color-scheme: dark;
  --bg: var(--custom-site-bg, #050505);
  --panel: var(--custom-tab-bg, #0a0a0a);
  --panel-soft: var(--custom-tab-bg, #101010);
  --line: rgba(var(--custom-text-color-rgb, 247, 248, 250), 0.16);
  --line-strong: rgba(var(--custom-text-color-rgb, 247, 248, 250), 0.28);
  --text: var(--custom-text-color, #f7f8fa);
  --muted: color-mix(in srgb, var(--custom-text-color, #f7f8fa) 64%, transparent);
  --subtle: color-mix(in srgb, var(--custom-text-color, #f7f8fa) 42%, transparent);
  --green: var(--custom-accent, #00e477);
  --green-mid: var(--custom-bar-great, #00b866);
  --accent-rgb: var(--custom-accent-rgb, 0, 228, 119);
  --accent-bright: var(--custom-accent-bright, #33e992);
  --accent-contrast: var(--custom-accent-contrast, #03150d);
  --secondary-rgb: var(--custom-accent-rgb, 0, 228, 119);
  --red: var(--custom-bar-low, #ff365b);
  --orange: var(--custom-bar-medium, #ff9d00);
  --shell-bg: var(--custom-site-bg, #050505);
  --shell-surface: var(--custom-tab-bg, #0a0a0a);
  --shell-surface-raised: var(--custom-tab-bg, #0a0a0a);
  --shell-surface-strong: var(--custom-tab-bg, #0a0a0a);
  --shell-line: rgba(var(--custom-text-color-rgb, 247, 248, 250), 0.13);
  --shell-line-strong: rgba(var(--custom-text-color-rgb, 247, 248, 250), 0.24);
  --shell-green-line: rgba(var(--custom-accent-rgb, 0, 228, 119), 0.48);
  --body-gradient-start: var(--custom-site-bg, #050505);
  --body-gradient-mid: var(--custom-site-bg, #050505);
  --body-gradient-end: var(--custom-site-bg, #050505);
  --topbar-rgb: var(--custom-site-background-rgb, 5, 5, 5);
  --panel-start-rgb: var(--custom-tab-background-rgb, 10, 10, 10);
  --panel-end-rgb: var(--custom-tab-background-rgb, 10, 10, 10);
  --button-start: color-mix(in srgb, var(--custom-tab-bg, #0a0a0a) 86%, var(--custom-text-color, #f7f8fa));
  --button-end: var(--custom-tab-bg, #0a0a0a);
  --button-hover-start: color-mix(in srgb, var(--custom-tab-bg, #0a0a0a) 78%, var(--custom-accent, #00e477));
  --button-hover-end: var(--custom-tab-bg, #0a0a0a);
  --input-bg: color-mix(in srgb, var(--custom-tab-bg, #0a0a0a) 90%, var(--custom-text-color, #f7f8fa));
  --track-rest: color-mix(in srgb, var(--custom-tab-bg, #0a0a0a) 72%, var(--custom-text-color, #f7f8fa));
  --thumb-border: var(--custom-tab-bg, #0a0a0a);
  --sticky-rgb: var(--custom-tab-background-rgb, 10, 10, 10);
  --active-card-bg: var(--custom-tab-bg, #0a0a0a);
  --category-icon-base: var(--custom-tab-bg, #0a0a0a);
}

:root {
  --green-soft: rgba(var(--accent-rgb), 0.15);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.brand {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2vw, 2.2rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.top-actions,
.panel-title-row,
.attribute-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.utility-button,
.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #111;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.utility-button {
  padding: 0 12px;
}

.theme-field {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  padding: 0 8px 0 10px;
  color: var(--green);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.theme-field svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.theme-field select {
  width: auto;
  min-height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 850;
}

.theme-field select option {
  background: var(--panel);
  color: var(--text);
}

.utility-button.small {
  min-height: 32px;
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  border: 1px solid #4f5660;
  border-radius: 3px;
  background: #1a1e23;
  color: #b9c1ca;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.utility-button:disabled .shortcut-key {
  border-color: #343a41;
  background: #15181c;
  color: #676e77;
}

.utility-button.icon-only {
  width: 38px;
  padding: 0;
}

.outline-button {
  width: 100%;
  padding: 0 12px;
}

.utility-button:hover,
.utility-button:focus-visible,
.outline-button:hover,
.outline-button:focus-visible {
  border-color: var(--green);
  background: #121d17;
  outline: none;
}

.utility-button:disabled,
.outline-button:disabled {
  border-color: var(--line);
  background: #111;
  color: #5f6670;
  cursor: not-allowed;
}

.utility-button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.utility-button.primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--accent-contrast);
}

.utility-button.primary:hover,
.utility-button.primary:focus-visible {
  border-color: #4dffa9;
  background: #4dffa9;
  color: var(--accent-contrast);
}

.utility-button.primary:disabled {
  border-color: #244134;
  background: #16251e;
  color: #61766c;
}

.utility-button.danger {
  border-color: #ff5278;
  background: rgba(255, 54, 91, 0.13);
  color: #ff7895;
}

.utility-button.danger:hover:not(:disabled),
.utility-button.danger:focus-visible:not(:disabled) {
  border-color: #ff8aa3;
  background: rgba(255, 54, 91, 0.22);
  color: #ffa0b4;
}

.utility-button.danger:disabled {
  border-color: #3a292e;
  background: #171214;
  color: #674852;
}

.saved-build-count-badge {
  min-width: 36px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #25282d;
  color: #d7dce3;
  font-size: 0.65rem;
  line-height: 1;
  text-align: center;
}

.in-game-stat-mode #stat-view-button.active {
  border-color: #ffffff;
  background: #ffffff;
  color: #050505;
}

.utility-button svg,
.outline-button svg {
  width: 16px;
  height: 16px;
}

.archetype-strip {
  padding: 18px 0 28px;
}

.archetype-tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 0 0 8px;
}

.archetype-tab {
  position: relative;
  display: grid;
  width: 92px;
  min-width: 92px;
  gap: 8px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  padding: 0 6px 18px;
}

.archetype-tab::after {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: transparent;
  content: "";
}

.archetype-tab.active::after {
  background: var(--green);
}

.archetype-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
}

.archetype-tab.active .archetype-icon {
  border-color: var(--text);
  color: var(--text);
}

.archetype-icon.image-icon {
  border: 0;
  border-radius: 0;
}

.archetype-icon svg {
  width: 32px;
  height: 32px;
}

.archetype-icon img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.archetype-name {
  min-height: 28px;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.main-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar,
.builder-content {
  display: grid;
  gap: 16px;
}

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

.compact-panel,
.playstyle-panel,
.skills-panel,
.specialization-panel,
.attributes-panel,
.radar-panel {
  padding: 22px;
}

.radar-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.ovr-summary {
  display: grid;
  width: 100%;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
}

.ovr-score,
.ovr-position-field {
  min-height: 72px;
  border: 1px solid #263447;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(46, 134, 255, 0.14), rgba(var(--accent-rgb), 0.07));
}

.ovr-score {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
}

.ovr-score span,
.ovr-position-field > span {
  color: #9eabba;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ovr-score output {
  color: var(--green);
  font-size: 2.35rem;
  font-weight: 950;
  line-height: 1;
}

.ovr-position-field {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 10px 12px;
}

.ovr-position-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #3a485a;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #f6f8fb;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
}

.ovr-position-field select:focus-visible {
  border-color: var(--green);
}

.ovr-position-field option {
  background: #101318;
  color: #f6f8fb;
}

.accelerate-pill {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: rgba(46, 134, 255, 0.12);
}

.accelerate-pill span {
  color: #a9b2c1;
  font-size: 0.72rem;
  font-weight: 700;
}

.accelerate-pill strong {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 900;
}

.compact-panel h2,
.playstyle-panel h2,
.skills-panel h2,
.specialization-panel h2,
.attributes-panel h2 {
  margin-bottom: 18px;
}

.panel-title-row {
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-title-row h2,
.panel-title-row p {
  margin-bottom: 0;
}

.panel-note {
  color: #a8b4c5;
  font-size: 0.75rem;
  line-height: 1.45;
}

.mastery-summary-panel {
  display: grid;
  gap: 14px;
}

.mastery-summary-heading,
.mastery-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mastery-summary-heading h2,
.mastery-title-line h2 {
  margin: 0;
}

.preview-chip {
  display: inline-grid;
  min-height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 170, 51, 0.5);
  border-radius: 999px;
  background: rgba(255, 170, 51, 0.1);
  padding: 2px 8px;
  color: var(--orange);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mastery-summary-panel .panel-note {
  margin: 0;
}

.mastery-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid #263447;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(46, 134, 255, 0.1), rgba(var(--accent-rgb), 0.05));
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mastery-summary-row strong,
.mastery-summary-row > span:last-child {
  color: var(--green);
  font-size: 1rem;
  font-weight: 950;
}

.mastery-summary-panel .outline-button {
  width: 100%;
}

.amp-summary-panel {
  display: grid;
  gap: 14px;
}

.amp-summary-heading,
.amp-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.amp-summary-heading h2,
.amp-title-line h2,
.amp-summary-panel .panel-note {
  margin: 0;
}

.amp-summary-slots {
  display: grid;
  gap: 7px;
}

.amp-summary-slot {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #2b3542;
  border-radius: 6px;
  background: rgba(32, 50, 70, 0.34);
  padding: 8px 10px;
}

.amp-summary-slot.signature {
  border-color: rgba(201, 167, 255, 0.34);
  background: rgba(112, 69, 156, 0.12);
}

.amp-summary-slot span {
  color: #8fa0b4;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.amp-summary-slot strong {
  overflow: hidden;
  color: #d7e8fa;
  font-size: 0.7rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amp-summary-slot.empty strong {
  color: #758296;
}

.amp-summary-slot.signature small {
  color: #8d9bad;
  font-size: 0.6rem;
  font-weight: 900;
}

.amp-summary-slot.signature.affinity-active {
  border-color: rgba(255, 130, 207, 0.55);
  box-shadow: inset 0 0 18px rgba(255, 91, 192, 0.08);
}

.amp-summary-slot.signature.affinity-active small {
  color: #ff82cf;
}

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.level-row output {
  display: inline-grid;
  min-width: 44px;
  min-height: 32px;
  place-items: center;
  border-radius: 5px;
  background: #25262a;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.range {
  width: 100%;
  min-height: 24px;
  accent-color: var(--green);
}

.range:focus-visible {
  border-radius: 999px;
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.stat-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
}

.stat-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stat-list dt {
  color: #a8b4c5;
  font-size: 0.82rem;
}

.stat-list dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.stat-list .ap-balance-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.stat-list .ap-balance-value > span[aria-hidden="true"] {
  color: var(--subtle);
  font-weight: 700;
}

.stat-list dd::before {
  color: var(--gold);
}

.stat-list .axp-stat-start {
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

#cumulative-axp,
#next-axp {
  color: var(--green);
}

.body-control {
  margin-top: 18px;
}

.body-control output {
  background: transparent;
  font-size: 1.55rem;
}

.suggested-positions-panel {
  overflow: hidden;
}

.suggested-positions {
  display: grid;
  min-height: 250px;
  place-items: center;
}

.position-pitch {
  position: relative;
  width: min(178px, 78%);
  aspect-ratio: 0.72;
  overflow: hidden;
  border: 1px solid #5c6269;
  background:
    linear-gradient(180deg, rgba(25, 52, 62, 0.38), rgba(18, 20, 31, 0.92)),
    #171821;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.38), 0 12px 32px rgba(0, 0, 0, 0.2);
}

.position-pitch::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px solid #5c6269;
}

.position-pitch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid #5c6269;
  border-radius: 50%;
}

.position-pitch-box,
.position-goal-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #5c6269;
}

.position-pitch-box {
  width: 68%;
  height: 19%;
}

.position-goal-box {
  width: 32%;
  height: 8%;
}

.position-pitch-box-top,
.position-goal-box-top {
  top: -1px;
  border-top: 0;
}

.position-pitch-box-bottom,
.position-goal-box-bottom {
  bottom: -1px;
  border-bottom: 0;
}

.position-center-spot {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #777d83;
}

.position-marker {
  position: absolute;
  z-index: 2;
  top: var(--position-y);
  left: var(--position-x);
  transform: translate(-50%, -50%);
  border-radius: 4px;
  background: rgba(7, 16, 17, 0.74);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.14);
  padding: 2px 4px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.36);
}

.suggested-positions-empty {
  margin: 0;
  color: var(--subtle);
  font-size: 0.78rem;
  text-align: center;
}

.scale-row {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  color: var(--subtle);
  font-size: 0.7rem;
}

.perk-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.perk-chip {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 34px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: transparent;
  padding: 8px 12px;
  color: var(--text);
  cursor: help;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
}

.perk-chip:hover,
.perk-chip[aria-expanded="true"] {
  background: rgba(var(--accent-rgb), 0.08);
}

.perk-chip:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.perk-range {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.1;
}

.perk-chip.specialization-perk {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--green);
}

.perk-chip.specialization-perk .perk-range {
  color: currentColor;
}

.signature-perk-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  display: none;
  box-sizing: border-box;
  width: min(320px, 100%);
  gap: 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.62);
  border-radius: 7px;
  background: #111714;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.58);
  pointer-events: none;
}

.perk-chip:focus-visible:not([data-perk-tooltip-dismissed="true"]) .signature-perk-tooltip,
.perk-chip[aria-expanded="true"] .signature-perk-tooltip {
  display: grid;
}

@media (hover: hover) and (pointer: fine) {
  .perk-chip:hover .signature-perk-tooltip {
    display: grid;
  }
}

.signature-perk-tooltip-title {
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 950;
}

.signature-perk-tooltip-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signature-perk-tooltip-effect {
  color: var(--text);
}

.signature-perk-tooltip-range {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
  color: var(--muted);
  font-size: 0.68rem;
}

.signature-perk-tooltip-range strong {
  color: var(--text);
  font-weight: 900;
}

.signature-perk-tooltip-range span {
  color: var(--green);
  font-weight: 900;
  text-align: right;
}

.select-field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.select-field span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #111;
  color: var(--text);
  padding: 0 10px;
}

select option {
  background: #111;
  color: var(--text);
}

.budget-option-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.budget-option-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #111;
  color: #f7f8fa;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.budget-option-button:hover,
.budget-option-button:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.budget-option-button.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--accent-contrast);
}

.gold-row {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 42px);
  min-height: 104px;
  padding: 10px 0 18px;
}

.play-card,
.spec-button {
  display: grid;
  place-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.diamond {
  display: grid;
  width: 68px;
  height: 58px;
  place-items: center;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--gold);
  color: #030303;
}

.diamond svg {
  width: 31px;
  height: 31px;
  stroke-width: 2.5;
}

.diamond img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.play-card .playstyle-diamond {
  width: 49px;
  height: 42px;
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
}

.spec-button .specialization-diamond {
  width: 49px;
  height: 42px;
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
}

.play-card > span:not(.diamond):not(.silver-icon-shape),
.spec-button > .spec-name {
  max-width: 92px;
  min-height: 26px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.empty-slot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(46px, 1fr));
  gap: 26px;
  padding-top: 10px;
}

.empty-slot {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  justify-self: center;
  border: 3px solid #585858;
  background: transparent;
  color: var(--text);
  transform: rotate(45deg);
  cursor: pointer;
}

.empty-slot svg {
  width: 22px;
  height: 22px;
  transform: rotate(-45deg);
}

.silver-slot {
  border-color: #6f6f6f;
  background: rgba(255, 255, 255, 0.01);
  transition: border-color 140ms ease, box-shadow 140ms ease, color 140ms ease, background 140ms ease;
}

.silver-slot:hover,
.silver-slot:focus-visible {
  border-color: var(--green);
  background: rgba(var(--accent-rgb), 0.04);
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22), 0 0 24px rgba(var(--accent-rgb), 0.42);
  outline: none;
}

.silver-slot.locked {
  opacity: 0.32;
  cursor: not-allowed;
}

.silver-slot.locked:hover,
.silver-slot.locked:focus-visible {
  border-color: #6f6f6f;
  background: rgba(255, 255, 255, 0.01);
  color: var(--muted);
  box-shadow: none;
}

.silver-slot.selected {
  border: 0;
  background: transparent;
  transform: none;
}

.empty-slot.silver-slot.selected {
  grid-template-rows: 35px auto;
  align-content: start;
  justify-items: center;
  width: 100%;
  min-width: 68px;
  max-width: 112px;
  height: 76px;
  gap: 10px;
  color: var(--text);
}

.silver-slot.selected:hover,
.silver-slot.selected:focus-visible {
  background: transparent;
  box-shadow: none;
}

.silver-icon-shape {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  background: #eeeeee;
  color: #050505;
  transform: rotate(45deg);
}

.silver-icon-shape img,
.silver-icon-shape svg {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  transform: rotate(-45deg) translate(0, 2px);
  transform-origin: center;
}

.signature-silver-shape {
  width: 35px;
  height: 35px;
}

.silver-slot.selected:hover .silver-icon-shape,
.silver-slot.selected:focus-visible .silver-icon-shape {
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35), 0 0 24px rgba(var(--accent-rgb), 0.34);
}

.silver-slot-name {
  display: block;
  width: max-content;
  max-width: 96px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.facility-playstyle-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 118px;
  padding: 24px 0 4px;
}

.facility-playstyle-row[hidden] {
  display: none;
}

.amp-playstyle-row {
  border-bottom: 1px solid rgba(255, 130, 207, 0.16);
}

.amp-playstyle-row .facility-playstyle-label,
.amp-playstyle-card > span:last-child {
  color: #ffb4e4;
}

.facility-playstyle-label {
  justify-self: end;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.facility-playstyle-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-width: 0;
}

.facility-playstyle-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 72px;
  text-align: center;
}

.facility-playstyle-card > span:last-child {
  max-width: 92px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
}

.facility-playstyle-card .silver-icon-shape.facility-playstyle-icon {
  width: 29.7px;
  height: 29.7px;
}

.facility-playstyle-card .silver-icon-shape.facility-playstyle-icon img,
.facility-playstyle-card .silver-icon-shape.facility-playstyle-icon svg {
  width: 28px;
  height: 28px;
}

.facility-playstyle-card .gold-icon-shape.facility-playstyle-icon {
  width: 44.3px;
  height: 38px;
}

.facility-playstyle-card .gold-icon-shape.facility-playstyle-icon img,
.facility-playstyle-card .gold-icon-shape.facility-playstyle-icon svg {
  width: 31px;
  height: 31px;
}

.skill-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 32px;
  font-size: 0.84rem;
  font-weight: 900;
}

.stars {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.skill-star {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #555b64;
  cursor: pointer;
}

.skill-star:disabled {
  cursor: not-allowed;
}

.skill-star svg {
  width: 20px;
  height: 20px;
  fill: transparent;
  stroke-width: 2.5;
}

.skill-star.filled {
  fill: #ffd11a;
  color: #ffd11a;
}

.skill-star.filled svg {
  fill: currentColor;
}

.skill-star:not(.filled):not(.capped):hover,
.skill-star:not(.filled):not(.capped):focus-visible {
  color: #ffd11a;
  outline: none;
}

.skill-star.capped,
.skill-star.unaffordable {
  opacity: 0.38;
}

.specialization-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 18px;
}

.spec-button {
  position: relative;
  cursor: pointer;
}

.spec-button:hover .diamond,
.spec-button:focus-visible .diamond,
.spec-button.active .diamond {
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.3), 0 0 24px rgba(var(--accent-rgb), 0.3);
}

.spec-button.active > .spec-name {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.spec-button > .spec-name {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #1f2025;
  padding: 4px 8px;
}

.in-game-stat-mode .attributes-panel .panel-note,
.in-game-stat-mode .sticky-build-bar {
  display: none;
}

.sticky-build-bar {
  position: sticky;
  top: 8px;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(5, 5, 5, 0.9);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
}

.sticky-playstyles {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  align-items: center;
  justify-content: start;
  gap: 12px;
  min-width: 0;
  padding: 12px 16px;
}

.sticky-playstyle-slot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  justify-self: center;
  border: 2px solid #595959;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transform: rotate(45deg);
}

.sticky-playstyle-slot.empty:not(.selected) {
  position: relative;
  width: 24px;
  height: 24px;
}

.sticky-playstyle-slot.empty:not(.selected) > svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  transform-origin: center;
}

.sticky-playstyle-slot.filled {
  border-color: #f2cb53;
  background: var(--gold);
  color: #050505;
}

.sticky-playstyle-slot.filled.gold {
  width: 39.6667px;
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
  border: 0;
  transform: none;
}

.sticky-playstyle-slot.filled.gold svg,
.sticky-playstyle-slot.filled.gold img {
  width: 27.5px;
  height: 27.5px;
  transform: none;
}

.sticky-playstyle-slot.filled.silver-signature {
  border: 0;
  background: transparent;
  color: #050505;
  transform: none;
}

.sticky-playstyle-slot.filled.silver-signature .silver-icon-shape {
  width: 24px;
  height: 24px;
}

.sticky-playstyle-slot.filled.silver-signature .silver-icon-shape img,
.sticky-playstyle-slot.filled.silver-signature .silver-icon-shape svg {
  width: 19px;
  height: 19px;
  transform: rotate(-45deg) translate(0, 1px);
}

.sticky-playstyle-slot.gold-empty {
  border-color: rgba(255, 220, 99, 0.5);
}

.sticky-playstyle-slot.silver-empty {
  border-color: #6f6f6f;
}

.sticky-playstyle-slot.silver-empty:hover,
.sticky-playstyle-slot.silver-empty:focus-visible {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22), 0 0 18px rgba(var(--accent-rgb), 0.38);
  outline: none;
}

.sticky-playstyle-slot.locked {
  opacity: 0.32;
  cursor: not-allowed;
}

.sticky-playstyle-slot.locked:hover,
.sticky-playstyle-slot.locked:focus-visible {
  border-color: #6f6f6f;
  color: var(--muted);
  box-shadow: none;
}

.sticky-playstyle-slot.selected {
  border: 0;
  background: transparent;
  transform: none;
}

.sticky-playstyle-slot.selected:hover,
.sticky-playstyle-slot.selected:focus-visible {
  box-shadow: none;
}

.sticky-playstyle-slot.selected .silver-icon-shape {
  width: 24px;
  height: 24px;
}

.sticky-playstyle-slot.selected .silver-icon-shape img,
.sticky-playstyle-slot.selected .silver-icon-shape svg {
  width: 19px;
  height: 19px;
  transform: rotate(-45deg) translate(0, 1px);
}

.sticky-playstyle-slot svg,
.sticky-playstyle-slot img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  stroke-width: 2.5;
  transform: rotate(-45deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.attribute-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 24px;
}

.attribute-section {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.pace-skills-stack {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 24px;
}

.attribute-section.pace {
  grid-template-columns: minmax(0, 1fr);
}

.player-skills-attribute-section {
  --category-icon-color: #ffd84a;
  --category-icon-rgb: 255, 216, 74;
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 10px;
}

.in-game-stat-mode .section-ap-total,
.in-game-stat-mode .player-skill-cost {
  display: none;
}

/* Pace (2 rows) and Player Skills together should end on the same grid line as
   Shooting and Passing (6 rows) in the compact in-game stat view. */
body.in-game-stat-mode .player-skills-attribute-section {
  gap: 6px;
}

body.in-game-stat-mode .player-skills-attribute-section .player-skill-row {
  min-height: 40px;
  padding-block: 0;
}

.player-skills-attribute-section .player-skill-row {
  display: grid;
  grid-template:
    "label stars cost" auto
    / max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 8px;
  min-height: 44px;
  padding: 3px 0;
  background: transparent;
}

.player-skill-label {
  grid-area: label;
  inline-size: 33px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.player-skill-cost.attribute-ap-badge {
  grid-area: cost;
  min-width: 44px;
  color: #a5ffcb;
  text-align: center;
}

.player-skill-cost.attribute-ap-badge strong {
  color: inherit;
  font-size: inherit;
}

.player-skills-attribute-section .stars {
  grid-area: stars;
  min-width: 0;
  justify-content: flex-start;
  gap: 4px;
}

.player-skills-attribute-section .skill-star {
  width: 22px;
  height: 22px;
}

.pace-control-row {
  min-height: 58px;
  margin: 0;
  border-radius: 5px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.pace-control-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pace-control-label {
  min-width: 0;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
}

.pace-value-badge {
  display: grid;
  min-width: 62px;
  min-height: 30px;
  place-items: center;
  border: 1px solid rgba(80, 191, 255, 0.24);
  border-radius: 4px;
  background: rgba(14, 24, 31, 0.88);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 950;
  line-height: 1;
}

.profile-body-panel {
  display: grid;
  gap: 10px;
}

.profile-body-panel .profile-body-heading {
  margin-bottom: 0;
}

.profile-body-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.profile-body-heading h2 svg {
  width: 17px;
  height: 17px;
  color: var(--green);
}

.profile-body-panel > .panel-note {
  margin: -2px 0 2px;
  font-size: 0.66rem;
}

.pace-range-control {
  display: grid;
  gap: 2px;
  margin-top: 7px;
}

.pace-range-control .range {
  margin: 0;
}

.pace-range-control .scale-row {
  color: #8b9691;
  font-size: 0.78rem;
  font-weight: 700;
}

.attribute-section.goalkeeper {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  column-gap: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
  min-height: 32px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.section-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cdd2d8;
  font-size: 0.92rem;
  font-weight: 900;
}

.section-name svg {
  width: 18px;
  height: 18px;
}

.section-metrics {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.section-ap-total {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(98, 217, 255, 0.3);
  border-radius: 4px;
  background: rgba(98, 217, 255, 0.09);
  color: #9ce9ff;
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 7px;
  white-space: nowrap;
}

.section-ap-total strong {
  color: inherit;
  font-size: 0.7rem;
}

.section-score {
  font-size: 1.08rem;
  font-weight: 900;
}

.section-score.green {
  color: var(--green);
}

.section-score.yellow {
  color: #ffd447;
}

.section-score.bright-green {
  color: var(--green-mid);
}

.section-score.deep-green {
  color: #087a3a;
}

.section-score.orange {
  color: var(--orange);
}

.section-score.red {
  color: var(--red);
}

.section-score.cyan {
  color: var(--cyan);
}

.attribute-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  height: auto;
  min-height: 58px;
  border-radius: 5px;
  padding: 7px 10px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.attribute-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  column-gap: 4px;
  row-gap: 5px;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
}

.attribute-name-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.attribute-name {
  white-space: nowrap;
}

.attribute-label.key-attribute {
  color: var(--green);
}

.attribute-label small {
  color: #a7adba;
  font-size: 0.7rem;
  font-weight: 800;
}

html[lang="ko"] .attribute-label {
  font-size: 0.8rem;
}

html[lang="ko"] .attribute-label small {
  font-size: 0.72rem;
}

.body-bonus-badge {
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
}

.attribute-bonus-badges {
  display: inline-flex;
  flex: 1 1 70px;
  min-width: 70px;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  white-space: normal;
}

.body-bonus-badge.positive {
  color: var(--green);
}

.body-bonus-badge.negative {
  color: var(--red);
}

.facility-bonus-badge {
  color: #62d9ff;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
}

.mastery-bonus-badge {
  color: var(--mastery-purple);
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 8px rgba(201, 167, 255, 0.24);
}

.amp-bonus-badge {
  color: var(--orange);
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 170, 51, 0.22);
}

.amp-affinity-bonus-badge {
  color: #ff82cf;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 130, 207, 0.3);
}

.key-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 2px solid var(--green);
  border-radius: 50%;
}

.step-button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #c5c8ce;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.step-button:disabled {
  color: #4c525a;
  cursor: not-allowed;
}

.attribute-ap-badge {
  display: inline-flex;
  min-width: 48px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.08);
  color: #a5ffcb;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
  padding: 0 6px;
  white-space: nowrap;
}

.attribute-ap-badge.short {
  border-color: rgba(255, 83, 112, 0.48);
  background: rgba(255, 83, 112, 0.11);
  color: #ff7f98;
}

.attribute-ap-badge.max {
  min-width: 42px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #20222a;
  color: #9ea5af;
}

.attribute-ap-badge.dragging {
  min-width: 82px;
  border-color: rgba(211, 161, 255, 0.38);
  background: rgba(211, 161, 255, 0.12);
  color: #dec4ff;
}

.attribute-ap-badge.refund {
  border-color: rgba(98, 217, 255, 0.34);
  background: rgba(98, 217, 255, 0.1);
  color: #9ce9ff;
}

.value-badge {
  display: inline-flex;
  width: auto;
  min-width: 50px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 3px;
  background: #20222a;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0 5px;
  white-space: nowrap;
}

.value-current {
  color: #d3a1ff;
  font-size: 0.78rem;
}

.value-divider {
  color: #737a85;
  font-size: 0.66rem;
}

.value-cap {
  color: #a6adb7;
  font-size: 0.78rem;
}

.attribute-bar-wrap {
  position: relative;
  grid-column: 1 / -1;
  min-height: 18px;
  cursor: pointer;
  touch-action: none;
}

.cap-track {
  position: absolute;
  inset: 4px 0 auto;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #272a2f;
}

.attribute-bar-wrap:hover .cap-track,
.attribute-bar-wrap.active-attribute-bar .cap-track {
  height: 7px;
}

.current-fill,
.potential-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
}

.current-fill {
  z-index: 2;
  background: var(--green);
}

.current-fill.red {
  background: var(--red);
}

.current-fill.orange {
  background: var(--orange);
}

.current-fill.yellow {
  background: #ffd447;
}

.current-fill.bright-green {
  background: var(--green-mid);
}

.current-fill.deep-green {
  background: #087a3a;
}

.potential-fill {
  z-index: 1;
  background: #60645e;
}

.cap-marker {
  position: absolute;
  top: -1px;
  z-index: 3;
  width: 5px;
  height: 7px;
  border-radius: 999px;
  background: #6f746c;
  transform: translateX(-50%);
}

.attribute-range {
  position: absolute;
  inset: -5px 0 auto;
  z-index: 4;
  height: 24px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.attribute-row.at-cap .value-badge {
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.36);
}

.in-game-stat-list {
  gap: 28px 30px;
}

.in-game-stat-list .attribute-section {
  gap: 7px;
}

.in-game-stat-list .attribute-section.goalkeeper {
  column-gap: 30px;
}

.in-game-stat-list .section-heading {
  margin-bottom: 4px;
}

.in-game-attribute-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  min-height: 30px;
}

.in-game-attribute-row .attribute-label {
  font-size: 0.86rem;
}

.in-game-value {
  display: grid;
  min-width: 48px;
  min-height: 30px;
  place-items: center;
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1;
}

.in-game-value.green {
  background: var(--green);
}

.in-game-value.yellow {
  background: #ffd447;
  color: #050505;
}

.in-game-value.bright-green {
  background: var(--green-mid);
}

.in-game-value.deep-green {
  background: #087a3a;
}

.in-game-value.orange {
  background: var(--orange);
}

.in-game-value.red {
  background: var(--red);
}

.dragging-attribute {
  cursor: grabbing;
  user-select: none;
}

.source-note {
  margin-top: 18px;
  color: #6f7682;
  font-size: 0.78rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(380px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.build-library-modal,
.playstyle-modal,
.facility-modal,
.mastery-modal,
.amp-modal {
  position: fixed;
  inset: 0;
  display: none;
}

.build-library-modal {
  z-index: 10000;
}

.build-library-modal.open,
.playstyle-modal.open,
.facility-modal.open,
.mastery-modal.open,
.amp-modal.open {
  display: block;
}

.build-library-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
}

.build-library-panel {
  position: absolute;
  inset: 2.5vh max(12px, calc((100vw - 1600px) / 2));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #303238;
  border-radius: 12px;
  background: #070809;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.72);
}

.build-library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, #0d1310, #090a0b 48%, #0b0c0e);
}

.build-library-eyebrow {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.09em;
}

.build-library-header h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.build-library-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.build-library-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.build-library-header-actions > strong {
  min-width: 64px;
  padding: 7px 10px;
  border: 1px solid #303238;
  border-radius: 999px;
  background: #111317;
  color: var(--green);
  font-size: 0.76rem;
  text-align: center;
}

.build-library-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.build-library-view[hidden],
.build-comparison-view[hidden] {
  display: none;
}

.build-save-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #0b0c0e;
}

.build-name-field {
  display: grid;
  width: min(480px, 100%);
  gap: 7px;
  color: #b7bec8;
  font-size: 0.7rem;
  font-weight: 850;
}

.build-name-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #34373d;
  border-radius: 6px;
  background: #121419;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  outline: none;
}

.build-name-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.13);
}

.build-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.delete-all-builds-button {
  margin-left: 12px;
}

.saved-build-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

.saved-build-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 1px dashed #34373d;
  border-radius: 10px;
  color: #89919c;
  text-align: center;
}

.saved-build-empty svg {
  width: 36px;
  height: 36px;
  color: var(--green);
}

.saved-build-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 116px;
  border: 1px solid #292c31;
  border-radius: 9px;
  background: linear-gradient(100deg, #0e1012, #090a0b);
  padding: 13px 14px;
  transition: border-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.saved-build-card.active {
  border-color: rgba(var(--accent-rgb), 0.58);
  box-shadow: inset 3px 0 0 var(--green);
}

.saved-build-card.dragging {
  z-index: 2;
  border-color: rgba(var(--accent-rgb), 0.72);
  opacity: 0.68;
  transform: scale(0.995);
}

.saved-build-compare {
  display: grid;
  place-items: center;
}

.saved-build-compare input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.saved-build-compare > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #44484f;
  border-radius: 6px;
  color: #8d949e;
  cursor: pointer;
}

.saved-build-compare > span svg {
  width: 17px;
  height: 17px;
}

.saved-build-compare input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22);
}

.saved-build-compare.disabled > span {
  cursor: not-allowed;
  opacity: 0.3;
}

.saved-build-order-controls {
  display: grid;
  place-items: center;
  gap: 4px;
}

.saved-build-position {
  color: #69717c;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.saved-build-drag-handle,
.saved-build-order-buttons button {
  display: grid;
  place-items: center;
  border: 1px solid #30343a;
  border-radius: 5px;
  background: #111318;
  color: #89919c;
}

.saved-build-drag-handle {
  width: 34px;
  height: 27px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.saved-build-drag-handle:active {
  cursor: grabbing;
}

body.dragging-saved-build,
body.dragging-saved-build * {
  cursor: grabbing !important;
  user-select: none !important;
}

.saved-build-order-buttons {
  display: grid;
  grid-template-columns: repeat(2, 17px);
  gap: 3px;
}

.saved-build-order-buttons button {
  width: 17px;
  height: 18px;
  cursor: pointer;
  padding: 0;
}

.saved-build-drag-handle:hover,
.saved-build-drag-handle:focus-visible,
.saved-build-order-buttons button:hover,
.saved-build-order-buttons button:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.saved-build-order-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.25;
}

.saved-build-drag-handle svg {
  width: 16px;
  height: 16px;
}

.saved-build-order-buttons svg {
  width: 12px;
  height: 12px;
}

.saved-build-main {
  min-width: 0;
}

.saved-build-title-row,
.saved-build-meta,
.saved-build-playstyles {
  display: flex;
  align-items: center;
}

.saved-build-title-row {
  gap: 9px;
}

.saved-build-title-row h3 {
  overflow: hidden;
  margin: 0;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-build-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 900;
}

.saved-build-meta {
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
  color: #8f97a2;
  font-size: 0.68rem;
  font-weight: 700;
}

.saved-build-meta strong {
  color: #cdd3dc;
}

.saved-build-meta time {
  color: #656d78;
}

.saved-build-playstyles {
  gap: 7px;
  min-height: 28px;
  margin-top: 9px;
}

.saved-build-playstyle-icon,
.comparison-playstyle-icon {
  display: grid;
  place-items: center;
  background: #eeeeee;
  color: #050505;
}

.saved-build-playstyle-icon {
  width: 19px;
  height: 19px;
  margin: 0 4px;
  transform: rotate(45deg);
}

.saved-build-playstyle-icon.gold {
  width: 31px;
  height: 26px;
  margin: 0;
  transform: none;
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
  background: var(--gold);
}

.saved-build-playstyle-icon img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  transform: rotate(-45deg);
}

.saved-build-playstyle-icon.gold img {
  width: 23px;
  height: 23px;
  transform: none;
}

.saved-build-extra {
  color: #aeb5bf;
  font-size: 0.7rem;
  font-weight: 900;
}

.saved-build-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 6px;
}

.saved-build-actions button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #30343a;
  border-radius: 5px;
  background: #13151a;
  color: #c8ced7;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 0.64rem;
  font-weight: 850;
}

.saved-build-actions button:hover,
.saved-build-actions button:focus-visible {
  border-color: var(--green);
  color: var(--text);
  outline: none;
}

.saved-build-actions button.danger:hover,
.saved-build-actions button.danger:focus-visible {
  border-color: var(--red);
  color: #ff8198;
}

.saved-build-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.saved-build-actions svg {
  width: 13px;
  height: 13px;
}

.build-compare-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #0b0c0e;
}

.build-compare-footer > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.build-compare-footer strong {
  color: var(--green);
  font-size: 0.84rem;
}

.build-comparison-view {
  min-height: 0;
  overflow-y: auto;
}

.comparison-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 11, 0.96);
  backdrop-filter: blur(10px);
}

.comparison-toolbar-copy h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.comparison-toolbar-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.comparison-content {
  display: grid;
  gap: 18px;
  padding: 20px 26px 34px;
}

.comparison-section {
  overflow: hidden;
  border: 1px solid #292c31;
  border-radius: 9px;
  background: #0a0b0d;
}

.comparison-section > h4,
.comparison-section-title-row {
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #292c31;
  background: #101216;
  font-size: 0.92rem;
}

.comparison-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comparison-section-title-row h4 {
  margin: 0;
}

.comparison-section-title-row span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 850;
}

.comparison-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #292c31;
}

.comparison-summary-card {
  min-width: 0;
  background: #0a0b0d;
  padding: 16px;
}

.comparison-amp-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #292c31;
}

.comparison-amp-summary-card {
  min-width: 0;
  background: #0a0b0d;
  padding: 14px 16px 16px;
}

.comparison-build-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.comparison-archetype-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid #dedede;
  border-radius: 50%;
}

.comparison-archetype-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-build-heading h5 {
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-build-heading strong {
  color: var(--green);
  font-size: 0.68rem;
}

.comparison-summary-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.comparison-summary-card dl > div {
  min-width: 0;
  border-radius: 5px;
  background: #121419;
  padding: 8px 10px;
}

.comparison-summary-card dt {
  margin-bottom: 4px;
  color: #7f8792;
  font-size: 0.62rem;
  font-weight: 750;
}

.comparison-summary-card dd {
  overflow: hidden;
  margin: 0;
  color: #e5e8ed;
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-build-masteries {
  display: grid;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid rgba(201, 167, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(105deg, rgba(201, 167, 255, 0.09), #0c0d10 52%);
}

.comparison-build-masteries-heading,
.comparison-amp-loadout-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.comparison-build-masteries-heading {
  padding: 12px 14px;
}

.comparison-build-masteries-heading > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(201, 167, 255, 0.34);
  border-radius: 7px;
  background: rgba(201, 167, 255, 0.1);
  color: var(--mastery-purple);
}

.comparison-build-masteries-heading svg {
  width: 16px;
  height: 16px;
}

.comparison-build-masteries-heading strong,
.comparison-build-masteries-heading small {
  display: block;
}

.comparison-build-masteries-heading strong {
  color: var(--mastery-purple);
  font-size: 0.77rem;
}

.comparison-build-masteries-heading small {
  margin-top: 3px;
  color: #8e96a2;
  font-size: 0.64rem;
  font-weight: 700;
}

.comparison-mastery-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid rgba(201, 167, 255, 0.2);
  background: #29252e;
}

.comparison-mastery-summary-card {
  min-width: 0;
  background: #0d0c10;
  padding: 10px 14px 12px;
}

.comparison-mastery-chips {
  display: grid;
  gap: 7px;
}

.comparison-mastery-chip {
  display: block;
  min-width: 0;
  border: 1px solid #2d2934;
  border-radius: 7px;
  background: #121016;
  padding: 7px 9px;
}

.comparison-mastery-chip strong,
.comparison-mastery-chip small,
.comparison-mastery-chip em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-mastery-chip strong {
  color: #eee8f8;
  font-size: 0.68rem;
}

.comparison-mastery-chip small {
  margin-top: 2px;
  color: var(--mastery-purple);
  font-size: 0.61rem;
  font-weight: 850;
}

.comparison-mastery-chip em {
  margin-top: 3px;
  color: #8f97a2;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 700;
}

.comparison-mastery-empty {
  color: #7f8792;
  font-size: 0.68rem;
  font-weight: 800;
}

.comparison-amp-loadout {
  display: grid;
  gap: 8px;
}

.comparison-amp-loadout-heading {
  color: var(--orange);
}

.comparison-amp-loadout-heading svg {
  width: 15px;
  height: 15px;
}

.comparison-amp-loadout-heading strong {
  font-size: 0.7rem;
}

.comparison-amp-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.comparison-amp-slot {
  min-width: 0;
  border: 1px solid #30343b;
  border-left: 3px solid var(--orange);
  border-radius: 6px;
  background: #111319;
  padding: 8px 9px;
}

.comparison-amp-slot.signature {
  grid-column: 1 / -1;
  border-left-color: var(--gold);
}

.comparison-amp-slot.signature.affinity-active {
  border-color: rgba(255, 130, 207, 0.48);
  border-left-color: #ff82cf;
  background: linear-gradient(100deg, rgba(255, 130, 207, 0.08), #111319 58%);
}

.comparison-amp-slot > span,
.comparison-amp-slot > strong,
.comparison-amp-slot > small {
  display: block;
}

.comparison-amp-slot > span {
  color: #777f8b;
  font-size: 0.57rem;
  font-weight: 850;
}

.comparison-amp-slot > strong {
  margin-top: 4px;
  color: #e6e9ee;
  font-size: 0.64rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.comparison-amp-slot > small {
  margin-top: 4px;
  color: #8d95a1;
  font-size: 0.59rem;
  font-weight: 750;
}

.comparison-amp-slot.signature.affinity-active > small {
  color: #ff9fda;
}

.comparison-amp-slot.empty {
  border-left-color: #41464e;
  opacity: 0.62;
}

.comparison-skill-stars {
  display: inline-flex;
  gap: 2px;
  font-size: 0.83rem;
  line-height: 1;
}

.comparison-skill-stars .filled {
  color: var(--gold);
}

.comparison-skill-stars .empty {
  color: #42464e;
}

.comparison-playstyle-board-scroll {
  width: 100%;
  overflow-x: auto;
}

.comparison-playstyle-board {
  display: grid;
  grid-template-columns: 150px repeat(2, minmax(0, 1fr));
  min-width: 720px;
}

.comparison-playstyle-board > * {
  min-width: 0;
  border-right: 1px solid #23262b;
  border-bottom: 1px solid #23262b;
}

.comparison-playstyle-board > :nth-child(3n) {
  border-right: 0;
}

.comparison-playstyle-board > :nth-last-child(-n + 3) {
  border-bottom: 0;
}

.comparison-playstyle-corner,
.comparison-playstyle-build-name {
  background: #111318;
  color: #b9c0ca;
  padding: 11px 13px;
  font-size: 0.68rem;
  font-weight: 850;
}

.comparison-playstyle-tier-heading {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #0e1013;
  color: #cfd4db;
  padding: 17px 13px;
  font-size: 0.7rem;
  font-weight: 900;
}

.comparison-playstyle-tier-heading::before {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 2px;
  background: #eeeeee;
  content: "";
  transform: rotate(45deg);
}

.comparison-playstyle-tier-heading.gold {
  color: var(--gold);
}

.comparison-playstyle-tier-heading.gold::before {
  width: 13px;
  background: var(--gold);
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
  transform: none;
}

.comparison-playstyle-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  align-content: start;
  align-items: start;
  gap: 18px 10px;
  min-height: 118px;
  padding: 17px 14px 19px;
}

.comparison-playstyle-group.empty {
  place-items: center;
}

.comparison-playstyle-item {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.comparison-playstyle-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  transform: rotate(45deg);
}

.comparison-playstyle-icon.gold {
  width: 50px;
  height: 43px;
  transform: none;
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
  background: var(--gold);
}

.comparison-playstyle-icon img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  transform: rotate(-45deg);
}

.comparison-playstyle-icon.gold img {
  width: 34px;
  height: 34px;
  transform: none;
}

.comparison-playstyle-item strong {
  display: block;
  width: 100%;
  color: #eef0f3;
  font-size: 0.67rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.comparison-missing {
  color: #4d535c;
  font-weight: 900;
}

.comparison-attribute-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}

.comparison-attribute-overview {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 12px 18px 0;
}

.comparison-overview-totals {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid #292d33;
  border-radius: 7px;
  background: #101216;
}

.comparison-overview-title {
  color: #dce2e9;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.comparison-overview-total-list {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.comparison-overview-total {
  display: inline-flex;
  min-width: 58px;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 4px;
  background: #181b20;
}

.comparison-overview-total b {
  font-size: 0.62rem;
  font-weight: 900;
  white-space: nowrap;
}

.comparison-overview-total > strong {
  margin-left: auto;
  color: #e6ebf0;
  font-size: 0.86rem;
}

.comparison-overview-total.a b,
.comparison-overview-category.a strong {
  color: var(--green);
}

.comparison-overview-total.b b,
.comparison-overview-category.b strong {
  color: #9fcfff;
}

.comparison-overview-total.equal b,
.comparison-overview-category.equal strong {
  color: #aab2bc;
}

.comparison-overview-categories {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.comparison-overview-category {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid #292d33;
  border-radius: 7px;
  background: #101216;
}

.comparison-overview-category span {
  min-width: 0;
  overflow: hidden;
  color: #aeb7c1;
  font-size: 0.66rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-overview-category strong {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 950;
  white-space: nowrap;
}

.comparison-build-legend {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #2b3037;
  border-radius: 7px;
  background: #101216;
}

.comparison-build-legend b {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 950;
}

.comparison-build-legend.build-b b {
  border-color: rgba(126, 190, 255, 0.45);
  background: rgba(83, 159, 235, 0.12);
  color: #9fcfff;
}

.comparison-build-legend > div {
  min-width: 0;
}

.comparison-build-legend strong,
.comparison-build-legend small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-build-legend strong {
  color: #f1f3f5;
  font-size: 0.86rem;
  font-weight: 900;
}

.comparison-build-legend small {
  margin-top: 4px;
  color: #85909d;
  font-size: 0.68rem;
  font-weight: 750;
}

.comparison-attribute-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  padding: 14px 18px 20px;
}

.comparison-attribute-card {
  overflow: hidden;
  border: 1px solid #292d33;
  border-radius: 7px;
  background: #090a0c;
}

.comparison-attribute-card > header,
.comparison-attribute-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 40px minmax(110px, 1.35fr) 40px;
  align-items: center;
  column-gap: 6px;
}

.comparison-attribute-card > header {
  min-height: 42px;
  background: #121922;
  color: #8fc7ff;
  padding: 9px 12px;
}

.comparison-attribute-card > header h5 {
  overflow: hidden;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-attribute-card > header > span {
  color: #6f7c8d;
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
}

.comparison-attribute-side-label.build-a {
  color: var(--green);
}

.comparison-attribute-side-label.build-b {
  color: #9fcfff;
}

.comparison-attribute-row {
  min-height: 46px;
  border-top: 1px solid #22252a;
  padding: 7px 12px;
}

.comparison-attribute-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #d5dae1;
  font-size: 0.8rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-attribute-name small {
  margin-left: 4px;
  color: #69717c;
  font-size: 0.64rem;
  font-weight: 850;
}

.comparison-attribute-value {
  display: grid;
  min-height: 28px;
  place-items: center;
  border: 1px solid #30343a;
  border-radius: 4px;
  background: #111317;
  color: #e8ebef;
  font-size: 0.9rem;
  font-weight: 950;
}

.comparison-attribute-value.higher.build-a {
  background: rgba(var(--accent-rgb), 0.11);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--green);
}

.comparison-attribute-value.higher.build-b {
  background: rgba(126, 190, 255, 0.11);
  border-color: rgba(126, 190, 255, 0.3);
  color: #9fcfff;
}

.comparison-attribute-value.lower {
  color: #7a848f;
}

.comparison-attribute-value.equal {
  color: #d9dee5;
}

.comparison-attribute-meter {
  display: grid;
  min-width: 0;
  height: 18px;
  grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr);
  align-items: stretch;
}

.comparison-meter-half {
  position: relative;
  overflow: hidden;
  height: 18px;
  background: #26292e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.comparison-meter-half i {
  display: block;
  width: var(--meter-fill);
  min-width: 1px;
  height: 100%;
  opacity: 0.38;
}

.comparison-meter-a {
  display: flex;
  justify-content: flex-end;
  border-radius: 999px 0 0 999px;
}

.comparison-meter-a i {
  background: var(--green);
}

.comparison-meter-b {
  display: flex;
  justify-content: flex-start;
  border-radius: 0 999px 999px 0;
}

.comparison-meter-b i {
  background: #9fcfff;
}

.comparison-meter-half.leading i {
  opacity: 1;
}

.comparison-meter-half.equal i {
  opacity: 0.68;
}

.comparison-meter-center {
  z-index: 1;
  background: #090a0c;
}

.comparison-empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.playstyle-modal {
  z-index: 80;
}

.playstyle-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.playstyle-modal-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, calc(100vw - 24px));
  height: 100%;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #050505;
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.5);
}

.playstyle-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.97);
}

.playstyle-modal-header h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.playstyle-modal-header p {
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
}

.playstyle-modal-header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.modal-close-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  color: var(--green);
  outline: none;
}

.modal-close-button svg {
  width: 18px;
  height: 18px;
}

.playstyle-modal-content {
  display: grid;
  gap: 28px;
  padding: 24px 26px 36px;
}

.mastery-modal {
  z-index: 100;
}

.mastery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(3px);
}

.mastery-modal-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(820px, calc(100vw - 24px));
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #050505;
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.56);
}

.mastery-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.98);
}

.mastery-modal-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.mastery-max-button {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--green);
}

.mastery-max-button:hover,
.mastery-max-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.15);
  color: #72ffba;
}

.mastery-modal-content {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 26px 36px;
}

.mastery-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(250px, 1.2fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid #262a31;
  border-radius: 8px;
  background: #0c0e11;
  padding: 13px 14px;
}

.mastery-archetype {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.mastery-archetype-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid #2d3948;
  border-radius: 7px;
  background: #111820;
}

.mastery-archetype-icon img,
.mastery-archetype-icon svg {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.mastery-archetype > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.mastery-archetype strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mastery-archetype span:not(.mastery-archetype-icon) {
  color: #91a0b2;
  font-size: 0.66rem;
  line-height: 1.35;
}

.mastery-milestones {
  display: grid;
  gap: 5px;
}

.mastery-milestones > span {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 7px;
  color: #bac3cf;
  font-size: 0.7rem;
  line-height: 1.35;
}

.mastery-milestones strong {
  color: var(--orange);
  font-size: 0.68rem;
}

.mastery-level-options {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #303844;
  border-radius: 6px;
}

.mastery-level-button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid #303844;
  background: #11151a;
  padding: 6px 9px;
  color: #8e9bad;
  cursor: pointer;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 900;
  white-space: nowrap;
}

.mastery-level-button:last-child {
  border-right: 0;
}

.mastery-level-button:hover,
.mastery-level-button:focus-visible {
  background: #18212a;
  color: var(--text);
  outline: none;
}

.mastery-level-button.active {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.amp-modal {
  z-index: 105;
}

.amp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
}

.amp-modal-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(920px, calc(100vw - 24px));
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #050608;
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.6);
}

.amp-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 8, 0.98);
}

.amp-modal-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.amp-modal-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 26px 0;
  border: 1px solid rgba(126, 215, 255, 0.34);
  border-radius: 7px;
  background: rgba(45, 123, 169, 0.09);
  padding: 11px 13px;
  color: #bdd5e7;
  font-size: 0.75rem;
  line-height: 1.5;
}

.amp-modal-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #7ed7ff;
}

.amp-modal-content {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 16px 26px 36px;
}

.amp-slot-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.amp-slot-tab {
  display: grid;
  min-width: 0;
  min-height: 70px;
  align-content: center;
  gap: 5px;
  border: 1px solid #2b3542;
  border-radius: 8px;
  background: #0d1117;
  padding: 10px 12px;
  color: #93a2b4;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.amp-slot-tab span {
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.amp-slot-tab strong {
  overflow: hidden;
  color: #cbd5e1;
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amp-slot-tab:hover,
.amp-slot-tab:focus-visible,
.amp-slot-tab.active {
  border-color: rgba(126, 215, 255, 0.68);
  outline: none;
  background: rgba(45, 123, 169, 0.14);
  color: #7ed7ff;
}

.amp-catalog-count {
  color: #8494a8;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: right;
}

.amp-standard-editor,
.signature-amp-preview {
  display: grid;
  gap: 16px;
  border: 1px solid #252d38;
  border-radius: 9px;
  background: #0b0e13;
  padding: 18px;
}

.amp-standard-editor > p,
.signature-amp-preview > p {
  margin: 0;
  color: #9faec0;
  font-size: 0.76rem;
  line-height: 1.5;
}

.amp-tier-tabs,
.amp-group-tabs {
  display: inline-flex;
  justify-self: start;
  overflow: hidden;
  border: 1px solid #344252;
  border-radius: 7px;
}

.amp-tier-tab,
.amp-group-tab {
  min-height: 36px;
  border: 0;
  border-right: 1px solid #344252;
  background: #111722;
  padding: 8px 14px;
  color: #91a0b3;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 950;
}

.amp-tier-tab:last-child,
.amp-group-tab:last-child {
  border-right: 0;
}

.amp-tier-tab:hover,
.amp-tier-tab:focus-visible,
.amp-tier-tab.active,
.amp-group-tab:hover,
.amp-group-tab:focus-visible,
.amp-group-tab.active {
  outline: none;
  background: rgba(46, 134, 255, 0.17);
  color: #7ed7ff;
}

.amp-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.amp-picker-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.amp-picker-grid label {
  display: grid;
  gap: 7px;
  color: #8796aa;
  font-size: 0.68rem;
  font-weight: 900;
}

.amp-picker-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #334154;
  border-radius: 6px;
  outline: 0;
  background: #111722;
  padding: 0 12px;
  color: #edf5ff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.amp-picker-grid select:focus-visible {
  border-color: #7ed7ff;
}

.amp-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.amp-equip-button {
  border-color: rgba(126, 215, 255, 0.64);
  background: rgba(45, 123, 169, 0.18);
  color: #bcecff;
}

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

.signature-amp-card {
  position: relative;
  display: grid;
  min-height: 390px;
  align-content: start;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(191, 125, 255, 0.5);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 32%, rgba(218, 172, 255, 0.28), transparent 34%),
    linear-gradient(145deg, #3b1f55, #17101f 66%);
  padding: 14px 14px 16px;
  color: #f0dfff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.signature-amp-card.tier-4 {
  border-color: rgba(255, 211, 111, 0.58);
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 224, 147, 0.3), transparent 34%),
    linear-gradient(145deg, #594725, #1e1910 66%);
  color: #ffedbd;
}

.signature-amp-card:hover,
.signature-amp-card:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.82);
  transform: translateY(-2px);
}

.signature-amp-card.selected {
  border-color: #7ed7ff;
  box-shadow: 0 0 0 2px rgba(126, 215, 255, 0.22), 0 12px 30px rgba(0, 0, 0, 0.34);
}

.signature-amp-card.affinity-active.selected {
  border-color: #ff82cf;
  box-shadow: 0 0 0 2px rgba(255, 130, 207, 0.24), 0 12px 30px rgba(0, 0, 0, 0.34);
}

.signature-amp-tier {
  position: absolute;
  top: 12px;
  left: 12px;
  color: currentColor;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.signature-amp-selected {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(126, 215, 255, 0.55);
  border-radius: 999px;
  background: rgba(5, 30, 45, 0.72);
  padding: 4px 7px;
  color: #9ce5ff;
  font-size: 0.55rem;
  font-weight: 950;
}

.signature-amp-emblem {
  display: grid;
  width: 58px;
  height: 68px;
  margin: 26px auto 2px;
  place-items: center;
  clip-path: polygon(50% 0, 95% 25%, 82% 82%, 50% 100%, 18% 82%, 5% 25%);
  background: rgba(255, 255, 255, 0.16);
  color: currentColor;
}

.signature-amp-emblem.playstyle-base {
  background: rgba(226, 232, 240, 0.22);
  color: #f1f5f9;
}

.signature-amp-emblem.playstyle-plus {
  background: rgba(255, 224, 147, 0.28);
  color: #ffe29a;
}

.signature-amp-emblem img,
.signature-amp-emblem svg {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.signature-amp-name {
  min-height: 38px;
  color: currentColor;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
}

.signature-amp-playstyle {
  color: #fff2bf;
  font-size: 0.67rem;
  font-weight: 950;
  text-align: center;
}

.signature-amp-boost {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 170, 51, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 7px 8px;
  color: #ffbf68;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.3;
}

.signature-amp-boost.affinity {
  border-color: rgba(255, 130, 207, 0.25);
  color: #ff9fda;
}

.signature-amp-boost small,
.signature-amp-affinity-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.signature-amp-affinity-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.signature-amp-affinity-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
}

.signature-amp-affinity-icon.current {
  border-color: #ff82cf;
  box-shadow: 0 0 0 2px rgba(255, 130, 207, 0.15);
}

.signature-amp-affinity-icon img,
.signature-amp-affinity-icon svg {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.signature-amp-affinity-status {
  margin-top: auto;
  color: #8b97a9;
  font-size: 0.61rem;
  font-weight: 950;
}

.signature-amp-card.affinity-active .signature-amp-affinity-status {
  color: #ff82cf;
}

.facility-modal {
  z-index: 90;
}

.facility-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.facility-modal-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: min(580px, calc(100vw - 18px));
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #050505;
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.5);
}

.facility-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.97);
}

.facility-modal-header h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.facility-modal-header p {
  margin: 0;
  color: #c5cbd4;
  font-size: 0.94rem;
  font-weight: 800;
}

.facility-modal-budget {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #080a09;
}

.facility-modal-budget .facility-budget-field {
  margin: 0;
}

.facility-modal-budget .facility-budget-field > span {
  color: #c5cbd4;
  font-size: 0.72rem;
  font-weight: 850;
}

.facility-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.facility-filter-bar {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #0a0a0a;
}

.facility-filter-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.facility-filter-search {
  position: relative;
  display: block;
  min-width: 0;
}

.facility-filter-search > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: #8f98a4;
  pointer-events: none;
  transform: translateY(-50%);
}

.facility-filter-search input,
.facility-filter-select-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #303238;
  border-radius: 5px;
  background: #121317;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  outline: none;
}

.facility-filter-search input {
  padding: 8px 12px 8px 38px;
}

.facility-filter-search input::placeholder {
  color: #767e89;
}

.facility-filter-search input:focus,
.facility-filter-select-row select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.facility-filter-clear {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #303238;
  border-radius: 5px;
  background: #121317;
  color: #c8ced7;
  cursor: pointer;
  padding: 7px 11px;
  font-size: 0.74rem;
  font-weight: 850;
}

.facility-filter-clear > svg {
  width: 15px;
  height: 15px;
}

.facility-filter-clear:hover:not(:disabled),
.facility-filter-clear:focus-visible:not(:disabled) {
  border-color: var(--green);
  color: var(--text);
  outline: none;
}

.facility-filter-clear:disabled {
  cursor: default;
  opacity: 0.38;
}

.facility-filter-select-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.facility-filter-select-row select {
  cursor: pointer;
  padding: 7px 10px;
}

.facility-filter-select-row option {
  background: #121317;
  color: var(--text);
}

.facility-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.facility-filter-toggles {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.facility-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b8c0cb;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.facility-filter-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--green);
}

.facility-filter-count {
  color: #89929f;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.facility-modal-content {
  display: grid;
  grid-auto-rows: max-content;
  min-height: 0;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 14px 12px 24px;
}

.facility-filter-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #8e97a3;
  text-align: center;
}

.facility-filter-empty > svg {
  width: 34px;
  height: 34px;
}

.facility-filter-empty strong {
  font-size: 0.86rem;
  font-weight: 850;
}

@media (max-width: 520px) {
  .facility-filter-search-row,
  .facility-filter-select-row {
    grid-template-columns: 1fr;
  }

  .facility-filter-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .facility-filter-toggles {
    flex-wrap: wrap;
  }
}

.facility-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080808;
}

.facility-item.expanded {
  border-color: #9a9a9a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.facility-item.selected {
  border-color: rgba(var(--accent-rgb), 0.48);
}

.facility-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
  text-align: left;
}

.facility-row:hover,
.facility-row:focus-visible {
  background: rgba(255, 255, 255, 0.035);
  outline: none;
}

.facility-icon {
  display: grid;
  place-items: center;
  color: #f8f8f8;
}

.facility-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 2.4;
}

.facility-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.facility-copy strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.facility-copy .facility-affected-attributes {
  overflow: hidden;
  color: #aab2bd;
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facility-copy .facility-price-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  color: #f1f4f7;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.facility-copy .facility-price-range > svg {
  width: 14px;
  height: 14px;
  color: var(--green);
  stroke-width: 2.2;
}

.facility-row-right {
  display: inline-grid;
  grid-template-columns: 44.3px 17px;
  align-items: center;
  justify-items: center;
  gap: 14px;
}

.facility-row-right > svg {
  width: 17px;
  height: 17px;
  color: #e9edf2;
}

.facility-playstyle-icon {
  flex: none;
}

.facility-row-right .silver-icon-shape.facility-playstyle-icon {
  width: 29.7px;
  height: 29.7px;
}

.facility-row-right .silver-icon-shape.facility-playstyle-icon img,
.facility-row-right .silver-icon-shape.facility-playstyle-icon svg {
  width: 28px;
  height: 28px;
}

.facility-row-right .gold-icon-shape.facility-playstyle-icon {
  width: 44.3px;
  height: 38px;
}

.facility-row-right .gold-icon-shape.facility-playstyle-icon img,
.facility-row-right .gold-icon-shape.facility-playstyle-icon svg {
  width: 31px;
  height: 31px;
}

.facility-level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-top: 1px solid #9a9a9a;
  background: #151515;
}

.facility-level-card {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  min-height: 245px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #050505;
  color: var(--text);
  cursor: pointer;
  padding: 14px 12px;
  text-align: center;
}

.facility-level-card:hover,
.facility-level-card:focus-visible {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.2), 0 0 18px rgba(var(--accent-rgb), 0.18);
}

.facility-level-card.selected {
  border-color: var(--green);
  background: rgba(var(--accent-rgb), 0.08);
}

.facility-level-card:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.facility-level-card > strong {
  font-size: 0.92rem;
  font-weight: 900;
}

.facility-boost-list {
  display: grid;
  gap: 6px;
  min-height: 72px;
  color: #b7bfca;
  font-size: 0.78rem;
  font-weight: 700;
}

.facility-boost-list strong {
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 950;
}

.facility-level-cost {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  color: #a9b1bd;
  font-size: 0.78rem;
  font-weight: 700;
}

.facility-level-cost strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 950;
}

.facility-level-playstyle {
  display: grid;
  min-height: 44px;
  place-items: center;
}

.facility-level-playstyle .silver-icon-shape.facility-playstyle-icon {
  width: 26.87px;
  height: 26.87px;
}

.facility-level-playstyle .silver-icon-shape.facility-playstyle-icon img,
.facility-level-playstyle .silver-icon-shape.facility-playstyle-icon svg {
  width: 25px;
  height: 25px;
}

.facility-level-playstyle .gold-icon-shape.facility-playstyle-icon {
  width: 40.3px;
  height: 34px;
}

.facility-level-playstyle .gold-icon-shape.facility-playstyle-icon img,
.facility-level-playstyle .gold-icon-shape.facility-playstyle-icon svg {
  width: 28px;
  height: 28px;
}

.playstyle-category {
  display: grid;
  gap: 16px;
}

.playstyle-category h3 {
  margin: 0;
  color: #b9c0ca;
  font-size: 0.96rem;
}

.playstyle-option-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(74px, 1fr));
  gap: 30px 20px;
}

.playstyle-option {
  position: relative;
  display: grid;
  min-height: 92px;
  place-items: start center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.playstyle-option.unavailable {
  color: #595f67;
  cursor: not-allowed;
}

.playstyle-option .option-icon {
  width: 42px;
  height: 42px;
  background: #f1f1f1;
  transition: background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.gold-icon-shape {
  display: grid;
  width: 49px;
  height: 42px;
  place-items: center;
  clip-path: polygon(24% 0, 76% 0, 100% 42%, 50% 100%, 0 42%);
  background: var(--gold);
  color: #050505;
}

.gold-icon-shape img,
.gold-icon-shape svg {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.playstyle-option .gold-icon-shape.option-icon {
  width: 49px;
  height: 42px;
  background: var(--gold);
}

.playstyle-option.unavailable .option-icon {
  background: #555;
  opacity: 0.7;
}

.playstyle-option.silver-option {
  color: #737981;
}

.playstyle-option.silver-option.available .option-icon {
  background: #555;
  box-shadow: 0 0 0 2px var(--green), 0 0 16px rgba(var(--accent-rgb), 0.18);
  opacity: 1;
}

.playstyle-option.silver-option.ap-shortage {
  cursor: not-allowed;
}

.playstyle-option.silver-option.ap-shortage .option-icon {
  background: #555;
  box-shadow: 0 0 0 2px var(--red), 0 0 16px rgba(255, 82, 82, 0.2);
  opacity: 1;
}

.playstyle-option.silver-option.ap-shortage:hover .option-icon,
.playstyle-option.silver-option.ap-shortage:focus-visible .option-icon {
  box-shadow: 0 0 0 2px #ff6b6b, 0 0 24px rgba(255, 82, 82, 0.34);
}

.playstyle-option.silver-option.available:hover .option-icon,
.playstyle-option.silver-option.available:focus-visible .option-icon,
.playstyle-option.silver-option.selected:hover .option-icon,
.playstyle-option.silver-option.selected:focus-visible .option-icon {
  background: #555;
  box-shadow: 0 0 0 2px var(--accent-bright), 0 0 24px rgba(var(--accent-rgb), 0.42);
}

.playstyle-option.silver-option.available .playstyle-option-name {
  color: #737981;
}

.playstyle-option.silver-option.selected .option-icon {
  background: #fff;
  box-shadow: 0 0 0 2px var(--green), 0 0 16px rgba(var(--accent-rgb), 0.18);
  opacity: 1;
}

.playstyle-option.silver-option.selected:hover .option-icon,
.playstyle-option.silver-option.selected:focus-visible .option-icon {
  background: #fff;
}

.playstyle-option.silver-option.selected .playstyle-option-name {
  color: var(--text);
}

.playstyle-option.locked-plus {
  opacity: 0.48;
}

.playstyle-option.locked-plus .gold-icon-shape.option-icon {
  background: #6f6336;
}

.playstyle-option.unlocked-plus {
  opacity: 1;
}

.playstyle-option.unlocked-plus .gold-icon-shape.option-icon {
  background: var(--gold);
}

.playstyle-option.available:hover .option-icon,
.playstyle-option.available:focus-visible .option-icon,
.playstyle-option.selected .option-icon {
  background: #fff;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.28);
}

.playstyle-option.unlocked-plus:hover .gold-icon-shape.option-icon,
.playstyle-option.unlocked-plus:focus-visible .gold-icon-shape.option-icon {
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 220, 99, 0.24), 0 0 24px rgba(255, 220, 99, 0.38);
}

.playstyle-option:focus-visible {
  outline: none;
}

.playstyle-option-name {
  max-width: 86px;
  color: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
}

.playstyle-option.available .playstyle-option-name,
.playstyle-option.selected .playstyle-option-name {
  color: var(--text);
}

.playstyle-option-status {
  color: #555;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.playstyle-option.selected .playstyle-option-status {
  color: var(--green);
}

.playstyle-tooltip {
  position: absolute;
  left: 50%;
  top: -10px;
  z-index: 5;
  display: none;
  width: max-content;
  max-width: 300px;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff;
  color: #161616;
  font-size: 0.73rem;
  line-height: 1.3;
  text-align: left;
  transform: translate(-50%, -100%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
  pointer-events: none;
}

.playstyle-tooltip::after {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.playstyle-modal .playstyle-tooltip.tooltip-below {
  top: calc(100% + 10px);
  transform: translate(-50%, 0);
}

.playstyle-modal .playstyle-tooltip.tooltip-below::after {
  top: -6px;
  bottom: auto;
}

.playstyle-tooltip strong {
  font-weight: 900;
}

.playstyle-tooltip-breakdown {
  display: grid;
  gap: 4px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid #d7d7d7;
}

.playstyle-tooltip-breakdown-title {
  color: #51565d;
  font-size: 0.68rem;
}

.playstyle-cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.playstyle-cost-route {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.playstyle-cost-route > strong {
  min-width: 28px;
}

.playstyle-cost-route small {
  border-radius: 3px;
  background: #d9f7e8;
  color: #07683d;
  padding: 1px 4px;
  font-size: 0.59rem;
  font-weight: 900;
}

.playstyle-cost-route small.max-value {
  background: #ffe2e5;
  color: #a51d32;
}

.playstyle-cost-row > b {
  color: #087c49;
  font-size: 0.7rem;
  font-weight: 950;
  white-space: nowrap;
}

.playstyle-cost-row > b.unavailable {
  color: #a51d32;
}

.playstyle-tooltip-ap {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px solid #d7d7d7;
}

.playstyle-tooltip-ap b {
  color: #087c49;
  font-weight: 950;
}

.playstyle-tooltip em {
  color: var(--red);
  font-style: normal;
}

.playstyle-option:hover .playstyle-tooltip,
.playstyle-option:focus-visible .playstyle-tooltip,
.spec-button:hover .specialization-tooltip,
.spec-button:focus-visible .specialization-tooltip {
  display: grid;
}

@media (max-width: 1180px) {
  .main-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .attribute-sections,
  .attribute-section.goalkeeper {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }

  .sticky-build-bar {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sticky-playstyles {
    grid-template-columns: repeat(4, 34px);
    justify-content: start;
    gap: 10px;
  }

  .empty-slot-row {
    grid-template-columns: repeat(3, minmax(46px, 1fr));
  }

  .playstyle-option-grid {
    grid-template-columns: repeat(4, minmax(74px, 1fr));
  }

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

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

  .comparison-overview-categories {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .comparison-attribute-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding-top: 14px;
  }

  .suggested-positions {
    min-height: 230px;
  }

  .position-pitch {
    width: min(172px, 70%);
  }

  .topbar,
  .panel-title-row,
  .attribute-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .utility-button {
    min-width: 0;
  }

  .build-library-panel {
    inset: 0;
    border: 0;
    border-radius: 0;
  }

  .build-library-header {
    padding: 16px 14px 14px;
  }

  .build-library-header h2 {
    font-size: 1.2rem;
  }

  .build-library-header p:last-child {
    max-width: 250px;
    font-size: 0.67rem;
  }

  .build-save-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .build-name-field {
    width: 100%;
  }

  .build-save-actions .utility-button {
    flex: 1 1 0;
  }

  .saved-build-list {
    gap: 9px;
    padding: 12px 14px 18px;
  }

  .saved-build-card {
    grid-template-columns: 36px 42px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 10px;
  }

  .saved-build-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .saved-build-actions button {
    min-width: 0;
    padding: 5px 4px;
  }

  .saved-build-meta {
    gap: 4px 8px;
  }

  .build-compare-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .build-compare-footer > div {
    align-items: flex-start;
  }

  .comparison-toolbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .comparison-toolbar-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .comparison-content {
    gap: 12px;
    padding: 12px 10px 24px;
  }

  .comparison-section:first-child {
    overflow-x: auto;
  }

  .comparison-summary-grid {
    min-width: 600px;
  }

  .comparison-amp-comparison-grid {
    min-width: 600px;
  }

  .comparison-mastery-comparison-grid {
    min-width: 600px;
  }

  .comparison-summary-card {
    padding: 12px;
  }

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

  .comparison-attribute-legend {
    gap: 9px;
    padding: 12px 10px 0;
  }

  .comparison-attribute-overview {
    gap: 9px;
    padding: 10px 10px 0;
  }

  .comparison-overview-totals {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .comparison-overview-total-list {
    width: 100%;
  }

  .comparison-overview-total {
    min-width: 0;
    flex: 1 1 0;
  }

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

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

  .main-grid,
  .attribute-sections,
  .attribute-section.goalkeeper {
    grid-template-columns: 1fr;
  }

  .sticky-build-bar {
    top: 0;
    min-height: 0;
    margin-right: -4px;
    margin-left: -4px;
  }

  .sticky-playstyles {
    grid-template-columns: repeat(4, 38px);
    justify-content: center;
    padding: 12px;
  }

  .gold-row {
    flex-wrap: wrap;
  }

  .empty-slot-row {
    grid-template-columns: repeat(3, minmax(46px, 1fr));
    gap: 18px;
  }

  .facility-playstyle-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
  }

  .facility-playstyle-label {
    justify-self: center;
  }

  .facility-playstyle-list {
    flex-wrap: wrap;
  }

  .archetype-tabs {
    gap: 10px;
  }

  .playstyle-modal-panel {
    width: 100%;
  }

  .facility-modal-panel {
    width: 100%;
  }

  .mastery-modal-panel {
    width: 100%;
  }

  .amp-modal-panel {
    width: 100%;
  }

  .mastery-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .amp-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mastery-modal-actions {
    justify-content: space-between;
  }

  .amp-modal-actions {
    justify-content: space-between;
  }

  .mastery-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mastery-level-options {
    justify-self: stretch;
  }

  .mastery-level-button {
    flex: 1 1 0;
  }

  .facility-level-grid {
    grid-template-columns: 1fr;
  }

  .facility-level-card {
    min-height: 190px;
  }

  .playstyle-modal-header,
  .playstyle-modal-content,
  .facility-modal-header,
  .facility-modal-content,
  .mastery-modal-header,
  .mastery-modal-content,
  .amp-modal-header,
  .amp-modal-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .amp-modal-note {
    margin-right: 18px;
    margin-left: 18px;
  }

  .amp-slot-tabs,
  .signature-amp-grid {
    grid-template-columns: 1fr;
  }

  .amp-picker-grid {
    grid-template-columns: 1fr;
  }

  .signature-amp-card {
    min-height: 350px;
  }

  .playstyle-option-grid {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    gap: 28px 14px;
  }
}

/* ========================================================================== */
/* FC27 WORKSPACE SHELL V2                                                    */
/* Full-width game workspace overrides. Kept unlayered to outrank legacy CSS. */
/* ========================================================================== */

:root {
  --shell-header-height: 72px;
  --shell-navigation-height: 58px;
  --shell-sticky-offset: 154px;
  --shell-page-gutter: clamp(14px, 2.2vw, 36px);
  --shell-panel-radius: 12px;
  --builder-profile-column: 300px;
  --builder-summary-column: 340px;
}

html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

html {
  scrollbar-gutter: stable;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% -8%, rgba(var(--accent-rgb), 0.13), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(var(--secondary-rgb), 0.1), transparent 30rem),
    linear-gradient(145deg, var(--body-gradient-start) 0%, var(--body-gradient-mid) 48%, var(--body-gradient-end) 100%);
  background-attachment: fixed;
}

.app-shell {
  width: 100%;
  max-width: 2040px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 var(--shell-page-gutter) 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--shell-header-height);
  flex-direction: row;
  align-items: center;
  margin: 0 calc(var(--shell-page-gutter) * -1);
  border-bottom: 1px solid var(--shell-line);
  background: rgba(var(--topbar-rgb), 0.92);
  padding: 10px var(--shell-page-gutter);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px) saturate(120%);
}

.topbar > div:first-child {
  min-width: 0;
}

.brand {
  margin-bottom: 3px;
  color: var(--green);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.35rem, 1.8vw, 2rem);
  letter-spacing: -0.035em;
}

.top-actions {
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.archetype-strip {
  min-width: 0;
  margin: 14px 0 16px;
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-panel-radius);
  background:
    linear-gradient(110deg, rgba(var(--accent-rgb), 0.07), transparent 35%),
    var(--shell-surface);
  padding: 15px 16px 10px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.archetype-tabs {
  min-width: 0;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.48) transparent;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

.archetype-tab {
  width: 82px;
  min-width: 82px;
  min-height: 102px;
  scroll-snap-align: start;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  padding: 9px 5px 15px;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.archetype-tab:hover,
.archetype-tab:focus-visible {
  border-color: var(--shell-line-strong);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
  transform: translateY(-1px);
}

.archetype-tab.active {
  border-color: var(--shell-green-line);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.025));
}

.archetype-tab::after {
  right: 12px;
  left: 12px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
}

.builder-stage {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, var(--builder-profile-column)) minmax(0, 1fr) minmax(0, var(--builder-summary-column));
  grid-template-areas: "profile workspace summary";
  align-items: start;
  gap: 18px;
}

.builder-stage > *,
.build-profile-rail > *,
.builder-workspace > *,
.build-summary-rail > * {
  min-width: 0;
}

.build-profile-rail {
  grid-area: profile;
}

.builder-workspace {
  grid-area: workspace;
}

.build-summary-rail {
  grid-area: summary;
}

.build-profile-rail,
.build-summary-rail {
  position: sticky;
  top: var(--shell-sticky-offset);
  display: grid;
  max-height: calc(100dvh - var(--shell-sticky-offset) - 18px);
  align-content: start;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 3px 4px 1px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  overscroll-behavior: contain;
}

.builder-workspace {
  display: grid;
  align-content: start;
  gap: 16px;
  container: builder-workspace / inline-size;
}

.panel {
  border-color: var(--shell-line);
  border-radius: var(--shell-panel-radius);
  background: linear-gradient(155deg, rgba(var(--panel-start-rgb), 0.98), rgba(var(--panel-end-rgb), 0.98));
  box-shadow: 0 14px 38px rgba(1, 5, 14, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.compact-panel,
.playstyle-panel,
.skills-panel,
.specialization-panel,
.attributes-panel,
.radar-panel {
  padding: clamp(17px, 1.8vw, 23px);
}

.panel-title-row,
.attribute-actions {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

.panel-title-row {
  gap: 12px;
}

.panel-title-row h2,
.compact-panel h2,
.playstyle-panel h2,
.skills-panel h2,
.specialization-panel h2,
.attributes-panel h2 {
  letter-spacing: -0.015em;
}

.utility-button,
.outline-button,
.theme-field {
  min-height: 38px;
  border-color: var(--shell-line);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--button-start), var(--button-end));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.utility-button:hover,
.utility-button:focus-visible,
.outline-button:hover,
.outline-button:focus-visible,
.theme-field:hover,
.theme-field:focus-within {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: linear-gradient(180deg, var(--button-hover-start), var(--button-hover-end));
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}

.utility-button.primary {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--accent-bright), var(--green));
  color: var(--accent-contrast);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.22);
}

.ovr-position-field select,
.theme-field select,
.facility-filter-select select,
.amp-picker-grid select,
.build-name-field input,
.facility-filter-search input {
  color: var(--text);
}

.build-name-field input,
.facility-filter-search,
.facility-filter-select select,
.amp-picker-grid select {
  border-color: var(--shell-line-strong);
  border-radius: 7px;
  background: var(--input-bg);
}

.range {
  appearance: none;
  min-height: 26px;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.5), var(--track-rest));
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -6px;
  border: 3px solid var(--thumb-border);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.74), 0 0 14px rgba(var(--accent-rgb), 0.34);
}

.range::-moz-range-track {
  height: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: var(--track-rest);
}

.range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.76);
}

.range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 3px solid var(--thumb-border);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.74), 0 0 14px rgba(var(--accent-rgb), 0.34);
}

.sticky-build-bar {
  border-color: var(--shell-line-strong);
  background: rgba(var(--sticky-rgb), 0.94);
  box-shadow: 0 15px 34px rgba(1, 5, 14, 0.38);
}

.build-summary-rail > .sticky-build-bar {
  position: relative;
  top: auto;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  margin: 0;
  border-color: rgba(var(--accent-rgb), 0.32);
  border-radius: var(--shell-panel-radius);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.11), transparent 42%),
    linear-gradient(160deg, #0d1210, #070a08);
  box-shadow: inset 3px 0 0 rgba(var(--accent-rgb), 0.58), 0 16px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: none;
}

.build-summary-rail > .sticky-build-bar .sticky-playstyles {
  grid-template-columns: repeat(4, 38px);
  justify-content: center;
  gap: 10px;
  padding: 18px 12px 16px;
}

.source-note {
  margin: 24px 0 0;
  border-top: 1px solid var(--shell-line);
  padding-top: 14px;
}

.build-library-backdrop,
.playstyle-modal-backdrop,
.facility-modal-backdrop,
.mastery-modal-backdrop,
.amp-modal-backdrop {
  background: rgba(1, 4, 3, 0.82);
  backdrop-filter: blur(9px) saturate(90%);
}

.build-library-panel,
.playstyle-modal-panel,
.facility-modal-panel,
.mastery-modal-panel,
.amp-modal-panel {
  height: 100dvh;
  max-height: 100dvh;
  border-color: var(--shell-line-strong);
  background:
    radial-gradient(circle at 100% 0, rgba(var(--accent-rgb), 0.07), transparent 26rem),
    #050807;
  box-shadow: -28px 0 72px rgba(0, 0, 0, 0.66);
}

.build-library-panel {
  inset: clamp(10px, 2.5vh, 28px) max(12px, calc((100vw - 1660px) / 2));
  height: auto;
  max-height: none;
  border-radius: 14px;
}

.build-library-header,
.playstyle-modal-header,
.facility-modal-header,
.mastery-modal-header,
.amp-modal-header,
.comparison-toolbar {
  border-color: var(--shell-line);
  background: rgba(7, 11, 9, 0.96);
  backdrop-filter: blur(14px);
}

.modal-close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--shell-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: rgba(var(--accent-rgb), 0.09);
}

.playstyle-modal-content,
.facility-modal-content,
.mastery-modal-content,
.amp-modal-content,
.saved-build-list,
.build-comparison-view {
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.toast {
  z-index: 200;
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(8, 14, 11, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(12px);
}

@media (max-width: 1320px) {
  :root {
    --shell-sticky-offset: 150px;
  }

  .builder-stage {
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
    grid-template-areas:
      "profile workspace"
      "summary summary";
  }

  .build-summary-rail {
    position: static;
    display: grid;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
  }

  .build-summary-rail > .sticky-build-bar {
    grid-column: 1 / -1;
  }

  .attribute-sections,
  .attribute-section.goalkeeper {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --shell-page-gutter: 12px;
    --shell-sticky-offset: 74px;
  }

  body {
    background-attachment: scroll;
  }

  .app-shell {
    width: 100%;
    max-width: none;
    padding-bottom: 24px;
  }

  .topbar {
    position: relative;
    top: auto;
    min-height: 64px;
    flex-direction: row;
    align-items: center;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .builder-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "workspace"
      "profile"
      "summary";
    gap: 14px;
  }

  .build-profile-rail,
  .build-summary-rail {
    position: static;
    display: grid;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
  }

  .build-profile-rail > .radar-panel,
  .build-summary-rail > .radar-panel,
  .build-profile-rail > .suggested-positions-panel {
    grid-row: span 2;
  }

  .build-summary-rail > .sticky-build-bar {
    grid-column: 1 / -1;
  }

  .panel-title-row,
  .attribute-actions {
    flex-direction: row;
    align-items: center;
  }

  .attribute-sections,
  .attribute-section.goalkeeper {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .build-library-panel {
    inset: 0;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 620px) {
  :root {
    --shell-page-gutter: 8px;
  }

  .app-shell {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-right: -8px;
    margin-left: -8px;
    padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 7px;
  }

  .top-actions .utility-button,
  .top-actions .theme-field {
    min-height: 42px;
  }

  .archetype-strip {
    margin: 9px 0 11px;
    border-radius: 9px;
    padding: 12px 10px 7px;
  }

  .archetype-tabs {
    gap: 7px;
  }

  .archetype-tab {
    width: 76px;
    min-width: 76px;
    min-height: 98px;
  }

  .builder-stage,
  .builder-workspace {
    gap: 11px;
  }

  .build-profile-rail,
  .build-summary-rail,
  .attribute-sections,
  .attribute-section.goalkeeper {
    grid-template-columns: minmax(0, 1fr);
  }

  .build-profile-rail > .radar-panel,
  .build-summary-rail > .radar-panel,
  .build-profile-rail > .suggested-positions-panel,
  .build-summary-rail > .suggested-positions-panel {
    grid-row: auto;
  }

  .compact-panel,
  .specialization-panel,
  .attributes-panel,
  .radar-panel {
    padding: 15px;
  }

  .panel {
    border-radius: 9px;
  }

  .panel-title-row {
    align-items: flex-start;
  }

  .attribute-actions {
    width: 100%;
    gap: 7px;
  }

  .attribute-actions .utility-button {
    flex: 1 1 auto;
  }

  .attribute-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto auto;
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .sticky-build-bar {
    margin-right: 0;
    margin-left: 0;
  }

  .playstyle-modal-panel,
  .facility-modal-panel,
  .mastery-modal-panel,
  .amp-modal-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
  }

  .playstyle-modal-header,
  .facility-modal-header,
  .mastery-modal-header,
  .amp-modal-header,
  .build-library-header {
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .toast {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .archetype-tab,
  .utility-button,
  .outline-button {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}

/* ========================================================================== */
/* FC27 TAB-FREE COMMAND CENTER V3                                            */
/* Continuous builder flow and grouped, full-width archetype command strip.   */
/* Kept unlayered so these rules deliberately supersede the V2 workspace.      */
/* ========================================================================== */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.archetype-strip {
  width: 100%;
  max-width: 100%;
  margin: 10px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 11px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.archetype-tabs,
#archetype-list {
  display: grid;
  width: max(100%, 1040px);
  min-width: 1040px;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  overflow: visible;
  padding: 0;
  scroll-snap-type: none;
}

.archetype-position-group {
  --group-accent: #6fffd4;
  --group-accent-rgb: 111, 255, 212;
  position: relative;
  display: grid;
  min-width: 0;
  grid-column: span var(--archetype-group-size);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 6px;
}

.archetype-position-group:first-child {
  padding-left: 0;
}

.archetype-position-group:last-child {
  border-right: 0;
  padding-right: 0;
}

.archetype-position-label {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 6px;
  margin: 0 3px 4px;
  border-bottom: 1px solid rgba(var(--group-accent-rgb), 0.32);
  color: var(--group-accent);
  font-size: 0.69rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.archetype-position-label::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--group-accent);
  box-shadow: 0 0 9px rgba(var(--group-accent-rgb), 0.66);
  content: "";
}

.archetype-position-items {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(var(--archetype-group-size), minmax(0, 1fr));
  align-items: stretch;
  gap: 4px;
}

.archetype-position-group[data-archetype-position-group="goalkeepers"] {
  --group-accent: #55bfff;
  --group-accent-rgb: 85, 191, 255;
}

.archetype-position-group[data-archetype-position-group="defenders"] {
  --group-accent: #65eccd;
  --group-accent-rgb: 101, 236, 205;
}

.archetype-position-group[data-archetype-position-group="midfielders"] {
  --group-accent: #c4a2ff;
  --group-accent-rgb: 196, 162, 255;
}

.archetype-position-group[data-archetype-position-group="attackers"] {
  --group-accent: #ffab61;
  --group-accent-rgb: 255, 171, 97;
}

.archetype-position-group .archetype-tab,
.archetype-tabs > .archetype-tab,
#archetype-list .archetype-tab {
  width: 100%;
  min-width: 0;
  min-height: 88px;
  margin: 0;
  scroll-snap-align: none;
  border-radius: 7px;
  padding: 6px 3px 11px;
}

.archetype-position-group .archetype-icon {
  width: 54px;
  height: 54px;
}

.archetype-position-group .archetype-icon img {
  width: 54px;
  height: 54px;
}

.archetype-position-group .archetype-icon svg {
  width: 30px;
  height: 30px;
}

.archetype-position-group .archetype-tab:hover,
.archetype-position-group .archetype-tab:focus-visible {
  border-color: rgba(var(--group-accent-rgb), 0.48);
  background: rgba(var(--group-accent-rgb), 0.07);
}

.archetype-position-group .archetype-tab.active {
  border-color: rgba(var(--group-accent-rgb), 0.72);
  background:
    linear-gradient(180deg, rgba(var(--group-accent-rgb), 0.15), rgba(var(--group-accent-rgb), 0.025)),
    var(--active-card-bg);
  box-shadow: inset 0 0 22px rgba(var(--group-accent-rgb), 0.045);
}

.archetype-position-group .archetype-tab.active::after {
  background: var(--group-accent);
  box-shadow: 0 0 12px rgba(var(--group-accent-rgb), 0.66);
}

.archetype-position-group .archetype-name {
  color: #f3f7f5;
  font-size: clamp(0.58rem, 0.66vw, 0.69rem);
}

/* The primary desktop view stays in three columns down to 1100px. This keeps
   the radar, continuous editor, and live build controls visible together. */
.builder-stage.tabless-builder-stage,
.tabless-builder-stage {
  display: grid;
  min-width: 0;
  grid-template-columns: var(--builder-profile-column) minmax(0, 1fr) var(--builder-summary-column);
  grid-template-areas: "profile workspace summary";
  align-items: start;
  gap: 14px;
}

.tabless-builder-stage > .build-profile-rail,
.tabless-builder-stage > .build-summary-rail {
  position: static;
  top: auto;
  display: grid;
  max-height: none;
  align-content: start;
  gap: 12px;
  overflow: visible;
  padding: 1px 0 5px;
  scrollbar-gutter: auto;
  overscroll-behavior: auto;
}

.tabless-builder-stage > .build-summary-rail {
  grid-template-columns: minmax(0, 1fr);
}

.tabless-builder-stage > .builder-workspace {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
  container: builder-workspace / inline-size;
}

.live-playstyle-panel {
  overflow: hidden;
  border-color: rgba(var(--accent-rgb), 0.3);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.085), transparent 44%),
    linear-gradient(155deg, #0d1210, #080a09);
  padding: 14px 12px 12px;
  box-shadow: inset 3px 0 0 rgba(var(--accent-rgb), 0.48), 0 16px 36px rgba(0, 0, 0, 0.24);
}

.live-playstyle-panel .live-playstyle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.live-playstyle-panel .live-playstyle-heading h2 {
  margin: 0;
}

.live-playstyle-panel > .sticky-build-bar {
  position: relative;
  top: auto;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  margin: 0;
  border-color: rgba(var(--accent-rgb), 0.27);
  border-radius: 8px;
  background: rgba(5, 9, 7, 0.82);
  box-shadow: none;
  backdrop-filter: none;
}

.live-playstyle-panel > .sticky-build-bar .sticky-playstyles {
  padding-top: 14px;
  grid-template-columns: repeat(4, 38px);
  justify-content: center;
  gap: 10px;
  padding: 14px 10px 13px;
}

.build-summary-rail > .summary-specialization-panel {
  padding: 17px 12px 15px;
}

.build-summary-rail > .summary-specialization-panel .panel-title-row {
  align-items: center;
}

.build-summary-rail > .summary-specialization-panel .specialization-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-top: 13px;
}

.build-summary-rail > .summary-specialization-panel .spec-button {
  gap: 7px;
}

.build-summary-rail > .summary-specialization-panel .spec-button .specialization-diamond {
  width: 44px;
  height: 38px;
}

.build-summary-rail > .summary-specialization-panel .spec-button > .spec-name {
  min-height: 22px;
  max-width: 78px;
  padding: 3px 5px;
  font-size: 0.64rem;
}

.build-settings-summary-panel {
  overflow: hidden;
  border-color: rgba(var(--accent-rgb), 0.22);
  padding: 0;
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.055), transparent 46%),
    linear-gradient(155deg, rgba(var(--panel-start-rgb), 0.98), rgba(var(--panel-end-rgb), 0.98));
}

.settings-summary-list {
  display: grid;
}

.settings-summary-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr) auto 15px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--shell-line);
  background: transparent;
  padding: 9px 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.settings-summary-row:last-child {
  border-bottom: 0;
}

.settings-summary-row:hover,
.settings-summary-row:focus-visible {
  background: rgba(var(--accent-rgb), 0.055);
  outline: none;
}

.settings-summary-row:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 0.46);
}

.settings-summary-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.075);
  color: var(--green);
}

.settings-summary-icon > svg {
  width: 17px;
  height: 17px;
}

.amp-summary-icon {
  border-color: rgba(255, 157, 0, 0.32);
  background: rgba(255, 157, 0, 0.075);
  color: var(--orange);
}

.facility-summary-icon {
  border-color: rgba(201, 167, 255, 0.3);
  background: rgba(201, 167, 255, 0.07);
  color: var(--mastery-purple);
}

.settings-summary-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-summary-copy > strong {
  overflow: hidden;
  font-size: 0.73rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-summary-value {
  display: inline-grid;
  min-height: 27px;
  place-items: center;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 0.7rem;
  font-weight: 950;
  white-space: nowrap;
}

.mastery-summary-value {
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--green);
}

.facility-summary-value {
  background: rgba(201, 167, 255, 0.11);
  color: var(--mastery-purple);
}

.settings-summary-chevron {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.amp-summary-slots {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.amp-mini-slot {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #52616a;
  border-radius: 3px;
  background: rgba(32, 50, 70, 0.34);
  color: #7f8d96;
  transform: rotate(45deg);
}

.amp-mini-slot strong {
  color: inherit;
  font-size: 0.5rem;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-45deg);
}

.amp-mini-slot.equipped {
  border-color: var(--orange);
  background: rgba(255, 157, 0, 0.16);
  color: var(--orange);
}

.amp-mini-slot.signature {
  border-color: rgba(201, 167, 255, 0.68);
  background: rgba(201, 167, 255, 0.09);
  color: var(--mastery-purple);
}

.amp-mini-slot.signature.affinity-active {
  border-color: #ff82cf;
  background: rgba(255, 130, 207, 0.12);
  color: #ff82cf;
  box-shadow: 0 0 12px rgba(255, 130, 207, 0.18);
}

.summary-signature-perks-panel .perk-row {
  gap: 8px;
}

.summary-signature-perks-panel .perk-chip {
  min-width: 0;
  flex: 1 1 112px;
  padding: 8px 9px;
}

.summary-signature-perks-panel .signature-perk-tooltip {
  top: auto;
  bottom: calc(100% + 10px);
}

@container builder-workspace (max-width: 900px) {
  .tabless-builder-stage .attribute-sections,
  .tabless-builder-stage .attribute-section.goalkeeper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }
}

@container builder-workspace (max-width: 560px) {
  .tabless-builder-stage .attribute-sections,
  .tabless-builder-stage .attribute-section.goalkeeper {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .builder-stage.tabless-builder-stage,
  .tabless-builder-stage {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas:
      "profile workspace"
      "summary summary";
  }

  .tabless-builder-stage > .build-profile-rail {
    position: static;
    top: auto;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .tabless-builder-stage > .build-profile-rail > .radar-panel,
  .tabless-builder-stage > .build-profile-rail > .suggested-positions-panel {
    grid-row: auto;
  }

  .tabless-builder-stage > .build-summary-rail {
    position: static;
    display: grid;
    max-height: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
  }

  .tabless-builder-stage > .build-summary-rail > .live-playstyle-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .builder-stage.tabless-builder-stage,
  .tabless-builder-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "workspace"
      "profile"
      "summary";
    gap: 12px;
  }

  .tabless-builder-stage > .build-profile-rail,
  .tabless-builder-stage > .build-summary-rail {
    position: static;
    display: grid;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
  }

  .tabless-builder-stage > .build-profile-rail > .radar-panel,
  .tabless-builder-stage > .build-summary-rail > .live-playstyle-panel {
    grid-column: 1 / -1;
  }

  .tabless-builder-stage > .build-summary-rail > .summary-signature-perks-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .archetype-strip {
    margin: 8px 0 10px;
    padding: 8px 8px 6px;
  }

  #archetype-list {
    width: 1040px;
  }

  .archetype-position-group {
    padding-right: 4px;
    padding-left: 4px;
  }

  .archetype-position-items {
    gap: 3px;
  }

  .archetype-position-label {
    margin-right: 2px;
    margin-left: 2px;
    font-size: 0.63rem;
  }

  .archetype-position-group .archetype-tab,
  .archetype-tabs > .archetype-tab,
  #archetype-list .archetype-tab {
    min-height: 84px;
  }

  .tabless-builder-stage,
  .tabless-builder-stage > .builder-workspace {
    gap: 10px;
  }

  .tabless-builder-stage > .build-profile-rail,
  .tabless-builder-stage > .build-summary-rail {
    grid-template-columns: minmax(0, 1fr);
  }

}

/* Live PlayStyle sources: only acquired AMP/facility grants are shown. */
.live-granted-playstyles {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin-top: 10px;
  border-top: 1px solid var(--shell-line);
  padding-top: 10px;
}

.live-granted-playstyles[hidden],
.live-granted-playstyles > .facility-playstyle-row[hidden] {
  display: none !important;
}

.live-granted-playstyles > .facility-playstyle-row {
  display: grid;
  min-height: 0;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 9px;
}

.live-granted-playstyles > .amp-playstyle-row {
  border-color: rgba(255, 171, 97, 0.22);
  border-left-color: var(--orange);
  background: rgba(255, 171, 97, 0.055);
}

.live-granted-playstyles > .live-facility-playstyle-row {
  border-color: rgba(80, 191, 255, 0.2);
  border-left-color: #50bfff;
  background: rgba(80, 191, 255, 0.05);
}

.live-granted-playstyles .facility-playstyle-label {
  align-self: center;
  justify-self: start;
  color: #d8e3dd;
  font-size: 0.64rem;
  line-height: 1.25;
  text-align: left;
}

.live-granted-playstyles .amp-playstyle-row .facility-playstyle-label,
.live-granted-playstyles .amp-playstyle-card > span:last-child {
  color: #ffc18c;
}

.live-granted-playstyles .live-facility-playstyle-row .facility-playstyle-label {
  color: #88d7ff;
}

.live-granted-playstyles .facility-playstyle-list {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.live-granted-playstyles .facility-playstyle-card {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  padding: 5px 7px;
  text-align: left;
}

.live-granted-playstyles .facility-playstyle-icon {
  justify-self: center;
}

.live-granted-playstyles .facility-playstyle-card > span:last-child {
  max-width: none;
  color: #dcecf4;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .live-granted-playstyles > .facility-playstyle-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}

/* Attribute category icon system. */
.attribute-section.goalkeeper {
  --category-icon-color: #50f0b0;
  --category-icon-rgb: 80, 240, 176;
}

.attribute-section.pace {
  --category-icon-color: #42cbff;
  --category-icon-rgb: 66, 203, 255;
}

.attribute-section.shooting {
  --category-icon-color: #ff6376;
  --category-icon-rgb: 255, 99, 118;
}

.attribute-section.passing {
  --category-icon-color: #ffbc48;
  --category-icon-rgb: 255, 188, 72;
}

.attribute-section.dribbling {
  --category-icon-color: #bf85ff;
  --category-icon-rgb: 191, 133, 255;
}

.attribute-section.defending {
  --category-icon-color: #43e59a;
  --category-icon-rgb: 67, 229, 154;
}

.attribute-section.physical {
  --category-icon-color: #ff8b46;
  --category-icon-rgb: 255, 139, 70;
}

.attribute-category-icon {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--category-icon-rgb), 0.38);
  border-radius: 8px 8px 4px 8px;
  color: var(--category-icon-color);
  background:
    linear-gradient(145deg, rgba(var(--category-icon-rgb), 0.22), rgba(var(--category-icon-rgb), 0.035) 68%),
    var(--category-icon-base);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(var(--category-icon-rgb), 0.1);
}

.section-name .attribute-category-icon svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  stroke-width: 2.25;
}

.attribute-section > .section-heading > .section-name {
  gap: 10px;
}

/* ========================================================================== */
/* Free palette editor                                                        */
/* ========================================================================== */

.palette-edit-button {
  min-width: 116px;
  border-color: rgba(var(--accent-rgb), 0.46);
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--green);
}

.palette-edit-button > svg {
  width: 16px;
  height: 16px;
}

.palette-edit-button.active,
.palette-edit-button[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12), 0 0 18px rgba(var(--accent-rgb), 0.12);
}

.free-palette-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  visibility: hidden;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, visibility 0s linear 140ms;
}

.free-palette-modal.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.free-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 3, 3, 0.86);
  backdrop-filter: blur(10px) saturate(88%);
}

.free-palette-panel {
  --text: #f7f8fa;
  --muted: #9aa0a8;
  --subtle: #68707a;
  --green: #00e477;
  --accent-rgb: 0, 228, 119;
  --accent-bright: #2dff9c;
  --accent-contrast: #03150d;
  --shell-line: rgba(255, 255, 255, 0.1);
  --shell-line-strong: rgba(255, 255, 255, 0.18);
  --button-start: #151917;
  --button-end: #0e110f;
  --button-hover-start: #15231c;
  --button-hover-end: #0d1712;
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1240px, calc(100vw - 48px));
  height: min(790px, calc(100dvh - 48px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--shell-line-strong);
  border-radius: 16px;
  background:
    radial-gradient(circle at 74% -15%, rgba(var(--accent-rgb), 0.12), transparent 32rem),
    #080b0a;
  box-shadow: 0 30px 96px rgba(0, 0, 0, 0.72);
  color: var(--text);
}

.free-palette-header,
.free-palette-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(8, 12, 10, 0.96);
  backdrop-filter: blur(16px);
}

.free-palette-header {
  min-height: 94px;
  border-bottom: 1px solid var(--shell-line);
  padding: 19px 22px 18px;
}

.free-palette-header h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.free-palette-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 218px minmax(500px, 1fr) 226px;
  overflow: hidden;
}

.free-palette-targets-panel,
.free-palette-preview {
  min-width: 0;
  overflow-y: auto;
  padding: 20px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.free-palette-targets-panel {
  border-right: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.018);
}

.free-palette-preview {
  border-left: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.012);
}

.free-palette-editor {
  min-width: 0;
  overflow-y: auto;
  padding: 20px 22px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.free-palette-section-heading,
.free-palette-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.free-palette-section-heading {
  min-height: 26px;
  margin-bottom: 11px;
}

.free-palette-section-heading strong {
  font-size: 0.74rem;
  font-weight: 950;
}

.free-palette-section-heading > span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
}

.free-palette-targets {
  display: grid;
  gap: 6px;
}

.free-palette-target {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.free-palette-target:hover,
.free-palette-target:focus-visible {
  border-color: var(--shell-line-strong);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.free-palette-target.active {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.11);
  box-shadow: inset 3px 0 0 var(--green);
}

.free-palette-target-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 5px;
  background: var(--target-color);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.28);
}

.free-palette-target > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.free-palette-target strong {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.free-palette-target small {
  color: var(--muted);
  font-size: 0.68rem;
}

.free-palette-editor-heading {
  min-height: 40px;
  margin-bottom: 14px;
}

.free-palette-editor-heading > div {
  display: grid;
  gap: 2px;
}

.free-palette-editor-heading span {
  color: var(--muted);
  font-size: 0.58rem;
}

.free-palette-editor-heading strong {
  font-size: 1rem;
}

.free-palette-reset-target {
  min-height: 30px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.6rem;
  font-weight: 850;
}

.free-palette-reset-target:hover,
.free-palette-reset-target:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.54);
  color: var(--green);
  outline: none;
}

.free-palette-picker-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(260px, 1fr) 52px 18px 154px;
  gap: 12px;
}

.free-palette-saturation {
  --picker-hue: 0;
  position: relative;
  min-width: 0;
  height: 286px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(to top, #000000, transparent),
    linear-gradient(to right, #ffffff, hsl(var(--picker-hue) 100% 50%));
  cursor: crosshair;
  touch-action: none;
}

.free-palette-saturation:focus-visible,
.free-palette-hue:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.free-palette-picker-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #000000, 0 2px 8px rgba(0, 0, 0, 0.48);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.free-palette-current-swatch {
  height: 286px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.free-palette-hue {
  position: relative;
  height: 286px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%, #00ffff 50%, #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%);
  cursor: ns-resize;
  touch-action: none;
}

.free-palette-hue-marker {
  position: absolute;
  left: 50%;
  width: 24px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 0 0 1px #000000, 0 2px 8px rgba(0, 0, 0, 0.46);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.free-palette-inputs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.free-palette-inputs label {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 70px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.free-palette-inputs .free-palette-hex-field {
  grid-template-columns: 36px minmax(0, 1fr);
}

.free-palette-inputs input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--shell-line-strong);
  border-radius: 6px;
  background: #0c100e;
  padding: 0 9px;
  color: #f7f8fa;
  font-size: 0.7rem;
  font-weight: 800;
  outline: none;
}

.free-palette-inputs input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.14);
}

.free-palette-rgb-heading {
  min-height: 30px;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 900;
}

.free-palette-contrast-setting {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 12px;
}

.free-palette-contrast-setting > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.free-palette-contrast-setting strong {
  font-size: 0.68rem;
  font-weight: 950;
}

.free-palette-contrast-setting > div > span {
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.4;
}

.free-palette-contrast-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 900;
}

.free-palette-contrast-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.free-palette-contrast-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border: 1px solid var(--shell-line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 120ms ease, background 120ms ease;
}

.free-palette-contrast-track::after {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: left 120ms ease, background 120ms ease;
}

.free-palette-contrast-switch input:checked + .free-palette-contrast-track {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.18);
}

.free-palette-contrast-switch input:checked + .free-palette-contrast-track::after {
  left: 19px;
  background: var(--green);
}

.free-palette-contrast-switch input:focus-visible + .free-palette-contrast-track {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.free-palette-swatches-section {
  margin-top: 18px;
}

.free-palette-default-swatches,
.free-palette-user-swatches {
  display: grid;
  grid-template-columns: repeat(10, 24px);
  gap: 9px 10px;
}

.free-palette-user-swatches {
  grid-template-columns: repeat(12, 24px);
}

.free-palette-swatch {
  position: relative;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: var(--swatch-color);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}

.free-palette-swatch:hover,
.free-palette-swatch:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  transform: scale(1.08);
}

.free-palette-swatch.empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.free-palette-swatch.empty svg {
  width: 11px;
  height: 11px;
}

.free-palette-section-heading > button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
}

.free-palette-section-heading > button:hover,
.free-palette-section-heading > button:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.free-palette-section-heading > button svg {
  width: 15px;
  height: 15px;
}

.free-palette-swatch-help {
  display: block;
  margin-top: 10px;
  color: var(--subtle);
  font-size: 0.56rem;
  line-height: 1.5;
}

.free-palette-preview-site {
  min-height: 232px;
  border: 1px solid var(--shell-line);
  border-radius: 10px;
  background: var(--custom-site-bg, #050505);
  padding: 18px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.26);
}

.free-palette-preview-tab {
  display: grid;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--custom-text-color, #f7f8fa) 18%, transparent);
  border-radius: 9px;
  background: var(--custom-tab-bg, #0a0a0a);
  padding: 16px;
  color: var(--custom-text-color, #f7f8fa);
}

.free-palette-preview-tab > span {
  color: var(--custom-text-color, #f7f8fa);
  font-size: 0.67rem;
  font-weight: 900;
}

.free-palette-preview-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.free-palette-preview-number {
  display: grid;
  min-width: 0;
  min-height: 54px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 6px;
  padding: 5px 3px;
}

.free-palette-preview-number small {
  color: inherit;
  font-size: 0.48rem;
  font-weight: 800;
  opacity: 0.78;
}

.free-palette-preview-number strong {
  color: inherit;
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1;
}

.free-palette-preview-number.neutral {
  border: 1px solid color-mix(in srgb, var(--custom-text-color, #f7f8fa) 14%, transparent);
  background: color-mix(in srgb, var(--custom-text-color, #f7f8fa) 5%, transparent);
  color: var(--custom-number-color, #d3a1ff);
}

.free-palette-preview-number.great {
  background: var(--custom-bar-great, #00b866);
  color: var(--custom-bar-great-contrast, #050505);
}

.free-palette-preview-number.good {
  background: var(--custom-bar-good, #ffd447);
  color: var(--custom-bar-good-contrast, #050505);
}

.free-palette-preview-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.free-palette-preview-bars i {
  height: 7px;
  border-radius: 999px;
}

.free-palette-preview-bars [data-preview-bar="barLow"] { background: var(--custom-bar-low, #ff365b); }
.free-palette-preview-bars [data-preview-bar="barMedium"] { background: var(--custom-bar-medium, #ff9d00); }
.free-palette-preview-bars [data-preview-bar="barGood"] { background: var(--custom-bar-good, #ffd447); }
.free-palette-preview-bars [data-preview-bar="barGreat"] { background: var(--custom-bar-great, #00b866); }
.free-palette-preview-bars [data-preview-bar="barElite"] { background: var(--custom-bar-elite, #087a3a); }

.free-palette-preview-tab button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: var(--custom-accent, #00e477);
  color: var(--custom-accent-contrast, #03150d);
  font-size: 0.64rem;
  font-weight: 950;
}

.free-palette-footer {
  min-height: 68px;
  border-top: 1px solid var(--shell-line);
  padding: 12px 18px;
}

.free-palette-footer > div {
  display: flex;
  gap: 9px;
}

.free-palette-footer .utility-button {
  min-width: 112px;
  justify-content: center;
}

/* Color settings application rules stay at the end so custom colors win. */
html[data-theme="custom"] body {
  background: var(--custom-site-bg);
}

html[data-theme="custom"] .topbar {
  background: rgba(var(--custom-site-background-rgb), 0.94);
}

html[data-theme="custom"] .panel,
html[data-theme="custom"] .archetype-strip,
html[data-theme="custom"] .archetype-position-group .archetype-tab,
html[data-theme="custom"] .live-playstyle-panel,
html[data-theme="custom"] .build-summary-rail > .sticky-build-bar,
html[data-theme="custom"] .build-settings-summary-panel {
  background: var(--custom-tab-bg);
}

html[data-theme="custom"] .archetype-position-group .archetype-tab.active {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.15), rgba(var(--accent-rgb), 0.025)),
    var(--custom-tab-bg);
}

html[data-theme="custom"] .current-fill.red,
html[data-theme="custom"] .in-game-value.red {
  background: var(--custom-bar-low);
}

html[data-theme="custom"] .in-game-value.red {
  color: var(--custom-bar-low-contrast);
}

html[data-theme="custom"] .current-fill.orange,
html[data-theme="custom"] .in-game-value.orange {
  background: var(--custom-bar-medium);
}

html[data-theme="custom"] .in-game-value.orange {
  color: var(--custom-bar-medium-contrast);
}

html[data-theme="custom"] .current-fill.yellow,
html[data-theme="custom"] .in-game-value.yellow {
  background: var(--custom-bar-good);
}

html[data-theme="custom"] .in-game-value.yellow {
  color: var(--custom-bar-good-contrast);
}

html[data-theme="custom"] .current-fill.bright-green,
html[data-theme="custom"] .in-game-value.bright-green {
  background: var(--custom-bar-great);
}

html[data-theme="custom"] .in-game-value.bright-green {
  color: var(--custom-bar-great-contrast);
}

html[data-theme="custom"] .current-fill.deep-green,
html[data-theme="custom"] .in-game-value.deep-green {
  background: var(--custom-bar-elite);
}

html[data-theme="custom"] .in-game-value.deep-green {
  color: var(--custom-bar-elite-contrast);
}

html[data-theme="custom"] .in-game-value.green {
  color: var(--custom-accent-contrast);
}

html[data-theme="custom"] output,
html[data-theme="custom"] .value-current,
html[data-theme="custom"] .value-cap,
html[data-theme="custom"] .section-score,
html[data-theme="custom"] .stat-list dd,
html[data-theme="custom"] .settings-summary-value,
html[data-theme="custom"] .comparison-attribute-value {
  color: var(--custom-number-color);
}

@media (max-width: 1120px) {
  .free-palette-panel {
    width: min(920px, calc(100vw - 32px));
  }

  .free-palette-body {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .free-palette-preview {
    display: none;
  }
}

@media (max-height: 820px) {
  .free-palette-panel {
    height: calc(100dvh - 24px);
  }

  .free-palette-header {
    min-height: 78px;
    padding-block: 13px;
  }

  .free-palette-saturation,
  .free-palette-current-swatch,
  .free-palette-hue {
    height: 228px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .free-palette-modal {
    transition: none;
  }
}
