:root {
  --bg: #0c0d0e;
  --surface: #141516;
  --surface-2: #1a1b1c;
  --border: #29292a;
  --border-soft: #1f2021;
  --text: #ece9e4;
  --text-dim: #a3a19c;
  --text-faint: #6d6b67;

  --accent: #e2542b;
  --accent-dim: #a83e20;
  --accent-text: #f5c19f;
  --accent-2: #e8b23f;

  --cost-1: #8b939b;
  --cost-2: #4fae63;
  --cost-3: #4a9fd8;
  --cost-4: #b26fe0;
  --cost-5: #e0b23f;

  --tier-s: #e2542b;
  --tier-a: #e2842b;
  --tier-b: #d8b23f;
  --tier-c: #6fae5f;
  --tier-d: #6d6b67;
  --tier-x: #a83e20;
  --trait-bronze: #b3773d;
  --trait-silver: #c4cbd1;

  --radius: 4px;
  --radius-sm: 3px;
  --font-display: "Bebas Neue", "Space Grotesk", sans-serif;
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(226, 84, 43, 0.035) 0px,
    rgba(226, 84, 43, 0.035) 1px,
    transparent 1px,
    transparent 26px
  );
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 2.4rem;
}
h2 {
  font-size: 1.6rem;
}
h3 {
  font-size: 1.15rem;
}
p {
  margin: 0 0 1em;
  color: var(--text-dim);
  max-width: 64ch;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }
}
@media (max-width: 380px) {
  .container {
    padding: 0 16px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 13, 14, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--accent);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  padding-bottom: 13px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  text-transform: uppercase;
}
.brand .mark {
  color: var(--accent);
}
.brand .set-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 0 0;
}
.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-links a.active {
  color: var(--accent);
  background: none;
}
.nav-menu {
  display: contents;
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  padding-left: 12px;
  border-left: 1px solid var(--border);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  overflow: hidden;
}
.lang-switch button {
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
}
.lang-switch button.active {
  background: var(--accent);
  color: #1a0d07;
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}
.btn:hover {
  border-color: var(--text-dim);
}
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0d07;
}
.btn-accent:hover {
  background: #f2683c;
  border-color: #f2683c;
}
.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}
.btn-danger {
  border-color: #5c2b28;
  color: #e2857f;
  background: none;
}
.btn-danger:hover {
  background: #241413;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hero {
  padding: 56px 0 0;
  border-bottom: none;
}
.hero-eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.hero h1 {
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 3.4rem;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p.lead {
  font-size: 1.02rem;
  max-width: 52ch;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  margin-top: 44px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.hero-stat {
  flex: 1;
  min-width: 120px;
  padding: 16px 20px 16px 0;
  border-right: 1px solid var(--border-soft);
}
.hero-stat:last-child {
  border-right: none;
}
.hero-stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  color: var(--accent);
  padding-left: 4px;
}
.hero-stat span {
  color: var(--text-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 4px;
}

section {
  padding: 48px 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.3rem;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}
.section-head p {
  margin: 6px 0 0;
}

.grid {
  display: grid;
  gap: 18px;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card-link {
  display: block;
  transition: border-color 0.15s;
}
.card-link:hover {
  border-top-color: var(--accent);
}

.filterbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 2px;
}
.chip {
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-faint);
  padding: 8px 12px;
  border-radius: 0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.chip:hover {
  color: var(--text);
}
.chip.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  min-width: 220px;
  margin-left: auto;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.tier-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  border: 1px solid var(--border);
  border-left: 6px solid var(--border);
  overflow: hidden;
  margin-bottom: 10px;
}
.tier-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  background: var(--surface);
}
.tier-s {
  border-left-color: var(--tier-s);
}
.tier-s .tier-label {
  color: var(--tier-s);
}
.tier-a {
  border-left-color: var(--tier-a);
}
.tier-a .tier-label {
  color: var(--tier-a);
}
.tier-b {
  border-left-color: var(--tier-b);
}
.tier-b .tier-label {
  color: var(--tier-b);
}
.tier-c {
  border-left-color: var(--tier-c);
}
.tier-c .tier-label {
  color: var(--tier-c);
}
.tier-d {
  border-left-color: var(--tier-d);
}
.tier-d .tier-label {
  color: var(--tier-d);
}
.tier-x {
  border-left-color: var(--tier-x);
}
.tier-x .tier-label {
  color: var(--tier-x);
}
.tier-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  align-items: center;
  min-height: 52px;
}

.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  color: #14100d;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.avatar-sq {
  border-radius: 5px;
}

.unit-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
}
.unit-card .meta {
  min-width: 0;
  flex: 1;
}
.unit-card .name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
}
.unit-card .traits {
  font-size: 0.72rem;
  color: var(--text-faint);
  white-space: normal;
  word-break: break-word;
  margin-top: 2px;
}

.tier-break {
  grid-column: 1 / -1;
  height: 0;
  margin: 0;
  padding: 0;
  visibility: hidden;
}

