:root {
  --bg: #05060f;
  --fg: #e8ecff;
  --accent: #ffd23f;
  --accent-2: #4cf2ff;
  --muted: #8a90b8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  word-break: keep-all;
  overflow-wrap: break-word;
}

#wrap {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
}

canvas {
  display: block;
  background: #000;
  image-rendering: pixelated;
  box-shadow: 0 0 40px rgba(76, 242, 255, 0.15);
  /* 실제 크기는 game.js 가 창 크기에 맞춰 지정 */
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 16px;
  background: rgba(5, 6, 15, 0.72);
}

.overlay.hidden { display: none; }

h1 {
  margin: 0;
  font-size: clamp(36px, 9vw, 56px);
  line-height: 1;
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 3px 3px 0 #d6336c;
}

.overlay p { margin: 0; color: var(--muted); }
.score-line { color: var(--accent-2) !important; font-size: 18px; }
.score-line:empty { display: none; }

button {
  font: inherit;
  font-size: 20px;
  letter-spacing: 3px;
  padding: 12px 36px;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b8901a;
}
button:active { transform: translateY(2px); box-shadow: 0 2px 0 #b8901a; }

.help {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

[hidden] { display: none !important; }

.btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.btns button { font-size: 16px; letter-spacing: 1px; padding: 11px 22px; }
button.ghost {
  color: var(--fg);
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--muted);
}
button.ghost:active { box-shadow: inset 0 0 0 2px var(--fg); transform: translateY(1px); }

.share {
  margin: 0;
  padding: 12px 14px;
  max-width: 100%;
  white-space: pre-wrap;
  text-align: left;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.back {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.back:hover, .back:focus-visible { color: var(--fg); }
.back-links { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.back-links .back { margin: 0; }

/* 조작 안내: 터치 기기에서는 키보드 설명을 숨기고 터치 설명만 보인다 */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .kbd-only { display: none; }
  .touch-only { display: inline; }
}
