:root {
  color-scheme: dark;
  font-family: "Courier New", Courier, monospace;
  background: #171717;
  color: #f6f1df;
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 20px;
  background:
    radial-gradient(circle at 18% 18%, rgba(73, 135, 99, 0.22), transparent 32%),
    linear-gradient(135deg, #151515 0%, #202418 45%, #171717 100%);
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  width: min(1280px, 100%);
  align-items: stretch;
}

.play-area {
  position: relative;
  min-width: 0;
  border: 2px solid #4d7046;
  background: #24351f;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: calc(100vh - 40px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border: 2px solid #4d7046;
  background: #202616;
  min-height: 0;
}

.kicker,
.label {
  margin: 0 0 6px;
  color: #c6d6a5;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.7rem);
  line-height: 0.95;
}

.status-block {
  padding: 12px;
  border: 1px solid #607a45;
  background: #18200f;
}

.big-number {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.level-name {
  margin: 0;
  color: #f7d66b;
  font-size: 1.18rem;
  font-weight: 800;
}

.hearts {
  margin: 0;
  color: #ff6969;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
}

.seek-list {
  display: grid;
  gap: 5px;
  max-height: min(46vh, 390px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.seek-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #38482b;
  background: #18200f;
  font-size: 0.95rem;
}

.seek-list li.found {
  color: #9ee493;
  border-color: #5aa954;
}

.message {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border: 2px solid #f7d66b;
  background: rgba(33, 25, 8, 0.94);
  color: #fff3b5;
  text-align: center;
  font-weight: 800;
  pointer-events: none;
}

.is-hidden {
  opacity: 0;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button {
  min-height: 44px;
  border: 0;
  background: #f7d66b;
  color: #1b1b12;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: #ffe68f;
}

button:disabled {
  background: #5b614b;
  color: #bcc4a5;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  body {
    padding: 12px;
  }

  .game-shell {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
  }

  .seek-list {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    max-height: none;
  }
}
