/* ------------------------------------------------------------------ */
/* Movie Guessr — feuille de style unique                              */
/* ------------------------------------------------------------------ */

:root {
  --ink: #08080a;
  --ink-soft: #0e0d10;
  --panel: #141316;
  --panel-2: #1a191d;
  --line: rgba(246, 241, 231, 0.11);
  --line-strong: rgba(246, 241, 231, 0.22);
  --cream: #f6f1e7;
  --cream-dim: #c9c2b6;
  --muted: #8f887d;
  --accent: #ff4d2e;
  --accent-soft: rgba(255, 77, 46, 0.14);
  --sun: #ffcf5c;
  --ok: #52d99a;
  --bad: #ff5d5d;
  --radius: 10px;
  --radius-lg: 18px;
  --font-display: "Anton", "Arial Narrow", "Haettenschweiler", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 78% -10%, rgba(255, 77, 46, 0.16), transparent 62%),
    radial-gradient(900px 700px at 8% 8%, rgba(255, 207, 92, 0.07), transparent 65%),
    radial-gradient(1400px 900px at 50% 120%, rgba(255, 255, 255, 0.04), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

input {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Layout ---------------------------------------------------------- */

.wrap {
  position: relative;
  z-index: 2;
  width: min(1180px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Header ---------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(1180px, 100% - 2.5rem);
  margin: 0 auto;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.brand span {
  color: var(--accent);
  font-style: italic;
  transform: skewX(-8deg);
  display: inline-block;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav a {
  transition: color 0.18s ease;
}

.site-nav a:hover {
  color: var(--cream);
}

.pseudo-chip {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--cream-dim);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.pseudo-chip:hover {
  border-color: var(--accent);
  color: var(--cream);
}

.pseudo-chip.has-pseudo {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.05);
}

/* Hero ------------------------------------------------------------ */

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem;
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 10.5vw, 8.6rem);
  line-height: 0.83;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.hero-title em {
  display: inline-block;
  font-style: italic;
  color: var(--accent);
  transform: skewX(-7deg);
  text-shadow: 0 0 60px rgba(255, 77, 46, 0.35);
}

.hero-lead {
  max-width: 34rem;
  margin: 1.6rem 0 0;
  color: var(--cream-dim);
  font-size: clamp(0.95rem, 1.1vw, 1.06rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.hero-note {
  margin: 1.4rem 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Boutons --------------------------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--cream);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-border: var(--accent);
  --btn-fg: #140603;
  box-shadow: 0 16px 40px -18px rgba(255, 77, 46, 0.85);
}

.btn-primary:hover {
  --btn-bg: #ff6247;
  box-shadow: 0 20px 44px -18px rgba(255, 77, 46, 0.95);
}

.btn-ghost:hover {
  --btn-border: var(--cream);
  background: rgba(255, 255, 255, 0.04);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--cream-dim);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.link-btn:hover {
  color: var(--cream);
  border-color: currentColor;
}

.icon-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
  color: var(--cream);
  border-color: var(--cream-dim);
}

/* Collage hero ---------------------------------------------------- */

.hero-collage {
  position: relative;
  aspect-ratio: 1 / 0.86;
  min-height: 280px;
}

.hero-collage figure {
  position: absolute;
  margin: 0;
  border: 1px solid rgba(246, 241, 231, 0.18);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.hero-collage figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.05);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-collage figure img.is-loaded {
  opacity: 1;
}

.hero-collage figure:nth-child(1) {
  width: 62%;
  aspect-ratio: 16 / 10;
  top: 0;
  left: 0;
  transform: rotate(-4.5deg);
  z-index: 3;
}

.hero-collage figure:nth-child(2) {
  width: 48%;
  aspect-ratio: 3 / 4;
  right: 2%;
  top: 12%;
  transform: rotate(5deg);
  z-index: 2;
}

.hero-collage figure:nth-child(3) {
  width: 52%;
  aspect-ratio: 16 / 9;
  bottom: 2%;
  left: 22%;
  transform: rotate(-1.5deg);
  z-index: 4;
}

.hero-collage::after {
  content: "";
  position: absolute;
  inset: -20% -10%;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(closest-side, transparent 55%, var(--ink) 100%);
}

.hero-collage .collage-badge {
  position: absolute;
  z-index: 6;
  bottom: 8%;
  right: 4%;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  transform: rotate(-2deg);
}

/* Sections -------------------------------------------------------- */

section {
  scroll-margin-top: 2rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.8rem;
}

.section-head h2,
.block-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.tag--accent {
  border-color: rgba(255, 77, 46, 0.5);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Règles ---------------------------------------------------------- */

.rules {
  padding: 1.5rem 0 clamp(3rem, 6vw, 5rem);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rule {
  background: var(--ink-soft);
  padding: 1.6rem 1.4rem 1.7rem;
  position: relative;
}

.rule strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.rule h3 {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Modes ----------------------------------------------------------- */

.modes {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.1rem;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel), var(--ink-soft));
  overflow: hidden;
}

.mode-card--daily {
  background:
    radial-gradient(500px 240px at 100% 0%, rgba(255, 77, 46, 0.2), transparent 70%),
    linear-gradient(160deg, #17130f, #0c0b0d);
  border-color: rgba(255, 77, 46, 0.28);
}

.mode-card h3 {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 24ch;
}

.mode-card p {
  margin: 0;
  color: var(--cream-dim);
  font-size: 0.9rem;
  max-width: 40ch;
}

.mode-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mode-date {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mode-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.mode-meta li::before {
  content: "— ";
  color: var(--accent);
}

.mode-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.mode-card .btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

/* Classement ------------------------------------------------------ */

.board {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-soft);
}

.tab {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab:hover {
  color: var(--cream);
}

.tab.is-active {
  background: var(--cream);
  color: #0a0908;
  font-weight: 600;
}

.board-table {
  border-top: 1px solid var(--line);
}

.board-row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) 6rem 4.5rem;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.board-row--head {
  padding-block: 0.6rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.board-rank {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--muted);
}

.board-row:nth-child(2) .board-rank {
  color: var(--sun);
}

.board-row:nth-child(3) .board-rank {
  color: var(--cream-dim);
}

.board-row:nth-child(4) .board-rank {
  color: #d9905e;
}

.board-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.board-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-score {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  text-align: right;
}

.board-detail {
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
}

.board-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.board-empty strong {
  display: block;
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* Proposition ----------------------------------------------------- */

.propose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 2.5rem;
  align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
}

.propose-copy h2 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  text-transform: uppercase;
  line-height: 1;
}

.propose-copy p {
  margin: 0 0 1.2rem;
  color: var(--cream-dim);
  max-width: 46ch;
}

.propose-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.propose-list li {
  display: flex;
  gap: 0.6rem;
}

.propose-list li::before {
  content: "→";
  color: var(--accent);
}

.propose-form {
  display: grid;
  gap: 0.9rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.propose-form label {
  display: grid;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="text"],
input:not([type]) {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--cream);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-status {
  margin: 0;
  min-height: 1.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-status.is-ok {
  color: var(--ok);
}

.form-status.is-error {
  color: var(--bad);
}

.proposal-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-soft);
}

.proposal-card img {
  width: 58px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 5px;
  background: #000;
}

.proposal-card strong {
  display: block;
  font-size: 0.95rem;
}

.proposal-card span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Footer ---------------------------------------------------------- */

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100% - 2.5rem);
  margin: 0 auto;
  padding: 2rem 0 2.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  max-width: 52ch;
}

.site-footer a {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}

.site-footer a:hover {
  color: var(--cream);
  border-color: var(--cream);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

/* Toast + dialog -------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 200;
  transform: translate(-50%, 1rem);
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 17, 20, 0.95);
  backdrop-filter: blur(10px);
  color: var(--cream);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-bad {
  border-color: rgba(255, 93, 93, 0.5);
}

.toast.is-ok {
  border-color: rgba(82, 217, 154, 0.5);
}

dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--cream);
  padding: 1.8rem;
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(6px);
}

dialog h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

dialog p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.dialog-form {
  display: grid;
  gap: 0.9rem;
}

.dialog-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ------------------------------------------------------------------ */
/* Page de jeu                                                         */
/* ------------------------------------------------------------------ */

.play {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #050506;
}

.play-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 6, 0.85);
  backdrop-filter: blur(12px);
}

.play-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: auto;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.play-meta strong {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.pill {
  border: 1px solid var(--line-strong);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
}

.pill--daily {
  border-color: rgba(255, 77, 46, 0.55);
  color: var(--accent);
}

.stage {
  position: relative;
  z-index: 5;
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.8rem) clamp(1rem, 3vw, 2rem) 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tries {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tries-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cream);
  opacity: 0.9;
  transition: background 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.tries-dot.is-spent {
  background: var(--line-strong);
  opacity: 1;
  transform: scale(0.7);
}

.timer {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  height: 14px;
}

.timer-track {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.timer-bar {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--sun));
  transition: transform 0.25s linear, background 0.3s ease;
}

.timer-text {
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--cream-dim);
  min-width: 2.2ch;
  text-align: right;
}

