/* ============================================================
   Player V2 — design kid-friendly
   ============================================================ */

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

:root {
  --green: #2e7d32; --green-dark: #1b5e20; --green-light: #4caf50;
  --orange: #ff9800; --orange-dark: #e65100;
  --blue: #1976d2; --yellow: #ffeb3b; --red: #e53935;
  --gray-bg: #f5f7fa; --gray-border: #e0e6ed; --gray-soft: #fafbfc;
  --text: #1a2733; --text-light: #5a6878; --white: #ffffff;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-strong: 0 8px 24px rgba(0,0,0,0.15);
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #e8f5e9 0%, #fff3e0 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 17px;
}

/* ----------- TOP BAR ----------- */
.topbar {
  background: var(--green);
  color: var(--white);
  padding: 16px 16px 12px;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  display: flex; align-items: center; gap: 8px;
  max-width: 600px; margin: 0 auto;
}
.logo { font-size: 36px; line-height: 1; }
.topbar-titles { flex: 1; min-width: 0; }
.topbar-titles h1 { font-size: 17px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.topbar-titles p { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.btn-icon {
  background: rgba(255,255,255,0.2); border: none; color: var(--white);
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.btn-icon:hover, .btn-icon:focus { background: rgba(255,255,255,0.35); }
.btn-icon[hidden] { display: none !important; }

.progress-bar {
  background: rgba(255,255,255,0.25); height: 10px; border-radius: 5px;
  margin-top: 14px; overflow: hidden;
  max-width: 600px; margin-left: auto; margin-right: auto;
}
.progress-fill {
  background: var(--yellow); height: 100%; width: 0%; border-radius: 5px;
  transition: width 0.5s ease;
}
.progress-text {
  font-size: 14px; text-align: center; margin-top: 6px; opacity: 0.95;
}

/* ----------- MAIN ----------- */
.main {
  max-width: 600px; margin: 0 auto; padding: 20px 16px 32px;
}

.card {
  background: var(--white); border-radius: 20px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.card.center { text-align: center; }
.card h2 { font-size: 22px; color: var(--green-dark); margin-bottom: 10px; }
.card p { font-size: 15px; color: var(--text); margin-bottom: 14px; }

.emoji-big { font-size: 70px; line-height: 1; margin-bottom: 12px; text-align: center; }
.emoji-big.bounce { animation: bounce 1s infinite ease-in-out; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ----------- LOGIN ----------- */
#form-login {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 18px;
}
#input-code {
  width: 100%; padding: 14px 16px;
  font-size: 18px; font-weight: 600;
  letter-spacing: 1.5px; text-align: center;
  border: 3px solid var(--gray-border); border-radius: 14px;
  outline: none; transition: border-color 0.2s;
  text-transform: uppercase; font-family: monospace;
}
#input-code:focus { border-color: var(--green-light); }

/* ----------- BUTTONS ----------- */
.btn {
  display: block; width: 100%; padding: 14px 24px;
  font-size: 16px; font-weight: 700; border: none;
  border-radius: 14px; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  font-family: inherit; text-align: center; margin-top: 8px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--green); color: var(--white); box-shadow: 0 4px 0 var(--green-dark); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--gray-soft); color: var(--text); border: 2px solid var(--gray-border); }
.btn-orange { background: var(--orange); color: var(--white); box-shadow: 0 4px 0 var(--orange-dark); }
.btn-link {
  background: transparent; color: var(--blue);
  text-decoration: underline; padding: 8px; font-size: 14px;
  margin-top: 4px; border: none; cursor: pointer; font-family: inherit;
  display: inline-block; width: auto;
}
.big-btn { font-size: 20px; padding: 18px 24px; }

/* ----------- ETAPE ----------- */
.chip {
  display: inline-block; background: var(--orange); color: var(--white);
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
  font-weight: 700; margin: 0 4px 12px 0;
}
.chip-blue { background: var(--blue); }
.question-text {
  font-size: 18px; background: #fff8e1; padding: 16px;
  border-radius: 14px; border-left: 4px solid var(--orange);
  margin: 16px 0 20px;
}
#form-answer { display: flex; flex-direction: column; gap: 10px; }
#input-answer, #input-secret {
  width: 100%; padding: 14px 16px;
  font-size: 18px; border: 3px solid var(--gray-border);
  border-radius: 14px; outline: none; text-align: center;
  transition: border-color 0.2s;
  font-family: inherit;
}
#input-answer:focus, #input-secret:focus { border-color: var(--green-light); }
.feedback { min-height: 24px; font-size: 14px; font-weight: 600; }
.feedback.ok { color: var(--green-dark); }
.feedback.ko { color: var(--red); }
.feedback.info { color: var(--blue); }

