/* ============================================================
   SW For Fun — Production theme ("Blood & Rust")
   Dark cinematic dark-fantasy. One skeleton, token-driven.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=UnifrakturCook:wght@700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ============================================================
   TOKENS — Production ("blood & rust")
   Swap this block (or :root[data-theme="classic"]) for the
   Classic parchment theme. Same variable names, new values.
   ============================================================ */
:root {
  /* surfaces */
  --bg:        oklch(0.165 0.034 25);
  --bg-2:      oklch(0.135 0.030 25);
  --bg-deep:   oklch(0.105 0.024 25);
  --panel:     oklch(0.215 0.044 22);
  --panel-2:   oklch(0.255 0.050 22);
  --panel-hi:  oklch(0.300 0.055 22);

  /* lines & strokes */
  --line:      oklch(0.345 0.050 24);
  --line-soft: oklch(0.275 0.040 24);
  --line-gold: oklch(0.62 0.090 78 / 0.45);

  /* text */
  --text:      oklch(0.930 0.012 70);
  --text-dim:  oklch(0.745 0.022 45);
  --text-mut:  oklch(0.600 0.025 35);

  /* brand accents */
  --link:      oklch(0.770 0.052 22);
  --link-hov:  oklch(0.870 0.080 38);
  --crimson:   oklch(0.500 0.170 27);
  --crimson-2: oklch(0.420 0.150 27);
  --ember:     oklch(0.690 0.190 42);
  --ember-2:   oklch(0.620 0.200 35);
  --gold:      oklch(0.810 0.120 84);
  --gold-dim:  oklch(0.660 0.095 80);

  /* status */
  --ok:        oklch(0.720 0.150 150);
  --ok-glow:   oklch(0.720 0.150 150 / 0.45);
  --warn:      oklch(0.780 0.140 80);
  --danger:    oklch(0.600 0.205 26);
  --danger-2:  oklch(0.520 0.190 26);
  --info:      oklch(0.700 0.090 230);

  /* rank metals */
  --rank-1: oklch(0.820 0.130 86);   /* gold   */
  --rank-2: oklch(0.800 0.018 250);  /* silver */
  --rank-3: oklch(0.660 0.110 55);   /* bronze */

  /* type */
  --f-display: 'Cinzel', serif;
  --f-black:   'UnifrakturCook', 'Cinzel', serif;
  --f-body:    'Spectral', 'Times New Roman', serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* geometry */
  --r-sm: 4px;
  --r-md: 7px;
  --r-lg: 12px;
  --maxw: 1200px;

  /* shadows / glows */
  --sh-1: 0 2px 8px oklch(0 0 0 / 0.35);
  --sh-2: 0 10px 34px oklch(0 0 0 / 0.50);
  --glow-ember: 0 0 24px oklch(0.69 0.19 42 / 0.35);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--f-body);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--link-hov); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--crimson); color: #fff; }

/* atmospheric backdrop layers — applied to the app root */
.app-bg {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(0.26 0.07 30) 0%, transparent 55%),
    radial-gradient(140% 90% at 50% 120%, oklch(0.10 0.04 20) 0%, transparent 50%),
    var(--bg);
}
.app-bg::after { /* fine grain texture */
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, oklch(0 0 0 / 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, oklch(1 0 0 / 0.012) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay; opacity: .5;
}
.app-vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  box-shadow: inset 0 0 220px 60px oklch(0 0 0 / 0.65);
  background: radial-gradient(130% 100% at 50% 35%, transparent 58%, oklch(0.06 0.02 20 / 0.7) 100%);
}

/* floating embers */
.embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--ember); box-shadow: 0 0 8px 2px oklch(0.69 0.19 42 / 0.6);
  opacity: 0; animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .5; }
  100% { transform: translateY(-104vh) translateX(var(--drift, 20px)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ember { display: none; } }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 64px; }