.timer.is-low .timer-bar {
  background: var(--bad);
}

.timer.is-low .timer-text {
  color: var(--bad);
}

.frame {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 58vh;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 1);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 0.55s ease, transform 1.4s ease;
}

.frame img.is-visible {
  opacity: 1;
  transform: scale(1);
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 18%, transparent 78%, rgba(0, 0, 0, 0.65)),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

.frame-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  background: #0a0a0b;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.frame-loader[hidden] {
  display: none;
}

.frame-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(246, 241, 231, 0.7);
}

.frame.is-shaking {
  animation: shake 0.42s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.thumbs {
  display: flex;
  gap: 0.5rem;
  min-height: 0;
}

.thumbs:empty {
  display: none;
}

.thumb {
  position: relative;
  width: 84px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  padding: 0;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.is-current {
  opacity: 1;
  border-color: var(--accent);
}

.thumb:hover {
  opacity: 1;
}

.guess {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.guess-field {
  position: relative;
  display: flex;
  gap: 0.55rem;
}

.guess-field input {
  flex: 1;
  height: 3.25rem;
  padding: 0 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #0d0d0f;
  color: var(--cream);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.guess-field input::placeholder {
  color: #6b665e;
}

.guess-field .btn {
  height: 3.25rem;
  padding-inline: 1.8rem;
}

.suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 9.5rem;
  top: calc(100% + 0.35rem);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #121114;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 15rem;
  overflow: auto;
}

.suggest li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.suggest li small {
  color: var(--muted);
  font-size: 0.78rem;
}

.suggest li[aria-selected="true"],
.suggest li:hover {
  background: rgba(255, 255, 255, 0.08);
}

.suggest .suggest-empty {
  color: var(--muted);
  font-size: 0.82rem;
  cursor: default;
}

.guess-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hint {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Flash ----------------------------------------------------------- */

.flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: var(--ok);
  opacity: 0;
}

.flash.is-on {
  animation: flash 0.6s ease;
}

.flash.is-bad {
  background: var(--bad);
}

@keyframes flash {
  0% { opacity: 0; }
  18% { opacity: 0.16; }
  100% { opacity: 0; }
}

/* Révélation ------------------------------------------------------ */

.reveal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(4, 4, 6, 0.86);
  backdrop-filter: blur(8px);
  animation: fade 0.25s ease;
}

.reveal[hidden],
.results[hidden] {
  display: none;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: center;
  width: min(720px, 100%);
  padding: 1.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(255, 77, 46, 0.14), transparent 70%),
    linear-gradient(160deg, #17161a, #0c0b0e);
  box-shadow: var(--shadow);
  animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.reveal-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}

.reveal-poster:empty {
  display: none;
}

.reveal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reveal-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.reveal-kicker.is-bad {
  color: var(--bad);
}

.reveal-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1;
  text-transform: uppercase;
}

.reveal-meta {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.reveal-points {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--ok);
  letter-spacing: 0.03em;
}

.reveal-points.is-zero {
  color: var(--bad);
}

.reveal-points small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.4rem;
}

