/* static/css/join.css */

:root {
  --bg: #1d1b3a;
  --panel: #2c294d;
  --highlight: #00f0ff;
  --accent: #ffcc00;
  --text: #ffffff;
  --muted: #888;
  --touch-target: 44px;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  font-family: 'Rubik', sans-serif;
  color: var(--text);
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  color: var(--highlight);
  text-align: center;
  margin: 20px 0 20px;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.container {
  max-width: 500px;
  width: 100%;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 0 15px var(--highlight);
  padding: 30px 20px;
  text-align: center;
}

/* Game Code Input Section */
.game-code-section {
  margin-bottom: 20px;
}

.game-code-section p {
  color: var(--text);
  margin-bottom: 20px;
  font-size: 1.1em;
}

.game-code-input-container {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
}

#gameCodeInput {
  flex: 2;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px solid var(--highlight);
  background: #1b1a2e;
  color: var(--text);
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  margin-bottom: 0;
}

.game-code-input-container button {
  flex: 1;
  margin-bottom: 0;
  background: var(--accent);
  color: #000;
  font-size: 14px;
  padding: 14px 12px;
}

.game-code-input-container button:hover {
  background: #e6b800;
}

.divider {
  margin: 25px 0;
  position: relative;
  color: var(--muted);
  font-size: 0.9em;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--muted);
  opacity: 0.3;
}

.divider span {
  background: var(--panel);
  padding: 0 15px;
  position: relative;
}

.hint-text {
  color: var(--muted);
  font-size: 0.9em;
  margin: 0;
}

/* Join Section */
.join-section {
  margin-top: 20px;
}

.logo {
  max-width: 300px;
  margin: 0 auto 20px;
  display: block;
}

input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 6px;
  border: none;
  background: #1b1a2e;
  color: var(--text);
  font-size: 1em;
  min-height: var(--touch-target);
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border: 2px solid var(--highlight);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

button {
  background: var(--highlight);
  color: #000;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  font-size: 1em;
  width: 100%;
  margin-bottom: 10px;
  min-height: var(--touch-target);
}

button:hover {
  background: #00e6e6;
  transform: translateY(-1px);
}

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

#waitingMessage {
  margin-top: 20px;
  font-size: 0.9em;
  color: var(--muted);
}

.game-id {
  margin: 10px 0;
  font-size: 1.1em;
  color: var(--accent);
  font-weight: bold;
}

.mute-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--highlight);
  color: var(--highlight);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  width: auto;
  min-width: 120px;
}

.mute-btn:hover {
  background: var(--highlight);
  color: #000;
}

/* Responsive Design */
@media (max-width: 600px) {
  body {
    padding: 15px;
  }

  h1 {
    font-size: 1.5em;
  }

  .container {
    padding: 20px 15px;
  }

  .logo {
    max-width: 250px;
  }

  .game-code-input-container {
    flex-direction: column;
    gap: 16px;
  }

  .game-code-input-container button {
    flex: none;
  }
}

@media (max-width: 400px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px 12px;
  }

  input, button {
    padding: 14px 16px;
    font-size: 16px;
  }

  #gameCodeInput {
    font-size: 20px;
    letter-spacing: 3px;
  }
}

/* Improved focus visibility */
button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Loading state */
.loading {
  position: relative;
  color: transparent !important;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid transparent;
  border-top: 3px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}