html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #06122a;
}

canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* Оверлей с фоном bg.jpg */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Фон тот же, что в игре */
  background:
    linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
    url("assets/bg.jpg") center / cover no-repeat;

  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.overlay.hidden {
  display: none;
}

/* Плашка #042900 */
.card {
  width: min(760px, 92vw);
  border-radius: 18px;
  padding: 20px 20px 16px;

  color: #ffffff;
  font: 500 14px/1.35 system-ui, Segoe UI, Arial;

  background: linear-gradient(180deg, #053300 0%, #042900 100%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow:
    0 20px 60px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.12);

  pointer-events: auto;
}

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
}

.subtitle {
  opacity: .85;
  font-weight: 600;
}

.rules {
  margin: 10px 0 12px;
  opacity: .95;
}

.rule { margin: 4px 0; }

.lb {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.10);
}

.lbTitle {
  font-weight: 800;
  margin-bottom: 8px;
  opacity: .95;
}

ol {
  margin: 0;
  padding-left: 20px;
}

li { margin: 4px 0; }

.result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 700;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

button {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;

  font: 800 16px/1 system-ui;
  color: #042900;

  background: linear-gradient(180deg, #e9ffe3 0%, #b9f2a8 100%);
  cursor: pointer;

  box-shadow:
    0 6px 18px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.6);

  pointer-events: auto;
}

button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }

/* На маленьких экранах */
@media (max-width: 520px) {
  .title { font-size: 22px; }
  .subtitle { display:none; }
}