.indice-box {
  background: #e3f2fd; border-left: 4px solid var(--blue);
  padding: 12px 14px; border-radius: 10px; font-size: 14px;
  margin: 12px 0; text-align: left;
}
.indice-box.hidden { display: none; }

/* ----------- BLOCUS ----------- */
.blocus-card {
  background: repeating-linear-gradient(45deg, #fff3e0 0, #fff3e0 14px, #ffe0b2 14px, #ffe0b2 28px);
  border: 3px dashed var(--orange);
}
.blocus-titre {
  color: var(--orange-dark) !important;
  font-size: 22px; font-weight: 900; text-align: center;
}
.ok-mini {
  color: var(--green-dark); font-weight: 700; font-size: 15px;
  text-align: center; margin-bottom: 10px;
}
#secret-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
#secret-form.hidden { display: none; }

/* ----------- ALERTS ----------- */
.alert {
  padding: 14px; border-radius: 12px; font-size: 14px; margin: 14px 0;
}
.alert-orange {
  background: #fff3e0; border-left: 4px solid var(--orange);
  color: var(--text);
}
.alert .btn-blocus {
  display: block; margin-top: 6px;
  background: transparent; border: none;
  color: var(--orange-dark); font-weight: 700;
  cursor: pointer; padding: 4px 0;
  text-align: left; font-size: 14px;
}

/* ----------- VICTOIRE ----------- */
.victoire-card {
  background: linear-gradient(135deg, #fff9c4 0%, #ffe082 100%);
  text-align: center; box-shadow: var(--shadow-strong);
  animation: pop 0.5s ease;
}
@keyframes pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.victoire-titre { font-size: 24px; color: var(--green-dark); font-weight: 900; }

/* ----------- MODAL SCAN ----------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal.hidden { display: none; }
.modal-scan-content {
  background: var(--white); border-radius: 20px;
  padding: 20px 18px 18px; max-width: 420px; width: 100%;
  text-align: center;
}
.modal-scan-content h2 { font-size: 18px; color: var(--green-dark); margin-bottom: 4px; }
.reader {
  width: 100%; max-width: 360px; margin: 12px auto;
  background: #000; border-radius: 14px; overflow: hidden; min-height: 240px;
}
.reader video { width: 100% !important; height: auto !important; display: block; }
.reader__dashboard_section_swaplink,
.reader__dashboard_section_csr,
.reader #html5-qrcode-button-camera-permission,
.reader #html5-qrcode-button-camera-start,
.reader #html5-qrcode-button-camera-stop { display: none !important; }

/* ----------- CONFETTI ----------- */
.confetti-container { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti-piece {
  position: absolute; width: 10px; height: 10px;
  top: -20px; animation: fall linear forwards;
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0.7; }
}

/* ----------- MISC ----------- */
.muted { color: var(--text-light); font-size: 13px; }
.footer { text-align: center; padding: 16px; }
.footer p { color: var(--text-light); font-size: 11px; }
.page-loading { text-align: center; padding: 60px 20px; color: var(--text-light); }

/* ----------- _redirects ----------- */
