@font-face { font-family: "Cormorant"; font-weight: 600; font-display: swap; src: url(/fonts/cormorant-garamond-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; font-weight: 600; font-display: swap; src: url(/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Cormorant"; font-weight: 700; font-display: swap; src: url(/fonts/cormorant-garamond-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; font-weight: 700; font-display: swap; src: url(/fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root {
  color-scheme: dark;
  --bg: #0b0d13;
  --surface: #141722;
  --surface2: #1a1e2b;
  --surface3: #232838;
  --line: rgba(224, 188, 120, .13);
  --line2: rgba(255, 255, 255, .07);
  --text: #ece7dc;
  --text2: #bdb9ae;
  --muted: #868896;
  --gold: #e0bc78;
  --gold2: #f4dcae;
  --danger: #ef6a6a;
  --good: #57c98c;
  --radius: 14px;
  --side: 232px;
  --serif: "Cormorant", Georgia, "Times New Roman", serif;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --q0: #9d9d9d; --q1: #e8e8e8; --q2: #35e04a; --q3: #4aa3ff; --q4: #bf7bff; --q5: #ff9a3c;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1100px 620px at 78% -8%, rgba(224, 188, 120, .08), transparent 62%), radial-gradient(800px 560px at -8% 106%, rgba(90, 120, 190, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; letter-spacing: .005em; line-height: 1.15; }
h1 { font-size: 40px; }
h2 { font-size: 23px; }
h3 { font-size: 18px; color: var(--text2); }
p { margin: 0; }
.muted { color: var(--muted); }
::selection { background: rgba(224, 188, 120, .32); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2f40; border-radius: 10px; border: 2px solid var(--bg); }
.ico { width: 18px; height: 18px; flex: none; }

.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface3); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 80px 0; display: grid; place-items: center; }

/* --- каркас --- */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: rgba(11, 13, 19, .7); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 16px; color: var(--text); font: 700 24px/1 var(--serif); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand b { color: var(--gold); font-weight: 700; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a, .sidebar .navbtn { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 9px; color: var(--text2); font: inherit; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.sidebar nav a:hover, .sidebar .navbtn:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.sidebar nav a.on { background: linear-gradient(90deg, rgba(224, 188, 120, .15), rgba(224, 188, 120, .03)); color: var(--gold2); }
.navsec { margin: 14px 11px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.side-foot { margin-top: auto; padding: 12px 11px 0; border-top: 1px solid var(--line2); font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.side-foot .who { color: var(--text2); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 30px 36px 70px; max-width: 1400px; width: 100%; margin: 0 auto; }
.topbar { display: none; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(224, 188, 120, .07); color: var(--text2); font-size: 13px; }

/* --- общие части --- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: 500 13px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn.primary { background: linear-gradient(180deg, #e9c98b, #c79e55); border-color: #e9c98b; color: #17120a; font-weight: 650; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.chip { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line2); background: none; color: var(--text2); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--gold); }
.chip.on { background: rgba(224, 188, 120, .14); border-color: rgba(224, 188, 120, .5); color: var(--gold2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
input[type=search], input[type=text], select { background: var(--surface); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); padding: 7px 11px; font: 13.5px var(--font); outline: none; }
input:focus, select:focus { border-color: var(--gold); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 20px; }
.page-head p { color: var(--muted); }
.spacer { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 16px; }

.card { background: linear-gradient(180deg, var(--surface2), var(--surface) 70%); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card > header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.card > header h2 { font-size: 21px; }
.card > header .sub { color: var(--muted); font-size: 12.5px; }
.card > header .tog { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; }
.scroll { max-height: 880px; overflow-y: auto; padding-right: 6px; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); }
.note { color: var(--muted); font-size: 12.5px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.kpi .l { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.kpi .l .ico { width: 15px; height: 15px; color: var(--gold); }
.kpi .v { margin-top: 3px; font: 700 29px/1.15 var(--serif); color: var(--text); overflow-wrap: anywhere; }
.kpi .v .money { font: 700 25px/1.15 var(--serif); }
.kpi .s { color: var(--muted); font-size: 12px; }

.hero { position: relative; overflow: hidden; margin-bottom: 18px; padding: 34px 34px 30px; border-radius: 18px; border: 1px solid var(--line); background: radial-gradient(700px 300px at 88% 0, rgba(224, 188, 120, .17), transparent 70%), linear-gradient(120deg, #1a1e2c, #11141d); }
.hero .eyebrow { color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: 11.5px; }
.hero h1 { font-size: 50px; margin: 6px 0 8px; }
.hero p { color: var(--text2); max-width: 680px; }

/* --- деньги, предметы --- */
.money { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money span { display: inline-flex; align-items: center; gap: 2px; }
.coin { display: inline-block; width: .68em; height: .68em; border-radius: 50%; }
.coin.g { background: radial-gradient(circle at 35% 30%, #ffe9a8, #d6a230); }
.coin.s { background: radial-gradient(circle at 35% 30%, #fff, #a6adb8); }
.coin.c { background: radial-gradient(circle at 35% 30%, #f0b58a, #a4623a); }
.iicon { display: inline-block; width: 26px; height: 26px; border-radius: 5px; border: 1px solid var(--q1); background: var(--surface3); overflow: hidden; flex: none; vertical-align: middle; }
.iicon img { display: block; width: 100%; height: 100%; }
.iicon.lg { width: 38px; height: 38px; }
.iicon.q0 { border-color: var(--q0); } .iicon.q2 { border-color: var(--q2); } .iicon.q3 { border-color: var(--q3); } .iicon.q4 { border-color: var(--q4); } .iicon.q5 { border-color: var(--q5); }
.iname.q0 { color: var(--q0); } .iname.q1 { color: var(--q1); } .iname.q2 { color: var(--q2); } .iname.q3 { color: var(--q3); } .iname.q4 { color: var(--q4); } .iname.q5 { color: var(--q5); }
.item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.crest { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; color: var(--cc); border: 1.5px solid var(--cc); background: color-mix(in srgb, var(--cc) 12%, #11141c); font: 700 18px/1 var(--serif); }
.crest.lg { width: 76px; height: 76px; font-size: 42px; border-width: 2px; }
.crest.sm { width: 24px; height: 24px; font-size: 13px; }
.clink { font-weight: 600; }

/* --- графики --- */
.chart { position: relative; width: 100%; }
.plot { width: 100%; }
.chart svg { display: block; max-width: 100%; }
.grid-line, .chart .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .ax { fill: var(--muted); font: 11px var(--font); }
.chart .cross { stroke: rgba(255, 255, 255, .28); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(255, 255, 255, .05); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--text2); font-size: 12.5px; }
.legend i, .ctip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.ctip { position: absolute; z-index: 5; pointer-events: none; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(12, 14, 20, .95); font-size: 12.5px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.ctip b { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.ctip div { display: flex; align-items: center; }
.ctip span { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tableview { max-height: 300px; overflow: auto; }
.spark { display: block; }
.scale { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 11.5px; justify-content: flex-end; }
.scale i { width: 96px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(224, 188, 120, .12), rgba(224, 188, 120, 1)); }
.hheat { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; }
.hh { color: var(--muted); font-size: 10.5px; text-align: left; }
.hd { color: var(--muted); font-size: 11.5px; line-height: 20px; }
.hc { height: 20px; border-radius: 3px; }
.calendar-scroll { overflow-x: auto; padding-bottom: 4px; }
.calendar { min-width: 690px; }
.cm { display: grid; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.cg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.cw { display: grid; gap: 2px; }
.cw i { display: block; aspect-ratio: 1; border-radius: 2.5px; }
.cw i.void { background: none; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.ht i { display: block; height: 100%; border-radius: 4px; }
.hv { color: var(--text2); font-variant-numeric: tabular-nums; text-align: right; }

/* --- лидеры --- */
.leader { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line2); }
.leader:last-child { border-bottom: 0; }
.leader .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader .r { width: 18px; color: var(--muted); font: 700 16px var(--serif); text-align: center; }
.leader:first-child .r { color: var(--gold); }

/* --- хроника --- */
.tl-day { margin: 18px 0 6px; color: var(--gold); font: 700 19px var(--serif); }
.tl-day::first-letter { text-transform: uppercase; }
.tl-day:first-child { margin-top: 0; }
.tl-row { display: grid; grid-template-columns: 46px 30px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line2); font-size: 13.5px; }
.tl-row:last-child { border-bottom: 0; }
.tl-time { color: var(--muted); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.tl-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface3); color: var(--gold); }
.tl-ico .ico { width: 14px; height: 14px; }
.tl-ico.death { color: var(--danger); }
.tl-ico.level { color: var(--good); }
.tl-ico.loot { color: var(--q4); }
.tl-sub { color: var(--muted); font-size: 12.5px; }

/* --- карточки персонажей --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pc { display: block; position: relative; padding: 15px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--cc) 9%, var(--surface2)), var(--surface) 60%); color: var(--text); }
.pc:hover { border-color: var(--cc); text-decoration: none; transform: translateY(-1px); }
.pc .top { display: flex; gap: 11px; align-items: center; }
.pc .nm { font: 700 21px/1.1 var(--serif); color: var(--cc); }
.pc .sub { color: var(--muted); font-size: 12.5px; }
.pc .lvl { margin-left: auto; font: 700 28px/1 var(--serif); color: var(--text); }
.pc dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0 8px; }
.pc dt { color: var(--muted); font-size: 11.5px; }
.pc dd { margin: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.pc .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.xpbar { position: relative; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7c5cc4, #b08cf0); border-radius: 4px; }
.xpbar em { position: absolute; top: 0; bottom: 0; background: rgba(90, 160, 255, .45); }

/* --- персонаж --- */
.ch-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 24px 26px; border-radius: 18px; border: 1px solid var(--line); margin-bottom: 14px; background: radial-gradient(640px 240px at 86% 0, color-mix(in srgb, var(--cc) 20%, transparent), transparent 70%), linear-gradient(120deg, #1a1e2c, #11141d); }
.ch-head h1 { color: var(--cc); }
.ch-head .meta { color: var(--text2); }
.ch-head .where { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 2px; margin-bottom: 16px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a { padding: 9px 13px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--gold2); border-bottom-color: var(--gold); }

.doll { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; background: rgba(255, 255, 255, .025); min-width: 0; }
.slot .t { min-width: 0; }
.slot .t > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .sn { color: var(--muted); font-size: 11.5px; }
.slot.none { opacity: .45; }
.slot .il { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.trees { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tree { padding: 14px; border: 1px solid var(--line2); border-radius: 12px; }
.tree h3 { display: flex; justify-content: space-between; margin-bottom: 10px; }
.tgrid { display: grid; gap: 6px; }
.tn { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tn.on { border-color: var(--gold); color: var(--gold2); background: rgba(224, 188, 120, .12); }
.tn.full { background: rgba(224, 188, 120, .26); }

.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.irow { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 0; }
.irow .iname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.irow .cnt { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.bar { display: grid; gap: 4px; padding: 7px 0; }
.bar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.bar .top span:last-child { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.bar .line { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar .line i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--text2); font-size: 12px; }
.badge.ok { color: var(--good); border-color: rgba(87, 201, 140, .4); }
.badge.bad { color: var(--danger); border-color: rgba(239, 106, 106, .4); }
.badge.gold { color: var(--gold2); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 550; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; }
td { padding: 7px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }

.quest { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.quest:last-child { border-bottom: 0; }
.quest .obj { color: var(--muted); font-size: 12.5px; }

/* --- вход --- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.gate-card { width: min(520px, 100%); padding: 40px 38px; text-align: center; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(420px 200px at 50% 0, rgba(224, 188, 120, .14), transparent 70%), var(--surface); }
.gate-card img { width: 62px; height: 62px; }
.gate-card h1 { margin: 12px 0 6px; font-size: 44px; }
.gate-card p { color: var(--text2); margin-bottom: 18px; }
.gate-card .btn { margin: 4px; }

.tip { position: fixed; z-index: 50; max-width: 300px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(12, 14, 20, .96); font-size: 12.5px; white-space: pre-line; pointer-events: none; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 8px; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--surface3); border: 1px solid var(--line); }
.toast.bad { border-color: var(--danger); }

@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: 250px; transform: translateX(-102%); transition: transform .18s; background: #0e1118; }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 8px 14px; background: rgba(11, 13, 19, .92); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; font-size: 20px; }
  .topbar .brand img { width: 24px; height: 24px; }
  .main { padding: 16px 16px 50px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 36px; }
  h1 { font-size: 32px; }
  .doll { grid-template-columns: minmax(0, 1fr); }
  .ch-head { padding: 18px; }
}
