/* ===== 네온 살보 — 디자인 (STANDARDS.md 기준, 레퍼런스: neon-striker) ===== */

/* 색상 토큰 — ★ 원본은 js/constants.js의 COLOR 객체. 값이 어긋나면 저쪽이 맞다. */
:root {
  --bg: #04050c;
  --cyan: #4ee1ff;
  --cyan-light: #bfefff;
  --blue: #2b7fff;
  --gold: #ffd53d;
  --red: #ff4d6d;
  --orange: #ff8c3b;
  --magenta: #ff4fd8;
  --text: #eaf6ff;
  --muted: #8fa3c8;
  --muted-dark: #5a6b8c;
  --font-pixel: 'Press Start 2P', monospace;       /* 숫자·영문 타이틀 전용 */
  --font-kr: 'Noto Sans KR', sans-serif;           /* 한글 라벨·안내문 */
}

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

body {
  background: var(--bg);
  background: radial-gradient(1100px 800px at 50% 18%, #0a0e22 0%, var(--bg) 70%);
  display: flex;
  /* 세로 방향이어야 한다. 기본값(가로)이면 게임이 안 뜰 때 안내문이
     캔버스 옆에 나란히 붙어 화면 밖으로 밀려난다 — 정작 필요할 때 안 보인다. */
  flex-direction: column;
  font-family: var(--font-kr);
  /* 모바일: 캔버스 가장자리에서 드래그가 당겨질 때 브라우저의
     당겨서-새로고침/바운스가 끼어들지 않게 막는다 */
  overscroll-behavior: none;
}

/* 게임 프레임 — 크기는 main.js fitCanvas()가 계산한다. 캔버스·HUD·오버레이가
   전부 이 안에서 100%로 따라간다.
   가운데 정렬은 margin: auto — 컨테이너 정렬(justify/align-content)은 내용이
   넘칠 때 위아래를 잘라버리고 잘린 부분에 스크롤도 못 닿는다(작은 모니터 하단
   잘림의 원인). margin: auto는 넘치면 정렬을 포기하고 스크롤로 닿게 놔둔다. */
.frame {
  position: relative;
  margin: auto;
  background: #020308;
  border-radius: 14px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  box-shadow:
    0 0 0 1px rgba(78, 225, 255, .25),
    0 0 60px rgba(78, 225, 255, .12),
    0 30px 80px rgba(0, 0, 0, .7);
}

#game { display: block; width: 100%; height: 100%; }

/* ── HUD ─────────────────────────────────────────────── */

.hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px;
  pointer-events: none;
}
.hud-col { display: flex; flex-direction: column; gap: 7px; }
.hud-col.right { align-items: flex-end; }
.hud-row { display: flex; align-items: baseline; gap: 8px; }
.hud-label { font-size: 11px; font-weight: 900; color: var(--muted); }
.hud-num {
  font-family: var(--font-pixel); font-size: 13px; color: var(--text);
  text-shadow: 0 0 8px rgba(78, 225, 255, .6);
}
.hud-num.gold { color: var(--gold); text-shadow: 0 0 8px rgba(255, 213, 61, .5); }
.hud-num.cyan { color: var(--cyan); }
.combo {
  font-family: var(--font-pixel); font-size: 10px; color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 213, 61, .7);
}
.lives {
  font-size: 12px; color: var(--red); letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255, 77, 109, .7);
}

.power {
  position: absolute; bottom: 12px; left: 16px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none;
}
.power-label {
  font-family: var(--font-pixel); font-size: 12px;
  color: var(--orange);                          /* P 아이템과 같은 주황 */
  text-shadow: 0 0 8px rgba(255, 140, 59, .7);
}
/* 게이지 — 파워 유지 시간(10초)이 줄어드는 게 보인다. 채움 색 = 현재 단계 */
.power-track {
  width: 110px; height: 10px;
  background: rgba(255, 255, 255, .12); border-radius: 5px; overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
}
.power-fill {
  height: 100%; width: 100%;
  background: var(--cyan);                       /* 1단계 */
  box-shadow: 0 0 10px rgba(78, 225, 255, .8);
}
.power-fill.lv2 { background: var(--gold);    box-shadow: 0 0 10px rgba(255, 213, 61, .8); }
.power-fill.lv3 { background: var(--magenta); box-shadow: 0 0 10px rgba(255, 79, 216, .8); }
.power-fill.blink { animation: blink .25s steps(1) infinite; }

/* 일시정지 버튼 (우상단, HUD 아래) */
.pause-btn {
  position: absolute; top: 88px; right: 14px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(2, 3, 10, .5);
  border: 1px solid rgba(143, 163, 200, .4);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.pause-btn span { width: 5px; height: 18px; background: var(--muted); }
.pause-btn:hover { border-color: var(--cyan); }
.pause-btn:hover span { background: var(--cyan); }

/* ── 보스 체력바 ─────────────────────────────────────── */

.boss-bar {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  width: 70%;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none;
}
.boss-tag {
  font-family: var(--font-pixel); font-size: 9px; color: #fff;
  background: #e02440; padding: 4px 7px; border-radius: 3px;
  box-shadow: 0 0 12px rgba(224, 36, 64, .8);
}
.boss-track {
  flex: 1; height: 10px;
  background: rgba(255, 255, 255, .12); border-radius: 5px; overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
}
.boss-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #ff3b3b, #ff7a3b);
  box-shadow: 0 0 10px rgba(255, 59, 59, .9);
}

/* ── 배너·카운트다운 (같은 자리 한 채널) ─────────────── */

/* 배너 텍스트는 한글("웨이브 n"/"BOSS 등장!"/"파워 업!") — 픽셀 폰트 금지 (§3) */
.banner {
  position: absolute; top: 38%; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-kr); font-weight: 900; font-size: 30px;
  letter-spacing: 6px; color: var(--cyan);
  text-shadow: 0 0 18px rgba(78, 225, 255, .9);
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
.banner.show { opacity: 1; }

