/* =====================================================================
   Roue de la fortune - styles partages (kiosque + connexion admin)
   ===================================================================== */

:root {
  --bg: #0B0D12;
  --bg-alt: #12151C;
  --card: #161A22;
  --border: #262B36;
  --gold: #D4AF37;
  --gold-light: #F1D98B;
  --text: #F5F3EE;
  --text-dim: #9AA0AC;
  --win: #3FA796;
  --lose: #6B7280;
  --danger: #B5495B;
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

button, input, select {
  font-family: inherit;
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.muted { color: var(--text-dim); }
.small { font-size: 0.85rem; }

/* -------------------- Kiosque : conteneur plein ecran -------------------- */

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 6vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  text-align: center;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
}

/* -------------------- Ecran d'accueil (attract) -------------------- */

#screen-attract {
  padding: 0;
  cursor: pointer;
}

.attract-video-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #171B24, #0B0D12 70%);
}

.attract-video-wrap video,
.attract-video-wrap .video-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attract-video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,13,18,0.15) 0%, rgba(11,13,18,0.55) 55%, rgba(11,13,18,0.92) 100%);
}

.attract-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 6vh 6vw 8vh;
}

.attract-content h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  margin: 0 0 0.6rem;
  max-width: 18ch;
}

.attract-content p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 42ch;
  margin: 0 0 2.5rem;
}

.tap-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 2.4rem;
  border-radius: 999px;
  background: var(--gold);
  color: #16130A;
  font-weight: 700;
  font-size: 1.15rem;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212,175,55,0.35); }
  50% { transform: scale(1.035); box-shadow: 0 0 0 14px rgba(212,175,55,0); }
}

/* -------------------- Formulaire -------------------- */

.form-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.4rem 2rem;
}

.form-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0 0 0.4rem;
}

.form-card .subtitle {
  color: var(--text-dim);
  margin: 0 0 1.8rem;
  font-size: 0.95rem;
}

.field {
  text-align: left;
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field input[type="email"],
.field select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.05rem;
}

.field-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  margin: 1.4rem 0 1.6rem;
}

.field-consent input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.field-consent label {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.btn-play {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: var(--gold);
  color: #16130A;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-play:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-error {
  background: rgba(181,73,91,0.15);
  border: 1px solid rgba(181,73,91,0.4);
  color: #F0B4BE;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
  text-align: left;
}

/* -------------------- Roue -------------------- */

#screen-wheel .wheel-wrap {
  position: relative;
  width: min(70vh, 80vw);
  max-width: 560px;
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 30px solid var(--gold);
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

#wheel-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 8px var(--bg-alt), 0 0 0 10px var(--border), 0 20px 60px rgba(0,0,0,0.5);
}

.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 14%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 70%);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  z-index: 2;
}

.btn-spin {
  margin-top: 2.4rem;
  padding: 1.1rem 3rem;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: #16130A;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-spin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -------------------- Resultat -------------------- */

.result-card {
  max-width: 480px;
}

.result-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin: 0 auto 1.4rem;
}

.result-icon.win { background: rgba(63,167,150,0.18); color: var(--win); }
.result-icon.lose { background: rgba(107,114,128,0.18); color: var(--lose); }

.result-card h2 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  margin: 0 0 0.6rem;
}

.result-card p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 38ch;
  margin: 0 auto 2.2rem;
}

.btn-finish {
  padding: 0.9rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.loading-text {
  color: var(--text-dim);
  margin-top: 1rem;
}