/* --- Flash messages --- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
.flash {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--panel);
  font-size: 14px; box-shadow: var(--sh-1);
  border-left-width: 3px;
}
.flash .fx-ic { flex: none; width: 18px; height: 18px; }
.flash--success { border-left-color: var(--ok); }
.flash--error   { border-left-color: var(--danger); }
.flash--info    { border-left-color: var(--info); }
.flash--success .fx-ic { color: var(--ok); }
.flash--error   .fx-ic { color: var(--danger); }
.flash--info    .fx-ic { color: var(--info); }
.flash .fx-close { margin-left: auto; background: none; border: 0; color: var(--text-mut); font-size: 18px; line-height: 1; }
.flash .fx-close:hover { color: var(--text); }

/* --- Header / banner --- */
.banner {
  position: relative; margin-top: 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background:
    radial-gradient(90% 160% at 50% 0%, oklch(0.30 0.12 35) 0%, transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--bg-2));
  overflow: hidden; box-shadow: var(--sh-2);
}
.banner::before { /* smoldering bottom glow */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
  background: radial-gradient(80% 120% at 50% 120%, oklch(0.55 0.20 35 / 0.55), transparent 70%);
  pointer-events: none;
}
.banner__inner {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 30px 20px 26px; cursor: pointer; text-align: center;
}
.banner__crest {
  width: 52px; height: 52px; margin-bottom: 2px;
  filter: drop-shadow(0 0 14px oklch(0.69 0.19 42 / 0.6));
}
.banner__word {
  font-family: var(--f-black); font-weight: 700; white-space: nowrap; padding: 0 .35em;
  font-size: clamp(38px, 7vw, 66px); line-height: 1.15; letter-spacing: 1px;
  color: var(--text);
  background: linear-gradient(180deg, oklch(0.95 0.04 70), var(--gold) 55%, var(--ember-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 30px oklch(0.69 0.19 42 / 0.25);
}
.banner__sub {
  font-family: var(--f-display); letter-spacing: .34em; text-transform: uppercase; white-space: nowrap;
  font-size: 11px; color: var(--gold-dim); padding-left: .34em;
}
@media (max-width: 460px) { .banner__sub { letter-spacing: .18em; font-size: 10px; } }
.banner__rule { display: flex; align-items: center; gap: 12px; color: var(--line-gold); margin-top: 4px; }
.banner__rule i { display: block; width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.banner__rule i:last-child { background: linear-gradient(270deg, transparent, var(--gold-dim)); }
.banner__rule b { width: 5px; height: 5px; background: var(--gold-dim); transform: rotate(45deg); }

/* --- Server status badge --- */
.srv {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  font-size: 12px; font-family: var(--f-mono); letter-spacing: .04em;
  border: 1px solid var(--line); background: oklch(0.12 0.02 25 / 0.7); backdrop-filter: blur(4px);
}
.srv__dot { width: 9px; height: 9px; border-radius: 50%; position: relative; }
.srv--up   .srv__dot { background: var(--ok); box-shadow: 0 0 0 0 var(--ok-glow); animation: pulse 2.2s infinite; }
.srv--down .srv__dot { background: var(--danger); }
.srv--up   { color: oklch(0.85 0.10 150); }
.srv--down { color: oklch(0.80 0.12 30); border-color: var(--danger-2); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--ok-glow); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* --- Navbar --- */
.nav {
  position: sticky; top: 0; z-index: 40; margin-top: 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--sh-1); backdrop-filter: blur(6px);
}
.nav__row { display: flex; align-items: stretch; }
.nav__links { display: flex; flex: 1; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 14px 20px; color: var(--text-dim); font-size: 14px;
  font-family: var(--f-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  border: 0; background: none; transition: color .15s, background .15s;
}
.nav__link .nv-ic { width: 17px; height: 17px; opacity: .8; }
.nav__link:hover { color: var(--text); background: oklch(1 0 0 / 0.03); }
.nav__link.is-active { color: var(--ember); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  box-shadow: 0 0 12px var(--ember);
}
.nav__burger { display: none; align-items: center; justify-content: center; width: 52px; border: 0; background: none; color: var(--text); font-size: 20px; }

/* --- Main grid --- */
.layout { display: grid; grid-template-columns: 232px 1fr; gap: 22px; margin-top: 22px; align-items: start; }

/* --- Sidebar --- */
.aside { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 16px; }
.panel {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  box-shadow: var(--sh-1); overflow: hidden;
}
.panel__head {
  padding: 11px 14px; font-family: var(--f-display); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dim);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, oklch(1 0 0 / 0.03), transparent);
}
.snav { display: flex; flex-direction: column; padding: 6px; }
.snav__link {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-dim); font-size: 14px; border: 0; background: none; text-align: left; width: 100%;
}
.snav__link .sn-ic { width: 16px; height: 16px; color: var(--crimson); opacity: .85; flex: none; }
.snav__link:hover { background: oklch(1 0 0 / 0.04); color: var(--text); }
.snav__link.is-active { background: linear-gradient(90deg, oklch(0.50 0.17 27 / 0.20), transparent); color: var(--text); box-shadow: inset 2px 0 0 var(--crimson); }
.snav__link small { display: block; color: var(--text-mut); font-size: 11px; font-family: var(--f-mono); }

