/* client.css — phone styles */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  height: 100dvh;
  background: #1a1a2e;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

.screen {
  display: none;
  flex-direction: column;
  height: 100dvh;
  padding: 2vh 4vw;
}
.screen.active { display: flex; }

/* -- Join screen -- */

#screen-join {
  justify-content: center;
  align-items: center;
  gap: 2vh;
}
#screen-join h1 { font-size: 7vw; margin: 0; color: #e94560; }
#screen-join label { font-size: 4vw; color: #aaa; }
#code-input, #name-input {
  font-size: 5vw;
  padding: 2vh 3vw;
  border: 2px solid #0f3460;
  border-radius: 12px;
  background: #16213e;
  color: #fff;
  width: 80vw;
  max-width: 400px;
  text-align: center;
}
#code-input:focus, #name-input:focus { outline: none; border-color: #e94560; }
.join-error {
  color: #ff6b6b;
  font-size: 4vw;
  text-align: center;
  padding: 1vh 2vw;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
  width: 80vw;
  max-width: 400px;
}
#join-btn {
  font-size: 5vw;
  padding: 2vh 8vw;
  border: none;
  border-radius: 12px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  margin-top: 2vh;
}
#join-btn:active { background: #c73650; }

/* -- Quiz screen -- */

#screen-quiz {
  padding: 0;
}
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5vh 4vw;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
  flex-shrink: 0;
}
.header-name { font-weight: bold; font-size: 4vw; }
.header-score { font-size: 4vw; color: #e94560; font-weight: bold; }
#audio-toggle {
  background: none;
  border: none;
  font-size: 5vw;
  cursor: pointer;
  padding: 0 1vw;
}
#quiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 2vh 4vw;
  display: flex;
  flex-direction: column;
}

/* -- Question -- */

.client-question-text {
  font-size: 5vw;
  line-height: 1.3;
  margin-bottom: 2vh;
  font-weight: 500;
}
.client-choices {
  display: flex;
  flex-direction: column;
  gap: 1.5vh;
}
.client-choice {
  display: flex;
  align-items: center;
  gap: 2vw;
  background: #16213e;
  border: 2px solid #0f3460;
  border-radius: 12px;
  padding: 2.5vh 3vw;
  font-size: 4.5vw;
  color: #fff;
  text-align: left;
  cursor: pointer;
  min-height: 8vh;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
}
.client-choice:active:not(.disabled) {
  background: #1a2745;
}
.client-choice.selected {
  border-color: #e94560;
  background: #2a1a3e;
}
.client-choice.disabled {
  opacity: 0.5;
}
.choice-letter {
  font-weight: bold;
  font-size: 1.2em;
  color: #e94560;
  min-width: 1.5em;
}
.choice-text { flex: 1; }

/* -- Status -- */

.client-status {
  text-align: center;
  padding: 2vh 0;
  font-size: 4vw;
  color: #aaa;
}
.client-countdown {
  font-size: 8vw;
  font-weight: bold;
  color: #e94560;
}

/* -- Answer phase -- */

.client-answer {
  text-align: center;
  padding: 2vh 0;
}
.client-answer-name {
  font-size: 6vw;
  font-weight: bold;
  color: #e94560;
  margin-bottom: 3vh;
}
.client-result {
  font-size: 5vw;
  padding: 2vh;
  background: #16213e;
  border-radius: 12px;
  margin: 2vh 0;
}
.client-score-info {
  font-size: 7vw;
  color: #0f0;
  margin-top: 2vh;
}
.client-total-score {
  font-size: 6vw;
  padding: 2vh;
  background: #2a1a3e;
  border-radius: 12px;
  margin-top: 2vh;
  color: #e94560;
}

/* -- Wait -- */

.client-wait {
  text-align: center;
  padding: 4vh 0;
  font-size: 5vw;
  color: #aaa;
}

/* -- Leaderboard -- */

.client-leaderboard h2 { text-align: center; font-size: 6vw; }
.client-own-score {
  text-align: center;
  font-size: 5vw;
  padding: 2vh;
  background: #16213e;
  border-radius: 12px;
  margin-top: 2vh;
}

/* -- Score feedback -- */

.score-feedback {
  position: fixed;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  background: #e94560;
  color: #fff;
  padding: 1.5vh 4vw;
  border-radius: 24px;
  font-size: 4vw;
  font-weight: bold;
  animation: scorePop 0.3s ease;
  z-index: 50;
}
@keyframes scorePop {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
