/* style.css — минималистичный мобильный дизайн «Политики»
   Монохромный фон, цветные акценты фракций, крупные тап-цели. */

:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel2: #1f242e;
  --border: #2a3040;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #e94560;
  --good: #2ecc71;
  --bad: #e74c3c;
  --warn: #f1c40f;

  --N: #e74c3c; /* Народ */
  --A: #2ecc71; /* Армия */
  --P: #3498db; /* Полиция */
  --M: #f1c40f; /* Магнаты */
  --I: #9b59b6; /* Интеллигенция */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior: none;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px 14px 32px;
}

/* ---------- типография ---------- */
h1, h2, h3 { margin: 0 0 8px; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.tiny { font-size: 12px; color: var(--muted); }
.center { text-align: center; }

/* ---------- кнопки ---------- */
button {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  background: var(--panel2);
  transition: transform 0.08s, opacity 0.15s;
  width: 100%;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; }
button.primary { background: var(--accent); }
button.good { background: var(--good); color: #062; }
button.bad { background: var(--bad); }
button.ghost { background: transparent; border: 1px solid var(--border); }

.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row button { flex: 1; }

/* ---------- панели ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

/* ---------- шапка ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.topbar .turn { font-weight: 600; color: var(--text); }
.topbar .treasury { color: var(--warn); font-weight: 600; }

/* ---------- карта закона ---------- */
.law-card {
  background: linear-gradient(160deg, #1f242e, #181b22);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 16px;
  margin-bottom: 14px;
}
.law-card .law-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.law-card .law-text { font-size: 17px; line-height: 1.45; }

/* ---------- фракции / доверие ---------- */
.faction-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.faction-dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex-shrink: 0;
}
.faction-name { font-size: 14px; width: 90px; }
.trust-bar {
  flex: 1;
  height: 22px;
  background: var(--panel2);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.trust-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s;
}
.trust-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.trust-delta { font-size: 12px; font-weight: 700; width: 30px; text-align: right; }
.trust-delta.up { color: var(--good); }
.trust-delta.down { color: var(--bad); }

/* пороги на полоске */
.trust-marks {
  position: absolute; inset: 0; pointer-events: none;
}
.trust-mark {
  position: absolute; top: 0; bottom: 0;
  width: 1px; background: rgba(255,255,255,0.12);
}

/* ---------- игроки ---------- */
.player-list { display: flex; flex-direction: column; gap: 6px; }
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: 10px;
  border: 1px solid transparent;
}
.player.me { border-color: var(--accent); }
.player.president { border-color: var(--warn); }
.player-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  color: #fff;
}
.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 14px; font-weight: 600; }
.player-role { font-size: 12px; color: var(--muted); }
.player-coins { font-size: 14px; font-weight: 700; color: var(--warn); }
.crown { font-size: 13px; }

/* ---------- голосование ---------- */
.vote-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
}
.vote-badge.for { background: rgba(46,204,113,0.2); color: var(--good); }
.vote-badge.against { background: rgba(231,76,60,0.2); color: var(--bad); }

/* ---------- лог событий ---------- */
.log-line {
  font-size: 13px;
  padding: 6px 10px;
  margin: 4px 0;
  border-radius: 8px;
  background: var(--panel2);
}
.log-line.effect { border-left: 3px solid var(--accent); }
.log-line.note { border-left: 3px solid var(--warn); color: var(--muted); }

/* ---------- мой тайна ---------- */
.secret-panel {
  background: linear-gradient(160deg, #2a1830, #1f242e);
  border: 1px solid #4a2a5a;
}
.secret-panel .secret-name { font-size: 18px; font-weight: 700; color: var(--I); }
.secret-goal-item { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.secret-goal-item.done { color: var(--good); }
.secret-goal-item.pending { color: var(--muted); }

/* ---------- выборы ---------- */
.candidate {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; background: var(--panel2); border-radius: 12px;
  margin-bottom: 8px; border: 1px solid transparent;
}
.candidate.selected { border-color: var(--accent); }
.candidate .score { font-size: 20px; font-weight: 700; color: var(--warn); }

/* ---------- модал/баннер ---------- */
.banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  z-index: 100;
}
.banner-inner { max-width: 520px; margin: 0 auto; }
.banner h3 { margin-bottom: 8px; }

/* ---------- экран старта ---------- */
.start-screen { text-align: center; padding-top: 40px; }
.logo {
  font-size: 40px; font-weight: 800; letter-spacing: -1px;
  margin-bottom: 8px;
}
.logo .accent { color: var(--accent); }
.tagline { color: var(--muted); margin-bottom: 32px; }
.player-count-picker { display: flex; gap: 8px; justify-content: center; margin: 16px 0 24px; }
.player-count-picker button {
  width: 56px; height: 56px; border-radius: 14px; font-size: 20px;
}
.player-count-picker button.active { background: var(--accent); }

/* ---------- экран финала ---------- */
.final-screen { text-align: center; padding-top: 30px; }
.winner-card {
  background: linear-gradient(160deg, #1e3a1e, #181b22);
  border: 1px solid var(--good);
  border-radius: 18px;
  padding: 24px 16px;
  margin: 16px 0;
}
.winner-card.lose { background: linear-gradient(160deg, #3a1e1e, #181b22); border-color: var(--bad); }
.standings { text-align: left; }
.standing-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: var(--panel2); border-radius: 10px; margin-bottom: 6px;
}

/* ---------- утилиты ---------- */
.spacer { height: 90px; } /* место под фиксированный баннер */
.fade-in { animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
