:root {
  --bg: #0b0f1e;
  --panel: #141a33;
  --panel-2: #1c2445;
  --line: #2a3563;
  --text: #e3ecff;
  --muted: #8f9cc4;
  --magic: #5fb8ff;
  --amber: #f0b45a;
  --danger: #ff7a7a;
  --hp: #e0566a;
  --xp: #b48cff;
  --stamina: #5fd3a8;
  --f-defenders: #7fb3ff;
  --f-destroyers: #c77dff;
  --f-hunters: #e8a33d;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#app {
  min-height: 100%;
  max-width: 480px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { margin: 0; }
.sub { color: var(--muted); font-size: 14px; }

/* Заставка */
.splash {
  min-height: calc(100vh - 48px);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  padding-bottom: 12vh; text-align: center;
  background: linear-gradient(to bottom, rgba(11,15,30,0) 40%, var(--bg) 92%), url("/img/splash.webp") center top / cover no-repeat;
  margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 0;
}
.splash h1 { font-size: 40px; text-shadow: 0 0 18px rgba(95,184,255,.7); }

/* Карточки и формы */
.stack { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input[type=text] {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none;
}
input[type=text]:focus { border-color: var(--magic); }

.choices { display: grid; gap: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice {
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.choice small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.choice[aria-pressed="true"] { border-color: var(--accent, var(--magic)); box-shadow: 0 0 0 1px var(--accent, var(--magic)) inset; }
.choice .title { font-weight: 600; color: var(--accent, var(--text)); }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; width: 100%;
  color: #071022; background: var(--magic); border: 0; border-radius: 12px; padding: 14px;
}
.btn:disabled { opacity: .5; cursor: default; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }

/* Экран героя */
.hero-banner {
  height: 200px; margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 0;
  background: linear-gradient(to bottom, rgba(11,15,30,0) 35%, var(--bg) 100%), url("/img/rift.webp") center 30% / cover no-repeat;
}
.hero-head { margin-top: -56px; position: relative; display: flex; flex-direction: column; gap: 4px; }
.tag { display: inline-block; font-size: 13px; color: var(--accent); }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px;
}
.action small { color: var(--muted); font-size: 12px; }
.action:disabled { opacity: .6; }
.footer-note { color: var(--muted); font-size: 12px; text-align: center; }
