:root {
  --bg: #ffffff;
  --logo: #fb553c;
  --text: #25252b;
  --muted: #8a8a90;
}

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

html, body { height: 100%; overflow: hidden; background: var(--bg); }

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
}

canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.credit {
  position: fixed; left: 24px; right: 24px; bottom: 20px;
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--muted);
}
.credit { align-items: center; }
.credit a { color: var(--text); text-decoration: none; font-weight: 600; }
.credit a:hover { color: var(--logo); }

.propose {
  font: inherit; font-weight: 600; color: var(--logo);
  background: var(--bg); border: 1px solid var(--logo); border-radius: 999px;
  padding: 7px 16px; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, opacity 0.3s;
}
.propose:hover { background: var(--logo); color: #fff; }
body.is-diving .propose { opacity: 0; pointer-events: none; }

/* Proposal form, shown in the calm eye of the funnel */
.panel {
  position: fixed; inset: 0; z-index: 5;
  display: grid; place-items: center; padding: 16px;
  pointer-events: none;
}
.panel[hidden] { display: none; }
.panel-form {
  pointer-events: auto;
  width: min(380px, 100%);
  text-align: center;
  padding: 36px 28px 28px;
  border-radius: 50%;
  /* Soft white halo so the text stays readable over passing disks */
  background: radial-gradient(closest-side, #fff 72%, rgba(255, 255, 255, 0.85) 86%, rgba(255, 255, 255, 0));
  aspect-ratio: 1;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
body.is-inside .panel-form { opacity: 1; transform: none; }
.panel h2 { font-family: "Nunito", sans-serif; font-weight: 900; font-size: 24px; color: var(--text); letter-spacing: -0.01em; }
.panel-lead { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 6px 0 18px; }
.field { display: block; text-align: left; margin-top: 10px; }
.field-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field-label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.field input {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  border: 0; border-bottom: 1.5px solid #d9d9dd; background: transparent;
  padding: 6px 0; outline: none; transition: border-color 0.2s;
}
.field input:focus { border-bottom-color: var(--logo); }
.field .field-word { font-family: "Nunito", sans-serif; font-weight: 900; font-size: 26px; color: var(--logo); }
.field-hint { font-size: 12px; color: var(--muted); text-align: left; margin-top: 4px; }
.field-hint.is-ok { color: #2f9e44; }
.panel-error { min-height: 18px; font-size: 13px; color: #c92a2a; margin-top: 10px; }
.panel-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: 10px 20px;
  background: var(--logo); color: #fff; border: 1px solid var(--logo);
  transition: filter 0.2s, background-color 0.2s, color 0.2s;
}
.btn:hover { filter: brightness(0.92); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border-color: #d9d9dd; }
.btn.ghost:hover { border-color: var(--text); filter: none; }

/* Bottom-left slot: the live word's credit replaces "Démo de candidature",
   except while diving or previewing, when it would point at the wrong word. */
.origin b { color: var(--text); font-weight: 600; }
.credit-left:has(.origin:not([hidden])) .demo-label { display: none; }
body.is-diving .origin,
.toast.is-on ~ .credit .origin { display: none; }
/* More specific than the rule above, so the label comes back in those two cases. */
body.is-diving .credit-left:has(.origin) .demo-label,
.toast.is-on ~ .credit .credit-left:has(.origin) .demo-label { display: inline; }

.toast {
  position: fixed; left: 50%; bottom: 72px; transform: translate(-50%, 12px);
  background: var(--text); color: #fff; border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .credit { font-size: 11px; left: 16px; right: 16px; }
  .panel-form { aspect-ratio: auto; border-radius: 24px; background: rgba(255, 255, 255, 0.94); }
  .toast { white-space: normal; text-align: center; width: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .panel-form, .toast { transition: none; }
}
