/* ============================================================
   MM2KING — design system
   Flat, static, high-contrast. No gradients, no blurs, no glow.
   Palette: near-black surfaces + a single gold accent.
   ============================================================ */

:root {
  --bg: #0c0c0e;
  --bg-secondary: #141417;
  --surface: #17181b;
  --surface-2: #1d1e22;
  --surface-border: #2a2b30;
  --border-strong: #3a3c43;

  --text: #f2f3f5;
  --text-muted: #969ba3;

  --accent: #e3b23c;
  --accent-hover: #f0c352;
  --accent-ink: #1a1505;
  --accent-soft: rgba(227, 178, 60, 0.10);
  --accent-line: rgba(227, 178, 60, 0.38);
  --accent-glow: transparent; /* kept for compatibility — no glow used */

  --btn-bg: #1d1e22;
  --btn-border: #33353c;

  --red: #e5484d;
  --green: #3fb950;
  --green-yellow: #b5cc18;
  --yellow: #d3a03a;
  --yellow-red: #e8794a;
  --popular-yellow: #e3b23c;
  --star-color: #e3b23c;
  --warn-red: #ff6b6b;

  --toast-bg: #1c1d21;
  --nav-bg: #141417;
  --tube-bg: #141417;
  --tube-hover: #1c1d21;
  --modal-bg: #17181b;

  --radius: 12px;
  --radius-sm: 8px;
  --transition-speed: 0s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; overflow-x: hidden; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: 'Archivo', 'Inter', sans-serif; }

img, svg { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2f3138; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3c3f47; }

.hidden { display: none !important; }

