/* ⛔ iOS 는 «16px 미만» 입력창에 포커스하면 화면을 «확대»하고 «되돌리지 않는다».
   user-scalable=no·maximum-scale 은 iOS 10 이후 무시된다 — 폰트로만 막힌다.
   ⇒ 채팅을 한 번 누르면 화면이 확대된 채 «고정»됐다 (2026-09-08 사용자 신고).
   ⚠️ 16px 아래로 내리지 마라. 작게 보이고 싶으면 «칸»을 줄여라. */
/* 우당탕탕 철골 건너기 — 밤 · 강철 · 경고등
   ⭐ 톤을 기존 3게임과 «일부러» 다르게 잡았다:
      경마=하늘/코믹 · 무궁화=초록/핑크 · 테트리스=네온 · 철골=«밤의 공사현장» */
:root {
  --ink:      #0a0d18;
  --ink-2:    #0f1424;
  --panel:    rgba(20, 26, 44, .88);
  --line:     rgba(150, 170, 210, .18);
  --paper:    #e9edf7;
  --muted:    #8f9ab5;
  --steel:    #93a0bb;
  --amber:    #ffb020;   /* 경고등 */
  --amber-d:  #c47c00;
  --danger:   #ff4438;
  --ok:       #47d38a;
  --radius:   14px;
  --font-disp:'Do Hyeon', 'Pretendard Variable', sans-serif;
  --font-num: 'Oswald', 'Pretendard Variable', sans-serif;
  --font-body:'Pretendard Variable', Pretendard, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }   /* ⛔ 없으면 .result-modal{display:flex} 가 hidden 을 덮어쓴다 */

html, body { height: 100%; font-family: var(--font-body); color: var(--paper); background: var(--ink); overflow: hidden; }

.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255,176,32,.07) 0%, transparent 60%),
    linear-gradient(rgba(147,160,187,.05) 1px, transparent 1px) 0 0/100% 44px,
    linear-gradient(90deg, rgba(147,160,187,.05) 1px, transparent 1px) 0 0/44px 100%,
    var(--ink);
}

.screen { position: fixed; inset: 0; display: none; overflow-y: auto; }
.screen.active { display: block; }

/* 버튼 */
.btn {
  font-family: var(--font-disp); font-size: 17px; color: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 20px; cursor: pointer;
  background: rgba(255,255,255,.05); transition: transform .1s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--amber); background: rgba(255,176,32,.10); }
/* ⛔ 위 규칙이 .btn-primary 의 «밝은 앰버 배경»까지 덮어써서, 어두운 글자(#1a1204)가
   어두운 배경 위에 남아 «글씨가 사라졌다» (2026-09-04 사용자 신고).
   → 색이 칠해진 버튼은 «더 밝게»만 하고 배경을 갈아치우지 않는다. */
