/* ISLEFALL — HUD·로비 스타일. 노을 하늘 위 반투명 유리 패널 */
:root { --ink: #fff; --glass: rgba(14, 22, 40, .62); --line: rgba(255, 255, 255, .18); --gold: #ffd36b; --font: 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a2a4a; color: var(--ink); font-family: var(--font); -webkit-user-select: none; user-select: none; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

/* 화면 공통 */
.screen, .overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.overlay { background: rgba(10, 14, 30, .45); backdrop-filter: blur(3px); }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; width: min(560px, 100%); backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.panel.center { text-align: center; }
.panel h2 { margin: 0 0 14px; font-size: 22px; font-weight: 900; }
.eyebrow { font-size: 12px; letter-spacing: .3em; color: var(--gold); font-weight: 700; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.panel.center .row { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 22px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); font-weight: 700; text-decoration: none; color: #fff; }
.btn small { font-weight: 400; font-size: 11px; opacity: .75; }
.btn.primary { background: linear-gradient(#ffb15a, #ff7a3d); border-color: #ffc38a; color: #3a1a05; box-shadow: 0 6px 20px rgba(255, 122, 61, .4); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 14px; font-size: 13px; }

/* 타이틀 */
.title { text-align: center; margin-top: -12vh; }
.logo { margin: 0; font: 900 clamp(56px, 12vw, 128px)/1 'Segoe UI Black', 'Arial Black', var(--font); letter-spacing: .04em; color: #fbf0d6;
  text-shadow: 0 3px 0 #b07a3e, 0 6px 0 #8a5a2b, 0 10px 0 #6b3f1c, 0 16px 30px rgba(80, 40, 10, .5); transform: rotate(-2deg); }
.tag { margin: 22px 0 26px; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.menu { display: flex; justify-content: center; }
.menu .btn { min-width: 240px; font-size: 18px; }
.links { margin-top: 18px; display: flex; gap: 12px; justify-content: center; align-items: center; }
.ver { font-size: 12px; opacity: .7; }

/* 로비 */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.modes button { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-weight: 900; font-size: 18px; display: flex; flex-direction: column; }
.modes button small { font-weight: 400; font-size: 12px; opacity: .75; }
.modes button.on { background: rgba(255, 211, 107, .18); border-color: var(--gold); }
.slot { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.slot i { width: 10px; height: 26px; border-radius: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.slot b { width: 28px; }
.slot small { font-size: 11px; opacity: .7; width: 34px; }
.seg { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 9px; font-size: 13px; }
.seg button.on { background: #fff; color: #1a2440; font-weight: 700; }
.hint { font-size: 12px; opacity: .75; margin: 10px 0 0; }
.opts { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; flex-wrap: wrap; }
.opts select { font: inherit; background: rgba(0, 0, 0, .3); color: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud button, #hud .card { pointer-events: auto; }
.top-left { position: absolute; left: 16px; top: 14px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.mini-logo { font: italic 900 22px 'Segoe UI Black', var(--font); background: linear-gradient(#fff2c4, #ff9a4a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#hud-mode { font-size: 11px; font-weight: 700; opacity: .8; letter-spacing: .08em; }
.top-center { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 40px; padding: 6px 8px 6px 20px; }
#turn-name { font-weight: 900; font-size: 20px; text-shadow: 0 0 12px currentColor; white-space: nowrap; }
.timer { --k: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--gold);
  background: radial-gradient(closest-side, #1a2440 78%, transparent 80% 100%), conic-gradient(var(--gold) calc(var(--k) * 360deg), rgba(255, 255, 255, .15) 0); }
.top-right { position: absolute; right: 16px; top: 14px; display: flex; gap: 8px; align-items: stretch; }
.wind { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; display: flex; align-items: center; gap: 8px; }
.wind small { font-size: 11px; font-weight: 700; opacity: .7; }
.wind b { font-size: 22px; color: #9fe8ff; }
#wind-arrow { width: 40px; height: 20px; transition: transform .3s; }
.icon { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; width: 44px; font-size: 18px; }

#cards { position: absolute; left: 16px; top: 86px; display: flex; flex-direction: column; gap: 6px; width: 200px; }
.card { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 8px 18px; }
.card i { position: absolute; left: 6px; top: 8px; bottom: 8px; width: 5px; border-radius: 3px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.card b { font-size: 14px; }
.card small { font-size: 11px; opacity: .7; margin-left: 6px; }
.card em { position: absolute; right: 10px; top: 6px; font-style: normal; font-weight: 900; font-size: 12px; color: var(--gold); }
.card.cur { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 18px color-mix(in srgb, var(--c) 40%, transparent); }
.card.dead { opacity: .4; filter: grayscale(.8); }
.hp { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); margin-top: 5px; overflow: hidden; }
.hp span { display: block; height: 100%; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 50%, #fff)); transition: width .5s; }

#hud.anim #tags .tag { opacity: .35; }
#tags .tag { position: absolute; transition: opacity .3s; left: 0; top: 0; font-size: 12px; font-weight: 900; padding: 3px 8px 5px; border-radius: 7px; background: rgba(8, 14, 26, .7); border: 1px solid var(--c); white-space: nowrap; min-width: 64px; text-align: center; }
#tags .tag .hp { height: 4px; margin-top: 3px; }

#controls { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 10px; align-items: stretch; width: min(980px, calc(100% - 24px)); background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px; pointer-events: auto; }
#controls.locked { opacity: .55; }
#controls.locked button { pointer-events: none; }
.elev { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 170px; }
.elev button { border: 1px solid var(--line); background: rgba(255, 255, 255, .06); border-radius: 10px; font-weight: 700; padding: 6px 0; }
.elev button small { display: block; font-size: 11px; font-weight: 400; opacity: .7; }
.elev button.on { background: #fff; color: #1a2440; }
.az { grid-column: 1 / -1; text-align: center; font-size: 12px; opacity: .85; }
.az b { font-size: 15px; }
.power { flex: 1; min-width: 160px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.pow-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.pow-head b { font-size: 18px; }
.pow-bar { position: relative; height: 22px; border-radius: 7px; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255, 255, 255, .22) calc(10% - 1px) 10%), rgba(255, 255, 255, .1); overflow: visible; }
#pow-fill { height: 100%; width: 0; border-radius: 7px; background: linear-gradient(90deg, #ffd36b, #ff8a3d 60%, #ff3d5a); box-shadow: 0 0 14px rgba(255, 138, 61, .6); }
#last-mark { position: absolute; top: -6px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #fff; transform: translateX(-7px); }
#weapons { display: flex; gap: 6px; }
.wpn { position: relative; width: 78px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 8px 4px 5px; display: flex; flex-direction: column; align-items: center; }
.wpn i { display: block; width: 20px; height: 20px; margin-bottom: 2px; }
.wpn i svg { width: 100%; height: 100%; }
.wpn b { font-size: 12px; white-space: nowrap; }
.wpn small { font-size: 11px; color: var(--gold); }
.wpn kbd { position: absolute; left: 6px; top: 3px; font: 700 10px var(--font); opacity: .5; }
.wpn.on { border-color: var(--gold); background: rgba(255, 211, 107, .18); box-shadow: 0 0 12px rgba(255, 211, 107, .35); }
.wpn.empty { opacity: .35; }
.act { display: flex; flex-direction: column; gap: 6px; width: 110px; }
#fire { flex: 1; border: 0; border-radius: 12px; background: linear-gradient(#ff9a4a, #ff4a3a); color: #fff; font-weight: 900; font-size: 18px; box-shadow: 0 6px 20px rgba(255, 74, 58, .45); }
#fire small { display: block; font-size: 10px; font-weight: 400; opacity: .85; }
#pass { border: 1px solid var(--line); background: transparent; border-radius: 8px; font-size: 12px; padding: 4px; }

#banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(.9); text-align: center; opacity: 0; transition: opacity .25s, transform .25s; }
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner b { display: block; font: italic 900 clamp(34px, 6vw, 64px) 'Segoe UI Black', var(--font); color: var(--c); text-shadow: 0 0 24px var(--c), 0 4px 0 rgba(0, 0, 0, .35); }
#banner small { display: inline-block; margin-top: 6px; background: rgba(0, 0, 0, .45); border-radius: 8px; padding: 4px 12px; font-weight: 700; }
#toasts { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: rgba(0, 0, 0, .55); border: 1px solid var(--gold); color: var(--gold); border-radius: 10px; padding: 6px 14px; font-weight: 700; animation: rise 2.6s forwards; }
.float { position: fixed; z-index: 15; font: 900 22px 'Segoe UI Black', var(--font); transform: translate(-50%, -50%); text-shadow: 0 2px 6px rgba(0, 0, 0, .6); animation: up 1.4s forwards; pointer-events: none; }
@keyframes up { to { transform: translate(-50%, -160%); opacity: 0; } }
@keyframes rise { 0% { opacity: 0; transform: translateY(8px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.nogl { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; z-index: 50; background: #1a2a4a; }
.nogl a { color: var(--gold); }

/* 휴대폰: 카드는 위로 좁게, 조작부는 두 줄 */
@media (max-width: 760px) {
  .top-left { display: none; }
  .top-center { left: 12px; transform: none; padding-left: 12px; }
  #turn-name { font-size: 15px; }
  #cards { top: 70px; left: 8px; width: 132px; }
  .card small { display: none; }
  #controls { flex-wrap: wrap; bottom: 8px; padding: 8px; gap: 8px; }
  .elev { width: calc(50% - 4px); }
  .act { width: calc(50% - 4px); flex-direction: row; }
  #fire { padding: 10px 0; }
  .power { order: -1; flex-basis: 100%; }
  #weapons { flex-basis: 100%; justify-content: space-between; }
  .wpn { flex: 1; width: auto; }
}

/* 킬캠: 레터박스 + FINAL BLOW */
#hud.kill #controls, #hud.kill #cards, #hud.kill .top-left, #hud.kill .top-center, #hud.kill .top-right, #hud.kill #tags { opacity: 0; transition: opacity .25s; pointer-events: none; }
#hud #controls, #hud #cards, #hud .top-left, #hud .top-center, #hud .top-right { transition: opacity .4s; }
#killcam { position: fixed; inset: 0; pointer-events: none; z-index: 12; }
#killcam .lb { position: absolute; left: 0; right: 0; height: 0; background: #000; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 0 28px; font: 900 18px var(--font); letter-spacing: .06em; transition: height .3s ease; }
#killcam .lb.top { top: 0; } #killcam .lb.bot { bottom: 0; justify-content: flex-end; font: 700 12px var(--font); color: rgba(255, 255, 255, .6); }
#killcam.on .lb { height: 9vh; }
#killcam .lb i { width: 12px; height: 12px; border-radius: 50%; background: #ff3355; box-shadow: 0 0 12px #ff3355; animation: rec 1s infinite; }
#kc-slow { color: var(--gold); font-size: 14px; }
@keyframes rec { 50% { opacity: .3; } }
#finalblow { position: fixed; left: 50%; bottom: 15vh; transform: translateX(-50%) scale(1.4); text-align: center; z-index: 13; pointer-events: none; opacity: 0; transition: opacity .2s, transform .35s cubic-bezier(.2, 1.6, .4, 1); }
#finalblow.show { opacity: 1; transform: translateX(-50%) scale(1); }
#finalblow b { display: block; font: italic 900 clamp(48px, 9vw, 110px)/1 'Segoe UI Black', var(--font); background: linear-gradient(#fff, #ffe9a8 55%, #ff9a4a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 140, 60, .85)) drop-shadow(5px 0 0 rgba(42, 216, 255, .35)) drop-shadow(-5px 0 0 rgba(255, 42, 90, .35)); white-space: nowrap; }
#finalblow span { display: inline-block; margin-top: 10px; background: rgba(0, 0, 0, .6); border-radius: 10px; padding: 8px 18px; font: 700 15px var(--font); }
#finalblow em { font-style: normal; font-weight: 900; }

/* M5: 드래프트·라운드·이동·피격 문구 */
.panel.wide { width: min(760px, 100%); }
#draft-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.dcard { border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.dcard i { width: 34px; height: 34px; } .dcard i svg { width: 100%; height: 100%; }
.dcard b { font-size: 15px; } .dcard small { font-size: 11px; opacity: .8; line-height: 1.35; min-height: 44px; } .dcard em { font-style: normal; font-size: 11px; color: var(--gold); }
.dcard.on { border-color: var(--gold); background: rgba(255, 211, 107, .18); box-shadow: 0 0 16px rgba(255, 211, 107, .35); transform: translateY(-3px); }
.btn:disabled { opacity: .4; cursor: default; }
#hud-round { font-size: 11px; font-weight: 700; color: var(--gold); margin-top: 2px; white-space: nowrap; }
.score { font-size: 18px; font-weight: 900; letter-spacing: .04em; }
.act2 { display: flex; gap: 4px; }
.act2 button { flex: 1; border: 1px solid var(--line); background: transparent; border-radius: 8px; font-size: 12px; padding: 4px; }
#move.on { background: #9fe8ff; color: #10203a; border-color: #9fe8ff; }
#move:disabled { opacity: .45; }
.float.big { font-size: 34px; letter-spacing: .02em; animation: upbig 1.5s forwards; text-shadow: 0 0 18px currentColor, 0 3px 0 rgba(0, 0, 0, .5); }
@keyframes upbig { 0% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -120%) scale(1); opacity: 0; } }
@media (max-width: 760px) { #draft-cards { grid-template-columns: repeat(2, 1fr); } .act2 { flex-direction: column; } }
