/* =============================================
   QUIZ Wereld — Mobiele speler stijlen
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple:  #6C5CE7;
  --green:   #00B894;
  --pink:    #E84393;
  --yellow:  #FDCB6E;
  --blue:    #0984E3;
  --dark:    #2D3436;
  --mid:     #636E72;
  --light:   #F0F0F5;
  --white:   #FFFFFF;
  --radius:  16px;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--dark);
  -webkit-tap-highlight-color: transparent;
}

/* ---- Schermen ---- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 20px;
  text-align: center;
}
.screen.active { display: flex; }

/* ---- Kaarten ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

/* ---- Logo / Header ---- */
.logo {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.logo span { color: var(--pink); }
.subtitle { color: var(--mid); font-size: .95rem; margin-bottom: 28px; }

/* ---- Formulier ---- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; text-align: left; }
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e8;
  border-radius: 10px;
  font-size: 1.1rem;
  outline: none;
  transition: border-color .2s;
}
input[type="text"]:focus { border-color: var(--purple); }
input[type="text"].code-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, opacity .2s;
  margin-top: 16px;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--purple); color: var(--white); }
.btn-green     { background: var(--green);  color: var(--white); }
.btn-disabled  { background: #ccc; color: #888; cursor: not-allowed; }

.error-msg {
  background: #ffe0eb;
  color: var(--pink);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
  margin-top: 12px;
  display: none;
}
.error-msg.show { display: block; }

/* ---- Wachtkamer ---- */
.waiting-header {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}
.waiting-code {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--dark);
  margin: 16px 0;
}
.participant-count {
  background: var(--light);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.participant-count .count-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--purple);
}
.participant-count .count-label {
  font-size: .9rem;
  color: var(--mid);
}
.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .5; }
}

/* ---- Timer balk ---- */
.timer-wrap {
  width: 100%;
  max-width: 420px;
  margin-bottom: 16px;
}
.timer-bar-bg {
  background: #e0e0e8;
  border-radius: 99px;
  height: 12px;
  overflow: hidden;
}
.timer-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width .5s linear, background .5s;
}
.timer-bar.warning { background: var(--yellow); }
.timer-bar.danger  { background: var(--pink); }
.timer-seconds {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: right;
  margin-top: 4px;
  color: var(--dark);
}

/* ---- Vraag ---- */
.question-num {
  font-size: .85rem;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.question-text {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 24px;
  color: var(--dark);
}

/* ---- Antwoord knoppen ---- */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}
.answer-btn {
  padding: 18px 12px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s, opacity .2s;
  color: var(--white);
  line-height: 1.3;
  min-height: 72px;
}
.answer-btn:active:not(:disabled) { transform: scale(.95); }
.answer-btn:disabled { opacity: .5; cursor: not-allowed; }
.answer-btn.color-a { background: #E84393; }
.answer-btn.color-b { background: #0984E3; }
.answer-btn.color-c { background: #FDCB6E; color: var(--dark); }
.answer-btn.color-d { background: #00B894; }

.answer-btn.selected  { box-shadow: 0 0 0 4px var(--dark); }
.answer-btn.correct   { background: var(--green) !important; opacity: 1 !important; }
.answer-btn.incorrect { background: #b2bec3 !important; opacity: .6 !important; }

/* Open vraag */
.open-answer-wrap { width: 100%; max-width: 420px; }
.open-answer-wrap textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid #e0e0e8;
  border-radius: 10px;
  font-size: 1rem;
  resize: none;
  height: 100px;
  outline: none;
}
.open-answer-wrap textarea:focus { border-color: var(--purple); }

/* ---- Resultaten ---- */
.result-icon { font-size: 4rem; margin-bottom: 12px; }
.result-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.result-score { font-size: 1rem; color: var(--mid); }
.correct-answer-label {
  font-size: .85rem;
  color: var(--mid);
  margin-top: 16px;
}
.correct-answer-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  margin-top: 4px;
}

/* ---- Scorebord ---- */
.leaderboard { width: 100%; max-width: 420px; }
.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--white);
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.lb-rank {
  font-size: 1.3rem;
  font-weight: 800;
  width: 36px;
  color: var(--mid);
}
.lb-rank.gold   { color: #F9CA24; }
.lb-rank.silver { color: #b2bec3; }
.lb-rank.bronze { color: #C8A165; }
.lb-name  { flex: 1; font-weight: 600; }
.lb-score { font-weight: 800; color: var(--purple); }
.lb-me    { border: 2px solid var(--purple); }
