/* Escape Multi — Style généré, piloté par variables CSS injectées depuis config.json */
:root {
  --primary: #ff7a18;
  --primary-dark: #c83c1c;
  --secondary: #b85b1a;
  --accent: #ffd27a;
  --bg: linear-gradient(160deg, #fff7e6 0%, #ffe0b2 100%);
  --card-bg: rgba(255, 255, 255, 0.88);
  --text: #3b2a1a;
  --text-muted: #6b4e2e;
  --success: #2e7d32;
  --error: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.app.admin { max-width: 760px; }

.logo-zone { display: flex; justify-content: center; padding: 8px; }
.logo-zone img { max-width: 160px; max-height: 110px; object-fit: contain; border-radius: 8px; background: #fff; padding: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.logo-placeholder {
  display: none; width: 100%; text-align: center; font-size: 0.85rem;
  color: var(--text-muted); background: #fff8e8; border: 2px dashed var(--accent);
  border-radius: 10px; padding: 12px; font-style: italic;
}

.screen {
  display: none; flex-direction: column; gap: 14px;
  background: var(--card-bg); border-radius: 16px;
  padding: 22px 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.4s ease;
}
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform:none;} }

.title { font-size: 1.6rem; color: var(--primary-dark); text-align: center; font-weight: 700; }
.subtitle { text-align: center; color: var(--secondary); font-weight: 600; margin-top: 4px; }
.intro { font-size: 1rem; text-align: center; color: var(--text); }
.label { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.question { font-size: 1.05rem; color: var(--text); }
.team-name { text-align: center; font-size: 1.2rem; font-weight: 700; color: var(--secondary); }
.end-message { text-align: center; font-size: 1.05rem; color: var(--text); padding: 6px 4px; }
.small { font-size: 0.85rem; color: var(--text-muted); }

.flame { display: inline-block; animation: flicker 1.6s ease-in-out infinite alternate; }
@keyframes flicker {
  from { transform: scale(1) rotate(-2deg); filter: drop-shadow(0 0 4px var(--accent)); }
  to   { transform: scale(1.1) rotate(2deg); filter: drop-shadow(0 0 12px var(--primary)); }
}
.pulse { font-size: 4rem; text-align: center; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.15); opacity: 1; } }

