@font-face {
  font-family: 'Morgath';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/Morgath-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Lenia Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/LeniaSans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Lenia Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/LeniaSans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Lenia Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/LeniaSans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Lenia Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/LeniaSans-700.woff2') format('woff2');
}

:root {
  --bg: #050608;
  --panel: rgba(10, 12, 16, 0.84);
  --panel-solid: #0b0d12;
  --line: rgba(235, 224, 200, 0.13);
  --line-strong: rgba(214, 174, 99, 0.48);
  --gold: #d6ae63;
  --gold-bright: #ecd092;
  --green: #58c98e;
  --text: #f3efe6;
  --muted: #939087;
  --dim: #66645e;
  --font-display: 'Morgath', Georgia, serif;
  --font-ui: 'Lenia Sans', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  border-radius: 0; /* XT44: strictly zero pill buttons or rounded capsules */
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#stageCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

button {
  font-family: var(--font-ui);
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* SCREEN VISIBILITY */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

body[data-screen="menu"] .screen-menu,
body[data-screen="select"] .screen-select,
body[data-screen="customize"] .screen-customize {
  opacity: 1;
  visibility: visible;
}

body[data-screen="menu"] .top-bar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* =========================================================
   SCREEN 0: MAIN MENU (Absolum / Duelyst / Destiny 2 inspired)
   ========================================================= */
.screen-menu {
  display: flex;
  align-items: center;
  padding-left: clamp(56px, 6.8vw, 136px);
  background: linear-gradient(90deg, rgba(5, 6, 8, 0.90) 0%, rgba(5, 6, 8, 0.62) 34%, rgba(5, 6, 8, 0.0) 64%);
}

.menu-rail {
  pointer-events: auto;
  width: clamp(320px, 28vw, 440px);
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--gold);
  margin-bottom: 12px;
}

.menu-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.2vw, 52px);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.08;
  color: #ffffff;
}

.gold-rule {
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin-top: 20px;
}
.gold-rule.short {
  width: 44px;
  margin-top: 14px;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.menu-item {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
  color: var(--muted);
  transition: color 0.16s ease, transform 0.16s ease;
}

.menu-bar {
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.18s ease;
}

.menu-label {
  font-size: clamp(18px, 1.35vw, 22px);
  font-weight: 600;
  letter-spacing: 0.18em;
}

.menu-item.is-primary {
  color: var(--text);
}
.menu-item.is-primary .menu-bar {
  width: 28px;
}
.menu-item:hover {
  color: #ffffff;
}
.menu-item:hover .menu-bar {
  width: 28px;
}
.menu-item.is-primary:hover {
  color: var(--gold-bright);
}

.menu-foot {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-profile-line {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
}

.menu-status-line {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* =========================================================
   SHARED TOP HEADER BAR (56px, single clean baseline)
   ========================================================= */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 clamp(24px, 3vw, 48px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: linear-gradient(180deg, rgba(5, 6, 8, 0.94) 0%, rgba(5, 6, 8, 0.72) 75%, rgba(5, 6, 8, 0.0) 100%);
  border-bottom: 1px solid var(--line);
  z-index: 30;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
}

.screen-heading {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.05vw, 18px);
  letter-spacing: 0.18em;
  color: var(--text);
  white-space: nowrap;
}

.top-tabs {
  display: flex;
  align-items: center;
  gap: clamp(24px, 2.8vw, 44px);
}

.tab-word {
  position: relative;
  padding: 18px 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.tab-word::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  transition: background 0.15s ease;
}

.tab-word:hover {
  color: var(--text);
}

.tab-word.is-active {
  color: var(--gold-bright);
}

.tab-word.is-active::after {
  background: var(--gold);
}

.top-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
}

.layout-switcher {
  display: flex;
  align-items: center;
  gap: 16px;
}

body:not([data-screen="select"]) .layout-switcher {
  display: none;
}

.layout-word {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--dim);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.layout-word:hover {
  color: var(--text);
}

.layout-word.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.icon-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.icon-word:hover {
  color: var(--gold-bright);
}

/* SHARED ARCHITECTURAL UNDERLINED WORD ACTIONS (XT44) */
.word-action {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid rgba(243, 239, 230, 0.34);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.word-action:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

.word-action.subtle {
  color: var(--muted);
  border-bottom-color: transparent;
}

.word-action.subtle:hover {
  color: var(--text);
  border-bottom-color: rgba(243, 239, 230, 0.38);
}

.word-action.is-gold {
  color: var(--gold-bright);
  border-bottom: 2px solid var(--gold);
}

.word-action.is-disabled {
  color: var(--dim);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  cursor: default;
}

.start-action {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.20em;
  color: var(--gold-bright);
  padding: 12px 4px;
  border-top: 1px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, letter-spacing 0.18s ease;
}

.start-action:hover {
  color: #ffffff;
  border-top-color: #ffffff;
  border-bottom-color: var(--gold-bright);
}

/* =========================================================
   SCREEN 1: CHARACTER SELECT (LAYOUTS A, B, C)
   ========================================================= */
/* Layout C: Three Witchfire-inspired Monolith Bays */
.monolith-grid {
  display: none;
  position: fixed;
  top: 84px;
  bottom: 128px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1600px, 78vw);
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  pointer-events: none;
}

body[data-select-layout="monoliths"] .monolith-grid {
  display: grid;
}

.monolith-bay {
  border-left: 1px solid rgba(214, 174, 99, 0.16);
  border-right: 1px solid rgba(214, 174, 99, 0.16);
  border-top: 1px solid rgba(214, 174, 99, 0.22);
  border-bottom: 1px solid rgba(214, 174, 99, 0.28);
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.28) 0%, rgba(11, 13, 18, 0.04) 50%, rgba(5, 6, 8, 0.42) 100%);
}

