:root {
  --ink: #16201c;
  --muted: #647067;
  --paper: #f5f1e8;
  --panel: #fffaf0;
  --line: #d7cdbb;
  --green: #2f7d57;
  --red: #b54a3c;
  --yellow: #d39c32;
  --blue: #3e6f8f;
  --road: #454b4a;
  --shadow: 0 18px 40px rgba(34, 38, 35, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #dfe8dd;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1480px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 22px;
}

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

.kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 4.8vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.day-card,
.stat,
.control-panel,
.ticker,
.modal-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.day-card {
  min-width: 130px;
  padding: 12px 14px;
  border-radius: 8px;
  text-align: right;
}

.day-card span,
.stat span,
.action-points span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.day-card strong,
.stat strong,
.action-points strong {
  display: block;
  margin-top: 3px;
  font-size: 1.45rem;
}

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

.stat {
  border-radius: 8px;
  padding: 12px 14px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 12px;
  align-items: start;
}

.map-panel {
  min-width: 0;
}

.canvas-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #87ad79;
  box-shadow: var(--shadow);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 980 / 640;
}

.ticker {
  margin-top: 10px;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 46px;
  color: #39433d;
  font-weight: 750;
}

.control-panel {
  border-radius: 8px;
  padding: 14px;
  position: sticky;
  top: 12px;
}

.panel-section + .panel-section {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.action-points {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-btn,
.action-btn {
  border: 1px solid #1b3328;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    opacity 120ms ease;
}

.primary-btn {
  min-height: 44px;
  padding: 0 18px;
}

.action-btn {
  width: 100%;
  min-height: 56px;
  padding: 9px 11px;
  text-align: left;
}

.primary-btn:hover,
.action-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.primary-btn:disabled,
.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.complaints-list,
.actions-list {
  display: grid;
  gap: 8px;
}

.complaint,
.ledger {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px 11px;
}

.complaint {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.complaint-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--red);
}

.complaint strong,
.action-title {
  display: block;
  font-size: 0.92rem;
}

.complaint span,
.action-meta,
.ledger {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.action-meta {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
}

.ledger {
  min-height: 74px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 32, 28, 0.48);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 8px;
  padding: 22px;
}

.modal-card p {
  color: #3d4741;
  line-height: 1.5;
  white-space: pre-line;
}

@media (max-width: 980px) {
  .status-grid,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100vw - 18px, 1480px);
    padding-top: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .day-card {
    text-align: left;
  }

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