/* mini server-info panel */
.srvinfo { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.srvinfo__row { display: flex; justify-content: space-between; align-items: baseline; }
.srvinfo__row span { color: var(--text-mut); }
.srvinfo__row b { font-family: var(--f-mono); color: var(--text); font-weight: 500; }
.srvinfo__row b.up { color: var(--ok); }

/* --- Content frame (the reimagined decorative borders) --- */
.frame {
  position: relative; min-height: 60vh;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background:
    radial-gradient(120% 60% at 50% 0%, oklch(0.22 0.05 28) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-deep));
  box-shadow: var(--sh-2), inset 0 0 120px oklch(0 0 0 / 0.5);
  padding: 30px 34px 38px;
  overflow: hidden;
}
.frame::before { /* gold hairline inset */
  content: ""; position: absolute; inset: 8px; border: 1px solid var(--line-gold);
  border-radius: calc(var(--r-lg) - 4px); pointer-events: none; opacity: .55;
}
.frame__corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold-dim); opacity: .5; pointer-events: none; }
.frame__corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.frame__corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.frame__corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.frame__corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.frame__body { position: relative; z-index: 1; }

/* ============================================================
   SHARED PRIMITIVES
   ============================================================ */
/* Page title (bilingual) */
.ptitle { margin: 0 0 22px; }
.ptitle__en {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: .04em; color: var(--text); line-height: 1.05;
  display: flex; align-items: center; gap: 14px;
}
.ptitle__en .tt-ic { width: 28px; height: 28px; color: var(--ember); filter: drop-shadow(0 0 10px oklch(0.69 0.19 42 / 0.5)); }
.ptitle__ru { font-family: var(--f-body); font-style: italic; color: var(--text-dim); font-size: 16px; margin-top: 4px; padding-left: 42px; }
.ptitle__count { font-family: var(--f-mono); color: var(--gold); font-weight: 700; }

