/* ============================================================
   QuizzBar — Design system commun
   Theme pub : charbon chaud, accent ambre, boutons tactiles.
   ============================================================ */

:root {
  /* Couleurs de marque */
  --brand: #e6a019;       /* ambre */
  --brand-2: #9b4d16;     /* cuivre */
  --brand-ink: #1b160f;   /* texte fonce sur fond ambre */
  --ink: #f2eee5;         /* creme */
  --ink-soft: #cbc4b6;
  --muted: #8f8779;

  /* Surfaces */
  --card: #1e1a15;
  --card-strong: #2a241c;
  --border: rgba(255, 255, 255, 0.085);

  /* Les 4 couleurs/formes de réponse (partagées mobile <-> projection) */
  --c-a: #d8423c; /* triangle */
  --c-b: #2f7ccb; /* losange  */
  --c-c: #e3a017; /* rond     */
  --c-d: #3a9d57; /* carré    */

  /* États */
  --good: #44a248;
  --bad: #d8423c;

  --radius: 8px;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 34%),
    #16130f;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Vignette discrete pour la profondeur, sans effet lumineux. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.24));
  pointer-events: none;
  z-index: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  color: inherit;
}

a {
  color: inherit;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ---------- Composants génériques ---------- */
.brand-logo {
  font-weight: 900;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.78rem;
  line-height: 1;
}
.brand-logo .dot {
  color: var(--brand);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--card-strong);
  border: 1px solid var(--border);
  transition: transform 0.12s ease, filter 0.2s ease, background 0.2s;
  user-select: none;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
}
.btn-primary:hover {
  background: #f0ad29;
  filter: none;
}
.btn-ghost {
  background: transparent;
}
.btn-danger {
  background: var(--bad);
  border: none;
}
.btn-lg {
  padding: 22px 30px;
  font-size: 1.3rem;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  outline: none;
  width: 100%;
  transition: border 0.2s, background 0.2s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-2);
  background: rgba(0, 0, 0, 0.35);
}
select option {
  color: #111;
}

.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.hidden {
  display: none !important;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Formes de réponse ---------- */
.shape {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}
.ans-a {
  background: var(--c-a);
}
.ans-b {
  background: var(--c-b);
}
.ans-c {
  background: var(--c-c);
}
.ans-d {
  background: var(--c-d);
}

/* ============================================================
   PAGE D'ACCUEIL
   ============================================================ */
.home {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.home-hero {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.home-logo {
  font-size: 2.4rem;
}
.home-tag {
  margin: 0;
  font-size: 1.05rem;
}
.join-card {
  width: 100%;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.join-title {
  font-size: 2rem;
  margin: 0;
}
.join-card .muted {
  margin: 0;
}
.pin-input {
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0;
  font-weight: 800;
  padding: 18px;
}
.host-link {
  margin-top: 6px;
  font-weight: 700;
  text-decoration: none;
}
.host-link:hover {
  color: var(--ink);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes floatUp {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
@keyframes spinIn {
  from {
    transform: rotate(-8deg) scale(0.9);
    opacity: 0;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}
.anim-pop {
  animation: pop 0.35s ease both;
}
.anim-float {
  animation: floatUp 0.4s ease both;
}

.status-mark {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  height: 72px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  color: var(--brand);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}
.status-mark.large {
  min-width: 96px;
  height: 96px;
  font-size: 2rem;
}

/* Reactions flottantes */
.reaction-float {
  position: fixed;
  bottom: 10%;
  min-width: 58px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  border: 2px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  z-index: 50;
  animation: reactionRise 2.4s ease-out forwards;
}
@keyframes reactionRise {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(-10px) scale(1.1);
  }
  100% {
    transform: translateY(-60vh) scale(1) rotate(15deg);
    opacity: 0;
  }
}

/* Confettis (podium) */
.confetti {
  position: fixed;
  top: -10vh;
  width: 12px;
  height: 18px;
  z-index: 40;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to {
    transform: translateY(120vh) rotate(720deg);
    opacity: 0.8;
  }
}

/* ============================================================
   Passe style v2 - plus chaleureux, plus bar, moins outil brut
   ============================================================ */
:root {
  --brand: #f3b43f;
  --brand-2: #1f8a70;
  --card: #211d17;
  --card-strong: #30271d;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 18px),
    #16120d;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 32%), var(--card);
  border-color: var(--border);
}

.btn {
  min-height: 44px;
}

.btn-primary {
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(243, 180, 63, 0.18);
}

input,
textarea,
select {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(255, 255, 255, 0.14);
}

.reaction-float {
  width: 86px;
  height: 86px;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8e7;
  color: #1b160f;
  border: 4px solid var(--brand);
  font-size: 3.1rem;
  line-height: 1;
}
