/* ============================================================
   DUNGEON OF ETERNAL MAGIC — visual system
   Dark fantasy · magical · elegant minimal · no greco-roman
   ============================================================ */

/* -- Design tokens (defaults; tweakable via data-theme/data-typo) -- */
:root {
  /* near-black with blue-night undertone */
  --bg-0: #05070d;
  --bg-1: #0a0e17;
  --bg-2: #111623;
  --bg-3: #1a2030;
  --bg-elev: #161b27;

  /* gold (primary accent) */
  --gold: #d4af6a;
  --gold-bright: #f0d28a;
  --gold-dim: #8e7740;
  --gold-glow: rgba(240, 210, 138, 0.35);

  /* magical secondary */
  --cyan: #6de4ff;
  --cyan-dim: #3a8aa6;
  --cyan-glow: rgba(109, 228, 255, 0.35);
  --purple: #b89cff;
  --purple-dim: #6e5ea8;

  /* text */
  --text: #ece6d4;
  --text-soft: #b8b1a0;
  --text-dim: #6f6a5d;
  --text-faint: #4a463c;
  --text-empty: #3a372f; /* for the "0" placeholder when data is missing */

  /* lines / strokes */
  --line: rgba(212, 175, 106, 0.14);
  --line-strong: rgba(212, 175, 106, 0.28);
  --line-cool: rgba(109, 228, 255, 0.18);
  --line-soft: rgba(255, 255, 255, 0.06);

  /* danger / success */
  --danger: #e26b6b;
  --success: #6ed09a;

  /* rarity */
  --r-common: #9a9690;
  --r-uncommon: #5ce39a;
  --r-rare: #6db8ff;
  --r-epic: #c084ff;
  --r-legendary: #f0c060;
  --r-mythic: #ff7fb4;

  /* radii / sizing */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --slot: 64px;

  /* typography (default: serif elegant) */
  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* density */
  --pad-cell-y: 14px;
  --pad-cell-x: 16px;

  /* animation tier */
  --anim-mult: 1; /* 0 = off, 0.6 = subtle, 1.2 = dramatic */
}

/* theme variants */
[data-theme="cyan"] {
  --gold: #6de4ff;
  --gold-bright: #b8f3ff;
  --gold-dim: #3a8aa6;
  --gold-glow: rgba(109, 228, 255, 0.35);
  --line: rgba(109, 228, 255, 0.16);
  --line-strong: rgba(109, 228, 255, 0.34);
}
[data-theme="purple"] {
  --gold: #b89cff;
  --gold-bright: #dccfff;
  --gold-dim: #6e5ea8;
  --gold-glow: rgba(184, 156, 255, 0.40);
  --line: rgba(184, 156, 255, 0.16);
  --line-strong: rgba(184, 156, 255, 0.34);
}

/* typography variants */
[data-typo="sans"] {
  --font-display: "Outfit", "Inter", ui-sans-serif, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* density variants */
[data-density="compact"] {
  --pad-cell-y: 8px;
  --pad-cell-x: 12px;
  --slot: 56px;
}
[data-density="comfortable"] {
  --pad-cell-y: 18px;
  --pad-cell-x: 22px;
  --slot: 72px;
}

/* animation variants */
[data-anim="off"]      { --anim-mult: 0; }
[data-anim="subtle"]   { --anim-mult: 0.7; }
[data-anim="dramatic"] { --anim-mult: 1.4; }

/* -- Reset + base -- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: default;
}

/* El cursor "I" (text caret) por defecto sobre cualquier párrafo o texto se
   sustituye por la flecha estándar. La selección de texto (copiar/pegar)
   sigue funcionando: eso depende de user-select, no de cursor. */
*, *::before, *::after { cursor: default; caret-color: transparent; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button, [role="button"], label[for], summary { font-family: inherit; cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
input, textarea, select, [contenteditable="true"] { font-family: inherit; color: inherit; cursor: text; caret-color: auto; }
select { cursor: pointer; }

::selection { background: var(--gold-glow); color: var(--text); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* -- Layered background: starfield + arcane circles + vignette -- */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(184, 156, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(109, 228, 255, 0.04), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(212, 175, 106, 0.05), transparent 60%),
    var(--bg-0);
}
.world-bg::after {
  /* fine grain noise */
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.04), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.04), transparent),
    radial-gradient(1px 1px at 40% 60%, rgba(255,255,255,0.03), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.03), transparent);
  background-size: 180px 180px, 240px 240px, 200px 200px, 160px 160px;
  opacity: .6;
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-glow);
  opacity: 0;
  animation: drift calc(18s / var(--anim-mult, 1)) linear infinite;
}
@keyframes drift {
  0%   { opacity: 0; transform: translateY(0) translateX(0); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-110vh) translateX(20px); }
}