.comp-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}
.comp-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.comp-icon {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.comp-icon-extra {
  position: absolute;
  right: -7px;
  bottom: -7px;
  line-height: 0;
  z-index: 1;
}
.comp-icon-extra img,
.comp-icon-extra .avatar {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.comp-card .top-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.comp-card .title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}
.tier-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  color: #14100d;
  flex-shrink: 0;
}
.comp-card .tier-tag {
  height: 24px;
  padding: 0 10px;
  align-self: flex-start;
}
.comp-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 8px;
}
.trait-chip b {
  color: var(--accent-2);
  font-weight: 700;
}
.trait-chip.trait-bronze {
  border-color: var(--trait-bronze);
  background: rgba(179, 119, 61, 0.12);
}
.trait-chip.trait-bronze b {
  color: var(--trait-bronze);
}
.trait-chip.trait-silver {
  border-color: var(--trait-silver);
  background: rgba(196, 203, 209, 0.12);
}
.trait-chip.trait-silver b {
  color: var(--trait-silver);
}
.trait-chip.trait-gold {
  border-color: var(--accent-2);
  background: rgba(232, 178, 63, 0.14);
}
.trait-chip.trait-gold b {
  color: var(--accent-2);
}

.comp-author {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.builder-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }
}
.hexboard {
  --hex-gap: 4px;
  container-type: inline-size;
  --hex-size: clamp(30px, calc(100cqw / 8.2), 60px);
  display: flex;
  flex-direction: column;
  gap: var(--hex-gap);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(10px, 3vw, 20px);
  overflow-x: auto;
}
@supports not (container-type: inline-size) {
  .hexboard {
    --hex-size: clamp(30px, calc((100vw - 76px) / 8.2), 60px);
  }
}

.hex-row {
  display: flex;
  gap: var(--hex-gap);
}
.hex-row.offset {
  margin-left: calc(var(--hex-size) / 2 + var(--hex-gap) / 2);
}
.hex-slot {
  width: var(--hex-size);
  height: var(--hex-size);
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.hex-slot:hover {
  border-color: var(--accent);
}
.hex-slot.filled {
  border-style: solid;
}
.hex-slot .avatar {
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
}
.hex-slot .item-dots {
  position: absolute;
  bottom: calc(var(--hex-size) * -0.1);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.hex-slot .item-dots img,
.hex-slot .item-dots .avatar {
  width: calc(var(--hex-size) * 0.34) !important;
  height: calc(var(--hex-size) * 0.34) !important;
  border: 1px solid var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.hex-slot .star-badge {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--hex-size) * 0.3);
  line-height: 1;
  color: var(--accent-2);
  background: rgba(8, 8, 12, 0.6);
  padding: 0 3px;
  border-radius: 4px;
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 2;
}
.hex-slot.star3 {
  box-shadow: 0 0 0 2px var(--accent-2);
}
#hexboard,
#hexboard9 {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#hexboard .hex-slot.filled,
#hexboard9 .hex-slot.filled {
  cursor: grab;
}
.hex-slot.dragging {
  opacity: 0.35;
}
.hex-slot.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.drag-ghost {
  position: fixed;
  z-index: 300;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  transform: translate(-50%, -50%) scale(1.1);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}
body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.side-slot {
  --side-slot-size: 60px;
  --hex-size: var(--side-slot-size);
  width: var(--side-slot-size) !important;
  height: var(--side-slot-size) !important;
}
.side-slot > img,
.side-slot > .avatar {
  width: 100% !important;
  height: 100% !important;
}
.side-slot {
  margin-bottom: calc(var(--side-slot-size) * 0.14);
}
.hex-slot.side-slot .item-dots {
  bottom: calc(var(--side-slot-size) * -0.12);
  gap: 1px;
}
.hex-slot.side-slot .item-dots img,
.hex-slot.side-slot .item-dots .avatar {
  width: calc(var(--side-slot-size) * 0.36) !important;
  height: calc(var(--side-slot-size) * 0.36) !important;
  border-radius: 4px;
}
@media (max-width: 480px) {
  .side-slot {
    --side-slot-size: 48px;
  }
}

