/* ─── MaxPlay – Styles partagés ─── */

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

:root {
  --bg-dark: #1a2a3a;
  --bg-light: #0d3b5e;
  --card-bg: #ffffff14;
  --accent-success: #00c47a;
  --accent-error: #ff4455;
  --accent-gold: #ffe066;
  --min-tap-size: 80px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(160deg, var(--bg-dark) 0%, var(--bg-light) 100%);
  color: #fff;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ─── Header ─── */
.hdr {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 16px 12px 0;
}

.back {
  background: linear-gradient(135deg, #00c47a, #00a060);
  border: none;
  color: #fff;
  font-size: 20px;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 196, 122, 0.3);
  transition: all 0.2s;
}

.back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 196, 122, 0.4);
}

.back:active { 
  transform: translateY(0) scale(0.95);
}

.htitle {
  font-size: 1.25rem;
  font-weight: 900;
}

/* ─── Score bar ─── */
.scorebar {
  width: calc(100% - 24px);
  background: #ffffff12;
  border-radius: 20px;
  padding: 10px 16px;
  margin: 0 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scoretxt { font-size: 0.9rem; opacity: 0.8; }
.scoreval { font-size: 1.3rem; font-weight: 900; color: var(--accent-gold); }
.streak { font-size: 0.85rem; color: #ff9f43; }

/* ─── Question box ─── */
.qbox {
  width: calc(100% - 24px);
  background: #ffffff12;
  border-radius: 20px;
  padding: 16px;
  margin: 0 12px 14px;
  text-align: center;
}

.qimg { margin: 8px auto; }
.qtxt {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 8px;
}

/* ─── Choices grid ─── */
.choices {
  display: grid;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 0 12px;
}

.ch {
  background: #ffffff18;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 10px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--min-tap-size);
  color: #fff;
}

.ch:active { transform: scale(0.97); }
.ch.ok { background: #00c47a33; border-color: var(--accent-success); }
.ch.ko { background: #ff445533; border-color: var(--accent-error); }

/* ─── Feedback Overlay ─── */
#fbOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 100;
  font-size: 5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

#fbOverlay.show { opacity: 1; }

/* ─── Confetti ─── */
.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 1.2s ease-in forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100dvh) rotate(720deg); opacity: 0; }
}

/* ─── Hub Menu ─── */
#menuScr {
  justify-content: flex-start;
  padding-top: 20px;
  overflow-y: auto;
}

.mtitle {
  text-align: center;
  margin-bottom: 16px;
}

.mtitle h2 { font-size: 1.5rem; font-weight: 900; }
.mtitle p { opacity: 0.7; font-size: 0.85rem; margin-top: 4px; }

.mgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 0 12px;
}

.mcard {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.15s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
}

.mcard:active { transform: scale(0.96); }
.mcard .bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 16px 16px 0 0;
}
.mcard .emoji { font-size: 2rem; margin: 4px 0; }
.mcard .mlbl { font-size: 0.9rem; font-weight: 900; }
.mcard .msub { font-size: 0.68rem; opacity: 0.65; margin-top: 2px; }

/* ─── Screen container ─── */
.scr {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0 0 16px;
  overflow-y: auto;
}
.scr.on { display: flex; }

/* ─── Bus SVG styles ─── */
.bus-svg {
  display: block;
  margin: 0 auto;
}

/* ─── Swatches (MJ-01) ─── */
.swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff4;
  display: inline-block;
  flex-shrink: 0;
}

/* portrait supporté — pas d'overlay forcé */