.app-root { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }

/* -- Typography -- */
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.01em; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-dim);
  font-weight: 500;
}
.subtle { color: var(--text-soft); }
.dim    { color: var(--text-dim); }
.empty  { color: var(--text-empty); font-variant-numeric: tabular-nums; }

/* small uppercase chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}

/* -- Buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 11px 22px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all calc(0.2s * var(--anim-mult, 1)) ease;
  position: relative;
}
.btn:hover {
  border-color: var(--line-strong);
  color: var(--gold-bright);
  background: rgba(212, 175, 106, 0.05);
}
.btn.primary {
  background: linear-gradient(180deg, rgba(212, 175, 106, 0.18), rgba(212, 175, 106, 0.04));
  border-color: var(--gold-dim);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(212,175,106,0.08) inset, 0 0 30px rgba(212,175,106,0.0);
}
.btn.primary:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(212,175,106,0.20) inset,
              0 0 24px rgba(212,175,106,0.25);
  color: var(--gold-bright);
}
.btn.ghost { padding: 8px 14px; font-size: 11.5px; letter-spacing: 0.16em; }
.btn.sm { padding: 7px 14px; font-size: 11px; letter-spacing: 0.14em; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* button with ornamental brackets */
.btn-ornate { position: relative; padding-left: 30px; padding-right: 30px; }
.btn-ornate::before,
.btn-ornate::after {
  content: "";
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px;
  border: 1px solid currentColor;
  opacity: 0.6;
}
.btn-ornate::before { left: 10px; border-right: none; border-bottom: none; }
.btn-ornate::after  { right: 10px; border-left: none; border-top: none; }

/* -- Header -- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 28px;
  padding: 18px 40px;
  background: linear-gradient(180deg, rgba(5,7,13,0.92), rgba(5,7,13,0.62));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; cursor: pointer; min-width: 0; justify-self: start; }
.brand-mark {
  width: 38px; height: 38px;
  flex: none;
  position: relative;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  min-width: 0;
}
.brand-name .of { color: var(--gold); font-style: italic; font-weight: 400; }
.brand-name .sub {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: var(--gold-dim);
  margin-top: 5px;
  font-family: var(--font-body);
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: center;
}
.nav-mobile {
  display: none;
}
.nav-link {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  position: relative;
  padding: 6px 0;
  cursor: pointer;
  background: none;
  border: none;
  transition: color calc(0.2s * var(--anim-mult, 1));
}
.nav-link:hover { color: var(--gold-bright); }
.nav-link.active { color: var(--gold-bright); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -2px;
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--gold-glow);
}
.nav-mobile-link {
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 11px 8px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.nav-mobile-link.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-dim);
}

.header-right { display: flex; align-items: center; gap: 22px; min-width: 0; justify-self: end; }

/* -- Page shell -- */
.page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px;
}