.countdown {
  font-size: 5rem; text-align: center; font-weight: 800; color: var(--primary-dark);
  text-shadow: 0 0 24px rgba(0,0,0,0.15);
  animation: pop 0.8s ease;
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

input[type="text"], input[type="password"] {
  width: 100%; padding: 14px; font-size: 1rem;
  border: 2px solid var(--accent); border-radius: 10px;
  background: #fffaf0; color: var(--text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,0,0,0.08); }

.btn {
  width: 100%; padding: 14px 18px; font-size: 1.05rem; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-primary.big { padding: 20px; font-size: 1.2rem; }
.btn-secondary { background: #fff; color: var(--secondary); border: 2px solid var(--primary); }
.btn-secondary.danger { color: var(--error); border-color: var(--error); }

.game-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.step-info { background: #fff4e0; padding: 6px 12px; border-radius: 20px; }
.timer { background: #fff; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--accent); }

.progress { width: 100%; height: 10px; background: #fff4e0; border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%); transition: width 0.5s ease; }

.card { background: #fffefa; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--accent); }

.puzzle-meta { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.95rem; }
.puzzle-points { color: var(--primary-dark); background: #fff4e0; padding: 4px 10px; border-radius: 20px; transition: color 0.3s, background 0.3s; }
.puzzle-points.dropping { animation: shake 0.4s ease; color: var(--error); }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-4px);} 75%{transform:translateX(4px);} }
.puzzle-total { color: var(--secondary); }

.feedback { min-height: 22px; font-size: 0.95rem; text-align: center; font-weight: 600; }
.feedback.success { color: var(--success); }
.feedback.error { color: var(--error); }
.feedback.info { color: var(--text-muted); }
.hint { background: #fff4e0; border-left: 4px solid var(--primary); padding: 10px 12px; border-radius: 8px; font-style: italic; color: var(--text-muted); font-size: 0.95rem; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.score-board {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border-radius: 12px; padding: 12px;
  border: 1px solid var(--accent);
}
.sb-row { display: flex; justify-content: space-between; padding: 4px 6px; font-size: 0.95rem; }
.sb-row strong { color: var(--primary-dark); }
.sb-row.total { border-top: 2px dashed var(--accent); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }
.sb-row.total strong { font-size: 1.3rem; }

/* ---- Admin ---- */
.qr-zone {
  display: flex; gap: 16px; align-items: center;
  background: #fff; padding: 14px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex-wrap: wrap; justify-content: center;
}
.qr-zone img { width: 220px; height: 220px; }
.qr-info { flex: 1; min-width: 200px; }
.url-box {
  font-family: monospace; font-size: 1rem; background: #fff4e0;
  padding: 8px 12px; border-radius: 8px; word-break: break-all; margin: 8px 0;
}
.status-bar {
  display: flex; justify-content: space-around; gap: 12px;
  background: #fff8e8; padding: 10px; border-radius: 10px;
  font-size: 0.95rem; flex-wrap: wrap;
}

.teams-list { display: flex; flex-direction: column; gap: 8px; }
.team-row {
  background: #fff; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--accent); display: flex; flex-direction: column; gap: 6px;
}
.team-row.finished { background: #e8f5e9; border-color: #66bb6a; }
.team-head { display: flex; justify-content: space-between; font-weight: 600; align-items: center; }
.team-name { color: var(--text); }
.team-score { color: var(--primary-dark); }
.team-meta { font-size: 0.82rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; }

.ranking-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ranking-list li {
  display: grid; grid-template-columns: 36px 1fr auto auto auto; gap: 8px; align-items: center;
  background: #fff; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--accent);
  font-size: 0.92rem;
}
.ranking-list li.me { background: #fff4e0; border-color: var(--primary); font-weight: 700; }
.ranking-list li.podium-1 { background: linear-gradient(135deg, #fff8d4 0%, #ffe07a 100%); border-color: #ffb000; }
.ranking-list li.podium-2 { background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%); }
.ranking-list li.podium-3 { background: linear-gradient(135deg, #fce4d6 0%, #e8a878 100%); }
.rk-pos { font-weight: 800; color: var(--primary-dark); font-size: 1.1rem; text-align: center; }
.rk-name { color: var(--text); }
.rk-score { color: var(--secondary); font-weight: 700; }
.rk-bonus { color: var(--primary-dark); font-size: 0.82rem; }
.rk-time { color: var(--text-muted); font-family: monospace; font-size: 0.85rem; }

/* ---- Ticket tombola ---- */
.ticket-box {
  background: linear-gradient(135deg, #fff8d4 0%, #ffd86b 100%);
  border: 2px dashed var(--primary-dark);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  position: relative;
}
.ticket-box::before,
.ticket-box::after {
  content: "";
  position: absolute; top: 50%; width: 16px; height: 16px;
  background: var(--bg, #fff); border-radius: 50%;
  transform: translateY(-50%);
}
.ticket-box::before { left: -8px; }
.ticket-box::after { right: -8px; }
.ticket-label { font-size: 0.9rem; color: var(--primary-dark); font-weight: 700; letter-spacing: 1px; }
.ticket-number {
  font-family: "Courier New", monospace; font-size: 2.4rem; font-weight: 900;
  color: var(--primary-dark); letter-spacing: 4px; margin: 6px 0;
}
.ticket-note { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

.rk-ticket {
  display: inline-block; font-family: monospace; font-size: 0.78rem;
  background: #fff8d4; color: var(--primary-dark); padding: 2px 6px;
  border-radius: 6px; margin-left: 6px; border: 1px solid #e6c060;
}

/* ---- Liste empreintes admin ---- */
.fp-list { display: flex; flex-direction: column; gap: 8px; }
.fp-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--accent); flex-wrap: wrap;
}
.fp-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.fp-ticket { font-family: monospace; color: var(--primary-dark); font-weight: 700; }
.fp-short { font-family: monospace; font-size: 0.78rem; color: var(--text-muted); }
.fp-btn { width: auto !important; padding: 8px 14px !important; font-size: 0.9rem !important; }

@media (min-width: 600px) {
  .title { font-size: 1.9rem; }
  .question { font-size: 1.15rem; }
}
