/* ============================================================
   Devine le jeu — style Zikof (Memphis pop sobre)
   ============================================================ */
:root {
  --bg: #17151f;
  --bg-soft: #211e2c;
  --ink: #f5f1e6;          /* crème */
  --line: #0c0b12;         /* contour noir */
  --blue: #2B2BFF;
  --pink: #FF5DA2;
  --yellow: #FFD23F;
  --green: #57E35F;
  --muted: #9b97a8;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--line);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* ---- Header ---- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.home {
  color: var(--ink); text-decoration: none; font-weight: 700;
  background: var(--bg-soft); border: 3px solid var(--line);
  border-radius: 12px; padding: 6px 12px; box-shadow: var(--shadow);
}
.title {
  font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; margin: 0;
  text-align: center; line-height: 1.05;
}
.title b { color: var(--yellow); }
.daily-pill {
  font-size: .72rem; font-weight: 700; color: var(--bg);
  background: var(--green); border: 3px solid var(--line);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

/* ---- Carte mystère ---- */
.mystery {
  background: var(--bg-soft);
  border: 4px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 16px;
}
.mystery-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.attempt-dots { display: flex; gap: 6px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--line); background: var(--bg);
}
.dot.used { background: var(--pink); }
.dot.current { background: var(--yellow); }
.score-now { font-weight: 900; color: var(--yellow); font-size: 1.1rem; }

/* ---- Indices ---- */
.clues { display: flex; flex-direction: column; gap: 10px; }
.clue {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg);
  border: 3px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.clue .ic {
  flex: 0 0 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.2rem;
  border: 3px solid var(--line);
}
.clue:nth-child(5n+1) .ic { background: var(--blue); }
.clue:nth-child(5n+2) .ic { background: var(--pink); }
.clue:nth-child(5n+3) .ic { background: var(--yellow); }
.clue:nth-child(5n+4) .ic { background: var(--green); }
.clue:nth-child(5n+5) .ic { background: var(--pink); }
.clue .label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.clue .val { font-weight: 700; font-size: .98rem; line-height: 1.2; }

/* indice screenshot flouté */
.shot-clue { flex-direction: column; align-items: stretch; }
.shots-row { display: flex; gap: 8px; width: 100%; }
.shots-row .shot-frame { flex: 1 1 0; min-width: 0; }
.shot-frame {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: 10px; overflow: hidden; border: 3px solid var(--line);
  background: linear-gradient(135deg, var(--blue), var(--pink));
}
.shot-frame img { width: 100%; height: 100%; object-fit: cover; filter: blur(11px) saturate(1.2); transform: scale(1.1); }
.shot-frame.reveal img { filter: none; transform: none; transition: filter .6s, transform .6s; }
.shot-frame .noimg {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.4rem; color: rgba(255,255,255,.85);
}

/* ---- Saisie ---- */
.guess-zone { position: relative; margin-top: 16px; }
.guess-input {
  width: 100%; padding: 14px 16px; font-size: 1rem; font-weight: 700;
  color: var(--ink); background: var(--bg);
  border: 4px solid var(--line); border-radius: 14px; outline: none;
}
.guess-input:focus { border-color: var(--blue); }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--bg-soft); border: 3px solid var(--line); border-radius: 12px;
  margin-top: 6px; max-height: 230px; overflow-y: auto; box-shadow: var(--shadow);
}
.suggest:empty { display: none; }
.suggest-item {
  padding: 11px 14px; cursor: pointer; font-weight: 700;
  border-bottom: 2px solid var(--line);
  display: flex; justify-content: space-between; gap: 8px;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: var(--blue); }
.suggest-item .yr { color: var(--muted); font-weight: 600; }

/* ---- Boutons ---- */
.btn {
  width: 100%; border: 4px solid var(--line); border-radius: 16px;
  padding: 15px; font-weight: 900; font-size: 1.05rem; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .08s;
  color: var(--line);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.btn-primary { background: var(--green); }
.btn-blue { background: var(--blue); color: var(--ink); }
.btn-yellow { background: var(--yellow); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.actions-row { display: flex; gap: 10px; }
.actions-row .btn { width: auto; flex: 1; }

/* ---- Feedback ---- */
.toast {
  text-align: center; font-weight: 800; margin-top: 12px; min-height: 22px;
}
.toast.wrong { color: var(--pink); }
.toast.skip { color: var(--muted); }

/* ---- Résultat ---- */
.result { text-align: center; }
.result .verdict { font-size: 1.8rem; font-weight: 900; margin: 4px 0; }
.result .verdict.win { color: var(--green); }
.result .verdict.lose { color: var(--pink); }
.answer-card {
  background: var(--bg-soft); border: 4px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 16px 0;
}
.answer-cover {
  width: 100%; aspect-ratio: 16/9; border-radius: 12px; border: 3px solid var(--line);
  object-fit: cover; background: linear-gradient(135deg, var(--blue), var(--pink));
  display: grid; place-items: center; font-size: 3rem;
}
.answer-name { font-size: 1.3rem; font-weight: 900; margin: 12px 0 4px; }
.answer-meta { color: var(--muted); font-weight: 600; font-size: .9rem; }
.stat-row { display: flex; justify-content: center; gap: 22px; margin: 16px 0; }
.stat { text-align: center; }
.stat .n { font-size: 1.7rem; font-weight: 900; color: var(--yellow); }
.stat .l { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.emoji-grid { font-size: 1.4rem; letter-spacing: 4px; margin: 8px 0 4px; }

/* ---- Attribution ---- */
.attribution {
  text-align: center; margin-top: 28px; font-size: .72rem; color: var(--muted);
}
.attribution a { color: var(--muted); }

.hidden { display: none !important; }

/* ---- Mise en page large + i18n ---- */
.wrap {
  max-width: 820px;
  padding: 20px 24px 56px;
}
.top-actions { display:flex; align-items:center; gap:8px; }
.lang-toggle {
  min-width: 44px;
  padding: 5px 9px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--line);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
}
.lang-toggle:active { transform: translate(2px,2px); box-shadow:1px 1px 0 var(--line); }

@media (min-width: 760px) {
  .title { font-size: 1.85rem; }
  .mystery { padding: 24px; }
  .clues { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .clue { min-height:76px; }
  .shot-clue { grid-column:1 / -1; }
  .guess-input { padding:17px 18px; font-size:1.08rem; }
  .actions > .btn-primary { max-width: 420px; margin-inline:auto; }
  .actions-row { max-width: 620px; width:100%; margin-inline:auto; }
  .answer-card { max-width: 680px; margin-inline:auto; }
}

@media (max-width: 759px) {
  .wrap { max-width: 540px; padding:16px 16px 48px; }
  .top { gap:8px; }
  .title { font-size:1.35rem; }
  .top-actions { gap:5px; }
  .daily-pill { padding-inline:7px; }
  .lang-toggle { min-width:40px; padding:4px 7px; }
}

@media (max-width: 420px) {
  .actions-row { flex-direction:column; }
  .actions-row .btn { width:100%; }
  .title { font-size:1.2rem; }
  .daily-pill { font-size:.65rem; }
}
