:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0d1110;
  color: #f7f2e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 18% 14%, rgba(244, 192, 91, 0.2), transparent 28%),
    radial-gradient(circle at 84% 80%, rgba(75, 176, 160, 0.16), transparent 30%),
    linear-gradient(135deg, #101715 0%, #16161d 50%, #111316 100%);
}

button {
  font: inherit;
}

.app {
  width: min(1220px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(320px, 780px) minmax(280px, 1fr);
  gap: 22px;
  align-items: center;
}

.game-shell {
  height: min(760px, calc(100svh - 40px));
  min-height: 620px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(12, 16, 18, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.hud > div {
  padding: 11px 10px;
  background: #171c22;
  min-width: 0;
}

.hud span {
  display: block;
  margin-bottom: 3px;
  color: #9fb0ac;
  font-size: 10px;
  letter-spacing: 0;
}

.hud strong {
  color: #f4c05b;
  font-size: clamp(18px, 3.6vw, 28px);
  line-height: 1;
}

#game {
  min-height: 0;
  background: #101719;
}

#game canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.panel {
  padding: 12px;
  background: #171c22;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #263139;
  color: #f7f2e8;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  color: #748087;
  background: #1b2027;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

#buildWall {
  background: linear-gradient(180deg, #f4c05b, #c97c39);
  color: #17140f;
  border: 0;
}

#message {
  min-height: 20px;
  margin: 8px 0 0;
  color: #c6d0cd;
  font-size: 13px;
}

.info {
  padding: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.info h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.96;
}

.info p {
  color: #cbd3d2;
  line-height: 1.55;
}

.info ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.info li {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #dce4e1;
}

.info b {
  color: #4bb0a0;
}

@media (max-width: 860px) {
  body {
    overflow: hidden;
  }

  .app {
    min-height: 100svh;
    padding: 8px;
    display: block;
  }

  .game-shell {
    height: calc(100svh - 16px);
    min-height: 0;
  }

  .hud > div {
    padding: 8px 6px;
  }

  .actions {
    gap: 6px;
  }

  button {
    min-height: 38px;
    border-radius: 7px;
    font-size: 12px;
  }

  #message {
    font-size: 12px;
  }

  .info {
    display: none;
  }
}
