
#lobby-panel .lp-stage-controls .lp-section-title,
#lobby-panel .lp-player-dock-header {
  margin: 0;
  font-size: 18px;
  line-height: 1;
}

#lobby-panel .lp-stage-choice {
  justify-self: center;
  min-width: 320px;
  max-width: 460px;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(8, 18, 30, 0.72);
  border: 1px solid rgba(255, 215, 130, 0.28);
  box-shadow: 0 10px 24px rgba(0,0,0,0.34);
  opacity: 0.96;
  appearance: none;
  text-align: left;
  cursor: pointer;
}

#lobby-panel .lp-stage-choice:hover {
  background: rgba(12, 24, 40, 0.82);
}

#lobby-panel .lp-stage-choice:focus-visible {
  outline: 2px solid rgba(255, 214, 86, 0.9);
  outline-offset: 2px;
}

#lobby-panel .lp-stage-choice-banner {
  width: 132px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(246,210,140,0.32), rgba(82,47,17,0.52));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

#lobby-panel .lp-stage-choice-text {
  font-size: 18px;
  font-weight: 800;
  color: #ffecbf;
  text-shadow: 0 2px 2px rgba(0,0,0,0.55);
}

#lobby-panel .lp-stage-choice .lp-countdown {
  grid-column: 2;
  text-align: left;
  min-width: 0;
  font-size: 24px;
}

#lobby-panel .lp-player-dock {
  justify-self: end;
  align-self: stretch;
  width: 340px;
  max-width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 18, 30, 0.62);
  border: 1px solid rgba(111, 154, 196, 0.3);
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

#lobby-panel #lp-player-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

#lobby-panel .lp-player-list-footer {
  margin-top: auto;
  padding-top: 8px;
}

#lobby-panel .lp-player-list-footer .lp-invite-btn {
  width: 100%;
}

#lobby-panel .lobby-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(24, 39, 58, 0.94), rgba(14, 24, 37, 0.96));
  border: 2px solid rgba(70, 102, 136, 0.95);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

#lobby-panel .lobby-player-name {
  min-width: 0;
  font-size: 14px;
}

#lobby-panel .lobby-ready-indicator {
  font-size: 11px;
  font-weight: 800;
}

#lobby-panel .lobby-chao-select,
#lobby-panel .lobby-ready-btn,
#lobby-panel #lp-start-btn {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}

#lobby-panel .lobby-friend-btn {
  justify-self: end;
  margin-left: 0;
}

#lobby-panel .lp-chat-overlay-left {
  position: absolute;
  left: 14px;
  top: 84px;
  bottom: 72px;
  width: min(350px, calc(100% - 420px));
  z-index: 4;
  display: flex;
}

#lobby-panel .lp-chat-log {
  width: 100%;
  height: 100%;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(8, 14, 23, 0.2), rgba(7, 12, 20, 0.32));
  border: 1px solid rgba(111, 154, 196, 0.22);
  border-radius: 16px;
  overflow-y: auto;
  backdrop-filter: blur(0.5px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#lobby-panel .lpchat-row {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(101, 135, 172, 0.16);
  background: rgba(8, 14, 24, 0.24);
  border-radius: 10px;
  margin-bottom: 4px;
}

#lobby-panel .lp-bottom-chat-strip {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  align-items: center;
}

#lobby-panel .lp-left-footer {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#lobby-panel .lp-chat-input-row {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(8, 18, 30, 0.82);
  border: 1px solid rgba(111, 154, 196, 0.3);
  box-shadow: 0 8px 20px rgba(0,0,0,0.26);
}

#lobby-panel .lp-chat-input {
  flex: 1;
  padding: 6px 8px;
  background: #0e1a29;
  border: 1px solid #37506b;
  color: #fff;
  border-radius: 6px;
}

#lobby-panel .lp-chat-send {
  padding: 6px 10px;
  background: #2b3e55;
  border: 1px solid #3e587b;
  color: #eee;
  border-radius: 6px;
  cursor: pointer;
}

#lobby-panel .lp-chat-input,
#lobby-panel .lp-chat-send,
#lobby-panel .lp-header-btn,
#lobby-panel .lp-invite-btn {
  min-height: 40px;
}

#lobby-panel .lp-game-drawer {
  position: absolute;
  left: 50%;
  top: 86px;
  width: min(860px, calc(100% - 180px));
  max-height: calc(100% - 172px);
  transform: translate(-50%, -8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  z-index: 7;
  pointer-events: none;
}

#lobby-panel .lp-game-drawer.open {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#lobby-panel .lp-game-drawer.collapsed {
  pointer-events: none;
}

#lobby-panel .lp-game-drawer-tab {
  display: none;
}

#lobby-panel .lp-game-drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10,18,30,0.98), rgba(7,12,20,0.98));
  border: 1px solid rgba(111, 154, 196, 0.3);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  max-height: calc(100% - 4px);
}

#lobby-panel .lp-game-drawer-header {
  font-size: 18px;
  font-weight: 800;
  color: #f3f6fb;
}

#lobby-panel .lp-game-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  flex: 0 0 auto;
  margin-bottom: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

#lobby-panel .lp-game-banner {
  min-height: 72px;
}

#lobby-panel .lp-game-banner .banner-img {
  width: 100%;
  height: 72px;
  object-fit: cover;
}

@media (max-width: 1400px) {
  #lobby-panel .lp-stage-topbar {
    grid-template-columns: 1fr 1fr;
  }
  #lobby-panel .lp-stage-choice {
    grid-column: 1 / -1;
    justify-self: center;
  }
  #lobby-panel .lp-player-dock {
    width: 320px;
  }
  #lobby-panel .lp-game-drawer {
    width: min(760px, calc(100% - 120px));
  }
  #lobby-panel .lp-game-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  #lobby-panel .lp-chat-overlay-left {
    width: 280px;
  }
  #lobby-panel .lp-bottom-chat-strip {
    grid-template-columns: 1fr;
  }
  #lobby-panel .lp-left-footer {
    order: 2;
  }
  #lobby-panel .lp-chat-input-row {
    grid-template-columns: 1fr 100px;
  }
}

