:root {
  --primary: #e95398;
  --primary-dark: #b12a6d;
  --success: #1fa855;
  --danger: #e8483a;
  --bg: #fce4ec;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --radius: 20px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", Tahoma, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 720px;
}

#screen-start { max-width: 700px; }

.screen.active {
  display: block;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  text-align: center;
}

h1 { font-size: 2.4rem; margin-bottom: 12px; }
h2 { font-size: 1.6rem; margin: 8px 0 28px; text-align: left; }

.subtitle { color: var(--muted); font-size: 1.1rem; margin-bottom: 32px; }

.logo {
  width: 190px;
  height: auto;
  margin-bottom: 18px;
}

/* Ecran d'accueil : logo à gauche, titre/sous-titre/bouton à droite */
.start-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  text-align: left;
  padding: 56px;
}

.start-card .start-logo { flex-shrink: 0; }
.start-card .logo { width: 240px; margin-bottom: 0; }
.start-card .start-content { flex: none; width: 320px; min-width: 0; }
.start-card h1 { font-size: 1.9rem; }
.start-card .subtitle { font-size: .95rem; margin-bottom: 20px; }
.start-card .btn-xl { padding: 16px; min-height: 56px; font-size: 1rem; }
.start-card h1, .start-card .subtitle { text-align: left; }

@media (max-width: 560px) {
  .start-card { flex-direction: column; text-align: center; gap: 20px; }
  .start-card h1, .start-card .subtitle { text-align: center; }
}

.btn {
  border: none;
  border-radius: 16px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}

.btn:active { transform: scale(.97); }

.btn-xl {
  width: 100%;
  padding: 22px;
  min-height: 72px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-secondary {
  background: #eef1f8;
  color: var(--text);
  padding: 14px 22px;
  border-radius: 12px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Quiz header / progress */
.quiz-header {
  text-align: left;
  margin-bottom: 20px;
}

#questionProgress {
  font-weight: 600;
  color: var(--muted);
  font-size: .95rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9edf5;
  border-radius: 8px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 20%;
  background: var(--primary);
  border-radius: 8px;
  transition: width .3s ease;
}

/* Options as radio buttons */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.option {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 2px solid #e2e6f0;
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  font-size: 1.1rem;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}

.option input[type="radio"] {
  width: 24px;
  height: 24px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.option.selected {
  border-color: var(--primary);
  background: #eef3ff;
}

.option.correct {
  border-color: var(--success);
  background: #e7f8ee;
}

.option.incorrect {
  border-color: var(--danger);
  background: #fdeceb;
}

/* Result screen */
.result-icon {
  font-size: 4.5rem;
  margin-bottom: 8px;
}

#screen-result.win .result-icon::before { content: "🏆"; }
#screen-result.lose .result-icon::before { content: "😕"; }

#screen-result.win #resultTitle { color: var(--success); }
#screen-result.lose #resultTitle { color: var(--danger); }

/* Hidden tap zone */
#hiddenZone {
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  z-index: 50;
}

/* Admin overlay */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-overlay.active {
  display: flex;
}

.admin-panel {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 30px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.admin-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  flex: 1;
  background: #f4f6fb;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--muted);
  font-size: .9rem;
}

.admin-panel h3 {
  margin: 18px 0 10px;
  font-size: 1.05rem;
}

.table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e9edf5;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eef1f8;
}

th {
  background: #f8f9fc;
  position: sticky;
  top: 0;
}

@media (max-width: 480px) {
  .card { padding: 32px 22px; }
  h1 { font-size: 1.9rem; }
}

/* Borne tactile grand format (ex. 43 pouces) : agrandir le contenu
   pour garder une bonne lisibilité à distance. */
@media (min-width: 1600px) {
  .screen { max-width: 920px; }
  .card { padding: 64px 56px; }
  h1 { font-size: 3.2rem; }
  h2 { font-size: 2.1rem; }
  .subtitle { font-size: 1.4rem; }
  .option { font-size: 1.4rem; padding: 24px 26px; }
  .btn-xl { font-size: 1.5rem; padding: 28px; min-height: 90px; }
  .logo { width: 260px; }
  .start-card .logo { width: 280px; }
  #hiddenZone { width: 220px; height: 220px; }
}
