:root {
  --bg: #0b0f22;
  --panel: rgba(22, 29, 62, 0.72);
  --panel-solid: #161d3e;
  --line: rgba(140, 160, 255, 0.22);
  --text: #f3f5ff;
  --sub: #a3aedb;
  --red: #ff4d6d;
  --red-d: #b3203f;
  --blue: #3da5ff;
  --blue-d: #1a63b8;
  --green: #3ddc84;
  --green-d: #1a8a4c;
  --gold: #ffd23f;
  --gold-d: #c98a00;
  --core: #c18cff;
  --ok: #4fe0b0;
  --title: 'Black Han Sans', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --round: 'Jua', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; overflow: hidden; }
button, input { font: inherit; }
img { user-select: none; -webkit-user-drag: none; }
.screen { display: none; position: fixed; inset: 0; z-index: 1; }
.screen.active { display: block; }

/* ---------- 배경 (Canva 로비 이미지) ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-img { position: absolute; inset: -30px; background: url('/img/lobby_bg.jpg') center / cover no-repeat; filter: blur(6px) saturate(1.2); transform: scale(1.05); }
.bg-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 40%, rgba(130, 70, 255, 0.25), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(0, 200, 255, 0.18), transparent 55%), linear-gradient(180deg, rgba(11, 15, 34, 0.55), rgba(11, 15, 34, 0.9)); }
.sparks { position: absolute; inset: 0; background-image: radial-gradient(2px 2px at 20% 30%, #c18cff, transparent), radial-gradient(2px 2px at 70% 60%, #7fe8ff, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent), radial-gradient(2px 2px at 85% 20%, #c18cff, transparent), radial-gradient(1.5px 1.5px at 55% 15%, #7fe8ff, transparent); background-size: 600px 600px; animation: drift 30s linear infinite; opacity: 0.7; }
@keyframes drift { to { background-position: 0 -600px; } }
body.in-game .bg { display: none; }

/* ---------- 공통 ---------- */
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.btn { position: relative; border: none; background: #2a3466; color: var(--text); border-radius: 14px; padding: 10px 18px; cursor: pointer; font-family: var(--round); font-size: 17px; box-shadow: 0 4px 0 #161c3b; transition: transform 0.08s, box-shadow 0.08s, filter 0.15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #161c3b; }
.btn.big { font-size: 22px; padding: 14px 28px; }
.btn.small { font-size: 15px; padding: 7px 14px; }
.btn.primary { background: linear-gradient(180deg, #ffe066, var(--gold)); color: #3a2600; box-shadow: 0 5px 0 var(--gold-d), 0 10px 24px rgba(255, 210, 63, 0.25); }
.btn.primary:active { box-shadow: 0 1px 0 var(--gold-d); }
.btn.blue { background: linear-gradient(180deg, #6cc0ff, var(--blue)); color: #fff; box-shadow: 0 5px 0 var(--blue-d); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.btn.ghost { background: rgba(255, 255, 255, 0.06); box-shadow: none; }
.btn.on-ready { background: linear-gradient(180deg, #7fffd0, var(--ok)); color: #003322; box-shadow: 0 5px 0 #1f9a72; }
input { background: rgba(5, 8, 22, 0.7); color: var(--text); border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 19px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.15); }
.msg { min-height: 24px; color: var(--gold); font-weight: 700; text-align: center; margin: 10px 0 0; }

.seg { display: flex; gap: 8px; margin: 12px 0 14px; }
.seg button { flex: 1; padding: 10px 0 8px; border-radius: 14px; border: 2px solid var(--line); background: rgba(5, 8, 22, 0.55); color: var(--sub); cursor: pointer; display: flex; flex-direction: column; align-items: center; transition: all 0.15s; }
.seg button b { font-family: var(--title); font-weight: 400; font-size: 22px; letter-spacing: 1px; }
.seg button small { font-size: 12px; }
.seg button.on { background: linear-gradient(180deg, #5db6ff, #2a86e8); border-color: #8fd0ff; color: #fff; box-shadow: 0 6px 18px rgba(61, 165, 255, 0.35); }
.seg.small button { padding: 6px 12px; flex: none; font-family: var(--round); font-size: 15px; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 9px 0; cursor: pointer; font-family: var(--round); font-size: 16px; }
.toggle small { color: var(--sub); font-family: inherit; font-size: 13px; }
.toggle input { display: none; }
.toggle .sw { width: 42px; height: 24px; border-radius: 12px; background: #2a3466; position: relative; flex: none; transition: background 0.15s; }
.toggle .sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + .sw { background: var(--ok); }
.toggle input:checked + .sw::after { transform: translateX(18px); }

/* ---------- 첫 화면 ---------- */
.home { height: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 440px); gap: 36px; align-items: center; max-width: 1240px; margin: 0 auto; padding: 24px 32px; overflow: auto; }
.home-left { text-align: center; }
.logo { margin: 0; font-family: var(--title); font-weight: 400; line-height: 0.9; display: inline-flex; flex-direction: column; align-items: center; }
.logo-top { font-size: 40px; letter-spacing: 18px; color: #7fe8ff; text-shadow: 0 0 18px rgba(127, 232, 255, 0.6); margin-left: 18px; }
.logo-main { font-size: 108px; letter-spacing: 4px; background: linear-gradient(180deg, #fff3a6 10%, #ffd23f 50%, #ff9f1c 95%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 #8a4b00) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5)); }
.logo-sub { font-family: var(--round); font-size: 26px; color: #e6dcff; letter-spacing: 6px; margin-top: 8px; text-shadow: 0 0 14px rgba(193, 140, 255, 0.8); }
.hero { display: block; width: 100%; max-width: 760px; margin: 6px auto 0; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.55)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.tagline { font-family: var(--round); font-size: 22px; color: var(--sub); margin: 4px 0 0; }
.home-right { padding: 26px 26px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--round); font-size: 16px; }
.field input { width: 100%; }
.block { margin-top: 18px; }
.block h2 { margin: 0; font-family: var(--round); font-weight: 400; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.block h2 i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #3a2600; display: grid; place-items: center; font-size: 16px; }
.block .btn.big { width: 100%; margin-top: 8px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--sub); margin: 18px 0 0; font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; margin-top: 10px; }
.code-input { flex: 1; min-width: 0; font-family: var(--title); font-size: 36px; text-align: center; letter-spacing: 10px; text-transform: uppercase; padding: 6px 10px; }

/* ---------- 대기실 ---------- */
.room-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 24px 40px; height: 100%; overflow: auto; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.room-code { display: flex; align-items: center; gap: 14px; padding: 6px 22px; border-radius: 18px; }
.room-code small { color: var(--sub); font-family: var(--round); font-size: 16px; }
.room-code b { font-family: var(--title); font-weight: 400; font-size: 54px; color: var(--gold); letter-spacing: 10px; text-shadow: 0 4px 0 #8a5a00; }
.room-mode { font-family: var(--title); font-size: 34px; color: #7fe8ff; text-shadow: 0 0 14px rgba(127, 232, 255, 0.5); }
.host-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 10px 18px; margin: 14px 0 6px; border-radius: 18px; }
.hb-title { font-family: var(--round); color: var(--gold); }
.host-bar .seg { margin: 0; }
.teams { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 10px; margin-top: 12px; }
.vs { font-family: var(--title); font-size: 46px; display: grid; place-items: center; background: linear-gradient(180deg, var(--red), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.team { border-radius: 22px; padding: 14px; position: relative; overflow: hidden; }
.team.red { background: linear-gradient(160deg, rgba(255, 77, 109, 0.28), rgba(30, 10, 30, 0.6)); border: 2px solid rgba(255, 77, 109, 0.7); }
.team.blue { background: linear-gradient(200deg, rgba(61, 165, 255, 0.28), rgba(10, 20, 50, 0.6)); border: 2px solid rgba(61, 165, 255, 0.7); }
.team h3 { margin: 0 0 10px; font-family: var(--title); font-weight: 400; font-size: 28px; letter-spacing: 2px; }
.team.red h3 { color: #ff8da1; }
.team.blue h3 { color: #8fcaff; }
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; align-items: center; gap: 12px; background: rgba(5, 8, 22, 0.55); border-radius: 16px; padding: 6px 12px 6px 6px; min-height: 62px; font-size: 18px; }
.slot .av { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; object-position: 50% 15%; background: radial-gradient(circle at 50% 30%, var(--c, #555), #0b0f22 90%); flex: none; }
.slot.empty { justify-content: center; color: var(--sub); border: 2px dashed var(--line); cursor: pointer; font-family: var(--round); padding: 6px 12px; }
.slot.empty:hover { color: var(--text); border-color: var(--text); background: rgba(255, 255, 255, 0.05); }
.slot.bot { color: var(--sub); justify-content: center; font-family: var(--round); padding: 6px 12px; }
.slot .nm { font-family: var(--round); font-size: 20px; }
.slot .ch { color: var(--sub); font-size: 14px; }
.slot .tag { margin-left: auto; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); color: var(--sub); }
.slot .tag.ready { background: var(--ok); color: #003322; }
.slot .tag.host { background: var(--gold); color: #3a2600; }
.slot.me { box-shadow: 0 0 0 3px #fff inset; }
.pick-title { margin: 24px 0 12px; font-family: var(--round); font-weight: 400; font-size: 24px; }
.chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.char { position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 22px; padding: 0 14px 14px; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; overflow: hidden; backdrop-filter: blur(10px); }
.char:hover { transform: translateY(-5px); }
.char.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4); }
.char.on::after { content: '선택!'; position: absolute; top: 12px; right: -30px; transform: rotate(35deg); background: var(--gold); color: #3a2600; font-family: var(--round); padding: 3px 36px; font-size: 14px; }
.char .art { margin: 0 -14px 6px; height: 170px; background: radial-gradient(circle at 50% 70%, var(--c), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent); display: flex; justify-content: center; align-items: flex-end; position: relative; }
.char .art img { height: 190px; margin-bottom: -10px; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5)); transition: transform 0.2s; }
.char:hover .art img { transform: scale(1.06) rotate(-2deg); }
.char .eng { position: absolute; left: 12px; top: 10px; font-family: var(--title); font-size: 15px; letter-spacing: 3px; color: rgba(255, 255, 255, 0.55); }
.char .nm { font-family: var(--title); font-weight: 400; font-size: 28px; line-height: 1.1; }
.char .role { display: inline-block; font-family: var(--round); font-size: 13px; padding: 2px 10px; border-radius: 10px; background: var(--c); color: #0b0f22; margin: 4px 0 8px; }
.bar { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 4px 0; color: var(--sub); }
.bar span { width: 40px; flex: none; }
.bar i { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); position: relative; overflow: hidden; }
.bar i::after { content: ''; position: absolute; inset: 0; width: var(--w); background: linear-gradient(90deg, var(--c), #fff); border-radius: 4px; }
.char .kit { margin-top: 10px; font-size: 13px; line-height: 1.55; }
.char .kit div { display: flex; gap: 6px; }
.char .kit b { flex: none; width: 22px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--gold); display: grid; place-items: center; font-size: 11px; }
.char .line { font-family: var(--round); font-size: 14px; color: var(--sub); margin-top: 8px; }
.room-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; padding: 12px 16px; position: sticky; bottom: 0; }
.room-foot .msg { flex: 1; text-align: left; margin: 0; font-family: var(--round); font-weight: 400; }
.result { margin-top: 16px; padding: 16px 18px; }
.result h3 { margin: 0 0 10px; font-family: var(--title); font-weight: 400; font-size: 30px; }
.result table { width: 100%; border-collapse: collapse; font-size: 16px; }
.result th, .result td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.result th { color: var(--sub); font-weight: 400; font-family: var(--round); }
.result td img { width: 34px; height: 34px; object-fit: cover; object-position: 50% 15%; border-radius: 8px; vertical-align: middle; }

/* ---------- 게임 화면 ---------- */
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; cursor: crosshair; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plabel { position: absolute; left: 0; top: 0; will-change: transform; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; pointer-events: none; }
.plabel .pn { font-family: var(--round); font-size: 14px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.plabel .hpb { width: 70px; height: 10px; background: rgba(0, 0, 0, 0.7); border-radius: 6px; overflow: hidden; margin: 2px auto 0; border: 2px solid rgba(0, 0, 0, 0.85); position: relative; }
.plabel .hpb i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #8fffd6, var(--ok)); transition: width 0.15s; }
.plabel .hpb s { position: absolute; right: 0; top: 0; bottom: 0; background: rgba(140, 220, 255, 0.95); }
.plabel.enemy .hpb i { background: linear-gradient(180deg, #ff8da1, var(--red)); }
.plabel .pc { display: inline-block; margin-top: 3px; font-family: var(--title); font-size: 13px; background: linear-gradient(180deg, #e2c6ff, var(--core)); color: #2a0a55; border-radius: 10px; padding: 0 8px; box-shadow: 0 0 10px rgba(193, 140, 255, 0.8); }
.dmgnum { position: absolute; transform: translate(-50%, -50%); font-family: var(--title); font-size: 24px; color: #fff; -webkit-text-stroke: 1.5px #000; text-shadow: 0 3px 0 #000; animation: floatUp 0.8s ease-out forwards; pointer-events: none; }
.dmgnum.heal { color: var(--ok); }
@keyframes floatUp { 0% { opacity: 1; margin-top: 0; transform: translate(-50%, -50%) scale(1.4); } 25% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; margin-top: -44px; } }

.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 8px; }
.score { display: flex; align-items: center; gap: 10px; padding: 6px 18px; border-radius: 18px; font-family: var(--title); color: #fff; min-width: 150px; justify-content: center; }
.score b { font-size: 44px; font-weight: 400; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.score .tname { font-size: 18px; opacity: 0.9; }
.score.red { background: linear-gradient(180deg, #ff6d88, var(--red-d)); box-shadow: 0 5px 0 #6e0f24; }
.score.blue { background: linear-gradient(180deg, #62b8ff, var(--blue-d)); box-shadow: 0 5px 0 #0c3a72; }
.score.mine { outline: 3px solid #fff; outline-offset: 2px; }
.core-ico { width: 20px; height: 20px; background: linear-gradient(135deg, #f1e2ff, var(--core)); transform: rotate(45deg); border-radius: 3px; box-shadow: 0 0 12px var(--core); }
.clock { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 18px; background: rgba(11, 15, 34, 0.85); border-radius: 18px; border: 2px solid var(--line); }
.clock b { font-family: var(--title); font-weight: 400; font-size: 32px; line-height: 1; }
.clock small { color: var(--core); font-family: var(--round); }
.banner { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); font-family: var(--title); font-size: 30px; padding: 8px 26px; border-radius: 16px; display: none; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.banner.show { display: block; animation: pulse 1s infinite; }
.banner.red { background: linear-gradient(180deg, #ff6d88, var(--red-d)); }
.banner.blue { background: linear-gradient(180deg, #62b8ff, var(--blue-d)); }
.banner.gold { background: linear-gradient(180deg, #ffe066, var(--gold)); color: #3a2600; text-shadow: none; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.06); } }
.killfeed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.killfeed div { background: rgba(11, 15, 34, 0.85); padding: 5px 12px; border-radius: 10px; font-family: var(--round); font-size: 15px; animation: fadeOut 4s forwards; border: 1px solid var(--line); }
@keyframes fadeOut { 80% { opacity: 1; } to { opacity: 0; } }
.kf-red { color: #ff8da1; }
.kf-blue { color: #8fcaff; }
.center-msg { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-family: var(--title); font-size: 72px; text-align: center; -webkit-text-stroke: 2px #000; text-shadow: 0 6px 0 #000, 0 0 30px rgba(0, 0, 0, 0.6); display: none; }
.center-msg.show { display: block; }
.center-msg small { display: block; font-family: var(--round); font-size: 24px; margin-top: 8px; color: #fff; -webkit-text-stroke: 0; text-shadow: 0 2px 4px #000; }
.me-card { position: absolute; left: 16px; bottom: 44px; display: flex; align-items: center; gap: 10px; background: rgba(11, 15, 34, 0.82); border: 1px solid var(--line); border-radius: 18px; padding: 6px 16px 6px 6px; }
.me-card img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; object-position: 50% 12%; background: radial-gradient(circle at 50% 30%, var(--c, #555), #0b0f22 90%); }
.me-info b { font-family: var(--round); font-weight: 400; font-size: 18px; }
.me-hp { width: 170px; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); border: 2px solid #000; position: relative; overflow: hidden; margin-top: 4px; }
.me-hp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #8fffd6, var(--ok)); transition: width 0.15s; }
.me-hp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.hud-bottom { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 22px; }
.ammo-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ammo-wrap small { font-family: var(--round); color: var(--sub); text-shadow: 0 1px 2px #000; }
.ammo { display: flex; gap: 6px; padding: 6px; background: rgba(11, 15, 34, 0.8); border-radius: 12px; }
.ammo i { width: 58px; height: 18px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); position: relative; overflow: hidden; }
.ammo i::after { content: ''; position: absolute; inset: 0; width: var(--f, 0%); background: linear-gradient(180deg, #ffe680, #ff9f1c); }
.ab { width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2c3870, #121735); border: 4px solid #3a4580; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.ab-key { font-family: var(--title); font-size: 28px; line-height: 1; z-index: 2; }
.ab-name { font-family: var(--round); font-size: 12px; z-index: 2; max-width: 74px; text-align: center; line-height: 1.1; }
.ab-cd { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.7); font-family: var(--title); font-size: 32px; z-index: 3; }
.ab-cd:empty { display: none; }
.ab.skill.ready { border-color: var(--ok); box-shadow: 0 0 16px rgba(79, 224, 176, 0.6); }
.ab-fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h, 0%); background: linear-gradient(180deg, rgba(255, 210, 63, 0.55), rgba(255, 140, 0, 0.55)); z-index: 1; transition: height 0.2s; }
.ab.ult.ready { border-color: var(--gold); animation: glow 0.7s infinite alternate; }
.ab.ult.ready .ab-fill { background: linear-gradient(180deg, #ffe066, #ff9f1c); }
.ab.ult.ready .ab-key, .ab.ult.ready .ab-name { color: #3a2600; }
@keyframes glow { from { box-shadow: 0 0 12px var(--gold); } to { box-shadow: 0 0 34px var(--gold), 0 0 60px rgba(255, 159, 28, 0.5); } }
.help { position: absolute; left: 16px; bottom: 10px; font-size: 13px; color: var(--sub); background: rgba(11, 15, 34, 0.7); padding: 4px 10px; border-radius: 8px; }

@media (max-width: 980px) {
  .home { grid-template-columns: 1fr; }
  .logo-main { font-size: 72px; }
  .chars { grid-template-columns: 1fr 1fr; }
}
.char .kit u { text-decoration: none; font-weight: 800; color: #fff; margin-right: 4px; }
.join-row .btn.big { width: auto; margin-top: 0; padding: 10px 26px; }

.mute { position: fixed; right: 14px; bottom: 14px; z-index: 50; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(11, 15, 34, 0.8); font-size: 22px; cursor: pointer; }
body.in-game .mute { bottom: auto; top: 90px; right: 14px; }
.hero { max-width: 820px; }

.perf { position: absolute; right: 70px; top: 100px; font-size: 12px; color: var(--sub); background: rgba(11, 15, 34, 0.7); padding: 3px 8px; border-radius: 8px; font-family: monospace; }
.gfx-btn { position: fixed; right: 68px; bottom: 14px; z-index: 50; height: 46px; padding: 0 14px; border-radius: 23px; border: 1px solid var(--line); background: rgba(11, 15, 34, 0.8); color: var(--text); font-family: var(--round); font-size: 15px; cursor: pointer; }
body.in-game .gfx-btn { display: none; }

/* ---------- 맵 고르기 ---------- */
.pick-title small { font-family: Jua, sans-serif; font-size: 14px; color: var(--muted, #9aa6d6); margin-left: 8px; font-weight: normal; }
.maps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 8px; }
.map { position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 8px; text-align: center; transition: transform 0.15s, border-color 0.15s; }
.map.can { cursor: pointer; }
.map.can:hover { transform: translateY(-3px); }
.map.on { border-color: #ffd23f; box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.35), 0 8px 24px rgba(255, 210, 63, 0.2); }
.map canvas { width: 100%; aspect-ratio: 19 / 27; border-radius: 10px; display: block; background: #10162e; }
.map .q { width: 100%; aspect-ratio: 19 / 27; border-radius: 10px; display: grid; place-items: center; font-size: 46px; background: linear-gradient(135deg, #3a2a7a, #1b4a8a); }
.map b { display: block; margin-top: 6px; font-size: 15px; }
.map span { display: block; font-size: 12px; opacity: 0.7; line-height: 1.3; }
.role-tabs { margin: 0 0 12px; flex-wrap: wrap; }
@media (max-width: 1100px) { .maps { grid-template-columns: repeat(4, 1fr); } }

/* ---------- v0.6 상성·특성 ---------- */
.char .trait { display: flex; gap: 6px; margin-top: 6px; font-size: 13px; line-height: 1.5; padding: 6px 8px; border-radius: 10px; background: rgba(255, 210, 63, 0.1); border: 1px solid rgba(255, 210, 63, 0.35); }
.char .trait b { flex: none; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--gold); color: #2a1a00; display: grid; place-items: center; font-size: 11px; }
.char .trait u { text-decoration: none; font-weight: 800; color: #fff; margin-right: 4px; }
.char .vsrow { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 13px; font-weight: 800; }
.char .vsrow span { padding: 3px 8px; border-radius: 8px; }
.char .vsrow .up { background: rgba(80, 230, 140, 0.16); color: #7dffb0; }
.char .vsrow .down { background: rgba(255, 90, 110, 0.16); color: #ff9aa8; }
.plabel .vs { display: inline-block; font-family: var(--title); font-size: 12px; padding: 0 7px; border-radius: 8px; margin-bottom: 2px; color: #fff; text-shadow: 0 1px 0 #000; }
.plabel .vs.up { background: #19b866; }
.plabel .vs.down { background: #d8324c; }
.plabel.marked .hpb { box-shadow: 0 0 0 2px #c18cff, 0 0 10px #c18cff; }
.dmgnum.counter { color: #ffd23f; font-size: 30px; }

/* ---------- v0.7 모드 ---------- */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.mode { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; transition: transform 0.15s, border-color 0.15s; }
.mode.can { cursor: pointer; }
.mode.can:hover { transform: translateY(-3px); }
.mode.on { border-color: #ffd23f; box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.35), 0 8px 24px rgba(255, 210, 63, 0.2); }
.mode .mi { font-size: 38px; line-height: 1.2; }
.mode b { display: block; font-family: var(--title); font-weight: 400; font-size: 22px; margin: 4px 0; }
.mode span { display: block; font-size: 13px; opacity: 0.8; line-height: 1.45; }
.seg.locked { opacity: 0.35; pointer-events: none; }
.teams.ffa { grid-template-columns: repeat(3, 1fr); }
.team.ffa-seat { background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 28%, transparent), rgba(15, 15, 35, 0.6)); border: 2px solid color-mix(in srgb, var(--tc) 70%, transparent); padding: 10px 12px; }
.team.ffa-seat h3 { color: var(--tc); font-size: 22px; margin-bottom: 6px; }
.banner.green { background: linear-gradient(180deg, #6cf0a4, var(--green-d)); }
.banner.yellow { background: linear-gradient(180deg, #ffe27a, #b38a00); color: #2a1a00; }
.banner.purple { background: linear-gradient(180deg, #cfb0ff, #6a3ac0); }
.banner.orange { background: linear-gradient(180deg, #ffb070, #b85a10); }
.ffa-board { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.ffa-board .fb { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; min-width: 170px; padding: 4px 10px; border-radius: 10px; background: rgba(10, 12, 30, 0.75); border-left: 5px solid var(--tc); font-family: var(--round); font-size: 15px; color: #fff; }
.ffa-board .fb i { font-style: normal; font-family: var(--title); color: var(--tc); }
.ffa-board .fb b { font-family: var(--title); font-weight: 400; color: #e2c6ff; }
.ffa-board .fb.me { outline: 2px solid #ffd23f; background: rgba(60, 45, 0, 0.8); }
.score .core-ico.txt { background: none; width: auto; height: auto; font-size: 22px; transform: none; box-shadow: none; }
@media (max-width: 1100px) { .modes { grid-template-columns: repeat(2, 1fr); } }

/* ---------- v0.9 능력치 점수·패시브 ---------- */
.bar em { width: 28px; flex: none; text-align: right; font-style: normal; font-weight: 800; color: #fff; font-size: 12px; }
.char .total { text-align: right; font-size: 12px; color: var(--sub); margin: 2px 0 4px; }
.char .total b { color: var(--gold); font-size: 14px; }
.char .kit .pv b { background: rgba(176, 124, 255, 0.35); color: #e2c6ff; }

/* ===== v1.0 개인전 서바이벌 ===== */
#ffa-board .fb-head { font-size: 12px; font-weight: 800; color: #ffd23f; text-align: center; margin-bottom: 4px; letter-spacing: 1px; }
#ffa-board .fb.out { opacity: 0.45; filter: grayscale(0.8); }
#ffa-board .fb.out span { text-decoration: line-through; }
body.in-storm #screen-game::after { content: '⚠ 안전 구역 밖! 안으로 들어가세요'; position: fixed; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px rgba(255, 30, 60, 0.55); display: flex; align-items: flex-start; justify-content: center; padding-top: 110px; font: 900 22px/1 sans-serif; color: #fff; text-shadow: 0 2px 6px #000; animation: stormPulse 0.8s infinite alternate; z-index: 5; }
@keyframes stormPulse { from { opacity: 0.55; } to { opacity: 1; } }
#ffa-board .fb { grid-template-columns: 34px 1fr auto; }
#ffa-board .fb i { white-space: nowrap; font-size: 13px; }

/* ===== 1인 체험: 봇 학습 노트 ===== */
.learn { margin: 14px 0; padding: 16px 18px; }
.learn .ln-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.learn h3 { margin: 0; font-size: 20px; }
.learn .ln-new { background: rgba(255, 210, 63, 0.12); border: 1px solid rgba(255, 210, 63, 0.5); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.learn .ln-new b { color: #ffd23f; }
.learn .ln-new ul { margin: 6px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }
.learn .ln-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.learn .ln-grid > div { background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 10px 12px; }
.learn .ln-grid small { display: block; opacity: 0.7; font-size: 12px; }
.learn .ln-grid b { display: block; font-size: 18px; margin: 3px 0; }
.learn .ln-grid em { display: block; font-style: normal; font-size: 12px; opacity: 0.65; }
.learn .ln-lv { display: flex; gap: 3px; margin: 7px 0 5px; }
.learn .ln-lv i { flex: 1; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); }
.learn .ln-lv i.on { background: linear-gradient(#ffd23f, #ff8a3d); }
@media (max-width: 900px) { .learn .ln-grid { grid-template-columns: repeat(2, 1fr); } }
