:root {
  color-scheme: dark;
  --bg: #020203;
  --card: #09090a;
  --card-strong: #120609;
  --text: #ede8e8;
  --muted: #8a8080;
  --line: rgba(172, 0, 22, 0.28);
  --soft: rgba(126, 0, 16, 0.12);
  --accent: #7d0010;
  --accent-2: #c90019;
  --gold: #d71f31;
  --green: #42d985;
  --ink: #050506;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(92, 0, 12, 0.34), transparent 18rem),
    radial-gradient(circle at 98% 0%, rgba(70, 0, 10, 0.24), transparent 15rem),
    linear-gradient(180deg, #070707 0%, #030303 54%, #000 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(146, 0, 18, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 0, 18, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

button {
  border: 1px solid rgba(172, 0, 22, 0.34);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.48;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  max-width: 620px;
  margin-bottom: 12px;
  font-size: clamp(32px, 9vw, 58px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.app {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px 16px 106px;
}

.hero,
.card,
.mini-card,
.bottom-nav {
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.62);
  backdrop-filter: none;
}

.hero {
  position: relative;
  display: flex;
  min-height: 174px;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  align-items: flex-start;
  padding: 22px;
  margin-bottom: 14px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(93, 0, 12, 0.72), rgba(5, 5, 6, 0.98)),
    var(--ink);
}

.hero::after {
  position: absolute;
  right: -54px;
  bottom: -54px;
  width: 190px;
  height: 190px;
  content: "";
  border: 1px solid rgba(172, 0, 22, 0.34);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(126, 0, 16, 0.12), transparent 62%);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-glow {
  position: absolute;
  inset: auto auto -70px -46px;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  opacity: 0.38;
  background: radial-gradient(circle, rgba(117, 0, 14, 0.28), transparent 65%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  margin: 14px 0 0;
  line-height: 1.45;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mini-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.58);
}

.mini-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.mini-card strong {
  display: block;
  overflow: hidden;
  color: var(--accent-2);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.card {
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(82, 0, 10, 0.14), rgba(0, 0, 0, 0.02)),
    var(--card);
}

.card.accent,
.card.dossier {
  background:
    linear-gradient(145deg, rgba(93, 0, 12, 0.36), rgba(0, 0, 0, 0.12)),
    var(--card-strong);
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.seal,
.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(172, 0, 22, 0.46);
  border-radius: 999px;
  color: var(--accent-2);
  font-weight: 950;
  background: rgba(0, 0, 0, 0.62);
}

.avatar {
  width: 54px;
  height: 54px;
  color: #fff;
  background: #71000e;
}

.stack {
  display: grid;
  gap: 10px;
}

.row,
.player,
.empty-state,
.callout,
.event-card,
.big-status,
.profile-head {
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.48);
}

.row,
.player {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.row span:first-child,
.player span:first-child {
  min-width: 0;
}

.value {
  color: var(--accent-2);
  text-align: right;
}

.big-status {
  display: grid;
  gap: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(98, 0, 12, 0.28), rgba(0, 0, 0, 0.42)),
    rgba(0, 0, 0, 0.56);
}

.big-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.big-status strong {
  color: var(--gold);
  font-size: 24px;
}

.players {
  display: grid;
  gap: 8px;
}

.player {
  align-items: center;
}

.badge {
  flex: 0 0 auto;
  border: 1px solid rgba(110, 231, 168, 0.25);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(110, 231, 168, 0.1);
  color: #bffbd7;
  font-size: 12px;
  font-weight: 800;
}

.badge.dead {
  border-color: rgba(255, 0, 31, 0.38);
  background: rgba(98, 0, 12, 0.32);
  color: #ff6d7e;
}

.action-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.span-2 {
  grid-column: 1 / -1;
}

.target-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.chat-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.secret-room {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 0, 31, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.54);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.small {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.chat-feed {
  display: grid;
  max-height: 360px;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.chat-message {
  max-width: 88%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 0, 31, 0.14);
  border-radius: 10px;
  background: rgba(12, 12, 14, 0.92);
}

.chat-message.own {
  justify-self: end;
  border-color: rgba(255, 0, 31, 0.42);
  background: rgba(120, 0, 14, 0.42);
}

.chat-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 12px;
}

.chat-message p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.note-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 0, 31, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.54);
}

.note-form label {
  color: var(--gold);
  font-weight: 900;
}

.note-form textarea,
.note-form input,
.note-form select {
  width: 100%;
  border: 1px solid rgba(255, 0, 31, 0.2);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font: inherit;
  background: #050506;
  outline: none;
}

.note-form textarea {
  min-height: 96px;
  resize: vertical;
}

.note-form textarea:focus,
.note-form input:focus,
.note-form select:focus {
  border-color: rgba(255, 0, 31, 0.74);
}

.alliance-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(255, 0, 31, 0.2);
  border-radius: 12px;
  background: rgba(120, 0, 14, 0.16);
}

.alliance-card p {
  margin-bottom: 0;
}

.selected {
  box-shadow: 0 0 0 2px rgba(172, 0, 22, 0.44);
}

.primary {
  background: #8b0011;
  box-shadow: none;
}

.secondary,
.ghost {
  border: 1px solid rgba(255, 0, 31, 0.24);
  background: #050506;
}

.ghost {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.role-name {
  padding: 18px;
  border: 1px solid rgba(255, 0, 31, 0.34);
  border-radius: 12px;
  color: var(--gold);
  font-size: 28px;
  font-weight: 950;
  background: rgba(149, 0, 18, 0.18);
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.admin-current {
  display: grid;
  gap: 10px;
}

.callout,
.event-card,
.empty-state {
  padding: 14px;
}

.callout strong,
.event-card strong,
.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.callout p,
.event-card p,
.empty-state p {
  margin-bottom: 0;
}

.profile-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.profile-head p {
  margin-bottom: 0;
}

.bottom-nav {
  position: fixed;
  z-index: 5;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: grid;
  max-width: 680px;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 7px;
  margin: 0 auto;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.94);
}

.nav-btn {
  padding: 11px 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.nav-btn.active {
  color: #fff;
  background: #8b0011;
}

.skeleton:empty::before {
  content: "Загрузка...";
  color: var(--muted);
}

.error {
  color: #ff8ba0;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: 92px;
  left: 18px;
  max-width: 520px;
  padding: 14px 16px;
  margin: 0 auto;
  border: 1px solid rgba(255, 0, 31, 0.38);
  border-radius: 12px;
  color: #fff;
  text-align: center;
  background: rgba(4, 4, 5, 0.98);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.4);
}

@media (max-width: 720px) {
  .app {
    padding: 12px 12px 106px;
  }

  .hero {
    flex-direction: column;
    min-height: 160px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-grid,
  .stats-grid,
  .admin-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .bottom-nav {
    grid-template-columns: repeat(3, 1fr);
  }
}
