:root {
  color-scheme: dark;
  --ink: #ece6d3;
  --muted: #aaa59b;
  --gold: #d4af69;
}

* { box-sizing: border-box; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(47, 51, 70, .34), transparent 42rem),
    repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    #08090d;
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

.game-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 800px) 280px;
  gap: 34px;
  align-items: center;
  padding: 28px;
}

.game-frame {
  overflow: hidden;
  border: 1px solid #504832;
  border-radius: 5px;
  background: #050509;
  box-shadow: 0 28px 80px #000, 0 0 0 5px #151318, 0 0 0 6px #3c3428;
}

canvas {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  image-rendering: pixelated;
  outline: none;
  background: #000;
}

.manual { padding: 8px 0; }
.eyebrow { color: var(--gold); font: 700 10px/1.4 Georgia, serif; letter-spacing: .18em; }
h1 { margin: 8px 0 18px; font: 700 32px/1.15 "Batang", "Malgun Gothic", serif; letter-spacing: -.06em; }
.lead { color: #cbc5b8; font-size: 14px; line-height: 1.8; }
dl { margin: 30px 0 20px; border-top: 1px solid #302d2b; }
dl div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid #302d2b; }
dt { color: #8e897e; font-size: 12px; }
dd { margin: 0; color: #e1dac9; font-size: 12px; }
.tip { color: #77746e; font-size: 11px; line-height: 1.7; }

#touch {
  display: none;
  justify-content: space-between;
  align-items: end;
  padding: 12px;
  background: #0c0b0e;
  border-top: 1px solid #29252a;
  user-select: none;
}

#touch button {
  border: 1px solid #51483c;
  border-radius: 4px;
  background: #19171d;
  color: #d9d1c2;
  min-width: 48px;
  min-height: 42px;
}

.dpad { display: grid; grid-template-columns: repeat(3, 48px); gap: 3px; }
.dpad button:first-child { grid-column: 2; }
.dpad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.dpad button:nth-child(3) { grid-column: 2; grid-row: 2; }
.dpad button:nth-child(4) { grid-column: 3; grid-row: 2; }
.actions { display: flex; gap: 7px; }
#touch .primary { color: #120f0a; background: #b89b62; }

@media (max-width: 900px) {
  body { display: block; }
  .game-shell { min-height: auto; grid-template-columns: 1fr; padding: 0; gap: 0; }
  .game-frame { border: 0; border-radius: 0; box-shadow: none; }
  .manual { padding: 24px; }
}

@media (pointer: coarse), (max-width: 700px) {
  #touch { display: flex; }
}