.countdown {
  position: absolute; top: 36%; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-pixel); font-size: 46px; color: var(--gold);
  text-shadow: 0 0 22px rgba(255, 213, 61, .8);
  pointer-events: none;
}

/* ── 오버레이 (타이틀·일시정지·게임오버) ─────────────── */

.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  background: rgba(2, 3, 10, .82);
  backdrop-filter: blur(3px);
  animation: popIn .3s ease-out;
}
.hidden { display: none !important; }

/* 로고 록업 — 폰트만으로 쓰지 않고 엠블럼·그라데이션·크로마틱 오프셋으로 "디자인된 이름" */
.logo { display: flex; flex-direction: column; align-items: center; }
.logo-ship {
  width: 100px;
  image-rendering: pixelated;   /* 게임 실물 스프라이트를 그대로 확대 */
  filter: drop-shadow(0 0 14px rgba(78, 225, 255, .6));
  margin-bottom: 10px;
}
.logo-neon {
  font-family: var(--font-pixel); font-size: 15px;
  letter-spacing: 18px; padding-left: 18px;   /* 자간만큼 중앙 보정 */
  color: var(--cyan-light);
  text-shadow:
    0 0 5px rgba(78, 225, 255, .95),
    0 0 16px rgba(78, 225, 255, .65),
    0 0 34px rgba(78, 225, 255, .35);   /* 네온관 광량 3겹 */
}
.logo-salvo {
  font-family: var(--font-pixel); font-size: 46px;
  letter-spacing: 12px; padding-left: 12px;   /* 5자라 자간으로 폭 보정 (STRIKER 7자 ≈ 294px 상당) */
  margin-top: 6px;
  background: linear-gradient(180deg, #ffffff 0%, var(--cyan) 45%, var(--blue) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: skewX(-5deg);                     /* 전진하는 속도감 */
  filter:
    drop-shadow(3px 3px 0 rgba(255, 79, 216, .55))   /* 마젠타 크로마틱 오프셋 */
    drop-shadow(0 0 18px rgba(78, 225, 255, .45));
}
.logo-line {
  width: 230px; height: 3px; margin-top: 14px;
  background: linear-gradient(90deg, transparent, var(--magenta), var(--cyan), transparent);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 79, 216, .5);
}
.subtitle { font-size: 14px; font-weight: 900; color: var(--muted); letter-spacing: 6px; }

.overlay-heading {
  font-family: var(--font-pixel); font-size: 28px; color: var(--text);
  text-shadow: 0 0 20px rgba(78, 225, 255, .6);
}
.overlay-heading.red {
  color: var(--red);
  text-shadow: 0 0 20px rgba(255, 77, 109, .7);
}

/* 버튼 라벨은 전부 한글 — 픽셀 폰트로 밀지 않고 고딕 900 (STANDARDS §3) */
.btn {
  font-family: var(--font-kr); font-weight: 900; font-size: 16px;
  letter-spacing: 3px; white-space: nowrap;
  color: #04121a;
  background: linear-gradient(180deg, var(--cyan-light), var(--cyan));
  border: none; padding: 15px 36px; border-radius: 6px;
  box-shadow: 0 0 24px rgba(78, 225, 255, .55);
  cursor: pointer;
  transition: transform .15s;
}
.btn:hover { transform: scale(1.05); }
.btn.pulse { animation: pulse 1.6s infinite; }
.btn.ghost {
  color: var(--muted);
  background: none;
  border: 1px solid rgba(143, 163, 200, .45);
  box-shadow: none;
}
.btn.ghost:hover { color: var(--cyan); border-color: var(--cyan); }
.btn-hearts { color: #e02440; letter-spacing: 2px; }   /* 남은 이어서하기 = 하트 */

.hints { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; }
.hint { font-size: 12px; font-weight: 700; color: var(--muted-dark); }
.hint-items { display: flex; gap: 14px; font-size: 12px; font-weight: 700; }
.hint-items .p { color: var(--orange); }
.hint-items .s { color: var(--cyan); }
.hint-items .b { color: var(--red); }

.credit {
  position: absolute; bottom: 22px; left: 0; right: 0;
  text-align: center;
  font-size: 12px; font-weight: 700; color: var(--muted-dark);
}

/* 게임 오버 */
.record {
  font-size: 13px; font-weight: 900; color: var(--gold);
  background: rgba(255, 213, 61, .12); padding: 6px 14px; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255, 213, 61, .4);
  animation: blink 1.2s infinite;
}
.final { display: flex; gap: 28px; margin: 4px 0 8px; }
.final-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.final-num { font-family: var(--font-pixel); font-size: 18px; color: var(--text); }
.final-num.gold { color: var(--gold); }
.final-num.cyan { color: var(--cyan); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 24px rgba(78, 225, 255, .55); }
                   50% { box-shadow: 0 0 40px rgba(78, 225, 255, .9); } }
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 접근성(§7): 상시 모션을 줄여달라는 설정이면 점멸·펄스·등장 연출을 끈다.
   (캔버스 쪽 흔들림·맥동은 draw.js가 같은 미디어쿼리로 끈다) */
@media (prefers-reduced-motion: reduce) {
  .btn.pulse, .record, .power-bars.blink { animation: none; }
  .overlay { animation: none; }
  .banner { transition: none; }
  .btn { transition: none; }
}

/* 게임이 안 뜰 때만 보이는 안내 (main.js가 정상 시작하면 지운다) */
#loadfail, noscript {
  margin: auto;
  color: #c9c4d6;
  font-family: var(--font-kr);
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
  padding: 24px;
}
