:root {
  --paper: #e7dcc4;
  --ink: #1e1713;
  --sand: #c2a97f;
  --bronze: #a05f2c;
  --rust: #7f2f16;
  --panel: rgba(43, 31, 23, 0.92);
  --panel-soft: rgba(64, 45, 32, 0.88);
  --line: rgba(255, 220, 176, 0.2);
  --accent: #f2a14b;
  --accent-2: #f6d16f;
  --muted: #c0ad8b;
  --card-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(255, 198, 124, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(15, 10, 7, 0.94), rgba(22, 14, 11, 0.98)),
    #120d0a;
  color: var(--paper);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 173, 93, 0.06), transparent 28%),
    linear-gradient(315deg, rgba(143, 65, 34, 0.08), transparent 36%),
    url("/assets/tf2-classified/wood.jpg") center/cover no-repeat;
  opacity: 0.16;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.pageShell {
  position: relative;
  z-index: 1;
  width: min(1560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 16, 12, 0.84);
  backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.brand__eyebrow {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__title {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.toplinks,
.authArea {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toplinks a,
.steamBtn {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.steamBtn {
  background: linear-gradient(135deg, #ed8e4b, #c45524);
  border-color: rgba(255, 198, 124, 0.5);
  color: #1c120c;
  font-weight: 700;
}

.loadoutPage {
  display: grid;
  gap: 22px;
}

.card,
.heroCard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(43, 31, 23, 0.94), rgba(30, 21, 15, 0.94));
  box-shadow: var(--card-shadow);
}

.heroCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 30px;
}

.heroRibbon,
.sectionLabel,
.badge,
.slotCard__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.heroRibbon,
.sectionLabel {
  color: var(--accent-2);
}

.heroCard h1,
.panelHead h2,
.loginGate h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
  line-height: 1.02;
}

.heroCard p,
.loginGate p,
.browserMeta,
.saveState,
.syncMeta {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.heroMeta {
  min-width: 320px;
  display: grid;
  gap: 18px;
}

.heroIdentity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.heroIdentity.hidden,
.hidden {
  display: none !important;
}

.heroAvatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(255, 209, 111, 0.35);
}

.heroName {
  font-size: 1.08rem;
  font-weight: 700;
}

.heroSteam {
  color: var(--muted);
  font-size: 0.92rem;
}

.heroBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  padding: 10px 12px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
}

.loginGate {
  padding: 26px 28px;
}

.primaryBtn {
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0a04d, #be5620);
  color: #20120a;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(240, 160, 77, 0.25);
}

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

.classRail,
.stage,
.browser {
  padding: 24px;
}

.browserBackdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 7, 5, 0.66);
  backdrop-filter: blur(8px);
}