.btn-primary:hover { background: linear-gradient(180deg, #ffc04a, var(--amber)); border-color: #ffd98a; color: #1a1204; }
.btn-accent:hover { background: rgba(147,160,187,.28); border-color: #b9c6e0; color: var(--paper); }
.btn:active { transform: translateY(2px); }
.btn.big { font-size: 21px; padding: 15px 26px; width: 100%; }
.btn.small { font-size: 14px; padding: 7px 13px; }
.btn-primary { background: linear-gradient(180deg, var(--amber), var(--amber-d)); border-color: var(--amber); color: #1a1204; font-weight: 700; }
.btn-accent { background: rgba(147,160,187,.16); border-color: var(--steel); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(6px); }

/* ===== 홈 ===== */
.home-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px 18px; }
.title-block { text-align: center; }
.beam-deco { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.beam-deco i { display: block; width: 46px; height: 9px; background: linear-gradient(180deg, #7d6450, #4a3a2c); border-radius: 2px; }
.beam-deco i:nth-child(2) { transform: rotate(-4deg); }
.beam-deco i:nth-child(3) { transform: rotate(3deg); }
.game-title { font-family: var(--font-disp); font-size: clamp(34px, 9vw, 66px); line-height: 1.05; letter-spacing: -.01em; }
.game-title span { color: var(--amber); text-shadow: 0 0 24px rgba(255,176,32,.45); }
.subtitle { margin-top: 12px; font-size: 15.5px; color: var(--muted); background: rgba(255,255,255,.04);
  display: inline-block; padding: 6px 15px; border-radius: 999px; border: 1px solid var(--line); }
.subtitle b { color: var(--amber); }

.home-card { width: min(430px, 100%); display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-disp); font-size: 14px; color: var(--muted); }
.fld input, .join-row input {
  font-family: var(--font-body); font-size: 17px; font-weight: 600; color: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: rgba(0,0,0,.3);
}
.fld input:focus, .join-row input:focus { outline: none; border-color: var(--amber); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; text-align: center; letter-spacing: .35em; font-family: var(--font-num); font-size: 20px; }
.join-room-badge { font-family: var(--font-disp); font-size: 17px; text-align: center; color: var(--amber); }
.err-msg { font-size: 13px; color: var(--danger); min-height: 18px; text-align: center; }
.foot { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 520px; }

/* ===== 로비 ===== */
.lobby-wrap { min-height: 100%; padding: 14px 16px 30px; max-width: 1100px; margin: 0 auto; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.room-badge { display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 2px solid var(--amber); border-radius: 999px; padding: 8px 18px; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
/* ⭐ 헤더 오른쪽: 인원·링크복사·나가기 를 한 덩어리로 (무궁화와 통일, 2026-09-04) */
.lobby-head > .head-actions { display: flex; align-items: center; gap: 8px; }
.rb-label { font-size: 12px; color: var(--muted); }
.rb-code { font-family: var(--font-num); font-size: 26px; font-weight: 700; letter-spacing: .16em; color: var(--amber); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.member-count { font-size: 13px; color: var(--muted); }

.lobby-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .lobby-grid { grid-template-columns: 1fr; } }
.panel-title { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-disp); font-size: 17px; margin-bottom: 12px; }
.ready-count, .host-tag { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.06); padding: 3px 9px; border-radius: 999px; }
.host-tag { color: var(--amber); }
.participant-list { display: flex; flex-direction: column; gap: 6px; max-height: 44vh; overflow-y: auto; }
.p-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.p-item.me { border-color: var(--amber); }
.p-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.p-name { font-weight: 600; }
.p-tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.p-x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }

.settings-body { display: flex; flex-direction: column; gap: 12px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.setting.toggle-row { border-bottom: 1px dashed var(--line); }
.s-label { font-size: 14px; color: var(--paper); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: 0; padding: 7px 13px; cursor: pointer; }
.seg-btn.active { background: var(--amber); color: #1a1204; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255,255,255,.12); border-radius: 999px; transition: .2s; cursor: pointer; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.notice { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.hint.center { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.howto { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(0,0,0,.25); }
.howto-title { font-family: var(--font-disp); font-size: 16px; margin-bottom: 10px; color: var(--amber); letter-spacing: .3px; }
.howto-title + .howto-list { margin-top: 0; }
.howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.howto-list li { position: relative; padding-left: 30px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.howto-list li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--amber); color: #1a1200; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-disp); }
.howto-list b { color: var(--paper); }
.howto-list .hint, .howto-list small { display: block; margin-top: 3px; font-size: 12px; opacity: .65; }
.howto-list i { font-style: normal; opacity: .75; }
.howto-list .tag { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; background: rgba(255,176,32,.18); color: var(--amber); vertical-align: 1px; }

/* ===== 게임 ===== */
#beam-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.game-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(6,8,16,.92), rgba(6,8,16,0));
  font-family: var(--font-disp);
}
.game-status { font-size: 14px; color: var(--muted); }
.alive-count { font-size: 15px; color: var(--ok); }
.dist-label { font-family: var(--font-num); font-size: 16px; color: var(--amber); }

/* 미니맵 — 후방 시점이라 «뒤»가 안 보이는 걸 보완한다 */
.minimap { position: fixed; top: 48px; left: 12px; right: 12px; height: 30px; z-index: 6; pointer-events: none; }
.minimap canvas { width: 100%; height: 100%; display: block; }

/* 바람 게이지 — 균형 게이지 «바로 위»에 둔다. 둘을 같이 봐야 판단이 된다 */
.wind-wrap { position: fixed; left: 0; right: 0; bottom: 146px; z-index: 6;
  display: flex; align-items: center; justify-content: center; gap: 7px; pointer-events: none; }
.wind-arrow { font-size: 11px; color: rgba(214,232,255,.25); transition: color .12s, transform .12s; }
.wind-arrow.on { color: var(--amber); }
.wind-track { position: relative; width: min(220px, 46vw); height: 6px;
  background: rgba(0,0,0,.55); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.wind-track::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.25); }
.wind-fill { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: var(--amber); transition: none; }
.wind-fill.gust { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.wind-label { font-family: var(--font-disp); font-size: 10.5px; color: var(--muted); }

/* 균형 게이지 */
.bal-wrap { position: fixed; left: 0; right: 0; bottom: 118px; z-index: 6; display: flex; justify-content: center; pointer-events: none; }
.bal-track { position: relative; width: min(360px, 74vw); height: 12px; background: rgba(0,0,0,.55);
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bal-safe { position: absolute; left: 32%; right: 32%; top: 0; bottom: 0; background: rgba(71,211,138,.22); }
.bal-pin { position: absolute; top: -3px; width: 5px; height: 18px; border-radius: 3px; background: var(--amber);
  left: 50%; transform: translateX(-50%); box-shadow: 0 0 10px rgba(255,176,32,.8); }
.bal-pin.warn { background: var(--danger); box-shadow: 0 0 12px rgba(255,68,56,.9); }

/* 조작 */
.controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
.ct-btn { flex: 1; font-family: var(--font-disp); font-size: 22px; color: var(--paper);
  background: rgba(20,26,44,.85); border: 1px solid var(--line); border-radius: 14px; padding: 18px 0; cursor: pointer;
  user-select: none; touch-action: manipulation; }
.ct-btn:active, .ct-btn.on { background: rgba(255,176,32,.25); border-color: var(--amber); }
.ct-go { flex: 1.35; color: var(--amber); }

.countdown { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.countdown span { font-family: var(--font-disp); font-size: clamp(70px, 18vw, 170px); color: var(--amber);
  text-shadow: 0 0 40px rgba(255,176,32,.6); animation: pop .45s ease-out; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ⭐ 인게임 알림 — «화면을 덮지 않는다».
   ⛔ 예전엔 .fall-msg 를 그대로 썼다: inset:0 + 반투명 검정 + 거대 글자라
      「외곽 붕괴!」가 뜨는 1.6초 동안 «불길을 피해야 할 바로 그 순간에» 판이 안 보였다
      (2026-09-05 사용자 신고). 알림은 위쪽 띠로 내리고 배경을 없앴다. */
.fall-msg { position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 19;
  display: flex; align-items: center; gap: 10px; pointer-events: none;
  max-width: calc(100vw - 24px); padding: 9px 18px; border-radius: 999px;
  background: rgba(24,8,10,.82); border: 1px solid rgba(255,90,70,.5);
  box-shadow: 0 6px 22px rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.fall-msg b { font-family: var(--font-disp); font-size: clamp(16px, 4.4vw, 22px); color: #ff6b52;
  letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.fall-msg span { font-size: 12.5px; color: #ffbdb4; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 520px) { .fall-msg span { display: none; } }
.fall-msg.pop { animation: bandpop .42s cubic-bezier(.15,1.4,.4,1) both; }
@keyframes bandpop { 0% { transform: translateX(-50%) translateY(-14px) scale(.86); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; } }
@keyframes fadeup { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 밀릴 때 — 어느 쪽에서 밀리는지 화면 가장자리로 알려준다 */
.push-l, .push-r { position: fixed; top: 0; bottom: 0; width: 22vw; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .1s; }
.push-l { left: 0; background: linear-gradient(90deg, rgba(255,90,60,.55), transparent); }
.push-r { right: 0; background: linear-gradient(270deg, rgba(255,90,60,.55), transparent); }

/* 결과 */
.result-modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(4,6,12,.86); padding: 18px; }
.result-card { background: var(--panel); border: 1px solid var(--amber); border-radius: 16px; padding: 24px;
  width: min(520px, 100%); max-height: 88vh; overflow-y: auto; text-align: center; }
.trophy { font-size: 46px; }
.result-title { font-family: var(--font-disp); font-size: 27px; margin: 6px 0 14px; color: var(--amber); }
.winner-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.winner-item { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--amber); border-radius: 10px; }
.winner-item.is-me { background: rgba(255,176,32,.12); }
.full-rank { text-align: left; border-top: 1px solid var(--line); padding-top: 12px; max-height: 38vh; overflow-y: auto; }
.fr-title { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; border-bottom: 1px solid var(--line); }
.rank-row.me { color: var(--amber); font-weight: 700; }
.rank-no { font-family: var(--font-num); width: 46px; color: var(--muted); }
.r-dist { margin-left: auto; color: var(--muted); font-family: var(--font-num); }
.result-actions { display: flex; gap: 9px; margin-top: 16px; }
.result-actions .btn { flex: 1; }

/* 채팅 */
.chat { position: fixed; left: 12px; bottom: 96px; z-index: 25; width: 270px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.chat-head { padding: 7px 11px; background: rgba(0,0,0,.35); cursor: pointer; font-family: var(--font-disp); }
.chat-body { display: flex; flex-direction: column; }
.chat.collapsed .chat-body { display: none; }
.chat-log { height: 132px; overflow-y: auto; padding: 8px 11px; display: flex; flex-direction: column; gap: 4px; }
.chat-msg b { font-weight: 700; }
.chat-form { display: flex; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; border: 0; background: transparent; color: var(--paper); padding: 8px 11px; font-family: inherit; font-size: 16px; }
.chat-form input:focus { outline: none; }
.chat-send { border: 0; background: rgba(255,176,32,.2); color: var(--amber); padding: 0 13px; cursor: pointer; font-family: var(--font-disp); }
#screen-game.active ~ #chat { opacity: .45; transition: opacity .2s; }
#screen-game.active ~ #chat:hover, #screen-game.active ~ #chat:focus-within { opacity: 1; }

.toast { position: fixed; left: 50%; bottom: 170px; transform: translateX(-50%); z-index: 40;
  background: rgba(0,0,0,.85); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; font-size: 13.5px; }

@media (max-width: 560px) {
  .bal-wrap { bottom: 110px; }
  .wind-wrap { bottom: 136px; }
  .chat { bottom: 92px; width: 210px; }
}


/* ⛔ 모바일에서 채팅이 «화면 절반»을 덮는다 — 440px 폭에서 280px = 64%.
   실측(2026-09-03): 로비 설정 패널이 통째로 가려져 조작이 안 됐다.
   ⭐ 폭을 줄이는 것만으론 부족해서 «터치 기기는 접힌 채로» 시작한다(app.js). */
@media (max-width: 620px) {
  .chat { width: 158px; }
  .chat-log { height: 88px; }
  .chat-head { padding: 6px 9px; font-size: 12px; }
  .chat-form input { padding: 6px 9px; font-size: 16px; }
  .chat-send { padding: 0 9px; font-size: 12px; }
}


/* ── 뽑기 방식 안내 · 라운드 HUD (2026-09-03) */
.mode-note { margin: -2px 0 10px; font-size: 12.5px; line-height: 1.5; opacity: .9; }
.round-info {
  font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.10);
}
.round-info.urgent { background: rgba(255,80,80,.22); color: #ffb3b3; animation: riPulse .9s ease-in-out infinite; }
@keyframes riPulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

.result-why { margin:2px 0 12px; font-size:12.5px; line-height:1.55; opacity:.85; text-align:center; }

/* ===== 모바일: 버튼 홀드 시 선택·복사 팝업 방지 + 채팅 스크롤 허용 (2026-09-04) ===== */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, canvas, .ct-btn, .seg-btn, .switch, .stepper, .tab, [role="button"] {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
canvas, .ct-btn { touch-action: none; }               /* 게임 조작은 스크롤 제스처를 먹지 않게 */
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.chat-log, .chat-body, #chat-log { touch-action: pan-y; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ⭐ 채팅 헤드 드래그 (2026-09-04 무궁화와 통일) */
.chat-head { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.chat-head:active { cursor: grabbing; }


/* 조작 — 왼손 스틱 / 오른손 폭탄 */
.bomber-controls { position:fixed; left:0; right:0; bottom:0; z-index:9; display:flex; align-items:flex-end;
  justify-content:space-between; padding:0 22px calc(22px + env(safe-area-inset-bottom)); pointer-events:none; }
.stick { pointer-events:auto; width:128px; height:128px; border-radius:50%;
  background:radial-gradient(circle,rgba(30,40,62,.55),rgba(20,28,46,.35)); border:2px solid rgba(120,160,230,.3);
  position:relative; touch-action:none; -webkit-user-select:none; user-select:none; }
.stick-knob { position:absolute; left:50%; top:50%; width:56px; height:56px; margin:-28px 0 0 -28px; border-radius:50%;
  background:radial-gradient(circle,#6db3ff,#3a6fd0); border:2px solid rgba(255,255,255,.35); box-shadow:0 3px 10px rgba(0,0,0,.4); }
.bomb-btn { pointer-events:auto; width:96px; height:96px; border-radius:50%; font-size:44px;
  background:radial-gradient(circle,#3a2030,#1c1018); border:3px solid rgba(255,120,90,.5); color:#fff;
  box-shadow:0 4px 14px rgba(0,0,0,.45); touch-action:none; -webkit-user-select:none; user-select:none; }
.bomb-btn.on { transform:scale(.92); border-color:#ff5d3c; }
@media (max-width:620px){ .stick{ width:112px; height:112px; } .bomb-btn{ width:84px; height:84px; font-size:38px; } }

/* ═══ 폭탄 대소동 — 게임 화면 ═══ */
#bomber-canvas { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; }
.my-stat { font-weight:800; font-variant-numeric:tabular-nums; padding:2px 8px; border-radius:999px; background:rgba(255,176,32,.14); color:#ffce6a; }
.spectate { position:fixed; top:52px; left:50%; transform:translateX(-50%); z-index:8;
  background:rgba(12,20,38,.85); border:1px solid rgba(255,120,90,.4); color:#ffb3a0;
  padding:6px 14px; border-radius:999px; font-weight:700; font-size:13px; }

/* ⭐ 조작 — 왼쪽 «십자 화살표(D패드)», 오른쪽 폭탄 (2026-09-04)
   ⛔ 아날로그 스틱을 두 번 시도했다가 걷어냈다: ① 고정 원형은 엄지 위치를 강요하고 채팅과 겹쳤다
      ② 플로팅은 «닿기 전엔 안 보여» 사용자가 조작부를 못 찾았고 가동범위가 넓어 부정확했다.
   ⭐ 이 게임은 «격자» 이동이라 방향이 4개뿐이다 — 아날로그로 얻을 게 없다. 버튼이 정확하다. */
.bomber-controls { position:fixed; inset:0; z-index:9; pointer-events:none; }
.bomb-btn { position:absolute; right:22px; bottom:calc(22px + env(safe-area-inset-bottom)); pointer-events:auto;
  width:104px; height:104px; border-radius:50%; font-size:46px;
  background:radial-gradient(circle,#3a2030,#1c1018); border:3px solid rgba(255,120,90,.5); color:#fff;
  box-shadow:0 4px 14px rgba(0,0,0,.45); touch-action:none; -webkit-user-select:none; user-select:none; }
.bomb-btn.on { transform:scale(.92); border-color:#ff5d3c; }
@media (max-width:620px){ .bomb-btn{ width:92px; height:92px; font-size:40px; } }

/* ⭐ 채팅 — 위치·크기는 다른 5게임과 «똑같이» 둔다 (2026-09-04 전수검사).
   ⛔ 상단으로 올렸더니 로비에서 «방 코드»와 겹치고 폭도 혼자 달랐다.
   게임 중에만 D패드(186+14px) 위로 올려 조작을 안 가린다. */
body.touch .chat.ingame { bottom: 158px; }   /* D패드가 3×2 로 낮아졌다(132px) */

/* ⭐ 조이스틱 — 왼쪽 아래 «구역» 어디를 눌러도 그 자리에 선다(플로팅).
   격자 4방향이라 스틱 값은 «주축 하나»로 바꿔 쓴다. 데드존을 작게 둬 살짝만 밀어도 걷는다. */
.stick-zone { position:absolute; left:0; bottom:0; z-index:1;
  width:min(48%, 300px); height:min(44%, 300px); pointer-events:auto; touch-action:none; }
.stick { position:absolute; width:146px; height:146px; margin:-73px 0 0 -73px; border-radius:50%;
  background:radial-gradient(circle at 50% 50%, rgba(40,58,92,.5), rgba(18,26,44,.72));
  border:2px solid rgba(120,160,230,.3); box-shadow:0 4px 16px rgba(0,0,0,.4);
  opacity:.66; transition:opacity .14s, border-color .14s; }
.stick.on { opacity:1; border-color:#6db3ff; }
.stick-knob { position:absolute; left:50%; top:50%; width:62px; height:62px; margin:-31px 0 0 -31px;
  border-radius:50%; background:radial-gradient(circle at 40% 34%, #9ccbff, #3d6cbb);
  border:2px solid rgba(222,240,255,.72); box-shadow:0 3px 10px rgba(0,0,0,.45); }
@media (max-width:620px){ .stick{ width:130px; height:130px; margin:-65px 0 0 -65px; }
  .stick-knob{ width:56px; height:56px; margin:-28px 0 0 -28px; } }

/* ⭐ 연습시간 배너 (2026-09-04) */
.practice-bar { position: fixed; top: 46px; left: 50%; transform: translateX(-50%); z-index: 12;
  display: flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px;
  background: rgba(12,20,38,.92); border: 1px solid rgba(110,220,160,.45); box-shadow: 0 4px 14px rgba(0,0,0,.45);
  font-size: 13px; color: #cfe9db; max-width: calc(100vw - 20px); }
.pb-tag { font-family: var(--font-disp); font-weight: 800; color: #6ee7a0; }
.pb-msg { opacity: .75; }
.pb-left { font-variant-numeric: tabular-nums; font-weight: 800; color: #fff; }
.pb-skip { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(110,220,160,.18); border: 1px solid rgba(110,220,160,.5); color: #a9f0c6; }
.pb-vote { font-size: 11.5px; opacity: .7; }
@media (max-width: 620px) {
  .practice-bar { font-size: 12px; gap: 7px; padding: 6px 11px; white-space: nowrap; top: 42px; }
  .pb-msg { display: none; }            /* 좁은 화면은 «연습 · 남은시간 · 건너뛰기» 만 */
  .pb-vote { display: none; }
  .pb-skip { padding: 4px 10px; }
}

/* ⭐ 게임 중 채팅 — 반투명(캐릭터 안 가림). 손대면 또렷해진다 */
.chat.ingame { opacity: .48; transition: opacity .18s; }
.chat.ingame:hover, .chat.ingame:focus-within { opacity: 1; }

/* ⭐ 연습 종료 카운트다운 — 화면 «정중앙»에 크게 (2026-09-04) */
.practice-cd { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; pointer-events: none; }
.pc-tx { font-family: var(--font-disp, inherit); font-size: clamp(15px, 4.5vw, 22px); font-weight: 800;
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.75), 0 0 22px rgba(0,0,0,.6); letter-spacing: .5px; }
.pc-num { font-family: var(--font-disp, inherit); font-size: clamp(76px, 26vw, 168px); font-weight: 900; line-height: 1;
  color: #ffd35f; text-shadow: 0 6px 26px rgba(0,0,0,.8), 0 0 40px rgba(255,180,60,.45);
  animation: pc-pop .42s cubic-bezier(.2,1.5,.4,1); }
@keyframes pc-pop { 0% { transform: scale(.55); opacity: 0; } 55% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* ⛔ 내용이 없는 안내 상자는 «빈 칸»으로 보인다 — 테두리·배경만 남아 설정 사이에 구멍이 생겼다 (2026-09-04) */
.notice:empty, .mode-note:empty { display: none; }

/* ── 봇 추가 바 (참가자 목록 위) — ⭐ 톤 중립: currentColor·rgba 만 써서 6게임 어디서나 뜬다 */
.botbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.botbar select, .botbar button { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(128,128,128,.45); background: rgba(128,128,128,.14); color: inherit; cursor: pointer; }
.botbar button { font-weight: 700; }
.botbar button:hover:not(:disabled) { background: rgba(128,128,128,.28); }
.botbar button:disabled, .botbar select:disabled { opacity: .4; cursor: default; }
.bot-note { font-size: 11px; opacity: .55; }
@media (max-width: 640px) { .bot-note { display: none; } }
/* ⭐ 혼자일 때 — 봇 추가 버튼이 «먼저 눈에 띈다». 권하는 것이지 막는 것이 아니다 */
.botbar.suggest button { border-color: rgba(255,190,90,.75); background: rgba(255,190,90,.2); animation: botpulse 1.9s ease-in-out infinite; }
.botbar.suggest .bot-note { opacity: .8; }
@keyframes botpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,190,90,.42); } 50% { box-shadow: 0 0 0 7px rgba(255,190,90,0); } }

/* ⭐ 붕괴 카운트다운 — 30초 안쪽부터만 뜬다. 늘 떠 있으면 소음이다 */
.cd-collapse { margin-left: 10px; font-size: 12.5px; font-weight: 700; color: #ffcf7a;
  padding: 2px 8px; border-radius: 999px; background: rgba(255,180,80,.16); border: 1px solid rgba(255,180,80,.4); }
.cd-collapse.hot { color: #ff8a6b; background: rgba(255,90,60,.2); border-color: rgba(255,90,60,.55);
  animation: cdpulse 1s ease-in-out infinite; }
@keyframes cdpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ⭐ 접힌 채팅은 «머리만큼만» 좁게 (2026-09-06 사용자: 「닫힌 상태는 가로 폭을 줄여서」).
   ⛔ 예전엔 접혀도 폭이 158~270px 그대로라, 접어도 화면을 그만큼 먹었다. */
.chat.collapsed { width: auto; min-width: 0; }
.chat.collapsed .chat-head { white-space: nowrap; }

/* ⭐ 모달 스크롤 (2026-09-06 사용자: 「모바일에서 팝업에 스크롤이 없어서 동작이 안 된다」)
   ⛔ 30명 순위가 화면을 넘치는데 .result-card 가 overflow:hidden 이라 «버튼을 못 눌러»
      게임 진행이 막혔다. 카드를 자르지 말고 «덮개»를 스크롤시킨다.
   ⭐ margin:auto + align-items:flex-start — 짧으면 가운데, 길면 위부터 스크롤. */
.result-modal { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.result-card { margin: auto; max-height: none; overflow: visible; }
.full-rank, .winner-list { max-height: none; overflow: visible; }

/* ⭐ 로비 헤더 — 8게임 «한 줄»로 통일 (2026-09-06 사용자 지시, 기준: 다리 건너기)
     방 코드 · 인원 · 링크 복사 · 나가기
   ⛔ 좁은 화면에서 로고까지 넣으면 줄이 접혀 헤더가 세 줄이 된다 (무궁화가 그랬다).
      로고는 폰에서 «뺀다» — 게임 화면 상단바에 이미 마크가 있다. */
@media (max-width: 620px) {
  .lobby-head { flex-wrap: nowrap; gap: 8px; }
  .lobby-head .tp-lobby-brand { display: none; }
  .room-badge { padding: 6px 12px; gap: 6px; flex: 0 1 auto; min-width: 0; }
  .rb-label { font-size: 10px; }
  .rb-code { font-size: 21px; letter-spacing: .10em; }
  .head-actions { gap: 6px; flex-wrap: nowrap; margin-left: auto; }
  .head-actions .btn { padding: 6px 9px; font-size: 12px; white-space: nowrap; }
  .member-count { padding: 4px 8px; font-size: 12px; white-space: nowrap; }
}