.monolith-bay.is-center {
  border-color: rgba(214, 174, 99, 0.46);
  background: linear-gradient(180deg, rgba(214, 174, 99, 0.05) 0%, rgba(11, 13, 18, 0.02) 55%, rgba(5, 6, 8, 0.45) 100%);
}

/* Layout B: Left Command Rail (Apex / Diablo IV inspired) */
.command-rail {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 316px;
  padding: 32px 28px 32px;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.92) 0%, rgba(7, 8, 12, 0.96) 100%);
  border-right: 1px solid var(--line);
  pointer-events: auto;
  flex-direction: column;
  gap: 24px;
}

body[data-select-layout="rail"] .command-rail {
  display: flex;
}

body[data-select-layout="rail"] .select-footer {
  display: none;
}

.rail-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.rail-roster {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-player {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(15, 18, 25, 0.65);
  text-align: left;
  transition: border-color 0.15s ease;
}

.rail-player:hover {
  border-color: rgba(214, 174, 99, 0.4);
}

.rail-player.is-me {
  border-color: var(--gold);
  background: rgba(214, 174, 99, 0.06);
}

.rail-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  background: #0c0e13;
  border: 1px solid var(--line);
}

.rail-name {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.14em;
  color: #fff;
}

.rail-skin {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.rail-state {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.rail-state.is-ready {
  color: var(--green);
  border-bottom-color: var(--green);
}

.rail-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rail-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rail-footer .start-action {
  width: 100%;
  text-align: center;
}

/* Layouts A & C: Single-Baseline Bottom Footer (XT38: zero overlap with hero shoes) */
.select-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 112px;
  padding: 0 clamp(28px, 3.6vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  background: linear-gradient(180deg, rgba(5, 6, 8, 0.0) 0%, rgba(5, 6, 8, 0.88) 32%, rgba(5, 6, 8, 0.98) 100%);
  border-top: 1px solid var(--line);
  pointer-events: auto;
}

.seat-strip {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, clamp(185px, 16vw, 260px));
  gap: clamp(24px, 3.2vw, 56px);
  align-items: center;
}

.seat-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 8px 14px;
  border-left: 2px solid var(--line);
  text-align: left;
  transition: border-color 0.15s ease;
}

.seat-col:hover {
  border-left-color: rgba(214, 174, 99, 0.6);
}

.seat-col.is-me {
  border-left-color: var(--gold);
}

.seat-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.seat-name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: #fff;
}

