:root {
  --ink: #0d0f14;
  --panel: #151922;
  --panel-2: #1b2130;
  --line: #2a3243;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --gold: #e3b458;
  --gold-soft: rgba(227, 180, 88, 0.14);
  --blood: #d8594f;
  --moss: #6fbf87;
  --radius: 12px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1100px 620px at 50% -12%, #232b40 0%, var(--ink) 62%) fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 20, 0.55);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand__name { font-weight: 700; letter-spacing: 0.26em; font-size: 16px; }

/* Затмение: тёмный диск, перекрывающий светило. */
.brand__mark, .hero__mark {
  border-radius: 50%;
  background: radial-gradient(circle at 62% 38%, var(--ink) 0 52%, transparent 53%), var(--gold);
  box-shadow: 0 0 18px rgba(227, 180, 88, 0.45);
}
.brand__mark { width: 30px; height: 30px; }

.top__nav { display: flex; align-items: center; gap: 10px; }
.top__who { color: var(--muted); margin-right: 6px; }
.top__who b { color: var(--text); font-weight: 600; }

.view {
  flex: 1;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) 16px 48px;
}

.hero { text-align: center; margin-bottom: 28px; }
.hero__mark { width: 84px; height: 84px; margin: 0 auto 20px; box-shadow: 0 0 46px rgba(227, 180, 88, 0.55); }
.hero h1 { margin: 0; font-size: clamp(30px, 6vw, 44px); letter-spacing: 0.3em; text-indent: 0.3em; font-weight: 700; }
.hero p { margin: 10px auto 0; max-width: 46ch; color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.card--narrow { width: min(100%, 400px); margin: 0 auto; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--ink); border-radius: 9px; }
.tab {
  flex: 1; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font: inherit; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.field input {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--ink); color: var(--text); font: inherit;
}
.field input:focus-visible, .button:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.button:hover { border-color: #3a4560; }
.button:disabled { opacity: 0.55; cursor: default; }
.button--primary { background: var(--gold); border-color: var(--gold); color: #1c1608; }
.button--primary:hover { background: #edc271; border-color: #edc271; }
.button--wide { width: 100%; }
.button--quiet { background: transparent; color: var(--muted); font-weight: 500; }
.button--quiet:hover { color: var(--text); }
.button--danger:hover { color: var(--blood); border-color: var(--blood); }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 14px; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

.characters { display: grid; gap: 12px; margin-bottom: 22px; }

.character {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.character__level {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--gold); color: var(--gold);
  font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums;
}
.character__body { flex: 1; min-width: 0; }
.character__name { font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.character__sub { color: var(--muted); font-size: 13px; }
.character__actions { display: flex; gap: 8px; flex: none; }

.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 22px; }

.create { display: flex; gap: 10px; align-items: flex-end; }
.create .field { flex: 1; margin-bottom: 0; }

.launch { margin-bottom: 22px; border-color: rgba(227, 180, 88, 0.5); }
.launch h2 { margin: 0 0 6px; font-size: 18px; }
.launch p { margin: 0 0 12px; color: var(--muted); }
.launch code {
  display: block; padding: 10px 12px; margin-bottom: 12px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; color: var(--text);
}
.launch__row { display: flex; gap: 8px; flex-wrap: wrap; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 10; }
.toast { padding: 11px 15px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); max-width: 360px; }
.toast--error { border-color: var(--blood); }
.toast--ok { border-color: var(--moss); }

@media (max-width: 560px) {
  .character { flex-wrap: wrap; }
  .character__actions { width: 100%; }
  .character__actions .button { flex: 1; }
  .create { flex-direction: column; align-items: stretch; }
}

/* Лаунчер: текст слева, кнопка скачивания справа. */
.launcher { display: flex; align-items: center; gap: 24px; justify-content: space-between; }
.launcher h2 { margin: 0 0 6px; }
.launcher p { margin: 0 0 6px; color: var(--muted); }
.launcher__meta { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .launcher { flex-direction: column; align-items: flex-start; } }
