/* ==========================================================================
   Metin2 — web
   Liquid glass on warm black. Display: Instrument Serif, UI: Geist.
   ========================================================================== */

:root {
  --bg: #0a0809;
  --bg-2: #120e0f;
  --ink: #f5efe6;
  --ink-2: #d9d1c5;
  --muted: #a39a8e;
  --faint: #6f675e;
  --line: rgba(255, 244, 228, 0.09);
  --line-2: rgba(255, 244, 228, 0.16);

  --gold: #e9b964;
  --gold-2: #f6d79c;
  --ember: #e2552f;
  --ok: #6fd19a;
  --bad: #ff6b5c;

  --shinsoo: #e5493d;
  --chunjo: #e8b53e;
  --jinno: #4d93ea;

  --warrior: #e07a4f;
  --ninja: #79c08f;
  --sura: #b77bea;
  --shaman: #58b6e6;

  --glass-tint: rgba(255, 250, 242, 0.075);
  --glass-tint-2: rgba(255, 250, 242, 0.035);
  --glass-rim: rgba(255, 255, 255, 0.5);

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;

  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --font-ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --page: min(1180px, 100% - 32px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-ui);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; outline: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(233, 185, 100, 0.35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop__img {
  position: absolute; inset: -6%;
  background: var(--bg-image, url('/assets/bg/hero.jpg')) center / cover no-repeat;
  filter: blur(40px) saturate(1.5) brightness(0.75);
  transform: scale(1.08);
  transition: background-image 0.6s var(--ease), opacity 0.6s;
}
.backdrop__grade {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(226, 85, 47, 0.22), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(233, 185, 100, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(10, 8, 9, 0.2) 0%, rgba(10, 8, 9, 0.62) 50%, rgba(10, 8, 9, 0.88) 100%);
}
.backdrop__grain {
  position: absolute; inset: 0; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ==========================================================================
   Liquid glass
   ========================================================================== */
.glass {
  --mx: 30%;
  --my: -20%;
  position: relative;
  isolation: isolate;
  background: linear-gradient(165deg, var(--glass-tint) 0%, var(--glass-tint-2) 55%, rgba(255, 250, 242, 0.06) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(175%) brightness(1.04);
  backdrop-filter: blur(22px) saturate(175%) brightness(1.04);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.07),
    inset 0 0 22px rgba(255, 255, 255, 0.025),
    0 1px 1px rgba(0, 0, 0, 0.25),
    0 24px 60px -24px rgba(0, 0, 0, 0.75);
}
/* rim light: thin gradient border that catches light top-left and bottom-right */
.glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.1) 22%,
    rgba(255, 255, 255, 0.02) 50%,
    rgba(255, 255, 255, 0.08) 78%,
    rgba(255, 255, 255, 0.32) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 2;
}
/* specular highlight that follows the pointer */
.glass::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 246, 230, 0.11), transparent 42%);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.4s;
}
.glass > * { position: relative; z-index: 3; }
.glass--deep { background: linear-gradient(165deg, rgba(20, 15, 15, 0.55), rgba(20, 15, 15, 0.35)); }
.glass--flat::after { display: none; }
/* Chromium gets real refraction through an SVG displacement map (see liquid.js) */
.glass.is-liquid { -webkit-backdrop-filter: var(--liquid); backdrop-filter: var(--liquid); }

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 20px;
  border: 0; border-radius: 999px;
  font-weight: 550; font-size: 14.5px; letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform 0.35s var(--spring), box-shadow 0.3s var(--ease), background 0.3s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 13.5px; }
