:root {
  --ink: #05070d;
  --glass: rgba(6, 10, 22, 0.7);
  --glass-2: rgba(10, 15, 32, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --fg: #f3f5fb;
  --dim: #a4b0c8;
  --accent: #8fd8ff;
  --enemy: #ff3ddf;
  --gold: #ffd23a;
  --c: #ff5a5f;
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", system-ui, sans-serif;
  --display: Anton, Impact, "Pretendard Variable", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #04060b; color: var(--fg); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
kbd { font-family: var(--sans); font-size: 0.86em; font-weight: 700; padding: 3px 9px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); border-bottom-width: 2px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); display: inline-block; }

/* ---------- 화면 분할 HUD ---------- */
.views { position: fixed; inset: 0; pointer-events: none; }
.vp { position: absolute; overflow: hidden; container-type: size; }
.vp.split { box-shadow: inset 0 0 0 2px rgba(2, 3, 8, 0.95); }
.vp.split::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); pointer-events: none; }
.vp.ov::after { box-shadow: none; }
.vp.down { filter: saturate(0.25) brightness(0.9); }

/* 슬로우: 비네트 + 채도 낮춤(이 칸에만) */
.fx { position: absolute; inset: 0; opacity: 0; transition: opacity 0.1s linear;
  background: radial-gradient(ellipse 72% 64% at 50% 52%, transparent 42%, rgba(10, 6, 30, 0.45) 78%, rgba(3, 2, 12, 0.88) 100%);
  -webkit-backdrop-filter: saturate(0.5) contrast(1.08); backdrop-filter: saturate(0.5) contrast(1.08); }
/* 맞았을 때 붉은 번쩍임 */
.hurt { position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 55%, rgba(255, 40, 80, 0.05) 30%, rgba(255, 30, 70, 0.55) 85%, rgba(255, 20, 60, 0.85) 100%); }
.hurt.on { animation: hurt 0.42s ease-out; }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

.badge { position: absolute; top: 3cqh; left: 2cqw; display: flex; align-items: stretch; height: clamp(40px, 9.5cqh, 86px);
  border-radius: 14px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35); }
.badge .who { display: grid; place-items: center; padding: 0 0.65em; min-width: 2.3em; background: var(--c); color: #0b0f17;
  font-family: var(--display); font-size: clamp(18px, 5.6cqh, 48px); }
.badge .sc { display: flex; align-items: baseline; gap: 0.2em; padding: 0 0.6em; align-self: center; font-family: var(--display);
  font-size: clamp(22px, 6.6cqh, 60px); line-height: 1; min-width: 3.2em; }