.seat-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.seat-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seat-skin {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.seat-ready-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.seat-ready-btn.is-ready {
  color: var(--green);
  border-bottom-color: var(--green);
}

.footer-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* =========================================================
   SCREEN 2: UNIFIED CUSTOMIZE TAB (XT110)
   ========================================================= */
.subtab-bar {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  background: rgba(6, 7, 10, 0.78);
  border-bottom: 1px solid var(--line);
  pointer-events: auto;
  z-index: 25;
}

.subtab-word {
  position: relative;
  height: 46px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.15s ease;
}

.subtab-word::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.subtab-word:hover {
  color: var(--text);
}

.subtab-word.is-active {
  color: var(--gold-bright);
}

.subtab-word.is-active::after {
  background: var(--gold);
}

.customize-pane {
  display: none;
  position: fixed;
  inset: 106px 0 0 0;
  pointer-events: none;
}

body[data-customize-tab="skins"] .pane-skins,
body[data-customize-tab="sleeves"] .pane-sleeves {
  display: block;
}

/* SKINS PANE */
.skins-left {
  position: absolute;
  top: 52px;
  left: clamp(32px, 4vw, 72px);
  width: 210px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.player-switch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.player-switch-btn {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.player-switch-btn:hover {
  color: var(--text);
}

.player-switch-btn.is-active {
  color: var(--gold-bright);
  border-left-color: var(--gold);
}

.thin-sep {
  width: 140px;
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 184px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
}

.toggle-line:hover {
  border-bottom-color: var(--gold);
}

.toggle-state {
  color: var(--muted);
}

.toggle-line[aria-pressed="true"] .toggle-state {
  color: var(--gold-bright);
}

.skins-count {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.skins-right {
  position: absolute;
  top: 52px;
  right: clamp(32px, 4vw, 72px);
  width: 240px;
  text-align: right;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.skin-hero-name {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #fff;
  text-transform: uppercase;
}

.skin-equip-row {
  margin-top: 22px;
}

.filmstrip-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px clamp(28px, 3.6vw, 56px) 22px;
  background: linear-gradient(180deg, rgba(5, 6, 8, 0.0) 0%, rgba(5, 6, 8, 0.90) 28%, rgba(5, 6, 8, 0.98) 100%);
  border-top: 1px solid var(--line);
  pointer-events: auto;
}

.filmstrip-track {
  display: flex;
  justify-content: center;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 174, 99, 0.35) transparent;
}

.skin-tile {
  position: relative;
  flex: 0 0 112px;
  height: 132px;
  background: #0d1016;
  border: 1px solid var(--line);
  border-top: 2px solid transparent;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.skin-tile:hover {
  border-color: rgba(214, 174, 99, 0.55);
  transform: translateY(-2px);
}

.skin-tile.is-active {
  border-color: var(--gold);
  border-top: 2px solid var(--gold-bright);
}

.skin-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skin-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 6px 6px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 6, 8, 0.92) 72%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mystery-tile-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #11141c 0%, #090b0f 100%);
}

.mystery-num {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.mystery-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

/* DECKS & SLEEVES PANE (SINGLE CARD LEFT + LOCKED VAULT RIGHT, XT110) */
.sleeve-stage-meta {
  position: absolute;
  top: 52px;
  left: clamp(32px, 4vw, 72px);
  width: 280px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sleeve-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #fff;
  text-transform: uppercase;
}

.sleeve-finish {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.sleeve-stage-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.drag-note {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.sleeve-vault {
  position: absolute;
  top: 50%;
  right: clamp(32px, 4.6vw, 88px);
  transform: translateY(-50%);
  width: min(500px, 40vw);
  padding: 24px 26px;
  background: rgba(9, 11, 15, 0.88);
  border: 1px solid var(--line);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vault-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.vault-count {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.sleeve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  flex: 1;
  align-content: start;
}

.sleeve-slot {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border: 1px solid var(--line);
  background: #0e1015;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

.sleeve-slot:hover {
  border-color: rgba(214, 174, 99, 0.55);
}

.sleeve-slot.is-selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.sleeve-slot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sleeve-swatch {
  position: absolute;
  inset: 0;
}

.sleeve-lock-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(235, 224, 200, 0.82);
}

.sleeve-lock-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.sleeve-slot-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 12px 6px 6px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 6, 8, 0.92) 72%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

/* =========================================================
   MODALS & TOAST
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 6, 0.78);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-box {
  width: min(520px, 90vw);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-box.wide {
  width: min(760px, 92vw);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: #fff;
}

.invite-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 8px;
}

.invite-url {
  padding: 12px 14px;
  background: #06070a;
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
  user-select: text;
}

.modal-actions {
  display: flex;
  gap: 28px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.setting-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text);
  min-width: 170px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.flow-step {
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.flow-step.is-done {
  color: var(--green);
  border-color: rgba(88, 201, 142, 0.45);
}

.flow-step.is-current {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.flow-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  background: rgba(11, 13, 18, 0.94);
  border-bottom: 2px solid var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.toast.is-show {
  opacity: 1;
}
