/* ============================================================
   Party Box — Core Lobby Styles
   Fun, arcade/board-game theme, mobile-first
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fredoka', system-ui, -apple-system, sans-serif;
  /* Playful, vibrant gradient background */
  background: linear-gradient(135deg, #4A0E4E, #811E68, #C33764);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Floating animation for the title */
@keyframes float {
  0% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(-2deg); }
}

.logo-container {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
  margin-bottom: 0.5rem;
  filter: drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.4));
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 2px;
  -webkit-text-stroke: 2px #2b003a;
  text-shadow: 0 4px 0 #2b003a;
  margin: 0;
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

h3 {
  font-size: 1.4rem;
  color: #FFD700;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.subtitle {
  font-size: 1.1rem;
  color: #FFE6E6;
  margin-bottom: 2rem;
  font-weight: 600;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* ---- Lobby Layout ---- */

#core-lobby {
  width: 100%;
  max-width: 450px;
  padding: 2rem 1.5rem;
  text-align: center;
}

/* ---- Cards ---- */

.card {
  background: #2D1445;
  border: 4px solid #1A0B2E;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

/* ---- Inputs ---- */

input[type="text"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  border: 3px solid #1A0B2E;
  border-radius: 12px;
  background: #fff;
  color: #2D1445;
  text-align: center;
  outline: none;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

input[type="text"]::placeholder {
  color: #999;
  font-weight: 400;
}

input[type="text"]:focus {
  border-color: #FF3366;
  box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.3), inset 2px 2px 5px rgba(0,0,0,0.1);
  transform: scale(1.02);
}

/* ---- Buttons ---- */

button {
  width: 100%;
  padding: 0.8rem 1.5rem;
  font-size: 1.2rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  border: 3px solid #1A0B2E;
  border-radius: 12px;
  cursor: pointer;
  background: #FF3366;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 5px 0 #991438;
  position: relative;
  transition: all 0.1s;
}

button:hover {
  background: #FF4D79;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #991438;
}

button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #991438;
}

#btn-join {
  background: #00CC99;
  box-shadow: 0 5px 0 #008060;
}

#btn-join:hover {
  background: #00E6AC;
  box-shadow: 0 7px 0 #008060;
}

#btn-join:active {
  box-shadow: 0 2px 0 #008060;
}

#btn-host {
  background: #8A2BE2;
  box-shadow: 0 5px 0 #4B0082;
}

#btn-host:hover {
  background: #9B3CEB;
  box-shadow: 0 7px 0 #4B0082;
}

#btn-host:active {
  box-shadow: 0 2px 0 #4B0082;
}

#btn-leave-room {
  background: #4A5568;
  box-shadow: 0 4px 0 #2D3748;
  color: #fff;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-width: 2px;
  width: auto;
  border-radius: 10px;
}

#btn-leave-room:hover {
  background: #718096;
  box-shadow: 0 5px 0 #2D3748;
}

#btn-leave-room:active {
  box-shadow: 0 1px 0 #2D3748;
}

#btn-leave-game {
  background: #E53E3E;
  box-shadow: 0 4px 0 #9B2C2C;
  color: #fff;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-width: 2px;
  border-radius: 10px;
  width: auto;
}

/* ---- Room View ---- */

#display-room-code {
  font-family: 'Courier New', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: #00CC99;
  letter-spacing: 0.15em;
  background: rgba(0,0,0,0.3);
  padding: 0.2rem 1rem;
  border-radius: 10px;
  border: 2px dashed rgba(0, 204, 153, 0.5);
  display: inline-block;
  margin-top: 0.5rem;
}

#role-text {
  color: #FFD700;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  background: rgba(255, 215, 0, 0.1);
  padding: 0.5rem;
  border-radius: 8px;
}

#host-controls {
  background: rgba(138, 43, 226, 0.15);
  border: 3px solid #8A2BE2;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 2rem;
  text-align: left;
}

#game-list {
  list-style: none;
  padding: 0;
}

#game-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
}

#game-list li:last-child {
  margin-bottom: 0;
}

#game-list li b {
  color: #ffffff;
  font-size: 1.1rem;
}

#game-list button {
  width: auto;
  font-size: 0.9rem;
  padding: 0.4rem 1.2rem;
  background: #FF3366;
  box-shadow: 0 3px 0 #991438;
}

#player-list-container {
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.2rem;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.1);
}

#player-list-container h3 {
  margin-bottom: 0.5rem;
  color: #00CC99;
}

#player-list {
  list-style: none;
  padding: 0;
}

#player-list li {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  color: #2D1445;
  font-weight: 600;
  font-size: 1.1rem;
  border: 2px solid #1A0B2E;
  display: flex;
  align-items: center;
}

#player-list li::before {
  content: "👤";
  margin-right: 0.5rem;
}

/* ---- Game Container ---- */

#game-container {
  position: fixed;
  top: 0;
  left: 0;
}

/* ---- Disconnect Overlay ---- */

#disconnectOverlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 11, 46, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.modal {
  background: #2D1445;
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  border: 4px solid #FF3366;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  max-width: 90%;
}

.modal h2 {
  color: #FF3366;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.modal p {
  color: #ffffff;
  font-size: 1.2rem;
}

/* ---- Confetti Canvas ---- */

#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}