.badge .sc b { font-weight: 400; display: inline-block; }
.badge .sc b.bump { animation: bump 0.5s cubic-bezier(.2, 1.6, .4, 1); }
.badge .sc span { font-family: var(--sans); font-weight: 800; font-size: 0.32em; color: var(--dim); }
.badge .hp { display: flex; flex-direction: column; justify-content: center; gap: 0.35em; padding: 0 0.9em; border-left: 1px solid var(--line); }
.badge .hp.shake { animation: shake 0.35s; }
.hp-k { font-size: clamp(10px, 2cqh, 16px); font-weight: 800; color: var(--dim); letter-spacing: 0.08em; }
.hp-bar { display: flex; gap: 3px; }
.hp-bar i { width: clamp(6px, 1.3cqw, 16px); height: clamp(8px, 2.2cqh, 18px); border-radius: 3px; background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s, box-shadow 0.2s; }
.hp-bar i.on { background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent); }
.hp-bar i.on.low { background: #ff4a5a; box-shadow: 0 0 10px #ff4a5a; animation: blink 0.5s infinite alternate; }
.badge .streak { display: none; flex-direction: column; justify-content: center; align-items: center; padding: 0 0.9em;
  border-left: 1px solid var(--line); color: var(--gold); }
.badge .streak.on { display: flex; }
.badge .streak b { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 5cqh, 44px); line-height: 1; }
.badge .streak span { font-size: clamp(9px, 1.8cqh, 14px); font-weight: 800; }
.badge.away { opacity: 0.6; }
.badge.away::after { content: "연결 끊김"; display: grid; place-items: center; padding: 0 0.9em; font-weight: 800;
  font-size: clamp(11px, 2.2cqh, 18px); color: #ffb3b3; border-left: 1px solid var(--line); }
@keyframes bump { 0% { transform: scale(1.45); color: var(--gold); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.wave { position: absolute; top: 3cqh; right: 2cqw; display: flex; flex-direction: column; align-items: flex-end; gap: 0.15em;
  padding: 0.45em 0.9em 0.5em; border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); }
.wave span { font-weight: 800; font-size: clamp(10px, 2.2cqh, 18px); letter-spacing: 0.16em; color: var(--accent); }
.wave span b { font-family: var(--display); font-weight: 400; font-size: 1.35em; letter-spacing: 0.02em; color: var(--fg); }
.wave .tm { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 6.4cqh, 58px); line-height: 1; }
.wave.urgent .tm { color: #ff6a7a; animation: blink 0.5s infinite alternate; }
.wave.on { animation: wavepop 1.6s; }
@keyframes wavepop { 0% { box-shadow: 0 0 0 0 var(--accent); transform: scale(1.12); } 40% { box-shadow: 0 0 30px 6px color-mix(in srgb, var(--accent) 40%, transparent); } 100% { transform: none; } }

.slowtag { position: absolute; top: 15cqh; left: 50%; display: flex; align-items: center; gap: 0.3em;
  font-family: var(--display); font-size: clamp(20px, 6.5cqh, 60px); letter-spacing: 0.16em; color: #fff;
  text-shadow: 0 0 22px var(--c), 0 4px 18px rgba(0, 0, 0, 0.6); opacity: 0; transform: translate(-50%, -10px);
  transition: opacity 0.12s, transform 0.18s; }
.slowtag.on { opacity: 1; transform: translate(-50%, 0); }
.slowtag i { width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--enemy); box-shadow: 0 0 14px var(--enemy); animation: blink 0.4s infinite alternate; }
@keyframes blink { to { opacity: 0.3; } }

/* 화면 밖 드론(충전 중) 방향 화살표 */
.arrows { position: absolute; inset: 0; }
.arrow { position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; }
.arrow i { width: 0; height: 0; border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-left: 22px solid var(--enemy);
  filter: drop-shadow(0 0 8px var(--enemy)); opacity: 0.75; }
.arrow.hot i { opacity: 1; animation: blink 0.18s infinite alternate; }

/* 판정 */
.call { position: absolute; left: 0; right: 0; top: 16%; text-align: center; opacity: 0; transform: translateY(12px) scale(0.92);
  transition: opacity 0.14s, transform 0.26s cubic-bezier(.2, 1.4, .4, 1); }
.call.on { opacity: 1; transform: none; }
.call b { display: block; font-weight: 900; font-size: clamp(28px, 9cqh, 92px); line-height: 1; letter-spacing: -0.03em;
  text-shadow: 0 0 26px color-mix(in srgb, var(--c) 70%, transparent), 0 6px 26px rgba(0, 0, 0, 0.55); }
.call span { display: block; margin-top: 0.25em; font-family: var(--display); font-size: clamp(16px, 5cqh, 46px); color: var(--c);
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.6); }
.call.good b { color: #ffffff; }
.call.streak b { background: linear-gradient(180deg, #fff8cf 0%, #ffd23a 50%, #ff9d1a 100%); -webkit-background-clip: text;
  background-clip: text; color: transparent; filter: drop-shadow(0 8px 24px rgba(255, 170, 0, 0.45)); text-shadow: none; }
.call.bad b { color: #ffb0bd; font-size: clamp(24px, 7.5cqh, 76px); }
.call.bad span { color: #ff8a9a; }
/* 웨이브·검투 시작 알림(타이머 상자 .wave 와 이름이 겹치지 않게 wavecall) */
.call.wavecall b { font-family: var(--display); font-weight: 400; letter-spacing: 0.08em; color: var(--accent); font-size: clamp(34px, 12cqh, 120px); }
.call.wavecall span { font-family: var(--sans); font-weight: 800; color: var(--fg); font-size: clamp(14px, 3.6cqh, 32px); }
.call.duelcall b { font-weight: 900; letter-spacing: -0.03em; color: #fff; font-size: clamp(30px, 10cqh, 100px);
  text-shadow: 0 0 30px rgba(255, 61, 223, 0.7), 0 6px 26px rgba(0, 0, 0, 0.55); }
.call.duelcall span { font-family: var(--sans); font-weight: 800; color: #ffd6f6; font-size: clamp(13px, 3.4cqh, 30px); }
/* 검투: 로봇 체력 띠 아래로 판정 글자를 내리고, 슬로우 글자는 숨깁니다(로봇이 벨 때마다 잠깐 느려지는 것은 연출) */
.vp.duel .call { top: 27%; }
.vp.duel .slowtag { display: none; }

/* 격추 알림 */
.toast { position: absolute; left: 50%; bottom: 9cqh; transform: translate(-50%, 18px); opacity: 0; display: flex; flex-direction: column;
  align-items: center; gap: 0.15em; padding: 0.5em 1.4em 0.6em; border-radius: 18px; background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); white-space: nowrap;
  transition: opacity 0.2s, transform 0.34s cubic-bezier(.2, 1.3, .4, 1); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 8cqh, 76px); letter-spacing: 0.04em; line-height: 1; }
.toast.kill b { background: linear-gradient(180deg, #fff3d6 0%, #ffb347 55%, #ff6a2a 100%); -webkit-background-clip: text;
  background-clip: text; color: transparent; filter: drop-shadow(0 6px 18px rgba(255, 120, 40, 0.5)); }
.toast span { font-weight: 800; color: var(--dim); font-size: clamp(11px, 2.6cqh, 22px); }

.banner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35em;
  background: radial-gradient(ellipse at center, rgba(4, 6, 18, 0.65), rgba(4, 6, 18, 0.25) 70%); opacity: 0; transition: opacity 0.4s; }
.banner.on { opacity: 1; }
.banner b { font-weight: 900; font-size: clamp(36px, 14cqh, 140px); letter-spacing: -0.04em; line-height: 1;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.banner.good b { color: var(--c); filter: drop-shadow(0 0 30px color-mix(in srgb, var(--c) 60%, transparent)); }
.banner.bad b { color: #dfe6ef; }
.banner span { font-family: var(--display); font-size: clamp(24px, 8cqh, 76px); color: var(--fg); }
.banner em { font-style: normal; font-weight: 800; font-size: clamp(12px, 3cqh, 26px); color: var(--dim); }

.note, .guide { position: absolute; left: 50%; transform: translate(-50%, -8px); opacity: 0; padding: 0.45em 1.1em; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); font-weight: 800; font-size: clamp(11px, 2.6cqh, 22px); white-space: nowrap;
  transition: opacity 0.2s, transform 0.3s; }
.note { bottom: 26cqh; }
.guide { bottom: 3.5cqh; color: #ffe6a0; border-color: rgba(255, 210, 120, 0.35); }
.note.on, .guide.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 로봇 검투 ---------- */
/* 로봇 체력: 선수 배지 줄 아래 가운데(보스 체력 띠) */
.rhp { position: absolute; left: 50%; top: calc(4.5cqh + clamp(40px, 9.5cqh, 86px)); width: clamp(220px, 42cqw, 560px);
  padding: 0.45em 0.8em 0.6em; border-radius: 14px; background: rgba(8, 4, 18, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 61, 223, 0.22); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -8px); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.rhp.on { opacity: 1; transform: translate(-50%, 0); }
.rhp-top { display: flex; align-items: baseline; gap: 0.6em; margin-bottom: 0.35em; padding: 0 0.2em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.rhp-n { font-family: var(--display); font-size: clamp(14px, 3.4cqh, 30px); letter-spacing: 0.12em; color: #ffd6f6; }
.rhp-lv { font-size: clamp(10px, 2cqh, 15px); font-weight: 800; color: var(--dim); padding: 0.1em 0.6em; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(6, 10, 22, 0.5); }
.rhp-lv:empty { display: none; }
.rhp-v { margin-left: auto; font-family: var(--display); font-weight: 400; font-size: clamp(16px, 4cqh, 36px); color: #fff; }
.rhp-bar { position: relative; height: clamp(10px, 2.3cqh, 20px); border-radius: 999px; overflow: hidden;
  background: rgba(10, 6, 20, 0.72); border: 1px solid rgba(255, 61, 223, 0.45);
  box-shadow: 0 0 18px rgba(255, 61, 223, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.rhp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.rhp-bar .g { background: rgba(255, 230, 250, 0.75); }
.rhp-bar .f { background: linear-gradient(90deg, #a2148d, var(--enemy) 60%, #ff9df0); box-shadow: 0 0 14px var(--enemy); transition: width 0.12s; }
.rhp.low .rhp-bar .f { animation: blink 0.45s infinite alternate; }
.rhp-bar s { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(5, 3, 12, 0.7); }
.rhp-bar s:nth-of-type(1) { left: 25%; }
.rhp-bar s:nth-of-type(2) { left: 50%; }
.rhp-bar s:nth-of-type(3) { left: 75%; }
.rhp.hit .rhp-bar { animation: rhit 0.35s; }
@keyframes rhit { 0% { transform: translateX(-6px); box-shadow: 0 0 34px #fff; } 40% { transform: translateX(5px); } 100% { transform: none; } }

/* 공격 예고: 오는 쪽 가장자리에 겹화살 + 막는 법 + 칠 때까지 차오르는 띠 */
.warn { position: absolute; display: flex; align-items: center; gap: 0.7em; padding: 0.55em 1em 0.75em; border-radius: 18px;
  background: linear-gradient(135deg, rgba(40, 4, 36, 0.78), rgba(10, 4, 20, 0.62)); border: 1.5px solid rgba(255, 61, 223, 0.6);
  box-shadow: 0 0 34px rgba(255, 61, 223, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none;
  transition: opacity 0.12s; --s: 1; }
.warn.on { opacity: 1; }
.warn.left { left: 2.5cqw; top: 50%; transform: translateY(-50%) scale(var(--s)); transform-origin: left center; }
.warn.right { right: 2.5cqw; top: 50%; transform: translateY(-50%) scale(var(--s)); transform-origin: right center; flex-direction: row-reverse; text-align: right; }
.warn.overhead { left: 50%; top: calc(11cqh + clamp(40px, 9.5cqh, 86px)); transform: translateX(-50%) scale(var(--s)); transform-origin: center top; }
.warn.thrust { left: 50%; bottom: 13cqh; transform: translateX(-50%) scale(var(--s)); transform-origin: center bottom; }
.warn.pop { animation: warnpop 0.38s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes warnpop { from { --s: 1.35; opacity: 0; } to { --s: 1; opacity: 1; } }
@property --s { syntax: "<number>"; inherits: false; initial-value: 1; }
.w-ic { flex: none; width: clamp(36px, 11cqh, 96px); height: clamp(36px, 11cqh, 96px); animation: warnbeat 0.5s infinite alternate; }
.w-ic svg { width: 100%; height: 100%; fill: none; stroke: var(--enemy); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 8px var(--enemy)); }
.w-ic svg .dot { fill: var(--enemy); }
@keyframes warnbeat { from { opacity: 0.55; } to { opacity: 1; } }
.w-tx { display: flex; flex-direction: column; gap: 0.15em; }
.w-tx b { font-weight: 900; font-size: clamp(18px, 5.6cqh, 52px); letter-spacing: -0.03em; line-height: 1.05; color: #fff;
  text-shadow: 0 0 18px rgba(255, 61, 223, 0.8); white-space: nowrap; }
.w-tx span { font-weight: 800; font-size: clamp(11px, 2.4cqh, 21px); color: #ffc6f1; white-space: nowrap; }
.w-bar { position: absolute; left: 1em; right: 1em; bottom: 0.38em; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.w-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9df0, var(--enemy)); transform-origin: left center; transform: scaleX(0); }
.warn.right .w-bar i { transform-origin: right center; }
.w-cb { position: absolute; top: -0.9em; left: 1em; font-style: normal; font-weight: 900; font-size: clamp(10px, 2.2cqh, 18px);
  padding: 0.15em 0.6em; border-radius: 999px; background: var(--gold); color: #1a1200; }
.w-cb:empty { display: none; }
.warn.right .w-cb { left: auto; right: 1em; }
.warn.now { background: linear-gradient(135deg, rgba(255, 61, 223, 0.9), rgba(120, 10, 110, 0.85)); border-color: #fff;
  box-shadow: 0 0 60px rgba(255, 61, 223, 0.8), 0 0 0 3px rgba(255, 255, 255, 0.5); --s: 1.08; }
.warn.now .w-ic svg { stroke: #fff; filter: drop-shadow(0 0 10px #fff); }
.warn.now .w-ic svg .dot { fill: #fff; }
.warn.now .w-tx span { color: #fff; }

/* 빈틈: 지금 베기! */
.openx { position: absolute; left: 50%; top: 71%; transform: translate(-50%, -50%) scale(0.85); display: flex; flex-direction: column;
  align-items: center; gap: 0.25em; opacity: 0; pointer-events: none; transition: opacity 0.12s, transform 0.25s cubic-bezier(.2, 1.5, .4, 1); }
.openx.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.openx b { font-weight: 900; font-size: clamp(30px, 11cqh, 110px); letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(180deg, #fffbe0 0%, #ffd23a 55%, #ff9d1a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 190, 40, 0.7)) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5)); animation: openpulse 0.32s infinite alternate; }
@keyframes openpulse { to { transform: scale(1.06); } }
.openx > span { font-weight: 800; font-size: clamp(12px, 3cqh, 26px); color: #fff3c4; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.o-bar { width: clamp(120px, 26cqw, 340px); height: 6px; margin-top: 0.3em; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.o-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9d1a, #ffd23a); transform-origin: left center; box-shadow: 0 0 12px #ffd23a; }
.o-pips { display: flex; gap: 6px; margin-top: 0.3em; }
.o-pips i { width: clamp(10px, 2.2cqh, 18px); height: clamp(10px, 2.2cqh, 18px); border-radius: 50%; border: 2px solid #ffd23a; }
.o-pips i.on { background: #ffd23a; box-shadow: 0 0 10px #ffd23a; }

/* 칼끼리 부딪힘: 하얀 번쩍 */
.clashfx { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 48%, rgba(255, 255, 255, 0.95), rgba(255, 210, 250, 0.45) 40%, rgba(255, 61, 223, 0.1) 75%, transparent); }
.clashfx.on { animation: clashfx 0.38s ease-out; }
@keyframes clashfx { 0% { opacity: 0.95; } 100% { opacity: 0; } }
/* 로봇 피해 숫자 */
.dmgs { position: absolute; inset: 0; pointer-events: none; }
.dmg { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 400; font-size: clamp(22px, 7.5cqh, 70px);
  color: #fff; text-shadow: 0 0 16px rgba(255, 140, 40, 0.9), 0 4px 14px rgba(0, 0, 0, 0.6); animation: dmgup 1s ease-out forwards; }
.dmg.h2 { font-size: clamp(26px, 9cqh, 84px); color: #ffe27a; }
.dmg.h3 { font-size: clamp(30px, 10.5cqh, 98px); color: #ffd23a; }
@keyframes dmgup { 0% { opacity: 0; transform: translate(-50%, -20%) scale(1.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(0.9); } }

/* 전체 보기 칸(3인일 때 네 번째 칸) */
.ov-tag { position: absolute; top: 3.2cqh; left: 2.4cqw; display: flex; align-items: center; gap: 0.5em; font-family: var(--display);
  font-size: clamp(16px, 4.6cqh, 40px); letter-spacing: 0.16em; color: var(--fg); text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6); }
.ov-tag i { width: 0.45em; height: 0.45em; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; animation: blink 0.8s infinite alternate; }
.ov-boards { position: absolute; left: 2.4cqw; bottom: 4cqh; display: flex; flex-direction: column; gap: 1.2cqh; }
.ovr { display: flex; align-items: center; gap: 0.6em; padding: 0.4em 0.9em; border-radius: 12px; background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); font-size: clamp(12px, 3.4cqh, 30px); }
.ovr > i { width: 0.3em; height: 1.2em; border-radius: 3px; }
.ovr .n { font-family: var(--display); min-width: 1.8em; }
.ovr b { font-family: var(--display); font-weight: 400; min-width: 3em; text-align: right; }
.ovr .hpm { width: 5em; height: 0.4em; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ovr .hpm span { display: block; height: 100%; border-radius: 99px; }
.ovr .hpm.rob { width: 3.6em; }
.ovr .hpm.rob span { background: var(--enemy); box-shadow: 0 0 6px var(--enemy); }
.ovr.down { opacity: 0.5; }

/* 카운트다운 */
.count { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.6); opacity: 0; pointer-events: none;
  font-family: var(--display); font-size: clamp(90px, 22vh, 260px); line-height: 1; color: #fff; letter-spacing: 0.04em;
  text-shadow: 0 0 40px rgba(143, 216, 255, 0.85), 0 0 90px rgba(143, 216, 255, 0.45), 0 10px 40px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s; }
.count.on { opacity: 1; }
.count.pop { animation: countpop 0.55s cubic-bezier(.2, 1.4, .4, 1); }
.count.go { color: #fff8d0; text-shadow: 0 0 40px rgba(255, 210, 90, 0.9), 0 0 100px rgba(255, 160, 60, 0.5), 0 10px 40px rgba(0, 0, 0, 0.6); }
@keyframes countpop { from { transform: translate(-50%, -50%) scale(1.6); } to { transform: translate(-50%, -50%) scale(1); } }

.join { position: fixed; right: 22px; bottom: 22px; width: 132px; padding: 9px; border-radius: 16px; background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); display: flex; flex-direction: column;
  gap: 6px; align-items: center; opacity: 0.88; }
.join img { width: 112px; height: 112px; border-radius: 10px; background: #fff; padding: 5px; }
.join div { display: flex; align-items: baseline; gap: 8px; }
.join-k { color: var(--dim); font-size: 12px; font-weight: 700; }
.join b { font-family: var(--display); font-weight: 400; letter-spacing: 0.18em; font-size: 20px; }

/* ---------- 대기실 ---------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 40px;
  background: linear-gradient(90deg, rgba(3, 4, 12, 0.94) 0%, rgba(3, 4, 12, 0.66) 50%, rgba(3, 4, 12, 0.06) 100%); }
.lobby { display: flex; align-items: center; gap: 60px; width: min(1240px, 100%); }
/* 넓은 화면: 글과 QR 카드를 왼쪽에 모아, 오른쪽 빈 곳에 시연 칼이 보이게 합니다(카메라가 그 자리를 겨눕니다). */
@media (min-width: 1001px) {
  #lobby { justify-items: start; padding-left: clamp(40px, 5vw, 120px); }
}
.lobby-copy { flex: 1; min-width: 0; }
.eyebrow { font-size: 14px; font-weight: 800; letter-spacing: 0.24em; color: var(--accent); margin-bottom: 14px; }
.wordmark { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(64px, 9vw, 132px); line-height: 0.9;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 48%, var(--accent) 78%, #b98cff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(143, 216, 255, 0.35)); }
.wordmark.sm { font-family: var(--sans); font-weight: 900; font-size: 60px; letter-spacing: -0.03em; }
.lede { margin: 20px 0 24px; font-size: 19px; color: #d6deee; line-height: 1.55; max-width: 62ch; }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--glass-2); border: 1px solid var(--line); }
.steps svg { flex: none; width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(143, 216, 255, 0.5)); }
.steps b { display: block; font-size: 16px; margin-bottom: 4px; }
.steps span { font-size: 13.5px; color: var(--dim); line-height: 1.45; }
.rules { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 10px; margin-bottom: 22px; }
.rules div { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px; border-radius: 14px; border: 1px dashed rgba(143, 216, 255, 0.28); }
.rules b { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--accent); }
.rules span { font-size: 13px; font-weight: 700; color: var(--dim); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.slot { position: relative; height: 72px; border-radius: 14px; border: 2px dashed rgba(255, 255, 255, 0.2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.4); font-weight: 700; font-size: 15px; transition: all 0.3s; }
.slot b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; }
.slot small { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: var(--dim); margin-top: 4px; }
.slot.on { border: 2px solid var(--c); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, transparent), transparent);
  color: var(--fg); animation: pop 0.4s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 25%, transparent); }
.slot.ready small { color: var(--c); }
.slot.away { opacity: 0.45; }
.slot.away small::after { content: " · 연결 끊김"; }
.slot.ready { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent), 0 10px 30px color-mix(in srgb, var(--c) 22%, transparent); }
.slot.prac small { color: var(--gold); }
.slot.prac::after { content: ""; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: blink 0.7s infinite alternate; }
/* 대기실 설정(모드·난이도)과 연습 현황 */
.setbox { margin: 0 0 16px; max-width: 760px; }
.setbox:empty { display: none; }
.tutbox { margin: 0 0 14px; }
.tutbox:empty { display: none; }
.over-set { margin: 0 auto 18px; max-width: 640px; }
.hint b { color: var(--fg); }
@keyframes pop { from { transform: scale(0.9); } to { transform: none; } }
.hint { color: var(--dim); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qr-card { flex: none; width: 340px; padding: 24px; border-radius: 26px; background: #f5f6fb; color: #0b1220;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(143, 216, 255, 0.18); text-align: center; }
.qr-card img { width: 100%; aspect-ratio: 1; display: block; border-radius: 10px; background: #eceef4; }
.qr-code { margin-top: 16px; display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.qr-code span { font-size: 13px; font-weight: 800; color: #5d6a7c; letter-spacing: 0.1em; }
.qr-code b { font-family: var(--display); font-weight: 400; font-size: 54px; letter-spacing: 0.2em; line-height: 1; }
.qr-url { margin-top: 6px; font-size: 13px; color: #5d6a7c; word-break: break-all; }
.qr-warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff1c7; color: #6a4b00; font-size: 13px; line-height: 1.45; font-weight: 600; }
.msg { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 16px); padding: 14px 24px; border-radius: 16px; background: var(--glass-2);
  border: 1px solid var(--line); font-weight: 700; opacity: 0; transition: opacity 0.25s, transform 0.35s; pointer-events: none; }
.msg.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 결과 ---------- */
.over-screen { background: radial-gradient(ellipse at center, rgba(3, 4, 12, 0.88) 0%, rgba(3, 4, 12, 0.72) 60%, rgba(3, 4, 12, 0.5) 100%); }
.over { width: min(920px, 100%); text-align: center; }
.podium { display: flex; flex-direction: column; gap: 12px; margin: 30px 0 26px; }
.podium .r { display: flex; align-items: center; gap: 18px; padding: 16px 24px; border-radius: 18px; background: var(--glass-2);
  border: 1px solid var(--line); text-align: left; animation: rise 0.5s backwards cubic-bezier(.2, 1.2, .4, 1); }
.podium .r:first-child { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 35%, transparent), var(--glass-2)); border-color: var(--c); padding: 22px 24px;
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 25%, transparent); }
.podium .rank { font-family: var(--display); font-size: 40px; width: 1.2em; color: var(--dim); }
.podium .r:first-child .rank { color: var(--gold); font-size: 52px; }
.podium .who { font-family: var(--display); font-size: 34px; flex: 1; color: var(--c); display: flex; align-items: baseline; gap: 10px; }
.podium .who small { font-family: var(--sans); font-size: 12px; font-weight: 800; color: var(--dim); letter-spacing: 0.1em; }
.podium .num { text-align: right; min-width: 82px; }
.podium .num b { font-family: var(--display); font-weight: 400; font-size: 32px; }
.podium .num span { display: block; color: var(--dim); font-size: 12px; font-weight: 700; }
.podium .num.big { min-width: 130px; }
.podium .res { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 16px; border-radius: 999px; font-weight: 900; font-size: 20px;
  letter-spacing: -0.02em; white-space: nowrap; background: rgba(255, 255, 255, 0.08); color: var(--dim); }
.podium .res small { font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: 0.04em; opacity: 0.8; }
.podium .res.win { background: linear-gradient(180deg, #fff3b0, var(--gold)); color: #1a1200; box-shadow: 0 0 22px rgba(255, 210, 58, 0.45); }
.podium .res.tw { background: color-mix(in srgb, var(--c) 30%, transparent); color: #fff; box-shadow: inset 0 0 0 1.5px var(--c); }
.podium .res.ko { color: #ff9aa6; }
.podium .num.big b { font-size: 42px; color: var(--fg); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.over .hint { justify-content: center; }

@media (max-width: 1000px) {
  .lobby { flex-direction: column; gap: 26px; }
  .steps { grid-template-columns: 1fr; }
  .rules { grid-template-columns: repeat(2, auto); }
  .qr-card { width: 280px; }
  .podium .num { min-width: 56px; }
}