/* bilingual inline pair helper */
.bi { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.bi--stack { display: block; }
.bi__ru { color: var(--text-dim); }
@media (max-width: 720px) { .bi { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  font-family: var(--f-display); letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid transparent; transition: all .15s ease; line-height: 1; white-space: nowrap;
}
.btn .bt-ic { width: 16px; height: 16px; }
.btn--primary {
  color: oklch(0.98 0.01 60);
  background: linear-gradient(180deg, var(--crimson), var(--crimson-2));
  border-color: oklch(0.55 0.18 27); box-shadow: var(--sh-1), inset 0 1px 0 oklch(1 0 0 / 0.15);
}
.btn--primary:hover { background: linear-gradient(180deg, var(--ember-2), var(--crimson)); box-shadow: var(--glow-ember); transform: translateY(-1px); }
.btn--secondary { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.btn--secondary:hover { background: var(--panel-hi); border-color: var(--gold-dim); color: var(--text); }
.btn--ghost { color: var(--text-dim); background: none; border-color: var(--line); }
.btn--ghost:hover { color: var(--text); border-color: var(--gold-dim); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* icon button */
.ibtn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
  transition: all .15s;
}
.ibtn .ic { width: 16px; height: 16px; }
.ibtn:hover { color: var(--text); border-color: var(--gold-dim); background: var(--panel-hi); }
.ibtn--danger:hover { color: oklch(0.85 0.12 28); border-color: var(--danger); background: oklch(0.50 0.17 27 / 0.25); }
.ibtn--ok:hover { color: oklch(0.85 0.12 150); border-color: var(--ok); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-family: var(--f-mono); font-weight: 500; letter-spacing: .02em;
  border: 1px solid var(--line); color: var(--text-dim); background: oklch(1 0 0 / 0.03);
}
.badge .bg-ic { width: 12px; height: 12px; }
.badge--afk    { color: var(--warn);   border-color: oklch(0.6 0.12 80 / 0.5);  background: oklch(0.6 0.12 80 / 0.10); }
.badge--dead   { color: var(--text-mut); border-color: var(--line); text-decoration: none; }
.badge--hidden { color: var(--info);   border-color: oklch(0.6 0.09 230 / 0.5); }
.badge--online { color: var(--ok);     border-color: oklch(0.6 0.12 150 / 0.5); background: oklch(0.6 0.12 150 / 0.10); }

/* race chip */
.race { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.race__emblem { width: 18px; height: 18px; border-radius: 4px; flex: none; display: grid; place-items: center; font-size: 11px; }

/* Tables */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th {
  text-align: left; padding: 11px 16px; font-family: var(--f-display); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dim);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: oklch(1 0 0 / 0.025); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--f-mono); }
.tbl .lvl { font-family: var(--f-mono); color: var(--gold); font-weight: 700; }
.tbl .pname { color: var(--link); font-weight: 600; }
.tbl tr:hover .pname { color: var(--link-hov); }
.tbl .is-dead .pname { color: var(--text-mut); }
.tbl .is-archived .pname { text-decoration: line-through; color: var(--text-mut); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field__label { font-size: 12px; font-family: var(--f-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.field__label .ru { color: var(--text-mut); font-family: var(--f-body); text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; margin-left: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; font-family: var(--f-body); font-size: 15px; color: var(--text);
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-sm); transition: border .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-mut); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ember-2); box-shadow: 0 0 0 3px oklch(0.62 0.20 35 / 0.18); }
.input:disabled, .input[readonly] { color: var(--text-dim); background: oklch(0.13 0.02 25); cursor: default; }
.field--err .input { border-color: var(--danger); }
.field__err { font-size: 12px; color: oklch(0.78 0.14 28); display: flex; align-items: center; gap: 6px; }
.field__hint { font-size: 12px; color: var(--text-mut); }
.checkrow { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-dim); cursor: pointer; }
.checkrow input { accent-color: var(--crimson); width: 16px; height: 16px; }

/* card */
.card { border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(180deg, var(--panel), var(--bg-2)); box-shadow: var(--sh-1); }
.card__pad { padding: 22px; }

/* divider w/ ornament */
.orn { display: flex; align-items: center; gap: 14px; color: var(--line-gold); margin: 22px 0; }
.orn i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-gold), transparent); }
.orn b { width: 6px; height: 6px; background: var(--gold-dim); transform: rotate(45deg); opacity: .7; }

/* ============================================================
   STATES — skeleton / empty / error
   ============================================================ */
