* { box-sizing: border-box; }

body { 
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Helvetica, Arial, "Microsoft JhengHei", sans-serif; 
  margin: 0; 
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh;
  color: #e2e8f0; 
}

.container { 
  max-width: 1000px; 
  margin: 0 auto; 
  padding: 20px;
}

h1 { 
  font-size: 36px; 
  margin: 0 0 24px; 
  text-align: center;
  background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hidden { display: none; }

/* Input & Button Styles */
input, button { 
  padding: 12px 16px; 
  font-size: 16px; 
  border: none;
  outline: none;
  transition: all 0.2s ease;
}

input {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
}

input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

button { 
  background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
  border-radius: 8px; 
  color: #0f172a; 
  cursor: pointer; 
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(34, 211, 238, 0.2);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover { 
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(34, 211, 238, 0.3);
}

button:active {
  transform: translateY(0);
}

button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
  transform: none;
  box-shadow: none;
}

/* Status & Info */
.status { 
  margin: 16px 0; 
  padding: 16px;
  background: rgba(165, 180, 252, 0.1);
  border-left: 4px solid #a5b4fc;
  border-radius: 8px;
  color: #c7d2fe;
}

.input-row { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  margin: 16px 0; 
  flex-wrap: wrap;
}

.messages { 
  margin: 20px 0; 
  padding: 16px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 8px;
  min-height: 50px;
  font-size: 15px;
  line-height: 1.6;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* Scoreboard */
.scoreboard { 
  width: 100%; 
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.scoreboard thead {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.scoreboard th { 
  padding: 16px 12px;
  text-align: left; 
  font-weight: 600;
  color: #22d3ee;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #22d3ee;
}

.scoreboard td { 
  padding: 14px 12px;
  border-bottom: 1px solid #334155; 
  transition: background 0.2s ease;
}

.scoreboard tbody tr {
  transition: all 0.2s ease;
}

.scoreboard tbody tr:hover {
  background: rgba(34, 211, 238, 0.05);
  transform: scale(1.01);
}

.scoreboard tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge { 
  display: inline-block; 
  padding: 4px 10px; 
  border-radius: 12px; 
  font-size: 12px; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge.out { 
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white; 
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.badge.in { 
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Join Section */
#join-section {
  max-width: 500px;
  margin: 60px auto;
  padding: 32px;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#join-section input {
  width: 100%;
  margin-bottom: 12px;
}

#join-section button {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  margin-top: 8px;
}

/* Game Section */
#game-section {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Room Display */
#room-display {
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 6px;
  font-size: 14px;
  color: #22d3ee;
}

/* Lobby Controls */
#lobby {
  background: rgba(30, 41, 59, 0.6);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(165, 180, 252, 0.2);
  margin-bottom: 20px;
}

#lobby > div {
  margin: 12px 0;
}

#lobby label {
  margin-right: 16px;
  cursor: pointer;
  transition: color 0.2s ease;
}

#lobby label:hover {
  color: #22d3ee;
}

#lobby input[type="checkbox"] {
  margin-right: 6px;
  cursor: pointer;
}

/* Round Info */
#round-info {
  background: rgba(34, 211, 238, 0.1);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

#round-info > div {
  margin: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  h1 {
    font-size: 28px;
  }
  
  .scoreboard th,
  .scoreboard td {
    padding: 10px 8px;
    font-size: 14px;
  }
  
  #join-section {
    margin: 20px auto;
    padding: 24px;
  }
}