.reveal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Résultats ------------------------------------------------------- */

.results {
  position: fixed;
  inset: 0;
  z-index: 110;
  overflow-y: auto;
  padding: clamp(1.2rem, 4vw, 3rem) 1.2rem;
  background:
    radial-gradient(700px 400px at 50% -10%, rgba(255, 77, 46, 0.18), transparent 70%),
    #08080a;
  animation: fade 0.3s ease;
}

.results-inner {
  width: min(680px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.4rem;
}

.results-head {
  text-align: center;
}

.results-head p {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.results-score {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.6rem, 12vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
}

.results-score span {
  font-size: 0.28em;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.results-sub {
  margin: 0.5rem 0 0;
  color: var(--cream-dim);
  font-size: 0.88rem;
}

.results-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: var(--ink-soft);
}

.result-row img,
.result-row .poster-fallback {
  width: 46px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  background: #000;
}

.result-row .result-name {
  min-width: 0;
}

.result-row strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row span {
  font-size: 0.76rem;
  color: var(--muted);
}

.result-points {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-align: right;
}

.result-points.is-zero {
  color: var(--muted);
}

.result-points.is-full {
  color: var(--ok);
}

.results-save {
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.results-save p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.save-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.save-row input {
  flex: 1;
  min-width: 10rem;
  height: 2.8rem;
  padding: 0 1rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--cream);
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.results-actions .btn {
  padding: 0.8rem 1.3rem;
}

/* Erreur de chargement -------------------------------------------- */

.stage-error {
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.stage-error strong {
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Responsive ------------------------------------------------------ */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-collage {
    order: -1;
    aspect-ratio: 16 / 10;
    max-height: 42vh;
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-grid,
  .propose {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 680px) {
  .site-header {
    gap: 0.9rem;
    padding: 1rem 0;
  }

  .pseudo-chip {
    padding: 0.4rem 0.7rem;
    font-size: 0.64rem;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .hero-collage {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .hero-actions .btn {
    flex: 1;
    padding-inline: 1rem;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .board-row {
    grid-template-columns: 2.4rem minmax(0, 1fr) 4.6rem;
    gap: 0.6rem;
  }

  .board-detail {
    display: none;
  }

  .play-header {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  .play-meta {
    gap: 0.8rem;
    font-size: 0.64rem;
  }

  .stage {
    padding: 0.8rem 0.8rem 1.4rem;
  }

  .frame {
    aspect-ratio: 4 / 3;
    max-height: 46vh;
  }

  .guess-field {
    flex-wrap: wrap;
  }

  .guess-field input {
    height: 3rem;
  }

  .guess-field .btn {
    width: 100%;
    height: 2.9rem;
  }

  .suggest {
    right: 0;
    top: calc(100% + 0.35rem);
  }

  .reveal-card {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 1.2rem;
    max-height: 92dvh;
    overflow-y: auto;
  }

  .reveal-poster {
    width: 118px;
  }

  .thumb {
    width: 68px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
