* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #10141c;
  color: #e8edf5;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#msg {
  position: fixed;
  top: 12px;
  left: 12px;
  background: rgba(12, 16, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.2px;
  pointer-events: none;
  width: 330px;
}

#msg b { display: block; font-weight: 600; }
#msg span { display: block; margin-top: 4px; color: #9aa4b4; font-size: 13px; }

#msg.urgent {
  background: rgba(120, 20, 20, 0.94);
  border-color: #ff5a5a;
  animation: msgPulse 1s ease-in-out infinite;
}

#msg.urgent span { color: #ffc0c0; }

@keyframes msgPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 90, 90, 0); }
  50% { box-shadow: 0 0 22px rgba(255, 90, 90, 0.75); }
}

#log {
  position: fixed;
  right: 12px;
  top: 12px;
  width: 270px;
  max-height: 26vh;
  overflow-y: auto;
  background: rgba(12, 16, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #b8c1d0;
  pointer-events: none;
}

#log div { border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding: 1px 0; }

#lobby, #gameover, #ammo-ask {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 15, 0.86);
  z-index: 10;
}

/* 탄약 쓸지 물어보는 창은 판을 가리지 않게 아래쪽에 띄운다 */
#ammo-ask {
  background: none;
  align-items: flex-end;
  padding-bottom: 26px;
  z-index: 12;
}
#ammo-ask .panel {
  padding: 20px 30px;
  border-color: #f2b312;
  box-shadow: 0 0 0 3px rgba(242, 179, 18, 0.25), 0 20px 60px rgba(0, 0, 0, 0.7);
}
#ammo-ask h2 { margin: 0 0 8px; font-size: 20px; color: #f2b312; }
#ammo-ask p { margin: 0 0 6px; font-size: 15px; color: #eef2f8; }
#ammo-ask .row { margin-top: 14px; }
#ammo-ask button { padding: 10px 22px; font-size: 16px; }
button.ghost { background: #39404d; }
button.ghost:hover { background: #4a5361; }

.hidden { display: none !important; }

.panel {
  background: #161c26;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 34px 44px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.panel h1 { margin: 0 0 6px; font-size: 40px; letter-spacing: 4px; }
.panel .sub { margin: 0 0 18px; color: #96a0b1; font-size: 15px; }
.panel .desc { margin: 0 0 24px; color: #c3cad6; font-size: 15px; line-height: 1.8; }
.panel .hint { margin: 18px 0 0; color: #7d8697; font-size: 13px; }

.row { display: flex; gap: 12px; justify-content: center; }

button {
  background: #2c3a52;
  color: #eef2f8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 12px 26px;
  font-size: 17px;
  cursor: pointer;
  font-family: inherit;
}

button:hover { background: #3a4d6d; }

/* 대기실 캐릭터 고르기 */
.panel.wide { width: min(900px, 94vw); max-height: 94vh; overflow-y: auto; }
.panel .pick-title { margin: 0 0 14px; color: #c3cad6; font-size: 14px; }

#picker {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.pick {
  width: 150px;
  padding: 10px 8px 12px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: #1d2532;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.pick:hover { transform: translateY(-4px); }
.pick.on { border-color: #ffd66e; background: #2a3242; }

.pick img { width: 100%; border-radius: 8px; display: block; }
.pick b { display: block; margin-top: 8px; font-size: 14px; }
.pick span { display: block; color: #96a0b1; font-size: 12px; margin-top: 2px; }
.pick .loc { color: #7fc8ff; margin-top: 6px; }

/* 캐릭터 뽑기 */
#draft-picker { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.pick.taken { opacity: 0.35; cursor: default; }
.pick.taken:hover { transform: none; }
.pick.can { border-color: #ffd66e; }

/* 대기실 자리 목록 */
#seat-list {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 4px 0 22px;
}
.seat {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1d2532;
  color: #96a0b1;
  font-size: 14px;
}
.seat.on { border-color: #7ee08a; color: #dff5e2; background: #223128; }

#room-link {
  flex: 1;
  min-width: 0;
  background: #0e131b;
  color: #dfe6f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
}
button:disabled { opacity: 0.35; cursor: default; }
button:disabled:hover { background: #2c3a52; }