/* -- Hero (Home) -- */
.hero {
  position: relative;
  padding: 60px 0 80px;
  text-align: center;
}
.hero-sigil {
  width: 140px; height: 140px;
  margin: 0 auto 24px;
  position: relative;
}
.hero-sigil svg { width: 100%; height: 100%; display: block; }
.hero-sigil .ring-spin {
  animation: spin calc(80s / var(--anim-mult, 1)) linear infinite;
  transform-origin: center;
}
.hero-sigil .ring-spin-r {
  animation: spin-r calc(120s / var(--anim-mult, 1)) linear infinite;
  transform-origin: center;
}
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes spin-r { to { transform: rotate(-360deg); } }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 0 0 18px;
  color: var(--text);
}
.hero h1 .of {
  color: var(--gold);
  font-style: italic;
  font-weight: 400;
}
.hero p.lede {
  max-width: 620px;
  margin: 0 auto 40px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 70px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hero-stat {
  background: var(--bg-1);
  padding: 22px 18px;
  text-align: center;
}
.hero-stat .v {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  line-height: 1;
}
.hero-stat .l {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 8px;
}

/* divider */
.divider {
  display: flex; align-items: center; gap: 16px;
  color: var(--gold-dim);
  margin: 36px 0 28px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.divider .ornament {
  width: 28px; height: 28px; flex: none; opacity: 0.7;
}

/* -- Section head -- */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 8px 0 28px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.1;
}
.section-head h2 .of { color: var(--gold); font-style: italic; }
.section-head .eyebrow { display: block; margin-bottom: 8px; }
.section-head .sub-desc { color: var(--text-soft); max-width: 520px; }

/* -- Toolbar -- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.search {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex; align-items: center;
  isolation: isolate;
}
.search::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--r-sm) - 1px);
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, rgba(212,175,106,0.06), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  pointer-events: none;
  z-index: 0;
}
.search::after {
  content: "";
  position: absolute;
  left: 41px;
  top: 50%;
  width: 1px;
  height: 22px;
  background: linear-gradient(180deg, transparent, rgba(212,175,106,0.18), transparent);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.search > svg,
.search .icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--gold-dim);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.search input {
  width: 100%;
  background: linear-gradient(180deg, rgba(18,22,32,0.96), rgba(10,13,21,0.98));
  border: 1px solid rgba(212,175,106,0.16);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 12px 16px 12px 52px;
  font-size: 13px;
  outline: none;
  transition: border-color calc(0.2s * var(--anim-mult, 1)), box-shadow calc(0.2s * var(--anim-mult, 1)), background calc(0.2s * var(--anim-mult, 1));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 10px 18px rgba(0,0,0,0.14);
  position: relative;
  z-index: 1;
}
.search input:focus {
  border-color: rgba(212,175,106,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 0 0 3px rgba(212,175,106,0.09),
    0 12px 24px rgba(0,0,0,0.18);
  background: linear-gradient(180deg, rgba(20,24,35,0.98), rgba(11,15,24,1));
}
.search input:hover {
  border-color: rgba(212,175,106,0.24);
}
.search input::placeholder {
  color: rgba(214, 208, 196, 0.46);
  letter-spacing: 0.04em;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px;
  background: var(--bg-1);
}
.seg button {
  background: transparent;
  border: none;
  color: var(--text-soft);
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all calc(0.15s * var(--anim-mult, 1));
}
.seg button.on {
  background: rgba(212,175,106,0.10);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
}

/* -- Player table -- */
.player-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.player-table thead th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 14px var(--pad-cell-x);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  background: linear-gradient(180deg, rgba(212,175,106,0.04), transparent);
  user-select: none;
}
.player-table thead th.sortable { cursor: pointer; transition: color 0.15s; }
.player-table thead th.sortable:hover { color: var(--gold-bright); }
.player-table thead th .sort-ind {
  display: inline-block;
  width: 8px;
  margin-left: 6px;
  opacity: 0.5;
}
.player-table thead th .sort-ind.active { opacity: 1; color: var(--gold-bright); }

