/* =========================================================================
   ДИКТАТОР — современный интерфейс
   ========================================================================= */
:root {
  --bg-1: #0b0e1a;
  --bg-2: #141a30;
  --panel: rgba(30, 37, 66, 0.72);
  --panel-border: rgba(120, 140, 200, 0.18);
  --gold: #f0c14b;
  --gold-2: #e0a52b;
  --text: #e8ecf8;
  --muted: #9aa4c4;
  --pos: #5ad19a;
  --neg: #ff6b6b;
  --zero: #a7b0d0;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(240, 193, 75, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(70, 100, 200, 0.16), transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 60%, #0a0d18);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }

/* ------------------------------- Шапка ------------------------------- */
.app-header {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  background: linear-gradient(120deg, rgba(40, 50, 90, 0.55), rgba(20, 26, 48, 0.55));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.app-header::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0.7;
}
.emblem { font-size: 46px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.header-text h1 {
  margin: 0; font-size: 34px; letter-spacing: 3px; font-weight: 800;
  background: linear-gradient(180deg, #fff, #d9c48a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 0.5px; }
.season-box { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.season-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; text-align: right; }
.season-label { font-size: 18px; font-weight: 700; color: var(--gold); }
.year-label { font-size: 14px; color: var(--text); }
.assembly-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(90, 209, 154, 0.15); border: 1px solid rgba(90, 209, 154, 0.4); color: var(--pos);
}
#season-image {
  width: 128px; height: 84px; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--panel-border); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* ------------------------------- Индикаторы ------------------------------- */
.topbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 18px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 14px; backdrop-filter: blur(6px);
}
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-value.money { color: var(--gold); }
.topbar .btn { flex: 0 0 auto; align-self: center; }
.topbar-btn { white-space: nowrap; }

/* ------------------------------- Панели ------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
  backdrop-filter: blur(6px); box-shadow: var(--shadow);
}
.panel-title { margin: 0 0 14px; font-size: 18px; letter-spacing: 0.5px; display: flex; align-items: baseline; gap: 8px; }
.layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-bottom: 18px; align-items: start; }
.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 400; text-transform: none; }

/* ------------------------------- Запрос ------------------------------- */
.req-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.badge {
  padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: rgba(240, 193, 75, 0.16); border: 1px solid rgba(240, 193, 75, 0.45); color: var(--gold);
}
.req-status { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.req-status.accepted { color: var(--pos); background: rgba(90, 209, 154, 0.15); border: 1px solid rgba(90, 209, 154, 0.4); }
.req-status.rejected { color: var(--neg); background: rgba(255, 107, 107, 0.15); border: 1px solid rgba(255, 107, 107, 0.4); }
.req-text { font-size: 18px; margin: 0 0 14px; }
.req-costs { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.req-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------- Группы ------------------------------- */
.groups-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.group-card {
  background: rgba(16, 21, 40, 0.5); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 12px 14px; transition: transform 0.15s ease, border-color 0.15s ease;
}
.group-card.danger { border-color: rgba(255, 107, 107, 0.5); }
.group-name { font-weight: 700; margin-bottom: 8px; }
.group-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: flex; flex-direction: column; padding: 4px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); min-width: 74px;
}
.chip span { font-size: 11px; color: var(--muted); }
.chip b { font-size: 17px; }
.chip.pos b { color: var(--pos); }
.chip.neg b { color: var(--neg); }
.chip.zero b { color: var(--zero); }

/* ------------------------------- Разведданные ------------------------------- */
.intel { display: block; }
.intel-when {
  font-size: 0.85rem; color: var(--muted); margin-bottom: 12px;
  border-bottom: 1px solid var(--panel-border); padding-bottom: 8px;
}
/* ------------------------------- Приказы ------------------------------- */
.decree-cat { margin-bottom: 18px; }
.decree-cat:last-child { margin-bottom: 0; }
.decree-cat h4 { margin: 0 0 10px; color: var(--gold); font-size: 15px; letter-spacing: 0.4px; }
.decree-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.decree {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; padding: 12px 14px;
  background: rgba(16, 21, 40, 0.5); border: 1px solid var(--panel-border);
  border-radius: 12px; color: var(--text); cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.decree:hover:not(.disabled) {
  transform: translateY(-2px); border-color: rgba(240, 193, 75, 0.6);
  background: rgba(30, 40, 74, 0.7);
}
.decree.disabled { opacity: 0.45; cursor: not-allowed; }
.decree.used { opacity: 0.55; cursor: not-allowed; border-style: dashed; }
.decree.used .decree-text { text-decoration: line-through; }
.decree-used { font-size: 12px; font-weight: 700; color: var(--pos); letter-spacing: 0.3px; }
.decree-text { font-size: 14px; font-weight: 600; }
.decree-cost { font-size: 12px; color: var(--muted); }

/* ------------------------------- Новости ------------------------------- */
#news-panel { display: flex; flex-direction: column; gap: 8px; }
.news-item {
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--line); background: rgba(16, 21, 40, 0.4);
}
.news-item.pos { border-left-color: var(--pos); background: rgba(90, 209, 154, 0.07); }
.news-item.neg { border-left-color: var(--neg); background: rgba(255, 107, 107, 0.07); }
.news-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 11px; border-radius: 999px; margin-bottom: 9px;
}
.news-item.pos .news-badge { color: var(--pos); background: rgba(90, 209, 154, 0.16); border: 1px solid rgba(90, 209, 154, 0.4); }
.news-item.neg .news-badge { color: var(--neg); background: rgba(255, 107, 107, 0.16); border: 1px solid rgba(255, 107, 107, 0.4); }
.news-headline { font-size: 21px; font-weight: 700; margin-bottom: 7px; line-height: 1.25; }
.news-body { font-size: 15px; line-height: 1.55; }
.news-prev { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ------------------------------- Кнопки ------------------------------- */
.btn {
  font: inherit; font-weight: 700; border-radius: 12px; padding: 12px 20px;
  cursor: pointer; color: var(--text);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-border);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1405; border: none; box-shadow: 0 8px 20px rgba(224, 165, 43, 0.3);
}
.btn.danger { background: linear-gradient(135deg, #ff6b6b, #d23a3a); color: #2a0808; border: none; }
.btn.ghost { background: rgba(255, 255, 255, 0.05); }
.btn.big { padding: 14px 26px; font-size: 16px; }
.actions-row { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ------------------------------- Журнал ------------------------------- */
.log-panel #log-panel { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.log-line {
  padding: 8px 12px; background: rgba(16, 21, 40, 0.5);
  border-left: 3px solid var(--gold-2); border-radius: 8px; font-size: 14px;
}
.app-footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ------------------------------- Модалка ------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 8, 18, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
  opacity: 0; transition: opacity 0.2s ease;
}
.modal-overlay.show { opacity: 1; }
.modal-card {
  width: 100%; max-width: 460px; text-align: center;
  background: linear-gradient(160deg, #1c2342, #12172c);
  border: 1px solid var(--panel-border); border-radius: 18px;
  padding: 26px 26px 22px; box-shadow: var(--shadow);
  transform: translateY(12px) scale(0.98); transition: transform 0.2s ease;
}
.modal-overlay.show .modal-card { transform: translateY(0) scale(1); }
.modal-icon { font-size: 46px; margin-bottom: 8px; }
.modal-card h3 { margin: 0 0 12px; font-size: 22px; }
.modal-body { color: var(--text); font-size: 15px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.vote-list { list-style: none; padding: 0; margin: 0; text-align: left; }
.vote-list li { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--panel-border); }
.vote-list li:last-child { border-bottom: none; }
.vote-list b { color: var(--gold); }

table.report { width: 100%; border-collapse: collapse; font-size: 14px; }
table.report th, table.report td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--panel-border); }
table.report th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
table.report tr.hl td { color: var(--gold); font-weight: 700; }