.skel { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-hi) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 54px 20px; color: var(--text-dim); }
.state__ic { width: 46px; height: 46px; color: var(--line); margin-bottom: 4px; }
.state__t { font-family: var(--f-display); font-size: 18px; color: var(--text); letter-spacing: .04em; }
.state__d { font-size: 14px; max-width: 360px; }
.state--error .state__ic { color: var(--danger); }

.freshness { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-family: var(--f-mono); color: var(--text-mut); }
.freshness .fr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { margin-top: 30px; border-top: 1px solid var(--line-soft); padding-top: 26px; }
.footer__grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand b { font-family: var(--f-black); font-size: 22px; color: var(--gold-dim); }
.footer__brand span { font-size: 12px; color: var(--text-mut); max-width: 260px; }
.footer__links { display: flex; gap: 8px; flex-wrap: wrap; }
.worldsw { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: 12px; font-family: var(--f-mono); }
.worldsw button { padding: 7px 14px; border: 0; background: none; color: var(--text-dim); }
.worldsw button.on { background: linear-gradient(180deg, var(--crimson), var(--crimson-2)); color: #fff; }
.langsw { display: inline-flex; gap: 4px; }
.langsw button { padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: none; color: var(--text-dim); font-size: 12px; font-family: var(--f-mono); }
.langsw button.on { color: var(--gold); border-color: var(--gold-dim); }
.footer__legal { margin-top: 18px; font-size: 12px; color: var(--text-mut); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .aside .panel { flex: 1; min-width: 240px; }
}
@media (max-width: 720px) {
  .shell { padding: 0 12px 48px; }
  .nav__links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
  .nav.open .nav__links { display: flex; }
  .nav__burger { display: flex; margin-left: auto; }
  .nav__row { justify-content: space-between; }
  .nav__link { padding: 13px 18px; }
  .frame { padding: 22px 16px 28px; }
  .aside { flex-direction: column; }
  .srv { position: static; margin: 10px auto 0; }
}

/* ============================================================
   CLASSIC THEME — "Faded Parchment"
   Same skeleton, light olive/archival skin. Activated by
   <html data-theme="classic">. Only tokens + a few hard-coded
   atmospheric layers are re-skinned; structure is untouched.
   ============================================================ */
:root[data-theme="classic"] {
  /* surfaces — warm cream parchment; panels read as raised ivory */
  --bg:        oklch(0.880 0.028 86);
  --bg-2:      oklch(0.910 0.024 88);
  --bg-deep:   oklch(0.955 0.018 90);
  --panel:     oklch(0.945 0.022 89);
  --panel-2:   oklch(0.915 0.026 87);
  --panel-hi:  oklch(0.885 0.030 85);

  /* lines — soft warm sepia */
  --line:      oklch(0.730 0.040 74);
  --line-soft: oklch(0.815 0.030 80);
  --line-gold: oklch(0.620 0.080 72 / 0.55);

  /* text — warm dark brown, not pure black */
  --text:      oklch(0.310 0.038 50);
  --text-dim:  oklch(0.450 0.040 50);
  --text-mut:  oklch(0.560 0.035 55);

  /* accents — rich but restrained, like aged ink + brass */
  --link:      oklch(0.470 0.140 32);
  --link-hov:  oklch(0.390 0.150 30);
  --crimson:   oklch(0.490 0.165 30);
  --crimson-2: oklch(0.430 0.158 30);
  --ember:     oklch(0.560 0.165 42);
  --ember-2:   oklch(0.510 0.165 36);
  --gold:      oklch(0.560 0.110 74);   /* antique brass — readable on cream */
  --gold-dim:  oklch(0.500 0.092 72);

  /* status */
  --ok:        oklch(0.520 0.140 150);
  --ok-glow:   oklch(0.520 0.140 150 / 0.40);
  --warn:      oklch(0.560 0.120 68);
  --danger:    oklch(0.500 0.180 28);
  --danger-2:  oklch(0.440 0.170 28);
  --info:      oklch(0.480 0.110 245);

  /* rank metals on cream */
  --rank-1: oklch(0.600 0.120 82);
  --rank-2: oklch(0.560 0.014 250);
  --rank-3: oklch(0.540 0.110 50);

  /* soft, warm paper shadows */
  --sh-1: 0 1px 3px oklch(0.45 0.04 60 / 0.18);
  --sh-2: 0 10px 28px oklch(0.45 0.05 55 / 0.20);
  --glow-ember: 0 0 18px oklch(0.56 0.17 40 / 0.22);
}

/* atmospheric layers re-skinned for warm parchment */
:root[data-theme="classic"] .app-bg {
  background:
    radial-gradient(120% 85% at 50% -10%, oklch(0.955 0.030 92) 0%, transparent 58%),
    radial-gradient(140% 95% at 50% 120%, oklch(0.840 0.034 78) 0%, transparent 55%),
    var(--bg);
}
:root[data-theme="classic"] .app-bg::after { opacity: .16; mix-blend-mode: multiply; }
:root[data-theme="classic"] .app-vignette {
  box-shadow: inset 0 0 220px 60px oklch(0.55 0.04 70 / 0.14);
  background: radial-gradient(130% 100% at 50% 35%, transparent 64%, oklch(0.62 0.05 72 / 0.16) 100%);
}
:root[data-theme="classic"] .embers { display: none; }   /* archival, not aflame */

/* banner — pale plate, soft inner glow, brass wordmark */
:root[data-theme="classic"] .banner {
  background:
    radial-gradient(90% 160% at 50% 0%, oklch(0.965 0.028 92) 0%, transparent 62%),
    linear-gradient(180deg, var(--panel), var(--bg-2));
}
:root[data-theme="classic"] .banner::before {
  background: radial-gradient(80% 120% at 50% 120%, oklch(0.62 0.13 58 / 0.22), transparent 70%);
}
:root[data-theme="classic"] .banner__word {
  background: linear-gradient(180deg, oklch(0.46 0.12 58), oklch(0.56 0.12 76) 56%, oklch(0.49 0.16 34));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 oklch(0.98 0.02 95 / 0.6);
}

/* nav + panels: lift them off the page with a hair of warmth */
:root[data-theme="classic"] .nav { background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
:root[data-theme="classic"] .panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); }
:root[data-theme="classic"] .card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); }

