/* PLAYER / MOBILE VIEW — Touch-friendly, clean, minimal */

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

html {
  height: -webkit-fill-available;
}

/* ═══════════ SCREENS ═══════════ */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ═══════════ JOIN SCREEN ═══════════ */
#join-screen {
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.join-logo {
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.join-logo h1 {
  font-size: 40px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.join-logo p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 4px;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 380px;
  animation: fadeIn 0.4s ease 0.1s both;
}

.join-form input {
  width: 100%;
  padding: 18px 24px;
  border: 3px solid var(--bg-card);
  border-radius: 16px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  -webkit-appearance: none;
}

.join-form input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.join-form input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

#room-code-input {
  font-size: 32px;
  letter-spacing: 8px;
  text-transform: uppercase;
}

.join-btn {
  width: 100%;
  padding: 20px;
  font-size: 20px;
}

.join-error {
  color: var(--red);
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  min-height: 24px;
}

.or-host {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.or-host a {
  color: var(--purple-light);
  text-decoration: none;
  font-weight: 600;
}

/* ═══════════ WAITING SCREEN ═══════════ */
#waiting-screen {
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.waiting-icon {
  font-size: 80px;
  animation: bounceIn 0.5s ease;
}

.waiting-text {
  font-size: 24px;
  font-weight: 700;
}

.waiting-room-code {
  font-size: 48px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 8px;
}

.waiting-sub {
  color: var(--text-muted);
  font-size: 16px;
  animation: pulse 2s ease-in-out infinite;
}

.player-list-mobile {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 360px;
}

.player-chip {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  animation: slideInUp 0.3s ease;
}

/* ═══════════ QUESTION SCREEN ═══════════ */
#question-screen {
  gap: 0;
  padding: 0;
}

.mobile-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px 8px;
  gap: 8px;
}

.mobile-timer .time {
  font-size: 40px;
  font-weight: 900;
  transition: color 0.3s ease;
}

.mobile-timer .time.warning { color: var(--orange); }
.mobile-timer .time.danger { color: var(--red); animation: countdownPulse 1s ease-in-out infinite; }

.mobile-timer-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.mobile-timer-bar .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width 1s linear;
  border-radius: 3px;
}

.mobile-timer-bar .bar.warning {
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.mobile-question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
}

.mobile-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.mobile-progress {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.mobile-question-text {
  padding: 8px 24px 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  animation: fadeInScale 0.3s ease;
}

.mobile-options {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 24px;
  justify-content: center;
}

.mobile-option {
  width: 100%;
  min-height: 64px;
  border: none;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.mobile-option:nth-child(1) { background: #E53E3E; }
.mobile-option:nth-child(2) { background: #3182CE; }
.mobile-option:nth-child(3) { background: #D69E2E; }
.mobile-option:nth-child(4) { background: #38A169; }

.mobile-option:active {
  transform: scale(0.97);
}

.mobile-option .letter {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}

.mobile-option .text {
  flex: 1;
  text-align: left;
  line-height: 1.3;
}

.mobile-option.selected {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
  transform: scale(1.02);
}

.mobile-option.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ═══════════ ANSWERED SCREEN ═══════════ */
#answered-screen {
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}

.answered-icon {
  font-size: 80px;
  animation: bounceIn 0.4s ease;
}

.answered-text {
  font-size: 24px;
  font-weight: 700;
}

.answered-sub {
  color: var(--text-muted);
  font-size: 16px;
}

/* ═══════════ RESULT SCREEN ═══════════ */
#result-screen {
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.result-icon {
  font-size: 100px;
  animation: bounceIn 0.5s ease;
}

.result-correct .result-icon { filter: none; }
.result-wrong .result-icon { filter: none; }

.result-text {
  font-size: 32px;
  font-weight: 800;
}

.result-correct .result-text { color: var(--green); }
.result-wrong .result-text { color: var(--red); }

.result-correct-answer {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 300px;
}

.result-correct-answer strong {
  color: var(--green);
}

.result-points {
  font-size: 48px;
  font-weight: 900;
  color: var(--orange);
  animation: bounceIn 0.5s ease 0.2s both;
}

.result-stats {
  display: flex;
  gap: 24px;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.result-stat .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--cyan);
}

.result-stat .label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.streak-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 12px;
  color: var(--orange);
  font-weight: 700;
  font-size: 18px;
  animation: streakPulse 1s ease-in-out infinite;
}

/* ═══════════ FINAL SCREEN ═══════════ */
#final-screen {
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.final-title {
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.final-rank {
  font-size: 80px;
  animation: bounceIn 0.5s ease;
}

.final-position {
  font-size: 28px;
  font-weight: 800;
}

.final-score {
  font-size: 20px;
  color: var(--text-secondary);
}

.final-score .points {
  color: var(--cyan);
  font-weight: 800;
  font-size: 28px;
}

.final-accuracy {
  display: flex;
  gap: 24px;
}

.final-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.final-stat .value {
  font-size: 32px;
  font-weight: 800;
  color: var(--purple-light);
}

.final-stat .label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.play-again-mobile {
  margin-top: 16px;
}

/* ═══════════ KICKED SCREEN ═══════════ */
#kicked-screen {
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 400px) {
  .join-logo h1 { font-size: 32px; }
  .mobile-question-text { font-size: 18px; }
  .mobile-option { font-size: 17px; min-height: 56px; padding: 12px 16px; }
  .mobile-option .letter { width: 36px; height: 36px; font-size: 18px; }
  .result-points { font-size: 40px; }
}

@media (min-width: 768px) {
  .screen { padding: 40px; }
  .join-form { max-width: 440px; }
}
