:root {
  --bg: #080a12;
  --line: #2a3450;
  --text: #e8eef8;
  --muted: #8a9ab0;
  --acc: #6ec8ff;
  --hot: #ff80c8;
  --gold: #ffd060;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, "Noto Sans KR", sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}
.bar {
  width: min(960px, 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.brand span { color: var(--hot); font-weight: 700; letter-spacing: 0.12em; }
.hud { display: flex; flex-wrap: wrap; gap: 14px; }
.hud b { color: var(--gold); font-variant-numeric: tabular-nums; }
#stage-box {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 384 / 216;
  background: #000;
  border: 2px solid var(--line);
  box-shadow: 0 0 0 1px #000, 0 20px 50px rgba(0,0,0,.55), 0 0 28px rgba(255,128,200,.08);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#c {
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a1020;
}
#scan {
  pointer-events: none;
  /* inset 단축 속성은 Chrome 87 부터다. 구버전(실기: Android 11 · Chrome 83)은 이 선언을
       통째로 버려 절대배치 요소가 스테이지를 덮지 못하고 정적 위치로 내려앉는다.
       실측 2026-08-07: 이 때문에 6대 캐비닛 전부 START 가 화면 밖으로 밀려 누를 수 없었다. */
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,.26) 2px,
    rgba(0,0,0,.26) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.85;
}
#scan.off { display: none; }
#overlay {
  /* inset 단축 속성은 Chrome 87 부터다. 구버전(실기: Android 11 · Chrome 83)은 이 선언을
       통째로 버려 절대배치 요소가 스테이지를 덮지 못하고 정적 위치로 내려앉는다.
       실측 2026-08-07: 이 때문에 6대 캐비닛 전부 START 가 화면 밖으로 밀려 누를 수 없었다. */
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(6,8,16,.82);
  text-align: center; padding: 16px; gap: 8px;
}
#overlay.hidden { display: none; }
#overlay h1 {
  margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--hot); letter-spacing: 0.14em;
  text-shadow: 0 0 24px rgba(255,128,200,.4);
}
#overlay .tag { color: var(--gold); font-size: 0.9rem; margin: 0; }
#overlay p { margin: 0; color: var(--muted); font-size: 0.9rem; max-width: 28rem; }
#overlay .hint { color: var(--acc); font-size: 0.85rem; }
#btn-start {
  margin-top: 8px; padding: 12px 22px;
  border: 1px solid var(--hot); border-radius: 8px;
  background: linear-gradient(180deg, #4a1838, #1a0a14);
  color: #ffb0d8; font-weight: 700; font-size: 1rem;
  cursor: pointer; letter-spacing: 0.06em;
}
#btn-start:hover { filter: brightness(1.12); }
#toast {
  position: absolute; left: 50%; top: 16%;
  transform: translateX(-50%);
  background: rgba(10,12,24,.9); border: 1px solid var(--gold);
  color: var(--gold); padding: 6px 14px; border-radius: 6px;
  font-weight: 700; font-size: 0.9rem;
  pointer-events: none;
}
.foot { opacity: 0.95; }
.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
#fps { font-variant-numeric: tabular-nums; min-width: 4.5rem; text-align: right; }
#touch {
  display: none;
  position: absolute; left: 0; right: 0; bottom: 6px;
  justify-content: center; gap: 8px;
  pointer-events: none;
}
#touch button {
  pointer-events: auto;
  width: 56px; height: 44px;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(16,20,36,.78); color: var(--text);
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  touch-action: none;
}
@media (max-width: 700px), (pointer: coarse) {
  #touch { display: flex; }
}
