@font-face {
  font-family: "Cinzel";
  src: url("/fonts/cinzel-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0d0f14;
  --panel: #161a22;
  --panel-2: #1d222c;
  --border: #2a303c;
  --text: #e6e2d6;
  --muted: #9a9789;
  --gold: #e8b64c;
  --gold-dim: #a8822f;
  --ice: #7fc6ff;
  --ok: #4cc46a;
  --bad: #e05252;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 500px at 50% -120px, #1c2a3d 0%, transparent 70%), var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--ice); }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
pre { background: #0a0c10; border: 1px solid var(--border); padding: 12px 14px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; }
pre code { background: none; padding: 0; font-size: 1rem; color: var(--gold); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.topbar { border-bottom: 1px solid var(--border); background: rgba(13, 15, 20, 0.85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.3rem; text-decoration: none; letter-spacing: 0.06em; }
.brand img { display: block; }
nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
nav a, .linklike { color: var(--text); text-decoration: none; padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 0.95rem; }
nav a:hover, .linklike:hover { background: var(--panel-2); }
nav a.active { color: var(--gold); }
.linklike { background: none; border: 0; cursor: pointer; }
.inline { display: inline; margin: 0; }

main.wrap { padding-top: 28px; padding-bottom: 40px; }

.hero { text-align: center; padding: 28px 0 24px; }
.hero-emblem { display: block; margin: 0 auto 6px; filter: drop-shadow(0 6px 24px rgba(232, 182, 76, 0.25)); }
.hero h1 { font-family: "Cinzel", Georgia, serif; font-size: clamp(2.4rem, 8vw, 4rem); margin: 0; letter-spacing: 0.08em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffe29a 0%, #e8b64c 55%, #a8822f 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 18px rgba(232, 182, 76, 0.25)); }
.tagline strong { color: var(--text); }
.tagline { color: var(--muted); margin: 6px 0 14px; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; border: 1px solid; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); border-color: rgba(76, 196, 106, 0.4); background: rgba(76, 196, 106, 0.08); }
.pill.bad { color: var(--bad); border-color: rgba(224, 82, 82, 0.4); background: rgba(224, 82, 82, 0.08); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.card h1 { margin-top: 0; color: var(--gold); font-size: 1.7rem; font-family: "Cinzel", Georgia, serif; letter-spacing: 0.03em; }
.card h2 { margin-top: 0; font-size: 1.25rem; }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.stat { text-align: center; padding: 18px; margin: 0; }
.stat .label { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.stat small { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

.details { width: 100%; border-collapse: collapse; }
.details th, .details td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.details th { color: var(--muted); font-weight: 500; width: 38%; padding-right: 16px; }
.details tr:last-child th, .details tr:last-child td { border-bottom: 0; }

.actions { margin: 18px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); color: #1a1408; border: 0; border-radius: 7px; padding: 9px 18px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); }
.btn.small { padding: 5px 12px; font-size: 0.88rem; }

.form { display: grid; gap: 14px; margin-top: 16px; }
.form label { display: grid; gap: 6px; font-size: 0.92rem; color: var(--muted); }
.form input { background: #0a0c10; border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 10px 12px; font: inherit; }
.form input:focus { outline: 2px solid var(--gold-dim); border-color: transparent; }

.flash { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid; }
.flash.success { color: #bfeccb; background: rgba(76, 196, 106, 0.1); border-color: rgba(76, 196, 106, 0.35); }
.flash.error { color: #f3c3c3; background: rgba(224, 82, 82, 0.1); border-color: rgba(224, 82, 82, 0.35); }
.flash.info { color: #cfe7ff; background: rgba(127, 198, 255, 0.08); border-color: rgba(127, 198, 255, 0.3); }

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

.chars { display: grid; gap: 10px; margin-top: 16px; }
.char { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; flex-wrap: wrap; }
.char-name { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.char-info .muted { font-size: 0.9rem; }
.char-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.tag { font-size: 0.82rem; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; padding: 4px 10px; }
.tag.pending { color: var(--gold); border-color: var(--gold-dim); }

.prose h3 { margin: 0 0 4px; font-size: 1.05rem; }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: 18px; }
.steps li::marker { color: var(--gold); font-weight: 700; }

.footer { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 10px 20px 30px; }

@media (max-width: 560px) {
  .card { padding: 18px; }
  .details th { width: auto; display: block; border: 0; padding-bottom: 0; }
  .details td { display: block; }
}

/* ---- credits & rewards ---- */
.wallet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.wallet-top h1 { margin-bottom: 2px; }
.wallet-top p { margin: 0; }
.balance { text-align: center; background: radial-gradient(circle at 50% 30%, rgba(232, 182, 76, 0.18), transparent 70%), var(--panel-2); border: 1px solid var(--gold-dim); border-radius: 12px; padding: 10px 22px; min-width: 120px; }
.balance-num { display: block; font-family: "Cinzel", Georgia, serif; font-size: 2.2rem; font-weight: 700; color: var(--gold); line-height: 1.1; }
.balance-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.prices { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 0.95rem; }
.prices th, .prices td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.prices th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.prices tr:last-child td { border-bottom: 0; }
.small { font-size: 0.88rem; }

.char { flex-direction: column; align-items: stretch; }
.char-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.char-gold { color: var(--gold); font-weight: 600; white-space: nowrap; }
.char-gold::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe9a8, #c8962f); margin-right: 6px; vertical-align: -1px; }
.btn.gold { background: transparent; color: #ffd877; border: 1px solid #c8962f; }

.rewards { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--border); }
.rewards-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px; }
.chip { font: inherit; font-size: 0.8rem; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--border); color: var(--muted); background: transparent; }
.chip.locked { opacity: 0.55; }
.chip.claimed { color: var(--ok); border-color: rgba(76, 196, 106, 0.35); }
.chip.ready { color: #1a1408; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); border-color: transparent; font-weight: 650; cursor: pointer; }
.chip.ready:hover { filter: brightness(1.08); }

.history { list-style: none; padding: 0; margin: 0; }
.history li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.history li:last-child { border-bottom: 0; }
.amt { font-weight: 700; text-align: right; }
.amt.plus { color: var(--ok); }
.amt.minus { color: var(--bad); }
.when { font-size: 0.85rem; }

/* ---- multiple realms ---- */
.realms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.realm { margin: 0; }
.realm-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.realm-top h3 { margin: 0; font-family: "Cinzel", Georgia, serif; color: var(--gold); font-size: 1.2rem; }
.realm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.realm-stats .label { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pill.small { font-size: 0.78rem; padding: 2px 10px; }
.realm-group + .realm-group { margin-top: 22px; }
.realm-heading { font-family: "Cinzel", Georgia, serif; color: var(--gold); font-size: 1.15rem; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* ---- realms under the title ---- */
.hero-realms { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.realm-badge {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 18px 9px 14px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(36, 48, 68, 0.85), rgba(15, 18, 26, 0.92));
  border: 1px solid rgba(232, 182, 76, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 226, 154, 0.12), 0 6px 22px rgba(0, 0, 0, 0.35);
}
.realm-badge-name {
  font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.06em;
  background: linear-gradient(180deg, #ffe29a 0%, #e8b64c 60%, #c08a2c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.realm-badge-state {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.status-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.is-online .status-dot { background: #4cd471; box-shadow: 0 0 0 2px rgba(76, 212, 113, 0.18), 0 0 10px rgba(76, 212, 113, 0.9); }
.is-online .status-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(76, 212, 113, 0.6); animation: realm-pulse 2s ease-out infinite;
}
.is-online .realm-badge-state { color: #7fe39a; }
.is-offline { border-color: rgba(224, 82, 82, 0.35); }
.is-offline .status-dot { background: #e05252; box-shadow: 0 0 8px rgba(224, 82, 82, 0.6); }
.is-offline .realm-badge-name { background: none; color: #9a9789; }
.is-offline .realm-badge-state { color: #e88a8a; }
@keyframes realm-pulse {
  0% { transform: scale(0.6); opacity: 1; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .is-online .status-dot::after { animation: none; opacity: 0; }
}

/* ---------- sign-up & Discord ---------- */
.small { font-size: 0.88rem; }
.grow { flex: 1; }
.center { text-align: center; }
.hint { font-size: 0.8rem; color: var(--muted); opacity: 0.85; }
.form-foot { margin: 18px 0 0; text-align: center; }
.form-foot a { color: var(--gold); }
.steps-list { display: grid; gap: 10px; margin: 18px 0 4px; }
.step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255, 255, 255, 0.02); flex-wrap: wrap; }
.step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #1a1408; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); }
.step.done { border-color: rgba(76, 196, 106, 0.4); background: rgba(76, 196, 106, 0.07); }
.step.done .step-num { background: var(--ok); color: #0d1a10; }
.step.locked { opacity: 0.55; margin-top: 10px; }
.step.locked .step-num { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.discord-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.discord-card h2 { margin: 0 0 4px; }
.discord-card p { margin: 0; }
.discord-card.verified { border-color: rgba(76, 196, 106, 0.35); }
.discord-badge { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; background: var(--ok); color: #0d1a10; }
.discord-badge.muted-badge { background: transparent; color: var(--gold); border: 2px solid var(--gold-dim); }
.step > .btn { flex-basis: 100%; text-align: center; margin-top: 4px; }

/* ---------- home: big hero ---------- */
.hero-big { position: relative; isolation: isolate; min-height: min(72vh, 640px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0 36px; }
.hero-big .hero-emblem { width: clamp(96px, 14vw, 140px); height: auto; margin-bottom: 10px; }
.hero-glow { position: absolute; left: 50%; top: 42%; width: min(760px, 120vw); aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(232, 182, 76, 0.13) 0%, rgba(232, 182, 76, 0.04) 35%, transparent 65%); pointer-events: none; z-index: -1; }
.hero-tag { margin: 10px 0 0; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.25rem); letter-spacing: 0.04em; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.btn.big { padding: 13px 28px; font-size: 1.05rem; border-radius: 9px; }
.btn.big:not(.ghost) { box-shadow: 0 6px 24px rgba(232, 182, 76, 0.22); }

/* ---------- home: Discord community ---------- */
.community { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border-left: 4px solid var(--gold); }
.community-text { flex: 1 1 360px; }
.community h2 { color: var(--gold); font-family: "Cinzel", Georgia, serif; letter-spacing: 0.03em; }
.community p { margin: 0 0 10px; color: var(--muted); }
.community-points { margin: 0; padding-left: 1.1em; color: var(--text); }
.community-points li { margin: 3px 0; }
.community-points li::marker { color: var(--gold); }

/* ---------- intro: "Forged in Gold" ---------- */
.intro-overlay { display: none; position: fixed; inset: 0; z-index: 1000; cursor: pointer; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #141824 0%, #050608 70%); }
html.intro-on .intro-overlay { display: block; }
html.intro-on body { overflow: hidden; }
html.intro-out .intro-overlay { opacity: 0; transform: scale(1.12); filter: blur(6px); transition: opacity 0.7s ease-in, transform 0.7s ease-in, filter 0.7s ease-in; pointer-events: none; }

.intro-embers span { position: absolute; bottom: -4%; border-radius: 50%; background: #ffc35c; box-shadow: 0 0 8px 2px rgba(255, 170, 60, 0.7); opacity: 0; animation: iv-rise linear infinite; }
@keyframes iv-rise { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 10% { opacity: 0.9; } 100% { transform: translate(var(--dx, 0), -110vh) scale(0.3); opacity: 0; } }

.intro-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3vh, 28px); }
.intro-emblem { width: clamp(120px, 20vmin, 220px); height: auto; overflow: visible; }
.iv-shield { fill: url(#iv-field); fill-opacity: 0; stroke: url(#iv-gold); stroke-width: 3.5; stroke-linejoin: round; stroke-dasharray: 190; stroke-dashoffset: 190; }
.iv-inner { fill: none; stroke: #e8b64c; stroke-opacity: 0; stroke-width: 1; }
.iv-vee { fill: url(#iv-gold); stroke: #5a3f12; stroke-width: 0.8; stroke-linejoin: round; transform-origin: 32px 35px; transform: scale(0.4); opacity: 0; }
.iv-star { fill: #e9f6ff; transform-origin: 32px 24px; transform: scale(0) rotate(-90deg); }
.intro-burst { position: absolute; left: 50%; top: 45%; width: min(90vmin, 900px); aspect-ratio: 1; transform: translate(-50%, -50%) scale(0); border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 236, 190, 0.9) 0%, rgba(232, 182, 76, 0.35) 25%, rgba(232, 182, 76, 0) 60%); }
.intro-word { font-family: "Cinzel", Georgia, serif; font-weight: 700; color: var(--gold); text-transform: uppercase; font-size: clamp(2.2rem, 8vw, 5rem); letter-spacing: 0.7em; margin-right: -0.7em; opacity: 0; text-shadow: 0 0 24px rgba(232, 182, 76, 0.45); }
.intro-skip { position: absolute; left: 0; right: 0; bottom: 5vh; text-align: center; font-size: 0.85rem; letter-spacing: 0.08em; color: rgba(236, 231, 220, 0.4); opacity: 0; }

.intro-overlay.playing .iv-shield { animation: iv-draw 1s 0.2s ease-in-out forwards, iv-fill 0.5s 1s ease forwards; }
.intro-overlay.playing .iv-inner { animation: iv-inner 0.4s 1.1s forwards; }
.intro-overlay.playing .iv-vee { animation: iv-vee 0.5s 1.1s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.intro-overlay.playing .iv-star { animation: iv-star 0.6s 1.5s ease-out forwards; }
.intro-overlay.playing .intro-burst { animation: iv-burst 1s 1.5s ease-out forwards; }
.intro-overlay.playing .intro-word { animation: iv-word 1s 1.75s ease-out forwards; }
.intro-overlay.playing .intro-skip { animation: iv-fade 0.6s 0.8s ease forwards; }
@keyframes iv-draw { to { stroke-dashoffset: 0; } }
@keyframes iv-fill { to { fill-opacity: 1; } }
@keyframes iv-inner { to { stroke-opacity: 0.35; } }
@keyframes iv-vee { to { transform: scale(1); opacity: 1; } }
@keyframes iv-star { 60% { transform: scale(1.6) rotate(10deg); } to { transform: scale(1) rotate(0); } }
@keyframes iv-burst { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 25% { opacity: 1; } to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes iv-word { to { letter-spacing: 0.25em; margin-right: -0.25em; opacity: 1; } }
@keyframes iv-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) { .intro-overlay { display: none !important; } }

/* ---------- home: lore ---------- */
.lore { max-width: 720px; margin: 8px auto 34px; text-align: center; padding: 0 4px; }
.lore-divider { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.lore-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.lore-divider span:last-child { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.lore-divider img { filter: drop-shadow(0 0 10px rgba(232, 182, 76, 0.35)); }
.lore h2 { font-family: "Cinzel", Georgia, serif; color: var(--gold); font-size: clamp(1.5rem, 3.6vw, 2.1rem); letter-spacing: 0.05em; margin: 0 0 18px; }
.lore p { color: #cfc9bc; line-height: 1.8; font-size: 1.04rem; margin: 0 0 16px; }
.lore .lore-lead { font-size: 1.14rem; color: var(--text); }
.lore .lore-lead::first-letter { font-family: "Cinzel", Georgia, serif; color: var(--gold); font-size: 1.35em; font-weight: 700; line-height: 1; }
.lore-sign { margin-top: 24px !important; display: flex; flex-direction: column; gap: 4px; }
.lore-sign em { color: var(--gold); font-family: Georgia, serif; font-size: 1.1rem; }
.lore-sign span { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- My characters ---------- */
/* Official class colours */
.cls-0 { --cc: #ffffff; } .cls-1 { --cc: #C79C6E; } .cls-2 { --cc: #F58CBA; } .cls-3 { --cc: #ABD473; }
.cls-4 { --cc: #FFF569; } .cls-5 { --cc: #FFFFFF; } .cls-6 { --cc: #C41F3B; } .cls-7 { --cc: #0070DE; }
.cls-8 { --cc: #69CCF0; } .cls-9 { --cc: #9482C9; } .cls-11 { --cc: #FF7D0A; }
.cc { color: var(--cc); }

.account-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-head h1 { margin-bottom: 2px; }
.account-head p { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
a.balance { text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
a.balance:hover { border-color: var(--gold); transform: translateY(-1px); }
.section-title { font-family: "Cinzel", Georgia, serif; color: var(--gold); letter-spacing: 0.03em; }

.meta-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: rgba(255, 255, 255, 0.03); }
.meta-pill.verified { color: #9fe6b2; border-color: rgba(76, 196, 106, 0.4); background: rgba(76, 196, 106, 0.08); }
.meta-pill.online { color: #9fe6b2; border-color: rgba(76, 196, 106, 0.4); }
.faction { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.faction.alliance { color: #8fb8ff; background: rgba(40, 90, 200, 0.15); border: 1px solid rgba(90, 140, 255, 0.35); }
.faction.horde { color: #ff8f8f; background: rgba(190, 30, 30, 0.15); border: 1px solid rgba(255, 90, 90, 0.35); }

/* portraits */
.portrait { position: relative; flex: none; border-radius: 14px; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--cc) 30%, #1a1f2b), #0b0d12 75%);
  border: 2px solid var(--gold-dim); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 18px color-mix(in srgb, var(--cc) 25%, transparent), inset 0 0 12px rgba(0, 0, 0, 0.7); }
.portrait.big { width: 116px; height: 116px; }
.portrait.small { width: 64px; height: 64px; border-radius: 10px; }
.portrait-initial { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Cinzel", Georgia, serif; font-weight: 700; color: var(--cc); font-size: 2.6rem; }
.portrait.small .portrait-initial { font-size: 1.6rem; }
.portrait-img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: cover; border-radius: 11px; image-rendering: auto; }
.portrait.small .portrait-img { border-radius: 7px; }
.portrait-class { position: absolute; right: -10px; bottom: -10px; width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6); background: #0b0d12; }
.portrait.small .portrait-class { width: 26px; height: 26px; right: -7px; bottom: -7px; border-width: 1.5px; }
.portrait-online { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); box-shadow: 0 0 8px rgba(76, 196, 106, 0.8); }

/* featured character */
.featured { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--cc) 35%, var(--border));
  background: radial-gradient(ellipse at 12% 0%, color-mix(in srgb, var(--cc) 14%, transparent), transparent 55%), var(--panel); }
.featured-ribbon { position: absolute; top: 26px; right: -50px; width: 200px; text-align: center; transform: rotate(35deg); background: linear-gradient(180deg, var(--gold), var(--gold-dim)); color: #1a1408; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.featured-top { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.featured-info { flex: 1; min-width: 200px; }
.featured-name { font-family: "Cinzel", Georgia, serif; font-size: clamp(1.8rem, 4.5vw, 2.5rem); margin: 0 0 4px; letter-spacing: 0.03em; text-shadow: 0 0 22px color-mix(in srgb, var(--cc) 35%, transparent); }
.featured-sub { color: var(--text); font-size: 1.05rem; margin-bottom: 10px; }
.featured-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.featured .char-actions { margin-bottom: 12px; }

/* other characters */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; margin-top: 6px; }
.char-card { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--cc); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.char-card-top { display: flex; align-items: center; gap: 16px; }
.char-card-info { flex: 1; min-width: 0; }
.char-card-name { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.2rem; }
.char-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.set-main { align-self: flex-start; }
.empty-roster { text-align: center; padding: 34px 24px; }
@media (max-width: 560px) {
  .char-card-top { flex-wrap: wrap; }
  .set-main { width: 100%; }
  .set-main .btn { width: 100%; }
  .featured-top { justify-content: center; text-align: center; }
  .featured-meta { justify-content: center; }
}
.img-broken { display: none !important; }

/* ---------- service buttons & pop-ups ---------- */
.service-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 16px 0 10px; }
.service-btn { font: inherit; color: var(--text); text-align: left; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px;
  background: radial-gradient(circle at 0% 0%, rgba(232, 182, 76, 0.12), transparent 60%), var(--panel-2); border: 1px solid var(--border); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.service-btn:hover:not(:disabled) { border-color: var(--gold-dim); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.service-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.service-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem; border-radius: 10px; background: rgba(232, 182, 76, 0.12); border: 1px solid rgba(232, 182, 76, 0.3); }
.service-text { flex: 1; display: grid; gap: 2px; }
.service-text strong { font-size: 1.02rem; }
.service-price { display: grid; text-align: right; color: var(--gold); font-weight: 700; white-space: nowrap; }

.svc-dialog { width: min(480px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--gold-dim); border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.svc-dialog::backdrop { background: rgba(4, 5, 8, 0.72); backdrop-filter: blur(3px); }
.svc-dialog[open] { animation: svc-in 0.18s ease-out; }
@keyframes svc-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.svc-form { padding: 22px 22px 20px; margin: 0; }
.svc-head { display: flex; align-items: center; gap: 12px; }
.svc-head h2 { margin: 0; flex: 1; font-family: "Cinzel", Georgia, serif; color: var(--gold); }
.svc-close { font: inherit; font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.svc-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.form select { background: #0a0c10; border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 10px 12px; font: inherit; }
.form select:focus { outline: 2px solid var(--gold-dim); border-color: transparent; }
.svc-races { display: grid; gap: 4px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 8px; }
.svc-races strong { color: var(--gold); font-weight: 600; }
.svc-note { margin: 0; }
.svc-pay { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.svc-pay legend { color: var(--muted); font-size: 0.92rem; margin-bottom: 6px; }
.pay-opt { display: flex !important; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; color: var(--text) !important; }
.pay-opt span { display: grid; gap: 1px; }
.pay-opt:has(input:checked) { border-color: var(--gold-dim); background: rgba(232, 182, 76, 0.07); }
.pay-opt:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.pay-opt input { accent-color: var(--gold); width: 18px; height: 18px; }
.svc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
/* service buttons: stacked card layout */
.service-btn { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; }
.service-text { gap: 4px; }
.service-price { display: flex; align-items: baseline; gap: 8px; text-align: left; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); width: 100%; font-size: 1.05rem; }
.service-price .small { font-weight: 500; }
.security-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.security-card h2 { margin-bottom: 4px; }
.security-card p { margin: 0; }
.roles-line { margin-top: 8px !important; }
.role-chip { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; border: 1px solid rgba(232, 182, 76, 0.35); color: var(--gold); font-size: 0.78rem; }

/* ---------- leaderboards ---------- */
.lb-head { text-align: center; margin: 10px 0 18px; }
.lb-head h1 { font-family: "Cinzel", Georgia, serif; color: var(--gold); font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 6px; letter-spacing: 0.05em;
  text-shadow: 0 0 22px rgba(232, 182, 76, 0.25); }
.lb-head p { margin: 0; }
.lb-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.lb-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: border-color 0.15s, background 0.15s; }
.lb-tab:hover { border-color: var(--gold-dim); }
.lb-tab.on { background: linear-gradient(180deg, var(--gold), var(--gold-dim)); color: #1a1408; border-color: transparent; }
.lb-realms { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.lb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-toolbar h2 { margin: 0; }
.lb-factions { display: flex; gap: 6px; }
.lb-faction { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.lb-faction.on { color: var(--gold); border-color: var(--gold-dim); background: rgba(232, 182, 76, 0.08); }
.lb-faction.alliance.on { color: #8fb8ff; border-color: rgba(90, 140, 255, 0.45); background: rgba(40, 90, 200, 0.12); }
.lb-faction.horde.on { color: #ff8f8f; border-color: rgba(255, 90, 90, 0.45); background: rgba(190, 30, 30, 0.12); }
.lb-cols { display: grid; grid-template-columns: 52px 1fr auto; padding: 6px 12px; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); }
.lb-cols span:nth-child(2) { padding-left: 52px; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: grid; grid-template-columns: 52px 44px 1fr 14px auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: rgba(255, 255, 255, 0.02); }
.lb-rank { text-align: center; font-family: "Cinzel", Georgia, serif; font-weight: 700; color: var(--muted); font-size: 1.05rem; }
.medal-1 .lb-rank, .medal-2 .lb-rank, .medal-3 .lb-rank { font-size: 1.5rem; }
.medal-1 { background: linear-gradient(90deg, rgba(232, 182, 76, 0.12), transparent 60%); }
.medal-2 { background: linear-gradient(90deg, rgba(200, 205, 215, 0.08), transparent 60%); }
.medal-3 { background: linear-gradient(90deg, rgba(205, 127, 50, 0.09), transparent 60%); }
.portrait.tiny { width: 44px; height: 44px; border-radius: 9px; border-width: 1.5px; }
.portrait.tiny .portrait-initial { font-size: 1.2rem; }
.portrait.tiny .portrait-img { border-radius: 6px; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
.lb-who { display: grid; min-width: 0; }
.lb-name { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.08rem; }
.lb-sub { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-guild { color: #b9d48e; }
.faction-dot { width: 10px; height: 10px; border-radius: 50%; }
.faction-dot.alliance { background: #4f86ff; box-shadow: 0 0 6px rgba(79, 134, 255, 0.6); }
.faction-dot.horde { background: #e04848; box-shadow: 0 0 6px rgba(224, 72, 72, 0.6); }
.lb-value { font-weight: 700; color: var(--gold); font-size: 1.05rem; text-align: right; min-width: 70px; font-variant-numeric: tabular-nums; }
.lb-empty { text-align: center; padding: 30px 0; }
@media (max-width: 560px) {
  .lb-row { grid-template-columns: 34px 38px 1fr auto; gap: 9px; padding: 9px 6px; }
  .lb-row .faction-dot { display: none; }
  .lb-sub { white-space: normal; line-height: 1.35; }
  .portrait.tiny { width: 38px; height: 38px; }
  .lb-cols { grid-template-columns: 34px 1fr auto; }
  .lb-cols span:nth-child(2) { padding-left: 47px; }
  .lb-tab { padding: 7px 12px; font-size: 0.85rem; }
}