.btn--lg { --h: 54px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--gold {
  color: #1d1308;
  background:
    radial-gradient(120% 140% at 30% 0%, rgba(255, 248, 230, 0.85), transparent 45%),
    linear-gradient(180deg, #f3cf88 0%, #e3a94f 55%, #c98a35 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 6px rgba(120, 60, 0, 0.35),
    0 10px 30px -10px rgba(233, 165, 70, 0.65),
    0 0 0 1px rgba(255, 220, 160, 0.25);
}
.btn--gold:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 6px rgba(120,60,0,.35), 0 14px 38px -10px rgba(233,165,70,.8), 0 0 0 1px rgba(255,220,160,.35); }

.btn--glass {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.4),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
.btn--glass:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)); }
.btn--ghost { color: var(--ink-2); background: transparent; }
.btn--ghost:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.btn--danger { color: #ffd9d3; background: rgba(255, 107, 92, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 107, 92, 0.3); }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(0,0,0,.55) rgba(0,0,0,.55) transparent transparent;
  animation: spin 0.7s linear infinite;
}
.btn--glass.is-loading::after { border-color: rgba(255,255,255,.8) rgba(255,255,255,.8) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- navigation ---------- */
.nav-wrap {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 16px 0;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  width: min(1180px, 100%);
  margin: 0 auto;
  height: 60px;
  padding: 0 10px 0 20px;
  display: flex; align-items: center; gap: 20px;
  border-radius: 999px;
  background: linear-gradient(165deg, rgba(28, 20, 20, 0.62), rgba(18, 13, 13, 0.42));
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand__mark { width: 22px; height: 22px; color: var(--gold); }
.brand__name { font: italic 400 26px/1 var(--font-display); letter-spacing: 0.01em; }
.nav__links { display: flex; gap: 2px; margin-left: 8px; }
.nav__links a {
  position: relative;
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color 0.2s, background 0.25s;
}
.nav__links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.nav__links a.is-active {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav__user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav__burger { display: none; }

.coin-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 8px; border-radius: 999px;
  background: rgba(233, 185, 100, 0.1);
  box-shadow: inset 0 0 0 1px rgba(233, 185, 100, 0.25);
  font: 500 13.5px var(--font-mono); color: var(--gold-2);
}
.coin { width: 20px; height: 20px; flex: none; }

.user-menu { position: relative; }
.user-menu__btn { display: inline-flex; align-items: center; gap: 8px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f0c77c, #b0702c);
  color: #1d1308; font: 700 12px var(--font-ui); text-transform: uppercase;
}
.user-menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 220px; padding: 8px;
  border-radius: 18px;
  display: none;
}
.user-menu.is-open .user-menu__panel { display: block; animation: pop 0.35s var(--spring); }
.user-menu__panel a, .user-menu__panel button {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; border: 0; background: none;
  font-size: 14px; color: var(--ink-2); text-align: left;
}
.user-menu__panel a:hover, .user-menu__panel button:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.user-menu__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu__head b { display: block; font-size: 14px; }
.user-menu__head span { font-size: 12.5px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }

/* ---------- layout ---------- */
.page { width: var(--page); margin: 0 auto; padding: 56px 0 96px; }
.page--tight { max-width: 520px; }
.section { margin-top: 96px; }
.section:first-child { margin-top: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 11.5px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }
.h1, .h2, .h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
.h1 { font-size: clamp(44px, 7vw, 92px); line-height: 0.95; }
.h2 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1; }
.h3 { font-size: 28px; line-height: 1.05; }
.h1 em, .h2 em { font-style: italic; color: var(--gold-2); }
.lead { font-size: 17px; color: var(--ink-2); max-width: 56ch; margin: 18px 0 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-feature-settings: 'zero', 'tnum'; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head .lead { margin-top: 12px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.link-arrow:hover { color: var(--gold-2); }
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.3s var(--spring); }
.link-arrow:hover svg { transform: translateX(3px); }

.page-head { padding: 24px 0 40px; }
.page-head .h1 { font-size: clamp(44px, 6vw, 76px); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(860px, calc(100svh - 74px));
  display: grid; align-items: center;
  width: var(--page); margin: 0 auto;
  padding: 40px 0 150px;
}
.hero__art {
  position: absolute; z-index: -1;
  right: -90px; top: 44%;
  transform: translateY(-50%);
  width: min(1000px, 74%);
  aspect-ratio: 794 / 484;
  background: url('/assets/bg/hero.jpg') center / cover no-repeat;
  -webkit-mask:
    linear-gradient(90deg, transparent 0%, #000 38%, #000 82%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 18%, #000 62%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(90deg, transparent 0%, #000 38%, #000 82%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 18%, #000 62%, transparent 100%);
  mask-composite: intersect;
  filter: saturate(1.08) contrast(1.04);
}
.hero__art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 8, 9, 0.55), transparent 45%);
}
.hero__content { max-width: 640px; }
.hero__title { margin: 22px 0 0; }
.hero__title span { display: block; }
.hero__actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none;
  box-shadow: 0 0 0 0 transparent;
}
.live-dot.is-up { background: var(--ok); animation: pulse 2.2s infinite; }
.live-dot.is-down { background: var(--bad); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 209, 154, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(111, 209, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 209, 154, 0); }
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 14px 0 12px; border-radius: 999px;
  font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}

