/* Player Join - Mobile Controller */
.player-join {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f5f5f0;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

/* Header */
.pj-header {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Lang switcher styles in main.css */

/* Content */
.pj-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

/* Avatar Section */
.avatar-section {
  position: relative;
  margin-bottom: 2rem;
}

.avatar-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 4px solid #f0e500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-refresh {
  position: absolute;
  bottom: 0;
  right: -8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1a1a;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.avatar-refresh:hover {
  background: #333;
}

.avatar-refresh:active {
  transform: scale(0.95) rotate(180deg);
}

.avatar-refresh.spinning {
  animation: spin 0.5s ease;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Form */
.pj-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 500;
  background: #fff;
  border: 2px solid #eee;
  border-radius: 16px;
  color: #1a1a1a;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input::placeholder {
  color: #bbb;
}

.input-group input:focus {
  outline: none;
  border-color: #f0e500;
  box-shadow: 0 0 0 4px rgba(240, 229, 0, 0.2);
}

/* Game code specific styling */
#game-code {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 8px;
  font-family: system-ui, sans-serif;
}

/* Join Button */
.join-btn {
  width: 100%;
  padding: 1.25rem;
  margin-top: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.join-btn:hover {
  opacity: 0.9;
}

.join-btn:active {
  transform: scale(0.98);
}

.join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
.pj-footer {
  text-align: center;
  padding: 1rem 0;
  color: #888;
  font-size: 0.8rem;
}

/* ============ RESPONSIVE ============ */

@media (min-height: 700px) {
  .avatar-wrapper {
    width: 140px;
    height: 140px;
  }
  
  .avatar-section {
    margin-bottom: 2.5rem;
  }
}

@media (max-height: 600px) {
  .player-join {
    padding: 1rem;
  }
  
  .avatar-wrapper {
    width: 90px;
    height: 90px;
  }
  
  .avatar-refresh {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .avatar-section {
    margin-bottom: 1rem;
  }
  
  .pj-form {
    gap: 0.75rem;
  }
  
  .input-group input {
    padding: 0.75rem 1rem;
  }
  
  #game-code {
    font-size: 1.5rem;
  }
  
  .join-btn {
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .pj-content {
    max-width: 450px;
  }
  
  .avatar-wrapper {
    width: 160px;
    height: 160px;
  }
  
  .avatar-refresh {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }
}
