/* Quick Quiz — layout and UI chrome.
 * Colors/fonts come from config.js via CSS variables set in src/main.js. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font, system-ui, sans-serif);
  background: var(--bg, #141c2e);
  color: var(--text, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 16px;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  display: none;
  width: min(94vw, 560px);
  background: var(--card, #1d2940);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.screen.active { display: block; }

/* start */
h1 { font-size: clamp(26px, 6vw, 38px); margin-bottom: 8px; }
#subtitle { opacity: 0.75; margin-bottom: 18px; }
#best-score { min-height: 20px; font-size: 14px; opacity: 0.8; margin-bottom: 14px; }

.big-btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 0;
  border-radius: 12px;
  padding: 14px 30px;
  background: var(--primary);
  color: #10131c;
  cursor: pointer;
  transition: transform 0.1s;
}
.big-btn:active { transform: scale(0.96); }

/* question */
.q-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 12px;
}

#timer-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
#timer-bar {
  height: 100%;
  width: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.1s linear;
}

#q-text {
  font-size: clamp(17px, 4vw, 22px);
  font-weight: 700;
  min-height: 56px;
  margin-bottom: 18px;
}

#answers { display: grid; gap: 10px; }

.answer {
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.answer:not(:disabled):hover { border-color: var(--primary); }
.answer:disabled { cursor: default; opacity: 0.9; }
.answer.correct { border-color: var(--correct); background: color-mix(in srgb, var(--correct) 25%, transparent); }
.answer.wrong { border-color: var(--wrong); background: color-mix(in srgb, var(--wrong) 25%, transparent); }

#timeup-note { min-height: 22px; margin-top: 12px; font-size: 14px; color: var(--wrong); font-weight: 700; }

/* result */
#result-title { font-size: clamp(24px, 5vw, 32px); margin-bottom: 6px; }
#result-message { opacity: 0.8; margin-bottom: 16px; }
#result-correct { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
#result-score { font-size: 16px; margin-bottom: 8px; }
#result-best { min-height: 20px; font-size: 14px; color: var(--primary); font-weight: 700; margin-bottom: 16px; }

#mute-btn {
  position: fixed;
  right: 14px; top: 14px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
  cursor: pointer;
}

/* embed mode (?embed=1): tight chrome for iframes */
body.embed { padding: 8px; }
body.embed .screen { width: 100%; max-width: none; padding: 20px 16px; box-shadow: none; }
body.embed #mute-btn { right: 6px; top: 6px; width: 34px; height: 34px; font-size: 16px; }