.statbar {
  position: absolute; left: 0; right: 0; bottom: 36px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-radius: var(--r-lg);
  padding: 6px;
}
.stat { padding: 16px 20px; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--line); }
.stat__label { font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stat__value { margin-top: 6px; font: 400 30px/1 var(--font-display); display: flex; align-items: center; gap: 10px; }
.stat__value small { font: 500 12px var(--font-mono); color: var(--muted); }
.chips-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ch-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px var(--font-mono); padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); color: var(--ink-2);
}

/* ---------- empires ---------- */
.empires { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.empire { padding: 26px; border-radius: var(--r-lg); overflow: hidden; }
.empire__glow {
  position: absolute; inset: auto -30% -60% auto; width: 80%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 65%); opacity: 0.32; z-index: 0 !important; filter: blur(10px);
}
.empire__name { font: 400 36px/1 var(--font-display); display: flex; align-items: center; gap: 12px; }
.empire__name i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); transform: rotate(45deg); box-shadow: 0 0 18px var(--c); }
.empire__desc { color: var(--muted); font-size: 14px; margin: 10px 0 26px; min-height: 44px; }
.empire__count { font: 400 48px/1 var(--font-display); }
.empire__count small { font: 500 12px var(--font-mono); color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-left: 8px; }
.meter { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); margin-top: 16px; overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w, 0%); background: var(--c); border-radius: inherit; transition: width 1.2s var(--ease); box-shadow: 0 0 12px var(--c); }

