:root {
  color-scheme: dark;
  --bg: #111411;
  --panel: #182018;
  --panel-2: #202a20;
  --line: #344332;
  --text: #f4f0dc;
  --muted: #b7b19c;
  --accent: #74c46f;
  --gold: #e0c65d;
  --danger: #d86a5e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(116, 196, 111, 0.16), transparent 30%),
    linear-gradient(145deg, #101410, #172016 45%, #202517);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button {
  min-height: 40px;
  border: 1px solid #53634a;
  border-radius: 8px;
  background: #27311f;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
}

button:hover {
  border-color: var(--accent);
  background: #344124;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 58px);
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stat,
.section-title span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 32, 24, 0.82);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.play-area {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 32, 24, 0.94);
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.controls {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.status-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #303b2e;
  padding: 8px 0;
}

.status-row span:last-child {
  color: var(--gold);
  font-weight: 700;
  text-align: right;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.canvas-wrap {
  position: relative;
  min-height: 620px;
  border: 1px solid #3d4d39;
  border-radius: 8px;
  overflow: hidden;
  background: #0d140f;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 720px;
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.crosshair::before,
.crosshair::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, 0.82);
}

.crosshair::before {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}

.crosshair::after {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  max-width: min(560px, calc(100% - 28px));
  transform: translateX(-50%) translateY(18px);
  border: 1px solid #5d6a42;
  border-radius: 8px;
  background: rgba(16, 20, 16, 0.94);
  color: var(--text);
  opacity: 0;
  padding: 10px 14px;
  transition: 0.18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .hud,
  .play-area {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hud {
    align-items: start;
  }
}