/* status pill on light */
:root[data-theme="classic"] .srv { background: oklch(0.96 0.02 92 / 0.8); }
:root[data-theme="classic"] .srv--up { color: oklch(0.46 0.13 150); }
:root[data-theme="classic"] .srv--down { color: oklch(0.48 0.17 30); }

/* inputs read as pale paper wells */
:root[data-theme="classic"] .input,
:root[data-theme="classic"] .select,
:root[data-theme="classic"] .textarea { background: oklch(0.975 0.014 92); }
:root[data-theme="classic"] .input:disabled,
:root[data-theme="classic"] .input[readonly] { background: oklch(0.905 0.020 88); }

/* selection */
:root[data-theme="classic"] ::selection { background: var(--crimson); color: oklch(0.97 0.02 95); }

/* content frame — bright parchment interior */
:root[data-theme="classic"] .frame {
  background:
    radial-gradient(120% 60% at 50% 0%, oklch(0.955 0.024 92) 0%, transparent 64%),
    linear-gradient(180deg, var(--panel), var(--bg-2));
  box-shadow: var(--sh-2), inset 0 0 90px oklch(0.70 0.04 80 / 0.12);
}

/* ============================================================
   LEGACY MARKUP BRIDGE
   Existing Twig markup is kept intact (texts/news untouched);
   these rules map its class names onto the new tokens so every
   page adopts the theme without rewriting its HTML. Token-based,
   so the Classic theme adapts automatically.
   ============================================================ */