/* ------------------------------- Конец игры ------------------------------- */
.gameover {
  position: fixed; inset: 0; background: rgba(5, 8, 18, 0.88); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 60;
}
.gameover.show { display: flex; }
.gameover-card {
  text-align: center; max-width: 440px;
  background: linear-gradient(160deg, #1c2342, #12172c);
  border: 1px solid var(--panel-border); border-radius: 20px; padding: 34px 30px;
  box-shadow: var(--shadow); animation: pop 0.35s ease;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gameover-icon { font-size: 64px; margin-bottom: 10px; }
.gameover-card h2 { margin: 0 0 12px; font-size: 30px; color: var(--gold); }
.gameover-card p { color: var(--text); font-size: 16px; margin: 0 0 18px; }
.gameover-rating { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 22px; }

/* ------------------------------- Вводный экран ------------------------------- */
.intro {
  position: fixed; inset: 0; z-index: 70;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(43,55,90,0.55), transparent),
    linear-gradient(180deg, rgba(6,9,17,0.99), rgba(8,11,20,0.995));
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.intro.show { display: flex; }
.intro-card {
  max-width: 660px; width: 100%; max-height: 92vh; overflow: auto;
  text-align: center;
  background: linear-gradient(160deg, #1c2342, #12172c);
  border: 1px solid rgba(240,193,75,0.35);
  border-radius: 18px; padding: 34px 34px 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: pop 0.4s ease;
}
.intro-emblem { font-size: 46px; margin-bottom: 6px; }
.intro-card .intro-title { margin: 0; font-size: 30px; letter-spacing: 3px; color: var(--gold); text-shadow: 0 2px 14px rgba(0,0,0,0.5); }
.intro-card .intro-sub { color: var(--muted); margin: 4px 0 20px; letter-spacing: 1px; font-size: 13px; }
.intro-text { text-align: left; color: var(--text); line-height: 1.7; font-size: 14.5px; margin-bottom: 24px; }
.intro-text p { margin: 0 0 14px; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-text b { color: var(--gold); }

/* ------------------------------- Адаптив ------------------------------- */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .app-header { flex-wrap: wrap; }
  .season-box { margin-left: 0; width: 100%; justify-content: space-between; }
  .topbar { grid-template-columns: 1fr; }
  .header-text h1 { font-size: 26px; }
}