.aug-slot {
  width: 60px;
  height: 60px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.aug-slot:hover {
  border-color: var(--accent);
}
.aug-slot.filled {
  border-style: solid;
}
.aug-slot > img,
.aug-slot > .avatar {
  width: 100% !important;
  height: 100% !important;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  width: 100%;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.item-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.item-tabs button {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.item-tabs button.active {
  background: var(--accent);
  color: #1a0d07;
  border-color: var(--accent);
}

.picker-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--surface);
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.picker-row:hover {
  background: var(--surface-2);
}
.picker-row span {
  font-size: 0.85rem;
}

.selected-item-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 0.8rem;
}

.tier-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 5px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s;
}
.pill.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.comp-pill:hover {
  border-color: var(--accent);
}
.comp-pill {
  gap: 10px;
  padding: 6px 16px 6px 6px;
}
.comp-pill span {
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  padding-top: 46px;
  max-width: 380px;
  width: 100%;
  position: relative;
  color: var(--text);
}
.modal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.modal .modal-close svg {
  display: block;
}
.modal .modal-close:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--surface);
}
.modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.modal-tabs button {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.modal-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1108;
}
.modal .field {
  margin-bottom: 12px;
}
.modal .field input {
  color: var(--text);
  background: var(--surface-2);
}
.modal .error-msg {
  color: #e2857f;
  font-size: 0.8rem;
  margin-top: -4px;
  margin-bottom: 10px;
  min-height: 1em;
}
.hidden {
  display: none !important;
}

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 36px 0;
  margin-top: 40px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer p {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 0;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-faint);
}
.empty-state h3 {
  color: var(--text-dim);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  z-index: 200;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 16px;
    padding: 8px 20px 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 24px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .nav-menu.open {
    display: flex;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-links a {
    padding: 15px 4px;
    font-size: 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-cta {
    flex-wrap: wrap;
    gap: 12px;
  }
  .nav-user {
    order: 1;
    flex: 1 0 100%;
    max-width: none;
    padding-left: 0;
    border-left: none;
    font-size: 0.9rem;
  }
  .nav-cta .btn-accent {
    order: 2;
    flex: 1 0 100%;
    padding: 13px 18px;
    font-size: 0.9rem;
  }
  .nav-cta .lang-switch {
    order: 3;
  }
  .nav-cta .btn-ghost {
    order: 4;
    margin-left: auto;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .tier-row {
    grid-template-columns: 48px 1fr;
  }
  .tier-label {
    font-size: 1.5rem;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .hero-stat {
    min-width: 0;
    border-right: none;
    padding: 12px 8px 12px 0;
  }
}

@media (max-width: 600px) {
  section {
    padding: 36px 0;
  }
  .grid {
    gap: 16px;
  }
  .section-head {
    margin-bottom: 20px;
  }
  .hero-actions {
    gap: 16px;
  }
  .btn-sm {
    padding: 9px 14px;
  }
  .filterbar {
    gap: 2px;
    margin-bottom: 24px;
    padding-bottom: 14px;
  }
  .chip {
    padding: 12px 14px;
  }
  .search-input {
    width: 100%;
    min-width: 0;
    margin: 14px 0 0;
    padding: 11px 14px;
  }
  .comp-card {
    gap: 14px;
    padding: 18px;
  }
  .comp-card .top {
    gap: 12px;
  }
  .comp-author {
    margin-top: 6px;
    font-size: 0.75rem;
  }
  .comp-traits {
    gap: 8px;
  }
  .trait-chip {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .builder-layout {
    gap: 20px;
  }
  .site-footer {
    padding: 28px 0;
  }
}

@media (max-width: 480px) {
  .aug-slot {
    width: 48px;
    height: 48px;
  }
  .brand .set-tag {
    display: none;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .comp-card .title {
    font-size: 1rem;
  }
}
.comp-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.comp-card-wrap > .card {
  flex: 1;
}

.pin-btn,
.pin-flag,
.comp-card-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1;
}
.pin-btn,
.pin-flag {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
}
.pin-btn,
.comp-card-tools button {
  cursor: pointer;
  transition: border-color 0.15s;
}
.pin-btn:hover,
.comp-card-tools button:hover {
  border-color: var(--text-dim);
}
.pin-ico {
  filter: grayscale(1);
  opacity: 0.55;
}
.pin-btn.active,
.pin-flag {
  border-color: var(--accent-2);
  background: rgba(232, 178, 63, 0.16);
}
.pin-btn.active .pin-ico,
.pin-flag .pin-ico {
  filter: none;
  opacity: 1;
}
.delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1;
  position: absolute;
  top: -6px;
  left: -6px;
  z-index: 2;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.delete-btn:hover {
  border-color: #5c2b28;
  color: #e2857f;
}

.comp-card-wrap.reorder {
  cursor: grab;
  user-select: none;
}
.comp-card-wrap.reorder > .card {
  border-style: dashed;
}
.comp-card-wrap.reorder.dragging {
  opacity: 0.4;
}
.comp-card-wrap.reorder.drag-over > .card {
  border-color: var(--accent);
}
.comp-card-tools {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  display: flex;
  gap: 4px;
}
.comp-card-tools button {
  font-size: 1rem;
  padding-bottom: 2px;
}

.order-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
}
.order-hint {
  flex: 1 1 260px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filterbar.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pill.rar-silver {
  border-color: var(--trait-silver);
}
.pill.rar-gold {
  border-color: var(--accent-2);
}
.pill.rar-prismatic {
  border-color: transparent;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(120deg, #7fd4ff, #c78bff, #ff8fd0, #ffd27f) border-box;
}

.nav-links a.nav-off {
  opacity: 0.55;
}

.patch-wrap {
  max-width: 760px;
}
.patch-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.patch-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px dashed var(--accent-dim);
  border-radius: var(--radius);
}
.patch-card {
  padding: 24px 26px;
}
.patch-title {
  margin: 0 0 14px;
  font-size: 1.6rem;
}
.patch-body p {
  margin: 0 0 14px;
  line-height: 1.65;
}
.patch-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.patch-meta {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.patch-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.patch-form h3 {
  margin: 0;
}
.patch-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
}
.patch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.board-title-input {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 360px;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 0;
}
.board-title-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.board-title-input::placeholder {
  color: var(--text-faint);
}