/* ---------------- brand ---------------- */
.brand-area {
  position: fixed;
  top: 0.9rem;
  left: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-logo { height: 30px; width: auto; }
.brand-text {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---------------- nav ---------------- */
.navbar {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 4px;
}
.nav-tabs { display: flex; gap: 2px; justify-content: center; }
.nav-tab {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0.5rem 0.95rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: #1f2025; }
.nav-tab.active { color: var(--accent-ink); background: var(--accent); font-weight: 700; }
.navbar.nav-hide {
  transform: translateX(-50%) translateY(-170%);
  opacity: 0;
  pointer-events: none;
}

.nav-ghost {
  position: fixed;
  top: 0.6rem;
  left: 50%;
  transform: translateX(-50%) translateY(-18px);
  width: 52px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  cursor: pointer;
  z-index: 950;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-ghost.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-ver {
  position: fixed;
  right: 0.6rem;
  bottom: 0.5rem;
  z-index: 4000;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

/* ---------------- layout ---------------- */
.main-content {
  position: relative;
  z-index: 1;
  padding: 5.5rem 1.5rem 3rem;
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 769px) {
  .main-content:has(#tab-values.active) { max-width: 1440px; }
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1rem 1rem 1.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ---------------- home ---------------- */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.2rem 1rem 0.4rem;
  gap: 0.7rem;
}
.home-logo { width: min(560px, 86vw); height: auto; }
.home-tag {
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}
.home-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  max-width: 900px;
  margin: 2.4rem auto 0;
  padding: 0 0.5rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.3rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.feature-card:hover { border-color: var(--accent-line); }
.feature-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.swap-logo { gap: 6px; }
.fl-side { width: 34px; height: 34px; object-fit: contain; }
.fl-arrow { font-size: 1.1rem; color: var(--accent); }
.fl-img { width: 54px; height: 54px; object-fit: contain; }
.fl-emoji { font-size: 2.4rem; line-height: 1; }
.feature-title {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.feature-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.35rem;
}

/* ---------------- servers ---------------- */
.servers-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.servers-title {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  color: var(--text);
}
.servers-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 820px;
  margin: 0 auto;
}

.continent-tube {
  background: var(--tube-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.continent-tube:hover { background: var(--tube-hover); }
.continent-tube.expanded { border-color: var(--accent-line); }

.tube-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  user-select: none;
}
.tube-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.92rem; }
.tube-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.continent-tube.expanded .tube-arrow { transform: rotate(180deg); }

.tube-body { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.continent-tube.expanded .tube-body { max-height: 1600px; }

.tube-stats-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-border);
}
.tube-stats-bar img { width: 16px; height: 16px; opacity: 0.7; }

.server-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid var(--surface-border);
  position: relative;
}
.server-row:hover { background: #1a1b1f; }
.server-flag-img { width: 24px; height: auto; border-radius: 2px; flex-shrink: 0; }
.server-name { flex: 1; font-size: 0.84rem; font-weight: 600; }
.server-name .city { color: var(--text-muted); font-weight: 500; font-size: 0.76rem; }

.popular-tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 0.45rem;
  vertical-align: middle;
}

.ping-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 18px;
  flex-shrink: 0;
}
.ping-bar { width: 4px; border-radius: 2px; background: #33353c; }
.ping-bar:nth-child(1) { height: 6px; }
.ping-bar:nth-child(2) { height: 9px; }
.ping-bar:nth-child(3) { height: 12px; }
.ping-bar:nth-child(4) { height: 15px; }
.ping-bar:nth-child(5) { height: 18px; }
.ping-ms {
  font-size: 0.74rem;
  color: var(--text-muted);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.loading-ms { color: #5a5d64; }
.ms-dot { color: inherit; }

/* ---------------- buttons ---------------- */
.btn-primary {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 0.72rem 1.8rem;
  border-radius: 9px;
  font-size: 0.96rem;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-join {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-join:hover { background: var(--accent-soft); }
.btn-join:disabled { opacity: 0.45; cursor: not-allowed; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ---------------- values ---------------- */
.values-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  max-width: 1080px;
  margin: 0 auto;
}
.values-main { flex: 1 1 0; min-width: 0; }
.values-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.values-title {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.values-search { flex: 1 1 180px; max-width: 300px; }
.values-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.vf-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.vf-btn:hover { color: var(--text); border-color: var(--border-strong); }
.vf-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}
.values-grid { overflow: visible; }

.selector-cell {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.4rem;
  font-family: inherit;
}
.selector-cell:hover { border-color: var(--border-strong); }
.selector-cell img { width: 72px; height: 72px; object-fit: contain; }
.cell-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  min-height: 1.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}
.cell-value { font-size: 0.78rem; font-weight: 800; color: var(--accent); }
.selector-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.tier-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding: 0.2rem 0.1rem;
}
.tier-header:first-child { margin-top: 0; }
.tier-name {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--text);
  text-transform: uppercase;
}
.tier-count {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.selector-cell.cat-godly { border-color: rgba(228, 120, 190, 0.40); }
.selector-cell.cat-godly .cell-name { color: #e88fc8; }
.selector-cell.cat-chroma { border-color: rgba(190, 120, 228, 0.45); }
.selector-cell.cat-chroma .cell-name { color: #c79bf0; }
.selector-cell.cat-ancient { border-color: rgba(150, 120, 235, 0.45); }
.selector-cell.cat-ancient .cell-name { color: #b3a0f0; }
.selector-cell.cat-unique { border-color: rgba(230, 160, 60, 0.50); }
.selector-cell.cat-unique .cell-name { color: #f0b24a; }

.v-cell { position: relative; }
.v-value { font-size: 0.82rem; font-weight: 800; color: var(--accent); }
.v-stats { font-size: 0.6rem; color: var(--text-muted); }
.v-stab { font-size: 0.56rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.45rem; margin-top: 0.1rem; background: var(--surface-2); }
.stab-stable { color: #86efac; background: rgba(63, 185, 80, 0.14); }
.stab-overpaid { color: #93c5fd; background: rgba(59, 130, 246, 0.14); }
.stab-underpaid { color: #fdba74; background: rgba(232, 121, 74, 0.16); }
.stab-peaking { color: #f9a8d4; background: rgba(228, 120, 190, 0.16); }
.stab-doing { color: #5eead4; background: rgba(20, 184, 166, 0.16); }
.stab-fluctuating { color: #fde047; background: rgba(211, 160, 58, 0.16); }
.stab-na { color: #9aa0a8; background: rgba(148, 163, 184, 0.14); }

.v-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 4px;
  padding: 0.1rem 0.32rem;
  z-index: 2;
}
.tag-chroma { color: #fff; background: #a24bd8; }
.tag-ancient { color: #e4daff; background: #4c2a9e; }
.tag-unique { color: #1a1206; background: #e0a12c; }
.tag-legendary { color: #fff; background: #7c3aed; }
.tag-rare { color: #fff; background: #2563eb; }
.tag-uncommon { color: #fff; background: #16a34a; }
.tag-common { color: #fff; background: #6b7280; }
.tag-vintage { color: #fff; background: #b45309; }
.tag-trophy { color: #1a1206; background: #f0b429; }

.v-stepper { display: flex; align-items: center; gap: 0.25rem; margin-top: 0.2rem; }
.v-minus, .v-plus {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.v-minus:hover { background: var(--red); color: #fff; }
.v-plus:hover { background: var(--accent); color: var(--accent-ink); }
.v-qty { font-size: 0.68rem; font-weight: 800; color: var(--text); min-width: 20px; text-align: center; }
.v-qty-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
}
.selector-cell.no-stock img { opacity: 0.45; }
.selector-cell.no-stock .cell-name,
.selector-cell.no-stock .cell-value { opacity: 0.6; }
.no-stock-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(200, 40, 40, 0.72);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  z-index: 2;
  pointer-events: none;
}
.btn-selector-sort {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn-selector-sort:hover { border-color: var(--border-strong); }
.btn-values-more {
  display: block;
  margin: 18px auto 4px;
  padding: 11px 26px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
}
.btn-values-more:hover { background: var(--accent-soft); }
.btn-toggle-calc { flex: 0 0 auto; padding: 0.55rem 0.9rem; font-size: 0.8rem; }

/* ---------------- inventory calc ---------------- */
.calc-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.calc-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.calc-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: 0.06em; }
.calc-drag-hint { font-size: 0.56rem; color: var(--text-muted); opacity: 0.6; user-select: none; margin-left: auto; }
.calc-actions { display: flex; align-items: center; gap: 0.35rem; }
.calc-clear {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 0.25rem 0.6rem;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.calc-clear:hover { background: var(--red); color: #fff; }
.calc-close {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-muted);
  border-radius: 7px;
  width: 24px;
  height: 24px;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.calc-close:hover { background: var(--red); color: #fff; }
.calc-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 52vh; overflow-y: auto; }
.calc-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.4rem; background: var(--bg); border: 1px solid var(--surface-border); border-radius: 8px; }
.calc-row img { width: 26px; height: 26px; object-fit: contain; }
.calc-name { flex: 1 1 0; min-width: 0; font-size: 0.7rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-sub { font-size: 0.7rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.calc-empty { font-size: 0.72rem; color: var(--text-muted); text-align: center; padding: 0.9rem 0; }
.calc-total {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.calc-total strong { color: var(--accent); font-size: 1rem; }
.calc-panel.hidden { display: none; }

/* ---------------- swap ---------------- */
.swap-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.swap-heading {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
}
.swap-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; max-width: 520px; margin: 0 auto; }

.swap-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
}
.swap-panel {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1rem;
}
.swap-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.9rem; }
.swap-panel-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.05em; color: var(--text); }
.swap-total { font-weight: 800; font-size: 1.05rem; color: var(--text-muted); white-space: nowrap; }
.swap-total.ok { color: var(--green); }

.swap-slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.swap-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px dashed var(--btn-border);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.45rem;
  overflow: hidden;
  font-family: inherit;
}
.swap-slot:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.swap-slot .slot-plus { font-size: 1.6rem; font-weight: 400; color: var(--text-muted); line-height: 1; }
.swap-slot.empty:hover .slot-plus { color: var(--accent); }
.swap-slot.filled { border-style: solid; border-color: var(--accent-line); background: var(--surface-2); }
.swap-slot.filled img { width: 48%; height: 48%; object-fit: contain; }
.slot-name { font-size: 0.68rem; font-weight: 600; color: var(--text); text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-value { font-size: 0.74rem; font-weight: 800; color: var(--accent); }

.swap-trade { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem; min-width: 120px; }
.swap-arrows { font-size: 2rem; line-height: 1; color: var(--accent); }
.btn-swap { width: 100%; padding: 0.8rem 1.3rem; font-size: 0.95rem; letter-spacing: 0.1em; }
.btn-swap.ready { border: 1px solid var(--accent); }
.swap-remove-hint, .swap-hint { font-size: 0.66rem; color: var(--text-muted); text-align: center; max-width: 140px; line-height: 1.4; }

.slot-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.slot-x:hover { background: var(--red); color: #fff; border-color: transparent; }
.slot-stepper { position: absolute; top: 3px; left: 3px; display: flex; align-items: center; gap: 3px; z-index: 2; }
.slot-stepper .slot-minus,
.slot-stepper .slot-plus {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--surface-border);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.slot-stepper .slot-minus:hover { background: var(--red); color: #fff; }
.slot-stepper .slot-plus:hover { background: var(--accent); color: var(--accent-ink); }
.slot-qty {
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 0.02rem 0.35rem;
  line-height: 1.25;
  text-align: center;
}
.swap-bot-img { max-width: 150px; }

/* ---------------- selector modal ---------------- */
.selector-window { max-width: none; width: min(880px, 94vw); max-height: 86vh; min-height: 0; display: flex; flex-direction: column; text-align: left; }
.selector-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0 0.8rem;
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--modal-bg);
}
.selector-title { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.3rem; letter-spacing: 0.03em; flex: 1; min-width: 0; }
.selector-search {
  flex: 0 1 240px;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.selector-search:focus { border-color: var(--accent-line); }
.selector-search::placeholder { color: var(--text-muted); }
.selector-close {
  flex: 0 0 auto;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.selector-close:hover { background: var(--red); color: #fff; border-color: transparent; }
.selector-head .selector-search { flex: 1 1 200px; max-width: none; }
.selector-window .selector-grid { flex: 1 1 auto; overflow-y: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#selectorOverlay { align-items: flex-start; }
#selectorOverlay .modal-window { margin: auto; }

/* ---------------- spin ---------------- */
.spins-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 680px; margin: 0 auto; padding: 0 0.5rem; }
.spin-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius); padding: 1.3rem; text-align: center; min-width: 0; }
.spin-preview {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 78px; margin-bottom: 0.9rem; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--surface-border); overflow: hidden; padding: 0 8px;
}
.spin-preview .spin-item { width: 48px; height: 48px; }
.spin-preview .spin-item img { width: 42px; height: 42px; margin-top: 0; }
.spin-card-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.spin-card-desc { font-size: 0.78rem; color: var(--text-muted); margin: 0.4rem 0 0.9rem; line-height: 1.5; }
.spin-cost { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.8rem; }
.spin-cost strong { color: var(--accent); }
.spin-btn { width: 100%; }
.spin-balance {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.3rem;
  padding: 0.28rem 0.8rem; border-radius: 999px; background: var(--btn-bg);
  border: 1px solid var(--btn-border); font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
}
.spin-balance strong { color: var(--accent); font-size: 0.92rem; }
.spin-page { max-width: 560px; margin: 0 auto; text-align: center; padding: 0 1rem; }
.spin-reel {
  position: relative; height: 180px; overflow: hidden; border-radius: var(--radius);
  background: var(--bg-secondary); border: 1px solid var(--surface-border); display: flex; align-items: center;
}
.spin-strip { display: flex; align-items: center; gap: 10px; padding: 0 20px; will-change: transform; transition: transform 2.6s cubic-bezier(0.15, 0.6, 0.2, 1); }
.spin-item { position: relative; flex: 0 0 auto; width: 110px; height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.spin-item img { width: 100px; height: 100px; object-fit: contain; margin-top: 8px; }
.spin-item.win img { outline: 3px solid var(--accent); border-radius: 10px; }
.spin-item-name {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
  font-size: 0.5rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 4px; padding: 1px 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px; margin: 0 auto;
}
.spin-marker { position: absolute; top: 6px; bottom: 6px; left: 50%; width: 3px; transform: translateX(-50%); background: var(--accent); border-radius: 2px; z-index: 3; pointer-events: none; }
.spin-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0.9rem 0 0.4rem; min-height: 1.2em; }
.spin-actions { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.spin-stop { width: 100%; }
.spin-again-btn { width: 100%; }
.spin-code-row { display: flex; gap: 0.5rem; max-width: 460px; margin: 1.4rem auto 0; padding: 0 1rem; }
.spin-code-input { flex: 1 1 auto; }
.spin-code-btn { flex: 0 0 auto; padding: 0.6rem 1.1rem; }
.spin-back {
  background: var(--btn-bg); border: 1px solid var(--btn-border); color: var(--text);
  border-radius: 8px; padding: 0.42rem 0.9rem; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; margin: 0 auto 0.7rem; display: inline-block;
}
.spin-back:hover { border-color: var(--border-strong); }
.spin-window { position: relative; width: min(520px, 94vw); max-width: none; text-align: center; padding-top: 1.6rem; }
.spin-title { margin-bottom: 1rem; }
.spin-preview-img { width: 150px; height: 150px; object-fit: contain; margin: 0 auto 0.9rem; display: block; }
.coin-hud {
  position: fixed; top: 1rem; right: 1rem; z-index: 1300; display: inline-flex; align-items: center;
  gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 999px; background: var(--bg-secondary);
  border: 1px solid var(--surface-border); font-size: 1.1rem; font-weight: 800; color: var(--text);
}
.coin-hud strong { color: var(--accent); font-size: 1.3rem; }

.confetti { position: fixed; top: -10vh; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; z-index: 4000; animation: confettiFall linear forwards; }
@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ---------------- modals ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.62);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
  overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1rem;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-window {
  background: var(--modal-bg); border: 1px solid var(--surface-border); border-radius: 16px;
  padding: 1.8rem; max-width: 420px; width: 90%; text-align: center;
  transform: translateY(-14px) scale(0.98); transition: transform 0.18s ease;
}
.modal-overlay.show .modal-window { transform: none; }
.modal-overlay.closing .modal-window { transform: translateY(8px); opacity: 0; }
body.modal-lock { overflow: hidden; }

.iframe-overlay { z-index: 3000; }
.iframe-window { position: relative; max-width: 1100px; width: 92%; height: 85vh; padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; border-radius: var(--radius); }
.iframe-window iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.iframe-controls { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 10; display: flex; justify-content: space-between; pointer-events: none; }
.btn-iframe-reload, .btn-iframe-close {
  pointer-events: auto; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--btn-border);
  background: var(--surface-2); color: var(--text); font-size: 16px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-iframe-reload:hover, .btn-iframe-close:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------------- join flow ---------------- */
.step-progress { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 1.4rem; }
.step-dot { width: 11px; height: 11px; border-radius: 50%; background: #2a2b30; border: 2px solid #33353c; }
.step-dot.active { background: var(--accent); border-color: var(--accent); }
.step-dot.done { background: var(--green); border-color: var(--green); }
.step-line { width: 40px; height: 2px; background: #2a2b30; }
.step-line.done { background: var(--green); }
.join-step { text-align: center; }
.search-animation { padding: 1.4rem 0; }
.magnifying-glass { color: var(--accent); margin-bottom: 1rem; display: flex; justify-content: center; }
.search-text { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.3rem; }
.dots::after { content: '...'; }
.search-server-name { font-size: 0.84rem; color: var(--text-muted); font-weight: 500; }

.found-header { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.found-check-icon { width: 26px; height: 26px; }
.found-header h3 { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.25rem; }
.found-details { background: var(--bg-secondary); border: 1px solid var(--surface-border); border-radius: 10px; padding: 1rem; margin-bottom: 1.1rem; }
.found-server-name { font-weight: 700; margin-bottom: 0.3rem; }
.found-code { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.found-code strong { color: var(--accent); font-family: 'Archivo', sans-serif; letter-spacing: 0.05em; font-size: 1rem; }
.found-players { display: flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.found-trade { display: flex; align-items: center; justify-content: center; gap: 0.25rem; margin-top: 0.6rem; flex-wrap: wrap; }
.ft-label { font-size: 0.66rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; margin-right: 0.1rem; }
.ft-item { position: relative; display: inline-flex; }
.ft-item img { width: 30px; height: 30px; object-fit: contain; }
.ft-qty { position: absolute; bottom: -3px; right: -3px; font-size: 0.55rem; font-weight: 800; color: #fff; background: rgba(0, 0, 0, 0.7); border: 1px solid var(--surface-border); border-radius: 999px; padding: 0 0.22rem; line-height: 1.2; }
.ft-arrow { color: var(--accent); font-size: 0.9rem; margin: 0 0.15rem; }
.found-claim { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; }
.fc-label { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }
.fc-img { width: 44px; height: 44px; object-fit: contain; }
.btn-join-server { width: 100%; margin-top: 0.4rem; }

.verify-img { max-width: 170px; border-radius: 10px; margin: 0 auto 1rem; display: block; }
.verify-img-bot { max-width: 150px; }
.verify-img-glow { border: 1px solid var(--surface-border); cursor: pointer; }
.verify-img-glow:hover { border-color: var(--accent-line); }
.verify-text { font-size: 0.92rem; margin-bottom: 0.4rem; line-height: 1.5; font-weight: 500; }
.verify-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.1rem; font-weight: 500; }
.red-warning { color: var(--warn-red); font-weight: 700; }
.kick-warnings { display: flex; justify-content: center; gap: 0.6rem; margin: 0.6rem 0; }
.kick-warn-emoji { font-size: 2.8rem; line-height: 1; }
.btn-fill-bar { width: 100%; padding: 0; background: var(--surface-2); border: 1px solid var(--surface-border); border-radius: 10px; overflow: hidden; position: relative; }
.btn-fill-bar.filled { border-color: var(--accent); cursor: pointer; }
.fill-bar-bg { position: absolute; inset: 0; }
.fill-bar-progress { position: absolute; inset: 0; width: 0%; background: var(--accent); border-radius: 10px; transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.btn-label { position: relative; z-index: 1; padding: 0.72rem 2rem; display: inline-block; }
.btn-join-bot { gap: 0.6rem; }
.btn-headshot { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* ---------------- ticket ---------------- */
.ticket-window { position: relative; width: min(420px, 94vw); max-width: none; text-align: center; padding-top: 1.6rem; }
.ticket-logo { width: 150px; height: auto; margin: 0 auto 0.6rem; display: block; }
.ticket-title { margin-bottom: 0.25rem; }
.ticket-loading { color: var(--text-muted); font-size: 0.92rem; margin: 0.9rem 0; min-height: 1.4em; }
.ticket-code-wrap { margin: 1rem 0 1.1rem; }
.ticket-code {
  display: inline-block; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 2rem;
  letter-spacing: 0.08em; color: var(--text); background: var(--bg); border: 1px solid var(--surface-border);
  border-radius: 12px; padding: 0.4rem 1.3rem; margin-bottom: 0.6rem;
}
.ticket-next { width: 100%; }
.ticket-next:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------- svu ---------------- */
.svu-window { position: relative; width: min(430px, 94vw); max-width: none; text-align: center; padding-top: 1.6rem; }
.svu-close { position: absolute; top: 10px; right: 10px; }
.svu-title { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--text); margin-bottom: 0.4rem; }
.svu-sub { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; margin-bottom: 1.1rem; }
.svu-search-row { display: flex; gap: 0.5rem; justify-content: center; }
.svu-input { flex: 1 1 auto; max-width: 280px; text-align: center; }
.svu-search-btn { flex: 0 0 auto; padding: 0.58rem 1.2rem; }
.svu-loading { color: var(--text-muted); font-size: 0.84rem; margin-top: 0.8rem; }
.svu-error { color: var(--red); font-size: 0.84rem; font-weight: 700; margin-top: 0.8rem; min-height: 1.1em; }
.svu-card { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 1.1rem; background: var(--bg-secondary); border: 1px solid var(--surface-border); border-radius: 12px; margin-bottom: 1.1rem; }
.svu-headshot { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.svu-display { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.svu-name { font-size: 0.84rem; color: var(--text-muted); }
.svu-actions { display: flex; gap: 0.6rem; justify-content: center; }
.svu-yes, .svu-no { flex: 0 0 auto; padding: 0.58rem 1.2rem; font-size: 0.88rem; }

/* ---------------- detail ---------------- */
.detail-window { position: relative; width: min(430px, 94vw); max-width: none; text-align: center; padding-top: 1.6rem; }
.detail-close { position: absolute; top: 10px; right: 10px; }
.detail-img { width: 140px; height: 140px; object-fit: contain; margin: 0 auto; display: block; }
.detail-name { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--text); margin-top: 0.5rem; }
.detail-value { display: block; font-size: 1.1rem; font-weight: 800; color: var(--accent); margin: 0.2rem 0 0.9rem; }
.detail-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1.1rem; }
.btn-detail-swap { width: 100%; }

/* ---------------- rate / dev ---------------- */
.modal-rate h3 { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.25rem; margin-bottom: 0.3rem; }
.rate-question { color: var(--text-muted); margin-bottom: 1.2rem; }
.stars-container { display: flex; justify-content: center; gap: 0.4rem; margin-bottom: 1.4rem; }
.star { background: none; border: none; font-size: 2.2rem; color: #33353c; cursor: pointer; line-height: 1; }
.star.active { color: var(--accent); }
.btn-rate-submit { min-width: 120px; }
#devCoinsInput { width: 100%; margin-bottom: 0.9rem; }

/* ---------------- toast ---------------- */
.toast-container { position: fixed; top: 1.4rem; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 0.6rem; pointer-events: none; align-items: center; }
.toast { display: flex; align-items: center; gap: 0.6rem; background: var(--toast-bg); border: 1px solid var(--surface-border); padding: 0.7rem 1.3rem; border-radius: 10px; font-weight: 600; font-size: 0.88rem; pointer-events: auto; }
.toast .toast-icon { width: 28px; height: 28px; flex-shrink: 0; object-fit: contain; }

/* ---------------- image checker ---------------- */
.imgcheck-window { max-width: 720px; width: 92vw; text-align: center; }
.imgcheck-note { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.imgcheck-warn { color: var(--warn-red); font-weight: 800; font-size: 0.84rem; margin: 0.3rem 0; }
#imgCheckFile { margin: 0.6rem auto; display: block; color: var(--text-muted); }
.imgcheck-btn { margin-top: 0.5rem; }
.imgcheck-progress { color: var(--text-muted); font-size: 0.84rem; margin: 0.6rem 0; }
.imgcheck-results { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-height: 46vh; overflow-y: auto; margin-top: 0.8rem; }
.ic-item { position: relative; width: 96px; padding: 8px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 9px; font-size: 0.62rem; }
.ic-item img { width: 60px; height: 60px; object-fit: contain; margin: 0 auto; display: block; }
.ic-item .ic-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-item .ic-val { color: var(--text-muted); }
.ic-item .ic-score { position: absolute; top: 2px; right: 4px; font-size: 0.5rem; color: var(--green); }
.ic-item.ic-unknown .ic-score { color: var(--warn-red); }
.imgcheck-total { margin-top: 0.8rem; font-size: 1.05rem; font-weight: 800; }
.imgcheck-unknown { color: var(--warn-red); font-size: 0.8rem; margin-top: 0.4rem; }

/* ---------------- safari scroll help ---------------- */
.safari-scroll-help { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 2500; }
.ss-btn { width: 54px; height: 54px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--btn-border); color: var(--text); font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ss-btn:active { background: var(--accent); color: var(--accent-ink); }
.ss-hint { writing-mode: vertical-rl; font-size: 0.6rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.1em; }

/* ---------------- click ripple ---------------- */
.ripple { position: fixed; border-radius: 50%; pointer-events: none; z-index: 9999; width: 8px; height: 8px; transform: translate(-50%, -50%) scale(0); animation: rippleOut 0.5s ease-out forwards; background: var(--accent); }
@keyframes rippleOut { to { transform: translate(-50%, -50%) scale(2.4); opacity: 0; } }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .home-features { grid-template-columns: repeat(2, 1fr); }
  .values-layout { flex-direction: column; }
}
@media (min-width: 769px) {
  .calc-panel { position: fixed; right: 1rem; top: 80px; width: 280px; max-height: calc(100vh - 110px); overflow-y: auto; z-index: 100; flex: none; }
  .values-main { padding-right: 300px; }
  .values-layout { max-width: 1440px; }
}
@media (max-width: 768px) {
  .calc-panel { position: fixed; left: 0.7rem; right: 0.7rem; bottom: 0.7rem; top: auto; width: auto; max-height: 40vh; z-index: 1200; margin: 0; }
  .values-main { padding-right: 0; }
}
@media (max-width: 700px) {
  .swap-container { flex-direction: row; gap: 0.45rem; }
  .swap-panel { padding: 0.55rem; border-radius: 10px; }
  .swap-panel-head { flex-direction: column; align-items: flex-start; gap: 0.15rem; margin-bottom: 0.5rem; }
  .swap-panel-title { font-size: 0.8rem; letter-spacing: 0.04em; }
  .swap-total { font-size: 0.75rem; }
  .swap-slots { grid-template-columns: 1fr; gap: 0.4rem; }
  .swap-slot { aspect-ratio: auto; min-height: 60px; padding: 0.35rem; border-radius: 8px; }
  .swap-slot.filled img { width: 30px; height: 30px; }
  .swap-slot .slot-name { font-size: 0.58rem; }
  .swap-slot .slot-value { font-size: 0.64rem; }
  .swap-trade { min-width: 0; width: 46px; gap: 0.5rem; }
  .swap-arrows { font-size: 1.1rem; }
  .btn-swap { padding: 0.5rem 0.15rem; font-size: 0.62rem; letter-spacing: 0.04em; }
  .slot-stepper .slot-minus, .slot-stepper .slot-plus { width: 22px; height: 22px; font-size: 0.9rem; }
}
@media (max-width: 640px) {
  .spins-grid { grid-template-columns: 1fr; max-width: 420px; }
  .home-features { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .feature-card { padding: 1rem 0.7rem; }
  .swap-logo .fl-side { width: 30px; height: 30px; }
  .fl-img { width: 46px; height: 46px; }
  .feature-desc { font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .brand-area { top: 0.55rem; left: 0.7rem; }
  .brand-logo { height: 24px; }
  .navbar { top: 0.55rem; }
  .nav-inner { padding: 3px; border-radius: 9px; }
  .nav-tab { padding: 0.4rem 0.6rem; font-size: 0.74rem; }
  .main-content { padding: 4.2rem 0.8rem 2rem; }
  .home-logo { width: min(400px, 90vw); }
  .home-tag { font-size: 0.9rem; }
  .servers-title { font-size: 1.4rem; }
  .modal-window { padding: 1.4rem; }
  .modal-overlay { padding: 0.6rem; }
  .values-title { font-size: 1.2rem; }
  .values-head { gap: 0.4rem; }
  .spin-reel { height: 150px; }
  .spin-item { width: 92px; height: 112px; }
  .spin-item img { width: 84px; height: 84px; }
  .spin-code-row { flex-direction: column; }
  .spin-code-btn { width: 100%; }
  .svu-headshot { width: 90px; height: 90px; }
  .svu-actions { flex-direction: column; }
  .toast { font-size: 0.78rem; padding: 0.6rem 1rem; }
  .toast .toast-icon { width: 22px; height: 22px; }
  .ft-item img { width: 26px; height: 26px; }
}

/* On small screens the corner wordmark collides with the centered nav —
   the hero already shows the brand, so drop the corner logo. */
@media (max-width: 600px) {
  .brand-area { display: none; }
}
@media (max-width: 400px) {
  .nav-tab { padding: 0.4rem 0.5rem; font-size: 0.7rem; }
}

/* ============================================================
   MM2KING v2 — APP / SIDEBAR LAYOUT
   Left rail on desktop, bottom tab bar on mobile. Reuses the
   flat token system above; only structure + components change.
   ============================================================ */

/* ---- rail shell ---- */
.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 244px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-secondary);
  border-right: 1px solid var(--surface-border);
  padding: 1.1rem 0.85rem;
}
.rail .brand-area { position: static; top: auto; left: auto; padding: 0.35rem 0.5rem 0.2rem; }
.rail .brand-logo { height: 34px; width: auto; }

.navbar { position: static; top: auto; left: auto; transform: none; z-index: auto; transition: none; }
.navbar.nav-hide { transform: none; opacity: 1; pointer-events: auto; }
.nav-inner { display: block; background: transparent; border: none; border-radius: 0; padding: 0; }
.nav-tabs { display: flex; flex-direction: column; gap: 0.2rem; justify-content: flex-start; }
.nav-tab {
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  border-left: 3px solid transparent;
}
.nav-tab:hover { color: var(--text); background: #1b1c21; }
.nav-tab.active {
  color: var(--text);
  background: #1b1c21;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-weight: 700;
}

.rail-foot {
  margin-top: auto;
  padding: 0.7rem 0.7rem 0.2rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.rail-title { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 0.82rem; color: var(--text); letter-spacing: 0.02em; }
.rail-sub { font-size: 0.68rem; color: var(--text-muted); }

.nav-ghost { display: none !important; }

/* ---- content shifts right of the rail ---- */
.main-content { margin-left: 244px; padding: 2.2rem 2rem 3rem; }

/* ---- home: menu list (not a card grid) ---- */
.home-hero { align-items: flex-start; text-align: left; padding: 0.8rem 0.4rem 0.2rem; gap: 0.5rem; }
.home-logo { width: min(440px, 74vw); }
.home-tag { text-align: left; margin: 0; }
.home-menu {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 720px;
  margin: 1.5rem 0 0;
  padding: 0;
}
.feature-card.menu-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feature-card.menu-row:hover { border-color: var(--accent-line); background: var(--surface-2); }
.menu-ic {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--surface-border); border-radius: 9px; background: var(--bg);
}
.menu-ic img { width: 26px; height: 26px; object-fit: contain; }
.menu-ic-sym { font-size: 1.25rem; color: var(--accent); }
.menu-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.menu-tx strong { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text); }
.menu-tx small { font-size: 0.76rem; color: var(--text-muted); }
.menu-arrow { flex: 0 0 auto; color: var(--accent); font-size: 1.05rem; }

/* ---- page headers become app-style top rows ---- */
.servers-head { flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.7rem; }
.swap-header { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; text-align: left; gap: 0.6rem; }
.swap-heading { font-size: 1.55rem; }
.swap-desc { text-align: left; margin: 0; max-width: none; }

/* ---- buttons: squared + uppercase (different from v1 pills) ---- */
.btn-primary {
  border-radius: 6px;
  padding: 0.66rem 1.5rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn-join {
  border-radius: 6px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- mobile: rail becomes a bottom tab bar ---- */
@media (max-width: 860px) {
  .rail {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-top: 1px solid var(--surface-border);
    padding: 0.25rem 0.3rem;
    gap: 0;
    background: var(--bg-secondary);
  }
  .rail .brand-area { display: none; }
  .rail-foot { display: none; }
  .navbar { flex: 1 1 auto; width: 100%; }
  .nav-inner { width: 100%; }
  .nav-tabs { flex-direction: row; justify-content: space-around; gap: 0; width: 100%; }
  .nav-tab {
    flex: 1 1 0;
    text-align: center;
    border-left: none;
    border-top: 3px solid transparent;
    border-radius: 0;
    padding: 0.5rem 0.2rem;
    font-size: 0.72rem;
    background: transparent;
  }
  .nav-tab:hover { background: transparent; color: var(--text); }
  .nav-tab.active {
    border-left: none;
    border-top: 3px solid var(--accent);
    border-radius: 0;
    background: transparent;
    color: var(--accent);
  }
  .main-content { margin-left: 0; max-width: 100%; padding: 1.6rem 1rem 5rem; }
  .home-logo { width: min(400px, 88vw); }
  .site-footer { margin-bottom: 4.6rem; }
  .calc-panel { bottom: 4.6rem !important; }
}




/* ============================================================
   MOTION — animations ported from the wavevalues build
   Each rule targets a class that already exists here, so the
   existing markup + script.js hooks light up with no JS change.
   (No blanket reduced-motion kill — motion always plays.)
   ============================================================ */

/* tab switches slide + fade in */
.tab-content { animation: fadeSlideIn 0.4s ease; }

/* POPULAR badge ring pulse */
.popular-tag { animation: popularPulse 2s ease-in-out infinite; }

/* "123 ms" loading dots */
.ms-dot { animation: msDotPulse 1.2s ease-in-out infinite; }
.ms-dot:nth-child(2) { animation-delay: 0.2s; }
.ms-dot:nth-child(3) { animation-delay: 0.4s; }

/* searching-server magnifier bobs */
.magnifying-glass { animation: searchFloat 1.2s ease-in-out infinite; }

/* animated "..." ellipsis */
.dots::after { animation: dotsAnim 1.4s steps(4, end) infinite; }

/* toasts pop in and out */
.toast {
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
             toastOut 0.35s ease 1.8s forwards;
}

/* swap arrows breathe */
.swap-arrows { animation: swapPulse 2.4s ease-in-out infinite; }

/* invalid trade shakes the swap container (script.js adds .shake) */
.swap-container.shake { animation: swapShake 0.45s ease; }

/* live "N online" dot pulse */
.live-dot { animation: livePulse 1.8s ease-out infinite; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popularPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 178, 60, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(227, 178, 60, 0); }
}
@keyframes msDotPulse {
  0%, 60%, 100% { opacity: 0.2; }
  30%           { opacity: 1; }
}
@keyframes searchFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-10px) rotate(5deg); }
}
@keyframes dotsAnim {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.9); }
}
@keyframes swapPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}
@keyframes swapShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

/* ============================================================
   MOTION v2 — wavevalues-style life on every control.
   Adds transitions + hover/active transforms to every button,
   card and icon control, plus a few ambient loops. (The blanket
   prefers-reduced-motion kill was removed so motion always plays,
   matching the wavevalues build.)
   ============================================================ */

/* shared transition for every interactive control */
.btn-primary, .btn-join, .btn-join-server, .btn-join-bot,
.btn-selector-sort, .btn-values-more, .spin-btn, .spin-back,
.svu-search-btn, .imgcheck-btn, .nav-tab, .vf-btn, .selector-cell,
.selector-close, .detail-close, .svu-close, .calc-clear, .calc-close,
.v-minus, .v-plus, .slot-x, .slot-minus, .slot-plus, .star,
.swap-slot, .ss-btn, .btn-iframe-reload, .btn-iframe-close,
.continent-tube, .server-row, .feature-card, .menu-arrow {
  transition: transform 0.18s ease, background 0.2s ease,
              border-color 0.2s ease, color 0.2s ease,
              box-shadow 0.22s ease, opacity 0.2s ease;
}

/* primary + secondary buttons */
.btn-primary:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 6px 18px rgba(227, 178, 60, 0.22); }
.btn-primary:active { transform: translateY(0) scale(0.96); }
.btn-primary:disabled, .btn-primary:disabled:hover { transform: none; box-shadow: none; }

.btn-join:hover { transform: scale(1.05); }
.btn-join:active { transform: scale(0.97); }
.btn-join:disabled, .btn-join:disabled:hover { transform: none; }

.btn-selector-sort:hover, .btn-values-more:hover, .spin-back:hover, .svu-search-btn:hover, .imgcheck-btn:hover { transform: translateY(-1px); }
.btn-selector-sort:active, .btn-values-more:active, .spin-back:active, .svu-search-btn:active, .imgcheck-btn:active { transform: translateY(0) scale(0.97); }

/* nav + filter pills */
.nav-tab { transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease; }
.nav-tab:hover { transform: translateY(-1px); }
.nav-tab:active { transform: translateY(0) scale(0.97); }
.vf-btn:hover { transform: translateY(-1px); }
.vf-btn:active { transform: scale(0.96); }

/* cards + tiles */
.feature-card:hover, .feature-card.menu-row:hover { transform: translateY(-4px); }
.feature-card:active, .feature-card.menu-row:active { transform: translateY(-1px) scale(0.99); }
.menu-row:hover .menu-arrow { transform: translateX(6px); }
.selector-cell:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.selector-cell:active { transform: translateY(-1px) scale(0.98); }
.continent-tube:hover { transform: translateY(-1px); }

/* swap slots + rating stars */
.swap-slot:hover { transform: scale(1.03); }
.swap-slot:active { transform: scale(0.98); }
.star:hover { transform: scale(1.18); }
.star:active { transform: scale(1.02); }

/* small icon buttons */
.selector-close:hover, .detail-close:hover, .svu-close:hover,
.calc-clear:hover, .calc-close:hover, .v-minus:hover, .v-plus:hover,
.slot-x:hover, .slot-minus:hover, .slot-plus:hover,
.btn-iframe-reload:hover, .btn-iframe-close:hover { transform: scale(1.08); }
.selector-close:active, .detail-close:active, .svu-close:active,
.calc-clear:active, .calc-close:active { transform: scale(0.95); }
.ss-btn:hover { transform: scale(1.07); }
.ss-btn:active { transform: scale(0.9); }

/* inputs */
.selector-search { transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.selector-search:focus { box-shadow: 0 0 0 3px var(--accent-soft); }

/* bouncy modal open (overrides the flatter default) */
.modal-overlay .modal-window {
  transform: translateY(-24px) scale(0.94);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.modal-overlay.show .modal-window { transform: none; }

/* wizard steps fade + slide in */
.join-step, .svu-step { animation: fadeSlideIn 0.35s ease; }

/* ---- ambient loops ---- */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.home-logo { animation: none; }
.rail .brand-logo { animation: none; }

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 178, 60, 0.45); }
  50%      { box-shadow: 0 0 0 10px rgba(227, 178, 60, 0); }
}
.btn-join-server, .spin-btn { animation: ctaPulse 2.4s ease-in-out infinite; }

@keyframes spinPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.spin-preview img { animation: spinPulse 3.2s ease-in-out infinite; }
.spin-card:hover .spin-preview img { animation-duration: 1.4s; }

/* ============================================================
   TOP NAV (all devices) — replaces the v2 left rail / bottom bar
   so the tab buttons sit across the top like the wavevalues build.
   These rules are last in the file, so they win at every width,
   including inside the earlier (max-width:860px) rail media query.
   ============================================================ */

/* un-box the rail so its children can float on the top bar */
.rail { display: contents; }
.rail-foot { display: none; }

/* brand pinned top-left */
.rail .brand-area {
  display: flex;
  position: fixed;
  top: 0.9rem;
  left: 1rem;
  padding: 0;
  z-index: 1000;
}
.rail .brand-logo { height: 32px; }

/* nav pill centered along the top */
.navbar {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  right: auto;
  width: auto;
  transform: translateX(-50%);
  z-index: 950;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.navbar.nav-hide {
  transform: translateX(-50%) translateY(-200%);
  opacity: 0;
  pointer-events: none;
}
.nav-inner {
  display: flex;
  width: auto;
  justify-content: center;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 4px;
}
.nav-tabs {
  display: flex;
  flex-direction: row;
  gap: 2px;
  width: auto;
  justify-content: center;
}
.nav-tab {
  flex: 0 0 auto;
  width: auto;
  text-align: center;
  padding: 0.5rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
}
.nav-tab:hover { color: var(--text); background: var(--btn-bg); }
.nav-tab.active {
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 7px;
  font-weight: 700;
}

/* ---- centered page content (top-nav build) ---- */
.home-hero { align-items: center; text-align: center; }
.home-tag { text-align: center; margin: 0; }
.home-menu { margin: 1.5rem auto 0; }

.servers-head { justify-content: center; }
.swap-header { flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.swap-desc { text-align: center; margin: 0 auto; }

/* ---- godly picker: let the window grow so the grid shows many tiles ---- */
#selectorOverlay .selector-window { max-width: none; width: min(920px, 96vw); }

@media (max-width: 600px) {
  #selectorOverlay .selector-window { width: 96vw; }
  .selector-grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
  .selector-cell img { width: 54px; height: 54px; }
}

/* content spans the full width under the top bar */
.main-content {
  margin: 0 auto;
  max-width: 1080px;
  padding: 5.5rem 1.5rem 3rem;
}

/* restore the scroll-away nav gesture + drop the now-unused bottom spacing */
.nav-ghost { display: block !important; }
.site-footer { margin-bottom: 0; }

/* small screens: drop the corner brand so nothing overlaps the pill */
@media (max-width: 600px) {
  .rail .brand-area { display: flex; }
  .rail .brand-logo { height: 16px; }
  .nav-tab { padding: 0.3rem 0.38rem; font-size: 0.62rem; }
  .main-content { padding: 4.3rem 1rem 2.5rem; }
}

/* calc panel: no bottom bar to clear any more */
@media (min-width: 769px) and (max-width: 860px) { .calc-panel { bottom: auto !important; } }
@media (max-width: 768px) { .calc-panel { bottom: 0.7rem !important; } }
