:root{
  --bg:#ffffff;
  --card:#ffffff;
  --card2:#ffffff;
  --text:#0b0f14;
  --muted:#4a5568;
  --line:#e2e8f0;
  --primary:#2563eb;
  --danger:#dc2626;
  --chip:#f1f5f9;
  --chipOn:#dbeafe;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color:var(--text);
}

.topbar{
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  justify-content:space-between;
  padding:12px 14px;
  gap:10px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.pill{
  display:flex;
  flex-direction:column;
  padding:10px 12px;
  border-radius:14px;
  background: #ffffff;
  border:1px solid var(--line);
  min-width:140px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.pill-title{ font-weight:800; letter-spacing:.2px; }
.pill-value{ color:var(--muted); margin-top:2px; font-variant-numeric: tabular-nums; }

.container{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  max-width:920px;
  margin:0 auto;
}

.card{
  background: #ffffff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.section-title{
  font-weight:900;
  font-size:13px;
  letter-spacing:.5px;
  color:#111827;
  margin-bottom:10px;
  text-transform:uppercase;
}

.hint, .subhint, .note{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.text-icons{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:8px;
}

.icon{
  display:flex;
  align-items:center;
  justify-content:center;
  height:44px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#ffffff;
  color:#111827;
  font-weight:900;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
}
.icon.available{ cursor:pointer; }
.icon.available:hover{ box-shadow: 0 8px 18px rgba(15,23,42,0.08); }
.icon.available:active{ transform:scale(0.98); }
.icon.taken{ opacity:.45; background:#f8fafc; }
.icon.mine{ outline:2px solid rgba(37,99,235,.45); }

.reader .reader-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.timer{
  font-variant-numeric: tabular-nums;
  font-weight:900;
  color:var(--muted);
  padding:6px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#ffffff;
}

.reader-box{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:#ffffff;
  min-height:140px;
  max-height:320px; /* lecture confortable */
  -webkit-overflow-scrolling: touch;
  overflow:auto;
}

.reader-empty{ color:var(--muted); font-size:13px; padding:6px; }

.reader-content{
  white-space:pre-wrap;
  line-height:1.55;
  font-size:14px;
  color:#0b0f14;
}

.blank{
  display:inline-block;
  padding:0 8px;
  margin:0 2px;
  border-radius:999px;
  background:#f8fafc;
  border:1px dashed rgba(37,99,235,.35);
  color:#111827;
  font-weight:900;
  cursor:pointer;
  min-width:56px;
  text-align:center;
}
.blank.selected{
  outline:2px solid rgba(37,99,235,.55);
  background:#eef2ff;
}

.actions{
  display:flex;
  gap:10px;
  margin-top:10px;
}

.btn{
  flex:1;
  border:none;
  padding:12px 12px;
  border-radius:14px;
  font-weight:900;
  letter-spacing:.2px;
  color:#111827;
  background:#f8fafc;
  border:1px solid var(--line);
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active{ transform:scale(0.99); }
.btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.btn.primary{
  color:white;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border-color: rgba(37,99,235,.55);
}
.btn.danger{
  color:white;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  border-color: rgba(220,38,38,.55);
}

.ifind{ display:flex; flex-direction:column; gap:10px; }

.suspects{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px;
}
.chip{
  border:none;
  padding:10px 10px;
  border-radius:14px;
  background: var(--chip);
  border:1px solid var(--line);
  color:#111827;
  font-weight:900;
  text-align:left;
}
.chip.on{
  background: var(--chipOn);
  outline:2px solid rgba(37,99,235,.45);
}

.ifind-actions{
  display:flex;
  gap:10px;
}


.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(15,23,42,.35);
  z-index:50;
}
.modal.show{ display:flex; }
.modal-card{
  width:min(520px, 100%);
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 16px 48px rgba(15,23,42,.18);
}
.modal-title{ font-weight:900; margin-bottom:8px; color:#111827; }
.modal-body{ color:var(--muted); line-height:1.4; margin-bottom:12px; }
.modal-actions{ display:flex; gap:10px; }

/* Responsive: keep same blocks, adapt grids */
@media (max-width: 420px){
  .text-icons{ grid-template-columns: repeat(4, 1fr); }
  .suspects{ grid-template-columns: 1fr; }
  .pill{ min-width: 132px; }
}


.btn.reset{
  margin-left:10px;
  background:#fef2f2;
  color:#7f1d1d;
  border:1px solid #fecaca;
}
.btn.reset:hover{
  background:#fee2e2;
}


/* RESET JEU next to CONFIRMER */
.ifind-actions{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
}
.btn.reset{
  background:#fef2f2;
  color:#7f1d1d;
  border:1px solid #fecaca;
  white-space:nowrap;
}
.btn.reset:hover{
  background:#fee2e2;
}




/* Background image Louvre - more visible */
body{
  background:
    linear-gradient(rgba(255,255,255,0.75), rgba(255,255,255,0.85)),
    url("louvre-bg.png") center / cover no-repeat fixed;
}

/* Override blanks style: red underline + visible */
.blank{
  display:inline-block;
  padding:0 2px !important;
  margin:0 1px !important;
  background:transparent !important;
  border:none !important;
  border-bottom:2px solid #d10 !important;
  border-radius:0 !important;
  color:#d10 !important;
  font-weight:800 !important;
  letter-spacing:1px !important;
  min-width:auto !important;
}
.blank.selected{
  outline:2px solid rgba(209,16,0,.35) !important;
  outline-offset:2px !important;
}

/* Helper text under purchase buttons */
.purchase-helper{
  display:block;
  margin-top:10px;
  font-size:14px;
  color:#000000;
  opacity:1;
  text-align:left;
  background:#ffffff;
  padding:6px 8px;
  border-radius:4px;
}
.purchase-helper .blank-example{
  color:#d10;
  font-weight:700;
  border-bottom:2px solid #d10;
  padding:0 2px;
}

.modal-close{
  background:#fff;
  color:#111;
  border:1px solid rgba(0,0,0,.25);
  padding:6px 10px;
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
}
.modal-close:hover{ filter:brightness(.96); }

/* Close cross in end.html popups */
.modal-header{ position: relative; }
.modal-x{
  position:absolute;
  top:8px;
  right:92px; /* leaves room for the 'Fermer' button on the right */
  width:34px;
  height:34px;
  border:none;
  background:transparent;
  color:#111;
  font-size:22px;
  font-weight:800;
  cursor:pointer;
  line-height:34px;
  text-align:center;
}
.modal-x:hover{ filter:brightness(.85); }

/* v62: modal close buttons layout */
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.modal-actions{ display:flex; align-items:center; gap:10px; }

/* Make X button clearly visible */
.modal-x{
  position:static !important;
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.25);
  background:#fff;
  color:#111;
  font-size:20px;
  font-weight:900;
  cursor:pointer;
  line-height:34px;
}

/* v63 - force visible close buttons in end.html popups */
.modal-actions{ display:flex; align-items:center; gap:10px; }
.force-xclose{
  width:38px;
  height:38px;
  border:2px solid #111;
  border-radius:12px;
  background:#fff;
  color:#111;
  font-size:22px;
  font-weight:900;
  cursor:pointer;
  line-height:34px;
}
.force-xclose:hover{ filter:brightness(.95); }
.force-modal-footer{ margin-top:16px; text-align:right; }
.force-closebtn{
  background:#111;
  color:#fff;
  border:none;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
}
.force-closebtn:hover{ filter:brightness(.9); }


/* ---------- In-game decoder ---------- */
.decoder-grid{ display:flex; flex-direction:column; gap:10px; }
.decoder-row{ display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.decoder-col{ flex: 1 1 240px; }
.decoder-label{ display:block; font-weight:700; margin-bottom:4px; }
.decoder-textarea{ width:100%; box-sizing:border-box; resize:vertical; min-height:88px; }
.decoder-select{ width:100%; box-sizing:border-box; }
.decoder-shift-value{ font-size:12px; opacity:0.85; margin-top:2px; }
.decoder-suggestions{
  border:1px solid rgba(255,255,255,0.14);
  border-radius:12px;
  padding:10px;
  background:rgba(0,0,0,0.18);
  max-height:220px;
  overflow:auto;
  white-space:pre-wrap;
  font-size:14px;
}
.decoder-helper{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.decoder-preview{
  display:inline-block;
  padding:6px 10px;
  border-radius:10px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.btn.small{ padding:8px 10px; font-size:12px; }

/* Responsive video wrapper (16:9 par défaut) */
.videoEmbed {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.videoEmbed iframe,
.videoEmbed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Variante 4:3 si besoin */
.videoEmbed.ratio43 { aspect-ratio: 4 / 3; }

/* Petite marge si tu veux l’aérer dans le texte */
.videoBlock { margin: 16px 0; }


/* ===== 2026 refresh: cinematic dark theme ===== */
:root{
  --bg:#070b14;
  --card:rgba(15,23,42,.82);
  --card2:rgba(15,23,42,.74);
  --text:#f8fafc;
  --muted:#b8c4d6;
  --line:rgba(255,255,255,.11);
  --primary:#e50914;
  --danger:#ef4444;
  --chip:rgba(255,255,255,.06);
  --chipOn:rgba(229,9,20,.18);
}
body{
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(229,9,20,.16), transparent 60%),
    radial-gradient(900px 600px at 100% 10%, rgba(59,130,246,.12), transparent 55%),
    linear-gradient(180deg, #050810, #0b1020 58%, #070b14);
  color:var(--text);
}
.topbar{
  background:rgba(7,11,20,.78);
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(14px);
}
.pill,
.card,
.reader-box,
.timer,
.icon,
.blank,
.chip,
.modal-card{
  background:var(--card);
  color:var(--text);
  border-color:var(--line);
  box-shadow:0 12px 30px rgba(0,0,0,.18);
}
.section-title,
.pill-title,
.reader-content,
.icon,
.blank,
.chip,
.modal-title{ color:var(--text); }
.pill-value,
.hint,
.subhint,
.note,
.modal-body,
.reader-empty{ color:var(--muted); }
.btn{
  background:rgba(255,255,255,.08);
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}
.btn.primary{
  background:linear-gradient(180deg, #e50914, #b20710);
  border-color:rgba(229,9,20,.45);
}
.btn.danger{
  background:linear-gradient(180deg, #ef4444, #b91c1c);
}
.icon.available:hover,
.btn:hover,
.chip:hover{
  box-shadow:0 18px 36px rgba(0,0,0,.22);
}
.blank{ background:rgba(255,255,255,.04); }
.blank.selected,
.chip.on,
.icon.mine{
  outline:2px solid rgba(229,9,20,.46);
  background:var(--chipOn);
}
.reader-box{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
}
.modal{
  background:rgba(2,6,14,.62);
}
.modal-card{
  background:linear-gradient(180deg, rgba(11,17,32,.98), rgba(7,11,20,.98));
}
.videoEmbed{ box-shadow:0 14px 40px rgba(0,0,0,.28); }