.panelHead {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.panelHead--wide {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.panelHead h2 {
  font-size: 1.45rem;
}

.panelHead--browser {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 12px;
  background: linear-gradient(180deg, rgba(43, 31, 23, 0.98), rgba(43, 31, 23, 0.88));
}

.stageHint,
.browserSteps {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.stageHint {
  font-size: 0.92rem;
}

.browserSteps {
  display: grid;
  gap: 6px;
}

.browserActions {
  margin-bottom: 14px;
}

.browserSteps span {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.browserSteps p,
.customizer__copy {
  margin: 0;
  line-height: 1.45;
  color: var(--muted);
}

.classGrid {
  display: grid;
  gap: 12px;
}

.classBtn {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.classBtn:hover,
.classBtn.is-active {
  transform: translateY(-1px);
  border-color: rgba(242, 161, 75, 0.5);
  background: rgba(242, 161, 75, 0.1);
}

.classBtn img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.classBtn strong {
  font-size: 0.98rem;
}

.classBtn span {
  color: var(--muted);
  font-size: 0.82rem;
}

.stageCanvas {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 22px;
  align-items: stretch;
}

.stageColumn {
  display: grid;
  gap: 14px;
}

.stageGroup {
  display: grid;
  gap: 12px;
}

.stageGroup__title {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.stageGroup__grid {
  display: grid;
  gap: 14px;
}

.slotCard {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 16px;
  border-radius: 22px;
  border: 2px solid rgba(255, 209, 111, 0.24);
  background: rgba(26, 18, 13, 0.72);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.slotCard::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 99, 0.16), transparent 65%);
}

.slotCard.is-selected {
  border-color: var(--accent-2);
  box-shadow: 0 14px 30px rgba(242, 161, 75, 0.18);
}

.slotCard--ghost {
  border-style: dashed;
  opacity: 0.7;
  cursor: not-allowed;
}

.slotCard__name {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.1;
  max-width: 86%;
}

.slotCard__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.slotCard__thumb {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    rgba(24, 16, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.characterStage {
  position: relative;
  min-height: 640px;
  padding: 22px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(245, 173, 89, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(52, 38, 27, 0.98), rgba(31, 22, 17, 0.98));
  overflow: hidden;
}

.characterBackdrop {
  position: absolute;
  inset: 28px;
  border-radius: 28px;
  border: 1px dashed rgba(255, 232, 196, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 38%),
    radial-gradient(circle at 20% 14%, rgba(255, 195, 118, 0.08), transparent 22%);
}

.characterPortrait {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -44%);
  max-width: min(66%, 420px);
  max-height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.36));
}

.characterLoadout {
  position: relative;
  z-index: 1;
  min-height: 596px;
}

.equippedChips {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.equippedChip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 241, 215, 0.08);
  border: 1px solid rgba(255, 209, 111, 0.16);
  color: var(--paper);
  font-size: 0.88rem;
}

.equippedChip--muted {
  color: var(--muted);
}

.stageFoot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.searchBox {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
}

.searchBox span {
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.searchBox input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

.browser {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 50;
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100vh - 56px);
  transform: translate(-50%, -50%);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

.itemGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.itemTile {
  display: grid;
  grid-template-rows: 108px auto;
  gap: 10px;
  align-content: start;
  padding: 12px;
  min-height: 206px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.itemTile:hover,
.itemTile.is-selected {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 111, 0.44);
  background: rgba(242, 161, 75, 0.08);
}

.itemTile__img {
  width: 100%;
  height: 108px;
  object-fit: contain;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    rgba(24, 16, 12, 0.86);
}

.itemTile__name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}

.itemTile__meta {
  margin-top: 8px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.customizer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.customizer__head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.customizer__head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.secondaryBtn {
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 209, 111, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  font-weight: 700;
  cursor: pointer;
}

.secondaryBtn--compact {
  width: auto;
  margin-top: 0;
  padding: 10px 14px;
  border-radius: 12px;
}

.secondaryBtn--ghost {
  width: 100%;
  margin-top: 0;
}

.secondaryBtn:disabled {
  opacity: 0.55;
  cursor: default;
}

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

.customizerGrid--simple {
  grid-template-columns: 1fr 1fr;
}

.customizerAdvanced {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.83rem;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

.toggleRow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toggle input {
  width: 18px;
  height: 18px;
}

body.browser-open {
  overflow: hidden;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .characterStage {
    min-height: 540px;
  }

  .stageFoot {
    flex-direction: column;
  }

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

  .browser {
    width: min(960px, calc(100vw - 28px));
  }
}

@media (max-width: 820px) {
  .pageShell {
    width: min(100vw - 20px, 100%);
    padding-top: 10px;
  }

  .topbar,
  .heroCard,
  .classRail,
  .stage,
  .browser,
  .loginGate {
    padding: 18px;
    border-radius: 22px;
  }

  .topbar,
  .heroCard {
    flex-direction: column;
    align-items: start;
  }

  .heroMeta {
    min-width: 0;
    width: 100%;
  }

  .panelHead--wide {
    flex-direction: column;
  }

  .characterStage {
    min-height: 460px;
  }

  .browser {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

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