:root {
  color-scheme: dark;
  --bg: #09090d;
  --bg-soft: #101016;
  --panel: rgba(20, 19, 26, .92);
  --panel-2: #18171f;
  --panel-hover: #201d27;
  --line: #302a35;
  --line-soft: rgba(155, 133, 113, .14);
  --text: #e8e2de;
  --muted: #96909b;
  --muted-2: #6e6873;
  --red: #a6323b;
  --red-bright: #d14b50;
  --red-soft: rgba(166, 50, 59, .13);
  --gold: #b99a65;
  --gold-light: #d7bd8d;
  --green: #6c9b78;
  --shadow: 0 18px 55px rgba(0, 0, 0, .34);
  --radius: 13px;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh; margin: 0; color: var(--text);
  font: 14px/1.6 Inter, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 50% -25%, rgba(113, 36, 44, .19), transparent 48%),
    radial-gradient(ellipse at 100% 45%, rgba(69, 48, 64, .10), transparent 34%),
    linear-gradient(180deg, #0c0b10 0%, var(--bg) 42%, #0b0a0e 100%);
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E"); }
a { color: var(--gold-light); text-decoration: none; transition: color .18s ease; }
a:hover { color: #fff0cc; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(90px); opacity: .12; }
.ambient-one { width: 360px; height: 360px; background: #8e202e; top: 25%; left: -250px; }
.ambient-two { width: 420px; height: 420px; background: #51405f; right: -320px; top: 68%; }
.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 76px; padding: 12px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(185, 154, 101, .18);
  background: rgba(10, 9, 14, .88); backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; flex: 0 0 auto; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 46px; color: var(--gold-light); font: 700 25px Cinzel, Georgia, serif;
  border: 1px solid rgba(185,154,101,.62); clip-path: polygon(50% 0, 92% 18%, 86% 76%, 50% 100%, 14% 76%, 8% 18%);
  background: linear-gradient(145deg, rgba(151,47,54,.24), rgba(18,15,22,.45)); text-shadow: 0 0 18px rgba(185,154,101,.3); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.22; }
.brand-copy strong { font: 700 16px Cinzel, Georgia, serif; letter-spacing: .12em; }
.brand-copy strong i { color: var(--red-bright); font-style: normal; }
.brand-copy small { margin-top: 4px; color: var(--muted-2); font-size: 8px; letter-spacing: .28em; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; }
.main-nav a { padding: 9px 12px; border: 1px solid transparent; border-radius: 7px; color: #bcb5bf; font-size: 12px; font-weight: 600; letter-spacing: .015em; }
.main-nav a:hover, .main-nav a.active { color: var(--gold-light); border-color: rgba(185,154,101,.22); background: rgba(185,154,101,.06); }
.main-nav a[data-a="logout"] { margin-left: 5px; color: #d17a7d; }
.nav-toggle { display: none; padding: 8px 12px; color: var(--gold-light); border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.page-shell { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 38px 0 54px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 22px; }
.page-title h1, h2, h3 { font-family: Cinzel, Georgia, serif; }
.page-title h1 { margin: 0; font-size: clamp(23px, 4vw, 32px); font-weight: 600; letter-spacing: .035em; }
.page-title p { margin: 5px 0 0; color: var(--muted); }
h2 { font-size: 23px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: .025em; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--red-bright); font-size: 9px; font-weight: 700; letter-spacing: .24em; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px;
  min-height: 300px; padding: clamp(28px, 5vw, 58px); margin-bottom: 22px;
  border: 1px solid rgba(185,154,101,.26); border-radius: 16px;
  background: linear-gradient(105deg, rgba(25,17,23,.98) 0%, rgba(22,17,25,.91) 54%, rgba(32,19,28,.62) 100%),
    radial-gradient(ellipse at 85% 40%, rgba(151,42,55,.44), transparent 42%);
  box-shadow: var(--shadow);
}
.hero::before { content: "☠"; position: absolute; z-index: -1; right: 6%; top: 50%; transform: translateY(-50%) rotate(-12deg); color: rgba(185,154,101,.07); font-size: clamp(150px, 24vw, 290px); line-height: 1; }
.hero::after { content: ""; position: absolute; inset: 12px; z-index: -1; border: 1px solid rgba(185,154,101,.09); border-radius: 10px; pointer-events: none; }
.hero-copy { max-width: 640px; }
.hero h1 { margin: 0; font: 600 clamp(30px, 5vw, 48px)/1.14 Cinzel, Georgia, serif; letter-spacing: .035em; }
.hero h1 span { color: var(--red-bright); }
.hero p { max-width: 540px; color: #aaa1aa; margin: 14px 0 24px; font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-mark { display: grid; place-items: center; width: 170px; height: 190px; margin-right: 2%; color: rgba(215,189,141,.78); font: 600 100px Cinzel, Georgia, serif; text-shadow: 0 0 32px rgba(185,154,101,.28); border: 1px solid rgba(185,154,101,.22); clip-path: polygon(50% 0, 94% 17%, 86% 78%, 50% 100%, 14% 78%, 6% 17%); background: linear-gradient(145deg, rgba(115,34,44,.2), rgba(16,13,19,.4)); }
.card { min-width: 0; padding: 20px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(25,23,31,.97), rgba(17,16,22,.97)); box-shadow: 0 9px 30px rgba(0,0,0,.15); }
.card > h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 15px; padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); color: #dfd5cf; }
.card > h3::before { content: ""; width: 3px; height: 16px; border-radius: 3px; background: var(--red); box-shadow: 0 0 12px rgba(209,75,80,.25); }
.card p:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid .card { height: 100%; }
.narrow { max-width: 440px; margin: 38px auto; }
.narrow h2 { margin: 0 0 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 18px 0 22px; }
.stat-tile { padding: 15px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(19,17,24,.8); }
.stat-tile strong { display: block; color: var(--gold-light); font: 600 24px Cinzel, Georgia, serif; }
.stat-tile span { color: var(--muted); font-size: 11px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 16px; color: #160f11; border: 1px solid #c15155; border-radius: 7px; background: linear-gradient(180deg, #c14a50, #952d37); box-shadow: 0 5px 15px rgba(115,24,36,.19); font-size: 12px; font-weight: 700; letter-spacing: .025em; transition: transform .16s ease, filter .16s ease, border-color .16s ease; }
button:hover, .button:hover { filter: brightness(1.12); transform: translateY(-1px); }
button:active { transform: translateY(0); }
.button-secondary, .sm, .icon-btn { color: #d2c9cb; border: 1px solid #45404a; background: linear-gradient(180deg, #302b35, #24212a); box-shadow: none; }
.button-ghost { color: var(--gold-light); border-color: rgba(185,154,101,.35); background: rgba(185,154,101,.06); box-shadow: none; }
button.red { color: #fff; border-color: #83333b; background: linear-gradient(180deg, #a63a44, #76242d); }
.sm { min-height: 29px; padding: 5px 9px; font-size: 11px; }
.icon-btn { width: 34px; min-height: 34px; padding: 0; font-size: 21px; }
label { display: block; margin: 0 0 14px; color: #bcb3bd; font-size: 12px; font-weight: 600; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; color: var(--text); border: 1px solid #3a3440; border-radius: 7px; outline: none; background: #100f15; transition: border-color .16s, box-shadow .16s; }
input::placeholder, textarea::placeholder { color: #6c6571; }
input:focus, textarea:focus, select:focus { border-color: rgba(185,154,101,.72); box-shadow: 0 0 0 3px rgba(185,154,101,.10); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--red); }
.chk { display: flex; align-items: center; gap: 9px; }
label small, .label-hint { color: var(--muted-2); font-weight: 400; }
.bar { display: flex; gap: 9px; margin-bottom: 18px; }
.bar input { min-width: 0; margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid rgba(155,133,113,.12); font-size: 12px; }
th { color: #948a96; background: rgba(10,9,13,.34); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
td { color: #d0c9d0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(185,154,101,.035); }
td small, small, .mu { color: var(--muted); }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row > :first-child { min-width: 0; }
.row p { margin: 5px 0 0; color: var(--muted); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 7px 0; }
.tag, .pill { display: inline-flex; align-items: center; padding: 3px 8px; color: #c9bca9; border: 1px solid rgba(185,154,101,.22); border-radius: 30px; background: rgba(185,154,101,.07); font-size: 10px; font-weight: 600; white-space: nowrap; }
.tag.red, .pill.red { color: #e28d91; border-color: rgba(209,75,80,.25); background: var(--red-soft); }
.tag.green, .pill.green { color: #8bb895; border-color: rgba(108,155,120,.25); background: rgba(108,155,120,.09); }
.id-text { color: #908895; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.entity-name { color: #e4d9cf; font-weight: 600; }
.entity-line { display: flex; flex-direction: column; gap: 2px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 28px 12px; color: var(--muted); text-align: center; }
.empty-state strong { color: #c6b9b4; font: 600 14px Cinzel, Georgia, serif; }
.empty-state span { max-width: 420px; font-size: 12px; }
.info-note { padding: 11px 13px; border-left: 2px solid var(--gold); border-radius: 0 7px 7px 0; color: var(--muted); background: rgba(185,154,101,.055); font-size: 11px; }
.profile-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.character-head { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; }
.character-emblem { display: grid; place-items: center; flex: 0 0 56px; height: 62px; color: var(--gold); border: 1px solid rgba(185,154,101,.28); border-radius: 9px; background: rgba(185,154,101,.055); font: 600 24px Cinzel, Georgia, serif; }
.character-head h1 { margin: 0; font: 600 26px Cinzel, Georgia, serif; }
.character-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.item-preview { color: var(--text); }
pre { overflow: auto; min-height: 110px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: #c9c0c9; background: #0c0b10; white-space: pre-wrap; word-break: break-word; }
.enc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.enc label { margin: 0; font-size: 11px; }
.enc input { padding: 8px; }
.enchant-heading { margin: 6px 0 10px; color: #c9bdc4; font-size: 12px; font-weight: 700; }
.asset-preview { min-height: 35px; margin: -4px 0 14px; padding: 8px 10px; color: var(--gold-light); border: 1px solid rgba(185,154,101,.17); border-radius: 6px; background: rgba(185,154,101,.055); font-size: 11px; }
.modal { width: min(500px, calc(100% - 28px)); max-height: 90vh; padding: 23px; color: var(--text); border: 1px solid rgba(185,154,101,.32); border-radius: 14px; background: #17151d; box-shadow: 0 25px 90px #000c; }
.modal::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.modal-heading h2 { margin: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 90px 0; color: var(--muted); }
.loader { width: 19px; height: 19px; border: 2px solid #413541; border-top-color: var(--red-bright); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.site-footer { display: flex; justify-content: space-between; gap: 18px; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 24px; color: #625b66; border-top: 1px solid rgba(155,133,113,.13); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.site-footer span:last-child { font-weight: 400; letter-spacing: .06em; }
#toast { position: fixed; z-index: 40; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 44px)); padding: 12px 17px; color: #eee6e3; border: 1px solid #51434b; border-radius: 9px; background: #211c25; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .22s ease; }
#toast.show { opacity: 1; transform: translateY(0); }
#toast.err { border-color: #8d343d; background: #351c24; }

@media (max-width: 900px) {
  .site-header { gap: 12px; padding: 10px 20px; }
  .main-nav a { padding: 8px 9px; font-size: 11px; }
  .hero-mark { width: 130px; height: 150px; font-size: 76px; }
}
@media (max-width: 700px) {
  .site-header { min-height: 68px; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .main-nav { display: none; flex: 1 0 100%; justify-content: flex-start; padding: 9px 0 4px; border-top: 1px solid var(--line-soft); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 8px 10px; }
  .page-shell { width: min(100% - 28px, 1180px); padding-top: 24px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .hero { min-height: 270px; padding: 28px 24px; }
  .hero-mark { position: absolute; right: 17px; bottom: 10px; width: 92px; height: 105px; font-size: 55px; opacity: .45; }
  .hero-copy { position: relative; z-index: 1; }
  .hero p { max-width: 390px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card { padding: 16px; }
  .site-footer { width: calc(100% - 28px); }
}
@media (max-width: 440px) {
  .brand-copy strong { font-size: 14px; }
  .brand-mark { width: 36px; height: 40px; font-size: 22px; }
  .hero h1 { font-size: 29px; }
  .bar { flex-direction: column; }
  .bar button { align-self: flex-start; }
  .enc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { flex-direction: column; }
  .stat-grid { gap: 8px; }
  .stat-tile { padding: 12px; }
  .site-footer { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.account-limit { margin: -8px 0 18px; }
.field-preview { display: block; min-height: 16px; margin-top: 4px; color: var(--gold); font-size: 10px; font-weight: 400; }