/* Banner logo — the real header.png inside the new banner plate */
.banner__logo { width: min(560px, 88%); height: auto; margin: 2px auto 0;
  filter: drop-shadow(0 4px 18px oklch(0 0 0 / .5)); }

/* Content typography inside the frame */
.frame__body h1, .frame__body h2, .frame__body h3, .frame__body h4 {
  font-family: var(--f-display); color: var(--gold); letter-spacing: .03em;
  margin: 0 0 16px; line-height: 1.15;
}
.frame__body h1 { font-size: clamp(26px, 3.4vw, 36px); }
.frame__body h2 { font-size: clamp(22px, 3vw, 30px); text-align: center; }
.frame__body h3 { font-size: 19px; color: var(--gold-dim); }
.frame__body p  { margin: 0 0 14px; }
.frame__body hr { border: 0; border-top: 1px solid var(--line-soft); margin: 22px 0; }
.frame__body ul { line-height: 1.6; }

/* Generic content tables (create-character stats, misc) */
.frame__body table { border-collapse: collapse; width: 100%; max-width: 560px; font-size: 14px; margin: 12px 0; }
.frame__body th, .frame__body td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.frame__body thead th { color: var(--gold-dim); font-family: var(--f-display); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

/* Generic forms */
.frame__body input[type="text"], .frame__body input[type="password"],
.frame__body input[type="email"], .frame__body input[type="number"],
.frame__body select, .frame__body textarea {
  width: 100%; max-width: 420px; padding: 11px 13px; font-family: var(--f-body);
  font-size: 15px; color: var(--text); background: var(--bg-deep);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border .15s, box-shadow .15s; margin-bottom: 12px;
}
.frame__body input::placeholder, .frame__body textarea::placeholder { color: var(--text-mut); }
.frame__body input:focus, .frame__body select:focus, .frame__body textarea:focus {
  outline: none; border-color: var(--ember-2); box-shadow: 0 0 0 3px oklch(0.62 0.20 35 / 0.18);
}
.frame__body input[readonly], .frame__body input:disabled { background: oklch(0.13 0.02 25); color: var(--text-dim); }
:root[data-theme="classic"] .frame__body input,
:root[data-theme="classic"] .frame__body select,
:root[data-theme="classic"] .frame__body textarea { background: oklch(0.975 0.014 92); }
:root[data-theme="classic"] .frame__body input[readonly],
:root[data-theme="classic"] .frame__body input:disabled { background: oklch(0.905 0.020 88); }
.frame__body label { font-size: 13px; color: var(--text-dim); }

/* Generic buttons (excluding the icon char-action & spoiler toggles) */
.frame__body button:not(.char-delete-button):not(.char-restore-button):not(.spoiler-toggle),
.frame__body input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  font-family: var(--f-display); letter-spacing: .05em; text-transform: uppercase;
  color: oklch(0.98 0.01 60); background: linear-gradient(180deg, var(--crimson), var(--crimson-2));
  border: 1px solid oklch(0.55 0.18 27); box-shadow: var(--sh-1), inset 0 1px 0 oklch(1 0 0 / 0.15);
  transition: all .15s ease; line-height: 1; cursor: pointer;
}
.frame__body button:not(.char-delete-button):not(.char-restore-button):not(.spoiler-toggle):hover,
.frame__body input[type="submit"]:hover {
  background: linear-gradient(180deg, var(--ember-2), var(--crimson)); box-shadow: var(--glow-ember); transform: translateY(-1px);
}

/* Login: signin | register side-by-side (no Bootstrap is loaded) */
.row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.row > .col-md-6 { flex: 1 1 280px; min-width: 0; }