/* ---------- home split ---------- */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.panel { padding: 28px; border-radius: var(--r-lg); }
.panel__title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; gap: 12px; }
.news-item { padding: 18px 0; border-top: 1px solid var(--line); }
.news-item:first-of-type { border-top: 0; padding-top: 4px; }
.news-item__meta { display: flex; gap: 12px; align-items: center; font: 500 11.5px var(--font-mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.tag { padding: 3px 8px; border-radius: 6px; background: rgba(233, 185, 100, 0.12); color: var(--gold-2); }
.news-item h3 { margin: 10px 0 6px; font: 400 26px/1.1 var(--font-display); }
.news-item p { margin: 0; color: var(--ink-2); white-space: pre-line; }

.mini-rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.mini-rank li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.mini-rank li:first-child { border-top: 0; }
.mini-rank .pos { font: 500 13px var(--font-mono); color: var(--faint); }
.mini-rank li:nth-child(-n+3) .pos { color: var(--gold); }
.mini-rank .who b { font-weight: 550; display: block; font-size: 14.5px; }
.mini-rank .who span { font-size: 12.5px; color: var(--muted); }
.lvl { font: 500 13px var(--font-mono); padding: 4px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 26px; border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 230px; }
.step__n { font: italic 400 64px/0.8 var(--font-display); color: var(--gold); opacity: 0.9; }
.step h3 { font: 400 28px/1.05 var(--font-display); margin: 22px 0 8px; }
.step p { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; }
.step .btn { margin-top: auto; align-self: flex-start; }

/* ---------- segmented control / chips ---------- */
.seg {
  position: relative; display: inline-flex; padding: 4px; border-radius: 999px; gap: 2px;
}
.seg__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; z-index: 3 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 16px -6px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s var(--spring), width 0.5s var(--spring);
}
.seg button {
  position: relative; z-index: 4 !important; border: 0; background: none;
  height: 38px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted); transition: color 0.25s;
}
.seg button.is-active { color: var(--ink); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, 0.05); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.chip.is-active { color: var(--ink); background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255,255,255,.2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; }
.diamond { width: 8px; height: 8px; border-radius: 2px; background: var(--c); transform: rotate(45deg); flex: none; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field__label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; }
.field__label small { color: var(--faint); font-weight: 400; }
.input {
  width: 100%; height: 48px; padding: 0 16px;
  border-radius: 14px; border: 0;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--ink); font-size: 15px;
  transition: box-shadow 0.2s, background 0.2s;
}
textarea.input { height: auto; min-height: 120px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input::placeholder { color: var(--faint); }
.input:hover { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.input:focus { outline: none; background: rgba(0, 0, 0, 0.36); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(233, 185, 100, 0.6), 0 0 0 4px rgba(233, 185, 100, 0.12); }
.field.has-error .input { box-shadow: inset 0 0 0 1px rgba(255, 107, 92, 0.6), 0 0 0 4px rgba(255, 107, 92, 0.1); }
.field__hint { font-size: 12.5px; color: var(--faint); margin-top: 7px; }
.field__error { font-size: 12.5px; color: var(--bad); margin-top: 7px; display: none; }
.field.has-error .field__error { display: block; }
.input-wrap { position: relative; }
.input-wrap .reveal { position: absolute; right: 6px; top: 6px; height: 36px; width: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; }
.input-wrap .reveal:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.input-wrap .reveal svg { width: 18px; height: 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; margin: 6px 0 22px; }
.check input { appearance: none; width: 20px; height: 20px; flex: none; margin: 1px 0 0; border-radius: 6px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--gold); box-shadow: none; }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: solid #1d1308; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.check a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
.form-error { display: none; padding: 12px 14px; border-radius: 12px; background: rgba(255, 107, 92, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 107, 92, 0.25); color: #ffcfc8; font-size: 14px; margin-bottom: 16px; }
.form-error.is-visible { display: block; animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.auth { min-height: calc(100svh - 300px); display: grid; place-items: center; padding: 40px 0 80px; }
.auth__card { width: min(460px, 100%); padding: 36px; border-radius: 32px; }
.auth__card .h2 { font-size: 46px; }
.auth__card .lead { font-size: 15px; margin: 10px 0 28px; }
.auth__alt { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth__alt a { color: var(--gold-2); font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- tables ---------- */
.table-wrap { border-radius: var(--r-lg); padding: 8px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.t th { text-align: left; font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; white-space: nowrap; }
.t td { padding: 14px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
.t tbody tr { transition: background 0.2s; }
.t tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.t .num { text-align: right; font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.t .pos { font: 500 13px var(--font-mono); color: var(--faint); width: 56px; }
.t .name { font-weight: 550; }
.cls { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.cls i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.emp { display: inline-flex; align-items: center; gap: 8px; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .h3 { color: var(--ink); margin-bottom: 8px; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar__filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; }
.search .input { height: 40px; padding-left: 38px; width: 220px; border-radius: 999px; font-size: 14px; }
.search svg { position: absolute; left: 13px; top: 11px; width: 18px; height: 18px; color: var(--faint); z-index: 1; }

.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 16px; align-items: end; margin-bottom: 20px; }
.podium__card { padding: 24px; border-radius: var(--r-lg); text-align: center; }
.podium__card.p1 { padding-top: 36px; padding-bottom: 32px; }
.podium__rank { font: italic 400 54px/0.8 var(--font-display); color: var(--gold); }
.podium__card.p2 .podium__rank { color: #d6d3cf; }
.podium__card.p3 .podium__rank { color: #d39a6a; }
.podium__name { font: 400 30px/1.05 var(--font-display); margin: 14px 0 6px; overflow-wrap: anywhere; }
.podium__meta { display: flex; gap: 10px; justify-content: center; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px; }
.pager span { font: 500 13px var(--font-mono); color: var(--muted); min-width: 90px; text-align: center; }

/* ---------- shop ---------- */
.shop-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding: 24px 0 32px; }
.balance { padding: 18px 22px; border-radius: 22px; display: flex; align-items: center; gap: 16px; min-width: 260px; }
.balance__icon { width: 44px; height: 44px; }
.balance__label { font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.balance__value { font: 400 34px/1 var(--font-display); color: var(--gold-2); margin-top: 4px; }
.balance__value small { font: 500 12px var(--font-mono); color: var(--muted); margin-left: 6px; }
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; border-radius: 18px; font-size: 14px; color: var(--ink-2); margin-bottom: 24px; }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--gold); margin-top: 1px; }
.notice b { color: var(--ink); font-weight: 600; }

.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.item {
  padding: 22px; border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 270px;
  transition: transform 0.45s var(--spring);
}
.item:hover { transform: translateY(-3px); }
.item__top { display: flex; justify-content: space-between; align-items: start; }
.item__well {
  width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 220, 160, 0.12), rgba(0, 0, 0, 0.25) 70%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 1px 0 rgba(255, 255, 255, 0.08);
}
.item__well img { width: 64px; height: auto; max-height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.item__well--sm { width: 52px; height: 52px; border-radius: 16px; }
.item__well--sm img { width: 32px; max-height: 44px; }
.badge {
  font: 600 10.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px; color: #1d1308; background: var(--gold);
}
.badge--hot { background: var(--ember); color: #fff3ee; }
.item__name { font: 400 25px/1.08 var(--font-display); margin: 18px 0 4px; }
.item__pack { font: 500 12px var(--font-mono); color: var(--muted); letter-spacing: 0.06em; }
.item__desc { color: var(--muted); font-size: 13.5px; margin: 10px 0 18px; }
.item__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price b { font: 400 30px/1 var(--font-display); color: var(--gold-2); }
.price span { font: 500 11.5px var(--font-mono); color: var(--muted); }
.price s { font: 500 13px var(--font-mono); color: var(--faint); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 4, 4, 0.55);
  animation: fade 0.25s var(--ease);
}
.modal__card { width: min(460px, 100%); padding: 30px; border-radius: 32px; animation: rise 0.5s var(--spring); }
.modal__card .h3 { margin-bottom: 4px; }
.modal__x { position: absolute !important; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); color: var(--muted); display: grid; place-items: center; z-index: 5 !important; }
.modal__x:hover { color: var(--ink); background: rgba(255,255,255,.12); }
.modal__x svg { width: 16px; height: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.buy-item { display: flex; gap: 16px; align-items: center; margin: 18px 0 22px; }
.buy-rows { border-top: 1px solid var(--line); margin: 18px 0 22px; }
.buy-rows div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.buy-rows b { color: var(--ink); font: 500 14px var(--font-mono); }
.buy-rows .total b { color: var(--gold-2); font-size: 16px; }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.stepper button { width: 36px; height: 36px; border: 0; background: none; border-radius: 50%; font-size: 18px; color: var(--ink-2); }
.stepper button:hover { background: rgba(255,255,255,.08); }
.stepper output { min-width: 34px; text-align: center; font: 500 14px var(--font-mono); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: min(440px, calc(100% - 32px)); }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 18px; font-size: 14px; animation: rise 0.5s var(--spring); width: 100%; }
.toast.is-leaving { animation: fade 0.3s reverse forwards; }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast--ok svg { color: var(--ok); }
.toast--err svg { color: var(--bad); }

/* ---------- account ---------- */
.acc-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.acc-side { position: sticky; top: 96px; display: grid; gap: 16px; }
.acc-id { padding: 26px; border-radius: var(--r-lg); }
.acc-id .avatar { width: 54px; height: 54px; font-size: 22px; }
.acc-id h2 { font: 400 34px/1 var(--font-display); margin: 16px 0 4px; overflow-wrap: anywhere; }
.kv { display: grid; gap: 0; margin-top: 18px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.kv dt, .kv span:first-child { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.char { padding: 20px; border-radius: 22px; overflow: hidden; }
.char__lvl { font: italic 400 46px/0.9 var(--font-display); color: var(--gold-2); }
.char__lvl small { font: 500 11px var(--font-mono); font-style: normal; color: var(--muted); letter-spacing: 0.12em; margin-left: 6px; }
.char__name { font: 600 16px var(--font-ui); margin: 14px 0 6px; overflow-wrap: anywhere; }
.char__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.char__glow { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: 0.25; z-index: 0 !important; }
.hist-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.hist-row:first-child { border-top: 0; }
.hist-row b { font-weight: 550; font-size: 14.5px; }
.hist-row small { display: block; color: var(--muted); font-size: 12.5px; }
.delta { font: 500 14px var(--font-mono); }
.delta.plus { color: var(--ok); }
.delta.minus { color: var(--ink-2); }
.stack { display: grid; gap: 20px; }

/* ---------- admin ---------- */
.admin-items { display: grid; gap: 8px; }
.admin-item { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line); }
.admin-item.is-off { opacity: 0.5; }
.admin-item b { font-weight: 550; }
.admin-item small { display: block; color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20 !important; border-radius: 16px; padding: 6px; max-height: 300px; overflow: auto; background: rgba(22, 17, 17, 0.92); box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 40px -10px rgba(0,0,0,.8); }
.suggest button { display: flex; width: 100%; gap: 12px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 10px; text-align: left; font-size: 14px; }
.suggest button:hover { background: rgba(255,255,255,.07); }
.suggest img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.suggest small { margin-left: auto; color: var(--muted); font-family: var(--font-mono); }

/* ---------- download ---------- */
.dl { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: stretch; }
.dl__main { padding: 36px; border-radius: 32px; display: flex; flex-direction: column; overflow: hidden; }
.dl__file { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 18px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px var(--line); margin: 26px 0; }
.dl__file svg { width: 36px; height: 36px; color: var(--gold); flex: none; }
.dl__file b { display: block; font-weight: 550; }
.dl__file small { color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; }
.req { list-style: none; padding: 0; margin: 0; }
.req li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 14px; }
.req li:first-child { border-top: 0; }
.req span { color: var(--muted); }
.ol { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ol li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-size: 14.5px; color: var(--ink-2); }
.ol li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--font-mono); background: rgba(233,185,100,.12); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(233,185,100,.3); }
.ol b { color: var(--ink); font-weight: 600; }

.prose { max-width: 70ch; }
.prose h2 { font: 400 30px/1.1 var(--font-display); margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ol { padding-left: 20px; }
.prose li { margin: 6px 0; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.35)); }
.footer__inner { width: var(--page); margin: 0 auto; padding: 48px 0 56px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer__note { max-width: 46ch; color: var(--faint); font-size: 13px; margin: 12px 0 0; }
.footer__cols { display: flex; gap: 64px; }
.footer h4 { margin: 0 0 12px; font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.footer__cols a { display: block; color: var(--ink-2); font-size: 14px; padding: 4px 0; }
.footer__cols a:hover { color: var(--gold-2); }

/* ---------- loading skeleton ---------- */
.skel { border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* page transition */
.view-enter { animation: view-in 0.6s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1020px) {
  .statbar { grid-template-columns: repeat(3, 1fr); }
  .statbar .stat:nth-child(n+4) { display: none; }
  .split, .dl { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: 1fr; }
  .acc-side { position: static; }
}

@media (max-width: 820px) {
  .nav { padding: 0 8px 0 18px; gap: 8px; height: 56px; }
  .nav__links {
    position: fixed; left: 16px; right: 16px; top: 80px;
    flex-direction: column; gap: 2px; padding: 8px; margin: 0;
    border-radius: 24px;
    background: rgba(22, 16, 16, 0.97);
    -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 1px rgba(255,255,255,.08), 0 30px 60px -20px rgba(0,0,0,.8);
    opacity: 0; transform: translateY(-8px) scale(0.98); pointer-events: none;
    transition: opacity 0.25s, transform 0.4s var(--spring);
  }
  .nav.is-open .nav__links { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 14px 16px; font-size: 16px; }
  .nav__burger {
    display: grid; place-items: center; gap: 5px; width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.06); align-content: center;
  }
  .nav__burger span { display: block; width: 16px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 0.3s var(--spring); }
  .nav.is-open .nav__burger span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .nav__user .btn--ghost { display: none; }
  .user-menu__btn .user-menu__login { display: none; }
  .coin-chip { height: 32px; padding: 0 10px 0 6px; font-size: 12.5px; }

  .hero { padding: 20px 0 40px; min-height: auto; }
  .hero__art { position: relative; right: auto; top: auto; width: calc(100% + 32px); margin: 0 -16px; height: 300px; order: -1; -webkit-mask: linear-gradient(180deg, #000 55%, transparent); mask: linear-gradient(180deg, #000 55%, transparent); background-position: 30% 15%; }
  .hero__art::after { display: none; }
  .hero { display: flex; flex-direction: column; }
  .hero__content { margin-top: -40px; }
  .statbar { position: static; margin-top: 36px; grid-template-columns: 1fr 1fr; }
  .statbar .stat:nth-child(n+4) { display: block; }
  .statbar .stat:nth-child(5) { display: none; }
  .stat + .stat::before { display: none; }
  .stat { padding: 14px 16px; }
  .empires, .steps { grid-template-columns: 1fr; }
  .empire__desc { min-height: 0; }
  .section { margin-top: 72px; }
  .page { padding-top: 32px; }
  .podium { grid-template-columns: 1fr; }
  .podium__card.p1 { order: -1; }
  .search .input { width: 100%; }
  .search { flex: 1; min-width: 180px; }
  .t .hide-sm { display: none; }
  .t th, .t td { padding: 12px 10px; }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .auth__card { padding: 28px 22px; }
  .dl__main { padding: 26px 22px; }
  .admin-item { grid-template-columns: 44px 1fr auto; }
  .admin-item .admin-item__price { display: none; }
  .footer__cols { gap: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