.player-table tbody tr {
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background calc(0.15s * var(--anim-mult, 1));
}
.player-table tbody tr:hover {
  background: rgba(212, 175, 106, 0.04);
}
.player-table tbody tr:hover td:first-child::before {
  opacity: 1;
}
.player-table tbody td {
  padding: var(--pad-cell-y) var(--pad-cell-x);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.player-table tbody tr:last-child td { border-bottom: none; }
.player-table td.col-name {
  position: relative;
}
.player-table td.col-name::before {
  content: "";
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 60%;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 0 8px var(--gold-glow);
}
.player-table .rank-num {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  width: 40px;
  text-align: center;
  letter-spacing: 0.04em;
}
.player-table .rank-top1 { color: var(--gold-bright); text-shadow: 0 0 12px var(--gold-glow); }
.player-table .rank-top2, .player-table .rank-top3 { color: var(--gold); }

.cell-player {
  display: flex; align-items: center; gap: 14px;
}
.cell-player .name {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.cell-player .class-tag {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

.lvl {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  line-height: 1;
}
.lvl-suf {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

.floor {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.04em;
}
.floor .deep {
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-glow);
}
.floor-sub {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

/* status dot */
.online-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
}
.offline-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}

/* -- Player cards grid (alt view) -- */
.player-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.pcard-rank {
  margin-bottom: 12px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
}
.pcard {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 20px 18px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all calc(0.25s * var(--anim-mult, 1));
}
.pcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, var(--gold-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.pcard:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.pcard:hover::before { opacity: 0.4; }
.pcard .pcard-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
  position: relative;
}
.pcard .pcard-name {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.1;
}
.pcard .pcard-class {
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}
.pcard .pcard-rank {
  position: absolute;
  top: 0; right: 0;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.pcard .pcard-stats {
  display: grid; grid-template-columns: 1fr 1px 1fr;
  gap: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  position: relative;
}
.pcard .pcard-stat { text-align: center; padding: 4px 6px; }
.pcard .pcard-stat .v {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  line-height: 1;
}
.pcard .pcard-stat .l {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 6px;
}
.pcard-stats::before {
  content: "";
  position: absolute;
  left: 50%; top: 16px; bottom: 0;
  width: 1px;
  background: var(--line);
}

/* avatar disc */
.avatar {
  width: 48px; height: 48px;
  flex: none;
  position: relative;
  border-radius: 50%;
  overflow: visible;
}
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.lg { width: 110px; height: 110px; }
.avatar.xl { width: 160px; height: 160px; }

/* class color halos */
.avatar[data-class="Arcanist"]     { --halo: var(--cyan); }
.avatar[data-class="Warden"]       { --halo: var(--gold); }
.avatar[data-class="Shadowblade"]  { --halo: var(--purple); }
.avatar[data-class="Lightbringer"] { --halo: var(--gold-bright); }
.avatar[data-class="Necromancer"]  { --halo: #b06ddd; }
.avatar[data-class="Beastmaster"]  { --halo: var(--success); }

/* -- Profile view -- */
.profile-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  margin-bottom: 28px;
  padding: 0;
  transition: color 0.2s;
}
.profile-back:hover { color: var(--gold-bright); }

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 36px;
  padding: 36px;
  background:
    radial-gradient(ellipse 60% 100% at 20% 0%, rgba(212,175,106,0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.profile-avatar-wrap {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(96, 201, 255, 0.08), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border: 1px solid rgba(96, 201, 255, 0.16);
  box-shadow: inset 0 0 24px rgba(96, 201, 255, 0.06);
}
.profile-hero::before {
  /* corner ornament TL */
  content: "";
  position: absolute;
  top: 12px; left: 12px;
  width: 22px; height: 22px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  opacity: 0.6;
}
.profile-hero::after {
  content: "";
  position: absolute;
  bottom: 12px; right: 12px;
  width: 22px; height: 22px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  opacity: 0.6;
}
.profile-hero .ph-name {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
  line-height: 1;
}
.profile-hero .ph-meta {
  display: flex; gap: 14px; align-items: center;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.profile-hero .ph-stats {
  display: flex; gap: 42px;
  margin-top: 22px;
  align-items: flex-start;
}
.profile-hero .ph-stat {
  min-width: 98px;
}
.profile-hero .ph-stat .v {
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  line-height: 1;
}
.profile-hero .ph-stat .v .deep {
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan-glow);
}
.profile-hero .ph-stat .l {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 6px;
}
.profile-hero .ph-floor-chip {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  max-width: 28ch;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 106, 0.24);
  background: rgba(212, 175, 106, 0.06);
  color: var(--gold-soft);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}
.xp-progress-card {
  margin-top: 22px;
  max-width: 520px;
}
.xp-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.xp-progress-label {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.xp-progress-values {
  color: var(--gold-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.xp-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 8px rgba(0,0,0,0.28);
}
.xp-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96, 201, 255, 0.85), rgba(212, 175, 106, 0.92));
  box-shadow: 0 0 18px rgba(96, 201, 255, 0.18);
}
.profile-hero .ph-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

/* friend states */
.friend-btn.is-pending { color: var(--cyan); border-color: var(--line-cool); }
.friend-btn.is-friends { color: var(--success); border-color: rgba(110,208,154,0.3); }

/* -- Tabs -- */
.tabs {
  display: flex;
  gap: 0;
  margin: 36px 0 18px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none; border: none;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 14px 24px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.tab:hover { color: var(--gold-bright); }
.tab.active { color: var(--gold-bright); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -1px;
  width: 40px; height: 2px;
  background: var(--gold);
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--gold-glow);
}
.tab .count {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-left: 8px;
}

/* -- Inventory: equipped paper-doll + bag -- */
.equipped-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 32px;
  margin-top: 8px;
}
@media (max-width: 880px) {
  .equipped-layout { grid-template-columns: 1fr; }
}

.paper-doll {
  position: relative;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 12px;
  align-items: center;
  justify-items: center;
  min-height: 460px;
}
.paper-doll .silhouette {
  grid-column: 2;
  grid-row: 1 / span 4;
  width: 130px;
  height: 100%;
  min-height: 380px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.paper-doll .silhouette svg { width: 100%; height: auto; max-height: 380px; }

.slot {
  width: var(--slot);
  height: var(--slot);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all calc(0.18s * var(--anim-mult, 1));
}
.slot::before, .slot::after {
  /* arcane corner brackets */
  content: ""; position: absolute;
  width: 8px; height: 8px;
  border: 1px solid var(--gold-dim);
  opacity: 0.45;
}
.slot::before { top: 3px; left: 3px; border-right: none; border-bottom: none; }
.slot::after  { bottom: 3px; right: 3px; border-left: none; border-top: none; }
.slot:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.slot.is-clickable {
  cursor: pointer;
}
.slot.is-selected {
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(212,175,106,0.52) inset,
    0 0 20px rgba(212,175,106,0.16);
}
.slot .slot-label {
  position: absolute;
  bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.slot.empty .slot-icon { opacity: 0.18; color: var(--text-faint); }
.slot .item-icon {
  width: 60%; height: 60%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.slot .item-icon svg { width: 100%; height: 100%; }
.slot .item-icon .item-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.22));
}

/* rarity treatment on slot */
.slot[data-rarity="common"]     { box-shadow: 0 0 0 1px rgba(154,150,144,0.18) inset; }
.slot[data-rarity="uncommon"]   { box-shadow: 0 0 0 1px rgba(92,227,154,0.30) inset, 0 0 12px rgba(92,227,154,0.10); border-color: rgba(92,227,154,0.30); }
.slot[data-rarity="rare"]       { box-shadow: 0 0 0 1px rgba(109,184,255,0.34) inset, 0 0 14px rgba(109,184,255,0.14); border-color: rgba(109,184,255,0.36); }
.slot[data-rarity="epic"]       { box-shadow: 0 0 0 1px rgba(192,132,255,0.40) inset, 0 0 16px rgba(192,132,255,0.18); border-color: rgba(192,132,255,0.42); }
.slot[data-rarity="legendary"]  { box-shadow: 0 0 0 1px rgba(240,192,96,0.46) inset, 0 0 18px rgba(240,192,96,0.22); border-color: rgba(240,192,96,0.50); }
.slot[data-rarity="mythic"]     { box-shadow: 0 0 0 1px rgba(255,127,180,0.46) inset, 0 0 20px rgba(255,127,180,0.24); border-color: rgba(255,127,180,0.50); }

/* slot positions in paper doll grid */
.slot.pos-head    { grid-column: 2; grid-row: 1; }
.slot.pos-cape    { grid-column: 1; grid-row: 1; }
.slot.pos-neck    { grid-column: 3; grid-row: 1; }
.slot.pos-chest   { grid-column: 2; grid-row: 2; align-self: center; }
.slot.pos-mh      { grid-column: 1; grid-row: 2; }
.slot.pos-oh      { grid-column: 3; grid-row: 2; }
.slot.pos-gloves  { grid-column: 1; grid-row: 3; }
.slot.pos-belt    { grid-column: 2; grid-row: 3; }
.slot.pos-ring    { grid-column: 3; grid-row: 3; }
.slot.pos-legs    { grid-column: 1; grid-row: 4; }
.slot.pos-boots   { grid-column: 2; grid-row: 4; }
.slot.pos-trinket { grid-column: 3; grid-row: 4; }
/* override silhouette to be behind */
.paper-doll .silhouette { z-index: 0; opacity: 0.6; }
.paper-doll .slot { z-index: 1; }

/* re-do silhouette span so it sits behind without colliding */
.paper-doll {
  grid-template-columns: var(--slot) var(--slot) var(--slot);
  justify-content: center;
  grid-template-rows: var(--slot) var(--slot) var(--slot) var(--slot);
  row-gap: 28px;
}
.paper-doll .silhouette {
  position: absolute;
  inset: 24px;
  width: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.paper-doll .silhouette svg {
  height: 90%;
  width: auto;
  opacity: 0.25;
}

/* bag grid */
.bag {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
}
.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--slot), 1fr));
  gap: 10px;
}
.bag-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.bag-showcase-grid {
  min-width: 0;
}
.item-inspector {
  min-height: 100%;
  background: linear-gradient(180deg, rgba(27, 31, 40, 0.96), rgba(12, 15, 24, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.item-inspector.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-inspector-empty {
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
  font-size: 12px;
  max-width: 24ch;
}
.item-inspector-artwrap {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.item-inspector-art {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.item-inspector-art .item-art,
.item-inspector-art svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.item-inspector-body {
  padding-top: 14px;
}
.item-inspector-name {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.05;
  color: var(--text);
}
.item-inspector[data-rarity="common"] .item-inspector-name { color: var(--r-common); }
.item-inspector[data-rarity="uncommon"] .item-inspector-name { color: var(--r-uncommon); }
.item-inspector[data-rarity="rare"] .item-inspector-name { color: var(--r-rare); }
.item-inspector[data-rarity="epic"] .item-inspector-name { color: var(--r-epic); }
.item-inspector[data-rarity="legendary"] .item-inspector-name { color: var(--r-legendary); }
.item-inspector[data-rarity="mythic"] .item-inspector-name { color: var(--r-mythic); }
.item-inspector-sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.item-inspector-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.item-inspector-stats {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.item-inspector-stat {
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 12.5px;
}
.item-inspector-stat b {
  color: var(--text);
  font-weight: 600;
}
.item-inspector-stat.dim {
  color: var(--text-dim);
}
.item-inspector-flavor {
  margin-top: 16px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.6;
  font-size: 12px;
}
.item-inspector-code {
  margin-top: 16px;
  color: var(--gold-dim);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  word-break: break-word;
}

/* skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.skill-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  transition: border-color 0.2s;
}
.skill-card:hover { border-color: var(--line-strong); }
.skill-card.is-locked { opacity: 0.45; }
.skill-card .skill-icon {
  width: 48px; height: 48px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  color: var(--gold);
}
.skill-card .skill-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
.skill-card .skill-desc { font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.skill-card .skill-rank {
  position: absolute;
  top: 12px; right: 14px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* -- Item tooltip -- */
.tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-width: 280px;
  background: rgba(8, 11, 19, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  pointer-events: none;
  font-size: 12.5px;
  line-height: 1.5;
}
.tooltip[data-rarity="uncommon"]  { border-color: rgba(92,227,154,0.46); }
.tooltip[data-rarity="rare"]      { border-color: rgba(109,184,255,0.48); }
.tooltip[data-rarity="epic"]      { border-color: rgba(192,132,255,0.54); }
.tooltip[data-rarity="legendary"] { border-color: rgba(240,192,96,0.60); }
.tooltip[data-rarity="mythic"]    { border-color: rgba(255,127,180,0.60); }

.tooltip .t-name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 0 0 2px;
}
.tooltip[data-rarity="common"]    .t-name { color: var(--r-common); }
.tooltip[data-rarity="uncommon"]  .t-name { color: var(--r-uncommon); }
.tooltip[data-rarity="rare"]      .t-name { color: var(--r-rare); }
.tooltip[data-rarity="epic"]      .t-name { color: var(--r-epic); }
.tooltip[data-rarity="legendary"] .t-name { color: var(--r-legendary); }
.tooltip[data-rarity="mythic"]    .t-name { color: var(--r-mythic); }

.tooltip .t-sub {
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.tooltip .t-stats { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.tooltip .t-stat { color: var(--text-soft); }
.tooltip .t-stat b { color: var(--text); font-weight: 500; }
.tooltip .t-flavor {
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-dim);
  font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}
.tooltip .t-lvl { color: var(--gold-dim); font-size: 11px; }

/* -- Modal -- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2,3,8,0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadein calc(0.22s * var(--anim-mult, 1)) ease both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 440px;
  max-height: min(90vh, 920px);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212,175,106,0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 40px 36px 32px;
  position: relative;
  animation: rise calc(0.32s * var(--anim-mult, 1)) cubic-bezier(.2,.7,.2,1) both;
  overflow-y: auto;
}
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal::before {
  content: ""; position: absolute; top: 12px; left: 12px;
  width: 22px; height: 22px;
  border-top: 1px solid var(--gold); border-left: 1px solid var(--gold);
  opacity: 0.55;
}
.modal::after {
  content: ""; position: absolute; bottom: 12px; right: 12px;
  width: 22px; height: 22px;
  border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold);
  opacity: 0.55;
}
.modal .close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 4px;
}
.modal .close:hover { color: var(--gold-bright); background: rgba(255,255,255,0.04); }
.modal h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  text-align: center;
}
.modal .lede {
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
  margin: 0 0 24px;
}
.modal .seg { display: flex; margin: 0 auto 22px; width: fit-content; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.password-toggle:hover {
  color: var(--gold-bright);
}
.password-toggle:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 2px;
  border-radius: 999px;
}
.password-strength {
  margin-top: 8px;
}
.password-strength-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.password-strength-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.2s ease, background 0.2s ease;
}
.password-strength-empty .password-strength-fill { background: var(--text-faint); }
.password-strength-weak .password-strength-fill { background: var(--danger); }
.password-strength-medium .password-strength-fill { background: var(--gold); }
.password-strength-strong .password-strength-fill { background: var(--success); }
.password-strength-meta {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  padding-right: 42px;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 50%, var(--gold-dim) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--gold-dim) 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
    var(--bg-1);
}
.field select option {
  background: var(--bg-1);
  color: var(--text);
}
.field input:focus,
.field select:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(212,175,106,0.08);
}
.field.has-error input,
.field.has-error select { border-color: var(--danger); }
.field .err {
  display: block;
  color: var(--danger);
  font-size: 11px;
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.modal .submit {
  width: 100%;
  margin-top: 8px;
  padding: 13px 20px;
}
.modal .alt {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
}
.modal .alt button {
  background: none; border: none;
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--gold-dim);
}

/* -- Footer -- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 30px 40px 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(212, 175, 106, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(8, 10, 17, 0.55), rgba(5, 7, 13, 0.94));
  color: var(--text-dim);
}
.footer-main {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, auto);
  gap: 34px;
  align-items: start;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-brand svg {
  flex: none;
}
.footer-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
}
.footer-title span {
  color: var(--gold);
  font-style: italic;
  text-transform: none;
}
.footer-brand p {
  margin: 6px 0 0;
  color: var(--gold-dim);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 24px;
}
.footer-label {
  margin-bottom: 10px;
  color: var(--gold-dim);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}
.footer-col button,
.footer-col a,
.footer-col span {
  padding: 0;
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: color calc(0.16s * var(--anim-mult, 1)) ease;
}
.footer-col button:hover,
.footer-col a:hover {
  color: var(--gold-bright);
}
.footer-socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-socials a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  transition:
    color calc(0.16s * var(--anim-mult, 1)) ease,
    border-color calc(0.16s * var(--anim-mult, 1)) ease,
    background calc(0.16s * var(--anim-mult, 1)) ease,
    transform calc(0.16s * var(--anim-mult, 1)) ease;
}
.footer-socials a:hover {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(212, 175, 106, 0.06);
  transform: translateY(-1px);
}
.footer-bottom {
  width: 100%;
  max-width: 1320px;
  margin: 24px auto 0;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-footer-band {
  margin-top: 42px;
  padding: 28px 28px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    radial-gradient(circle at 12% 0%, rgba(212, 175, 106, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(10, 14, 23, 0.92), rgba(7, 10, 17, 0.98));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}
.home-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.home-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-footer-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
}
.home-footer-title .of {
  color: var(--gold);
  font-style: italic;
  text-transform: none;
}
.home-footer-brand p {
  margin: 6px 0 0;
  color: var(--gold-dim);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.home-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.home-footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding-top: 22px;
}
.home-footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.home-footer-col button,
.home-footer-col a,
.home-footer-col span {
  padding: 0;
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: color calc(0.16s * var(--anim-mult, 1)) ease;
}
.home-footer-col button:hover,
.home-footer-col a:hover {
  color: var(--gold-bright);
}
.home-footer-socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.home-footer-socials a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  transition:
    color calc(0.16s * var(--anim-mult, 1)) ease,
    border-color calc(0.16s * var(--anim-mult, 1)) ease,
    background calc(0.16s * var(--anim-mult, 1)) ease,
    transform calc(0.16s * var(--anim-mult, 1)) ease;
}
.home-footer-socials a:hover {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(212, 175, 106, 0.06);
  transform: translateY(-1px);
}
.home-footer-bottom {
  margin-top: 22px;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* -- Animations & misc -- */
.fadein { animation: fadein calc(0.3s * var(--anim-mult, 1)) ease both; }
[data-anim="off"] .fadein { animation: none; opacity: 1; }
@media (max-width: 720px) {
  .header { padding: 14px 20px; }
  .page { padding: 24px 18px; }
  .nav { display: none; }
  .profile-hero { grid-template-columns: auto 1fr; }
  .profile-hero .ph-actions { grid-column: 1 / -1; align-items: stretch; }
}

/* utility */
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* ============================================================
   RESPONSIVE — tablet & mobile
   Breakpoints: 1100 (compact), 900 (tablet), 600 (mobile), 420 (xs)
   ============================================================ */

/* Tablet & compact desktop */
@media (max-width: 1100px) {
  .page { padding: 32px 24px; }
  .header { padding: 18px 24px; }
  .header-right { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  .hero h1 { font-size: clamp(40px, 8vw, 72px); }
  .hero-stats { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .profile-hero { grid-template-columns: auto 1fr; gap: 22px; padding: 28px; }
  .profile-hero .ph-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet */
@media (max-width: 900px) {
  .page { padding: 28px 20px; max-width: 100%; }
  .header { padding: 16px 20px; gap: 14px; flex-wrap: wrap; }
  .brand { flex: 1 1 260px; }
  .brand-name .sub { display: none; }
  .brand-name { font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-right { margin-left: auto; gap: 10px; }
  .hero h1 { font-size: clamp(36px, 9vw, 60px); letter-spacing: -0.02em; }
  .hero p.lede { font-size: 14.5px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-head h2 { font-size: clamp(24px, 5vw, 36px); }
  .home-footer-top,
  .home-footer-bottom { flex-direction: column; align-items: center; text-align: center; }
  .home-footer-links { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar .search { flex: 1 1 100%; }
  .equipped-layout { grid-template-columns: 1fr; gap: 24px; }
  .paper-doll { max-width: 480px; margin: 0 auto; }
  .bag-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .bag-showcase { grid-template-columns: 1fr; }
  .bag-showcase .bag-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }
  .bag-showcase .bag-grid .slot {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
  }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs .tab { white-space: nowrap; }
  .modal .seg { width: 100%; flex-wrap: wrap; }
  .modal .seg > * { flex: 1 1 160px; }
}

/* Mobile */
@media (max-width: 600px) {
  .page { padding: 20px 14px; }
  .header {
    grid-template-columns: 1fr;
    padding: 14px 14px 10px;
    gap: 12px;
    align-items: center;
    justify-items: center;
  }
  .nav { display: none; }
  .nav-mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    position: sticky;
    top: 73px;
    z-index: 45;
    padding: 0 10px;
    background: linear-gradient(180deg, rgba(5,7,13,0.96), rgba(5,7,13,0.82));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .brand {
    gap: 10px;
    min-width: 0;
    align-self: center;
    justify-self: center;
    text-align: left;
  }
  .brand-name {
    font-size: 12.5px;
    line-height: 1.1;
    letter-spacing: 0.06em;
    max-width: 190px;
    word-break: normal;
    overflow-wrap: normal;
  }
  .brand-name .of { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .header-right {
    width: 100%;
    justify-self: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  /* Avatar + name del header: ocultar el texto, dejar solo el avatar con dot */
  .header-right > .user-menu-trigger > button > div:not(:first-child) { display: none; }
  /* CoinChips: solo iconos en móvil */
  .coin-chips { padding: 4px 6px; gap: 1px; }
  .coin { font-size: 0; padding: 2px 5px; min-width: 18px; justify-content: center; }
  .coin-sep { display: none; }
  /* Hero */
  .hero { padding-top: 28px; }
  .hero-sigil { width: 60px; height: 60px; margin-bottom: 18px; }
  .hero h1 { font-size: clamp(34px, 11vw, 48px); }
  .hero p.lede { font-size: 13.5px; padding: 0 4px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stat .v { font-size: 26px; }
  .home-footer-band { margin-top: 30px; padding: 22px 18px 16px; }
  .home-footer-brand { align-items: center; justify-content: center; text-align: center; }
  .home-footer-actions { width: 100%; }
  .home-footer-actions .btn { flex: 1 1 100%; }
  .home-footer-title,
  .footer-title { font-size: 16px; letter-spacing: 0.08em; }
  .home-footer-links { text-align: center; }
  .home-footer-col { align-items: center; }
  .home-footer-socials { justify-content: center; }
  /* Tabla de jugadores: horizontal scroll en lugar de romperse */
  .player-table { font-size: 13px; min-width: 540px; }
  .player-cards { grid-template-columns: 1fr; }
  .player-cards .pcard { width: 100%; }
  /* Profile */
  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 22px 18px;
    gap: 16px;
  }
  .profile-hero .avatar { margin: 0 auto; }
  .profile-hero .ph-meta { justify-content: center; flex-wrap: wrap; }
  .profile-hero .ph-stats { justify-content: center; }
  .xp-progress-card { margin-left: auto; margin-right: auto; }
  .xp-progress-head { flex-direction: column; align-items: center; }
  .profile-hero .ph-actions { grid-column: 1 / -1; justify-content: center; }
  .profile-hero .ph-name { font-size: clamp(26px, 7vw, 36px); }
  .paper-doll { max-width: 100%; }
  .bag-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
  .bag-showcase .bag-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .item-inspector-name { font-size: 22px; }
  .skill-card { grid-template-columns: auto 1fr; gap: 10px; padding: 10px; }
  .skill-card .skill-rank { display: none; }
  /* Modales */
  .modal-overlay { padding: 10px; }
  .modal { padding: 28px 22px 24px; max-width: 100%; }
  .modal h2 { font-size: 22px; }
  .modal .seg { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .modal .seg > * { flex: 1 1 0; min-width: 0; }
  .field input,
  .field select { font-size: 16px; }
  /* Tooltip: limitar ancho para móvil */
  .tooltip { max-width: 280px; }
  /* Footer */
  .footer { padding: 28px 18px 18px; }
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand { justify-content: center; text-align: left; }
  .footer-links { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .footer-col { align-items: center; }
  .footer-socials { justify-content: center; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; font-size: 10px; }
}

@media (max-width: 900px) {
  .tooltip {
    display: none !important;
  }
}

/* XS / smartphones pequeños */
@media (max-width: 420px) {
  .hero h1 { font-size: clamp(28px, 12vw, 40px); }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .profile-hero { padding: 18px 14px; }
  .coin-chips .coin span:not(.mark) { display: none; }
  .header-right { gap: 6px; }
  .header-right .icon-btn,
  .header-right .icon-btn-menu,
  .header-right .icon-btn-chat,
  .header-right .icon-btn-alert,
  .header-right .icon-btn-friends { width: 38px; height: 38px; }
  .home-footer-band { padding: 18px 14px 14px; }
}

/* Permite scroll horizontal a la tabla de jugadores en móvil sin romper el layout */
@media (max-width: 900px) {
  .player-table { display: block; overflow-x: auto; }
}