/* ---- Online table & character-list (.online-list) ---- */
.character-list, .online-list { margin-top: 8px; }
.online-list {
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); box-shadow: var(--sh-1);
}
.online-list ul { list-style: none; margin: 0; padding: 0; }
.online-list li {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.online-list ul > li:last-child { border-bottom: 0; }
.online-list b li { /* header row: <b><li>…</li></b> */
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  font-family: var(--f-display); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid var(--line);
}
.online-list .name  { flex: 1 1 30%; color: var(--link); font-weight: 600; min-width: 0; }
.online-list .level { flex: 0 0 14%; font-family: var(--f-mono); color: var(--gold); font-weight: 700; }
.online-list .race  { flex: 0 0 16%; color: var(--text-dim); }
.online-list .guild { flex: 1 1 22%; color: var(--text-dim); min-width: 0; }
.online-list .info-status { flex: 0 0 16%; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }
.online-list b li .name, .online-list b li .level,
.online-list b li .race, .online-list b li .guild { color: var(--gold-dim); }
.online-list ul > li:hover { background: oklch(1 0 0 / 0.025); }
.online-list b li:hover { background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.online-list s { text-decoration: none; }
.online-list s li .name { text-decoration: line-through; color: var(--text-mut); }

/* char action icon-buttons (archive / delete / restore) */
.char-delete-button, .char-restore-button {
  background: none !important; border: 0 !important; padding: 2px; line-height: 0;
  opacity: .85; transition: opacity .15s; cursor: pointer;
}
.char-restore-button { margin-left: 6px; }
.char-delete-button:hover, .char-restore-button:hover { opacity: 1; }
.char-delete-button img, .char-restore-button img { display: inline-block; border-radius: var(--r-sm); }

/* ---- Top list ---- */
.top-list-container h2 { text-align: center; }
.skill-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.skill-column {
  flex: 1 1 280px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); box-shadow: var(--sh-1); overflow: hidden;
}
.skill-column h3 {
  margin: 0; text-align: center; padding: 11px 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--gold-dim);
  border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
}
.skill-column ul { list-style: none; margin: 0; padding: 6px 0; }
.skill-column li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 14px; }
.skill-column li:nth-child(odd) { background: oklch(1 0 0 / 0.02); }
.skill-column .character-name, .skill-column .name { color: var(--link); font-weight: 600; }
.skill-column .skill { font-family: var(--f-mono); color: var(--gold); font-weight: 700; }
.skill-column li:nth-child(1) .skill { color: var(--rank-1); }
.skill-column li:nth-child(2) .skill { color: var(--rank-2); }
.skill-column li:nth-child(3) .skill { color: var(--rank-3); }

/* legacy flash + spoiler */
.flash-message {
  margin: 12px 0; padding: 11px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); border-left: 3px solid var(--ember);
  background: var(--panel); font-size: 14px; box-shadow: var(--sh-1);
}
.spoiler-toggle { cursor: pointer; color: var(--link); display: inline-flex; gap: 8px; align-items: center; }
.spoiler-toggle:hover { color: var(--link-hov); text-decoration: underline; }
.spoiler-content { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); margin-top: 10px; }

/* footer world switch as real domain links */
.worldsw a { padding: 7px 14px; color: var(--text-dim); }
.worldsw a.on { background: linear-gradient(180deg, var(--crimson), var(--crimson-2)); color: #fff; }

/* account / profile / create-character forms (replaces register.css) */
.form-container {
  max-width: 440px; margin: 0 auto; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); box-shadow: var(--sh-1);
}
.frame__body .form-container button[type="submit"],
.frame__body .form-container button[type="button"] { width: 100%; }
[data-validate-error] { color: oklch(0.78 0.14 28); margin: 8px 0; font-size: 13px; }
.race-selection-container { display: flex; align-items: flex-start; justify-content: flex-start; gap: 20px; flex-wrap: wrap; margin: 12px 0; }
.race-options { margin: 0; }
.race-image img { height: auto; border-radius: var(--r-sm); }
.race-stats { margin: 0; }
