/* 경주마 스타트 Pro - 멀티플레이 UI (가로 모드 최적화) */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: #1a1a1a;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
}

#game-container {
  width: 100%;
  height: 100%;
}

/* Phaser 캔버스 위에 겹치는 DOM UI (Title/Lobby) */
#ui-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
#ui-overlay.active { pointer-events: auto; }

/* ========== Title Scene: 별명 입력 ========== */
.title-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%),
    url('title.png') center center / cover no-repeat;
}

.title-panel h1 {
  color: #f5e6d3;
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.title-panel .sub {
  color: #b0a090;
  font-size: clamp(14px, 2.5vw, 18px);
  margin-bottom: 14px;
}
.title-top3 {
  width: 100%;
  max-width: 420px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 245, 157, 0.45);
  border-radius: 10px;
  background: rgba(10, 25, 15, 0.58);
  color: #e8f5e9;
}
.title-top3-head {
  font-size: clamp(12px, 2vw, 14px);
  color: #fff59d;
  margin-bottom: 6px;
  font-weight: bold;
}
.title-top3 ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.title-top3 li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(12px, 2vw, 14px);
}

.nickname-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}
.title-actions {
  width: 100%;
  display: flex;
  gap: 10px;
}

.nickname-wrap input {
  width: 100%;
  padding: 14px 18px;
  font-size: 18px;
  border: 2px solid #8d6e63;
  border-radius: 12px;
  background: #3d2c24;
  color: #f5e6d3;
  outline: none;
}
.nickname-wrap input::placeholder { color: #8a7a6d; }
.nickname-wrap input:focus { border-color: #b89585; }

.btn-start {
  width: 100%;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(180deg, #c85a2a 0%, #8b3a1a 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.btn-start:active { transform: scale(0.98); }
.btn-start:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-start.secondary {
  background: linear-gradient(180deg, #5c5c5c 0%, #333 100%);
}

/* ========== Lobby Scene ========== */
.lobby-panel {
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #2d1f0f 0%, #1a1a1a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lobby-panel h2 {
  color: #f5e6d3;
  font-size: clamp(22px, 4vw, 28px);
  margin-bottom: 8px;
}

.lobby-panel .countdown {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: bold;
  color: #ff9800;
  margin: 16px 0;
  min-height: 60px;
}

.lobby-panel .message {
  color: #b0a090;
  font-size: clamp(14px, 2.5vw, 16px);
  margin-bottom: 24px;
  text-align: center;
}

.player-list {
  width: 100%;
  max-width: 480px;
  list-style: none;
  margin-bottom: 24px;
}

.player-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(61, 44, 36, 0.9);
  border-radius: 10px;
  color: #f5e6d3;
  font-size: 16px;
}

.player-list .horse-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}
.player-list .horse-dot.red { background: #e53935; }
.player-list .horse-dot.blue { background: #1e88e5; }
.player-list .horse-dot.green { background: #43a047; }
.player-list .horse-dot.yellow { background: #fdd835; }

.lobby-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-lobby {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-lobby.primary {
  background: linear-gradient(180deg, #43a047 0%, #2e7d32 100%);
}
.btn-lobby.secondary {
  background: linear-gradient(180deg, #5c5c5c 0%, #333 100%);
}
.btn-lobby:active { transform: scale(0.98); }

.hidden { display: none !important; }
