/* Roue de la chance — charte 42 UI Kit */
:root {
  --bg: #030D20;
  --bg-2: #0A1E41;
  --card: #F8FAFF;
  --line: #BFC8D9;
  --text-2: #4E5E7A;
  --brand-700: #365399;
  --brand-500: #6388E3;
  --brand-300: #B8CDFF;
  --teal-500: #15B79E;
  --teal-700: #107569;
  --pink-500: #EE46BC;
  --pink-700: #C11574;
  --ok: #17B26A;
  --warn: #FAC515;
  --danger: #FF4E41;
  --info: #2E90FA;
  --mono: 'Kode Mono', ui-monospace, monospace;
  --sans: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: radial-gradient(120% 80% at 50% 0%, var(--bg-2) 0%, var(--bg) 60%);
  color: #fff;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 18px 40px; }
.brand { text-align: center; padding: 8px 0 4px; }
.brand img { width: 60%; max-width: 220px; height: auto; }

h1, h2, h3, .mono { font-family: var(--mono); font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 1.45rem; text-align: center; margin: 10px 0 4px; }
.subtitle { text-align: center; color: var(--brand-300); margin: 0 0 18px; }

.card {
  background: var(--card); color: var(--bg); border-radius: 18px; padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card h2 { font-size: 1.1rem; margin: 0 0 12px; color: var(--brand-700); }
.muted { color: var(--text-2); font-size: .92rem; }

label { display: block; font-weight: 700; font-size: .9rem; margin: 12px 0 6px; color: var(--bg); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search] {
  width: 100%; font: inherit; font-size: 17px; padding: 14px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--bg); outline: none;
}
input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,136,227,.25); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; margin-top: 18px; padding: 0 20px;
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem; letter-spacing: .03em;
  border: 0; border-radius: 14px; cursor: pointer; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  box-shadow: 0 6px 18px rgba(238,70,188,.35);
  transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.secondary { background: var(--brand-700); box-shadow: none; }
.btn.teal { background: var(--teal-700); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--brand-700); border: 1.5px solid var(--line); box-shadow: none; }
.btn.small { width: auto; min-height: 40px; margin-top: 0; font-size: .9rem; padding: 0 14px; border-radius: 10px; }
.btn.danger { background: var(--danger); box-shadow: none; }

.alert { border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: .95rem; }
.alert.error { background: #FFE9E7; color: #8A1C13; border: 1px solid #FFC2BC; }
.alert.info { background: #E6F1FE; color: #0B4A8F; border: 1px solid #B9D8FD; }
.alert.ok { background: #E3F6EC; color: #0C6B3D; border: 1px solid #B2E5C9; }
.hidden { display: none !important; }

/* Roue */
.wheel-zone { position: relative; width: min(88vw, 380px); aspect-ratio: 1; margin: 6px auto 0; }
.wheel-zone canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.wheel-zone .pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #fff;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); z-index: 2;
}
.wheel-zone .hub {
  position: absolute; inset: 0; margin: auto; width: 22%; height: 22%; border-radius: 50%;
  background: var(--bg); border: 4px solid #fff; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: clamp(18px, 6vw, 26px); color: #fff; z-index: 1;
}

/* Résultat */
.result { text-align: center; }
.result .lot { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--brand-700); margin: 6px 0 12px; }
.result.ultra .lot { color: var(--pink-700); }
.code {
  font-family: var(--mono); font-weight: 700; font-size: 2.4rem; letter-spacing: .28em; padding: 14px 8px 14px 18px;
  background: var(--bg); color: #fff; border-radius: 14px; margin: 8px 0;
}
.result.ultra .card, .card.ultra { box-shadow: 0 0 0 3px var(--pink-500), 0 0 40px rgba(238,70,188,.6); }
.badge {
  display: inline-block; font-family: var(--mono); font-size: .75rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: var(--brand-300); color: var(--bg);
}
.badge.pink { background: var(--pink-500); color: #fff; }
.badge.teal { background: var(--teal-500); color: #fff; }
.badge.grey { background: var(--line); color: var(--text-2); }
.badge.warn { background: var(--warn); color: var(--bg); }

.footer { text-align: center; color: var(--brand-300); font-size: .8rem; margin-top: 26px; opacity: .8; }

/* Confettis */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: .95;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
