/* Devine le Groupe — skin brutaliste par-dessus zikof-theme.css */
.dlg-main { max-width: 640px; margin: 0 auto; padding: 16px; }
.dlg-screen.hidden, .hidden { display: none !important; }
.dlg-title { font-family: var(--font-display, 'Anton', sans-serif); font-size: clamp(2rem, 8vw, 3.2rem); margin: .2em 0 .1em; line-height: 1; }
.dlg-sub { color: var(--soft); margin: 0 0 .6em; }
.dlg-streak { display: inline-block; font-weight: 800; font-size: .95rem; margin: 0 0 1em;
  padding: 6px 12px; border: 3px solid var(--ink); border-radius: 999px; background: var(--yellow); color: #15131c;
  box-shadow: 3px 3px 0 var(--ink); }

.dlg-genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-genre { padding: 18px 12px; border: 3px solid var(--ink); border-radius: 14px; background: var(--surf);
  color: var(--ink); font-weight: 800; font-size: 1.05rem; cursor: pointer; box-shadow: 5px 5px 0 var(--ink);
  transition: transform .05s, box-shadow .05s; line-height: 1.2; }
.dlg-genre:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--ink); }
.dlg-genre--global { grid-column: 1 / -1; background: var(--yellow); color: #15131c; }
.dlg-genre small { display: block; font-weight: 600; font-size: .8rem; opacity: .75; margin-top: 2px; }
.dlg-rules-link { text-align: center; margin-top: 18px; }
.dlg-rules-link a { color: var(--soft); }

.dlg-game-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dlg-game-title { font-family: var(--font-display, 'Anton', sans-serif); font-size: 2rem; margin: .2em 0; }
.dlg-tries { font-weight: 800; white-space: nowrap; }

.dlg-image-wrap { text-align: center; margin: 10px 0; }
#dlg-image { max-width: 220px; width: 60%; border: 3px solid var(--ink); border-radius: 12px; transition: filter .3s; }

.dlg-input-row { position: relative; display: flex; gap: 8px; margin: 12px 0 6px; }
.dlg-input-row input { flex: 1; min-width: 0; padding: 12px; border: 3px solid var(--ink); border-radius: 10px;
  font-size: 1rem; background: var(--surf); color: var(--ink); }
.dlg-input-row .zk-btn { white-space: nowrap; }
.dlg-suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; list-style: none; margin: 4px 0 0; padding: 0;
  background: var(--surf); border: 3px solid var(--ink); border-radius: 10px; max-height: 240px; overflow: auto; }
.dlg-suggestions:empty { display: none; }
.dlg-suggestions li { padding: 10px 12px; cursor: pointer; }
.dlg-suggestions li + li { border-top: 1px solid var(--ink); }
.dlg-suggestions li:hover, .dlg-suggestions li[aria-selected="true"] { background: var(--yellow); color: #15131c; }

.dlg-legend { font-size: .72rem; color: var(--soft); margin: 4px 0 10px; }

/* Une carte par essai : tête (photo ronde + nom) puis 6 cases libellées en grille 3 colonnes. */
.dlg-rows { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.dlg-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dlg-row-photo { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; flex: none; }
.dlg-row-name { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.dlg-row-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dlg-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
  padding: 11px 4px; border: 2px solid var(--ink); border-radius: 10px; min-height: 72px; line-height: 1.12; word-break: break-word; }
.dlg-cell-label { font-size: .8rem; font-weight: 800; opacity: .85; }
.dlg-cell-val { font-weight: 800; font-size: 1.08rem; }
.dlg-cell--ok { background: var(--green, #57e35f); color: #15131c;
  animation: dlg-pop-ok .55s cubic-bezier(.34, 1.56, .64, 1) both; }
/* "pop" + halo vert quand une case tombe juste */
@keyframes dlg-pop-ok {
  0%   { transform: scale(.5);  box-shadow: 0 0 0 0 rgba(87, 227, 95, 0); }
  50%  { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(87, 227, 95, .55); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(87, 227, 95, 0); }
}
@media (prefers-reduced-motion: reduce) { .dlg-cell--ok { animation: none; } }
.dlg-cell--no { background: #e7e1ee; color: #15131c; }
.dlg-cell--up .dlg-cell-val::after { content: ' ⬆'; }
.dlg-cell--down .dlg-cell-val::after { content: ' ⬇'; }
.dlg-cell--up, .dlg-cell--down { background: var(--yellow); color: #15131c; }
.dlg-cell--na { background: var(--surf); color: var(--soft); }

/* Écran de fin en pop-in (modale centrée) */
.dlg-result { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(8, 6, 16, .66); animation: dlg-fade .2s ease; }
.dlg-modal { position: relative; background: var(--surf); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink); padding: 26px 20px 20px; max-width: 460px; width: 100%; max-height: 88vh; overflow: auto;
  display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center;
  animation: dlg-popin .3s cubic-bezier(.34, 1.56, .64, 1); }
.dlg-modal-close { position: absolute; top: 6px; right: 12px; background: none; border: none; font-size: 1.9rem;
  line-height: 1; color: var(--soft); cursor: pointer; padding: 4px; }
.dlg-countdown { font-weight: 800; font-size: .95rem; color: var(--soft); margin: -4px 0 2px; }
.dlg-countdown.hidden { display: none; }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-popin { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.dlg-result-text, #dlg-result-text { font-weight: 800; font-size: 1.05rem; }
.dlg-result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dlg-link { color: var(--soft); }

@keyframes dlg-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.shake { animation: dlg-shake .3s; border-color: var(--pink) !important; }

@media (max-width: 380px) {
  .dlg-cell { min-height: 64px; padding: 9px 2px; }
  .dlg-cell-label { font-size: .7rem; }
  .dlg-cell-val { font-size: .94rem; }
}

/* Mobile : la liste passe DANS le flux (aucune superposition — le clavier ne peut plus la masquer) */
@media (max-width: 640px) {
  .dlg-input-row { flex-wrap: wrap; }
  .dlg-input-row .zk-btn { flex: 1; }
  .dlg-suggestions { position: static; max-height: 40vh; margin-top: 8px; }
}

/* 💡 Fait marquant à la découverte */
.dlg-result-fact { margin: 10px 0 0; font-size: .95rem; line-height: 1.4; color: var(--soft); }

/* ===== Thème Rennes Musique (refonte UI/UX — août 2026) ===== */
:root, .dlg-main {
  --rm-violet: #9333ea;
  --rm-violet-deep: #7e22ce;
  --rm-pink: #ec4899;
  --rm-amber: #fbbf24;
  --rm-bg: #0a0a0a;
  --rm-card: #16161f;
  --rm-text: #fafafa;
  --rm-soft: #9ca3af;
}
.dlg-main {
  background: radial-gradient(1200px 600px at 50% -10%, #22143a 0%, var(--rm-bg) 55%);
  color: var(--rm-text); border-radius: 24px; padding: 20px 16px;
}
.dlg-title, .dlg-game-title {
  /* Style moderne : couleur unie, pas de dégradé */
  color: var(--rm-text);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: .2em 0 .15em;
}
.dlg-title em, .dlg-game-title em {
  font-style: normal;
  color: var(--rm-violet);
}
.dlg-game-head {
  position: relative;
  padding-bottom: 10px;
}
.dlg-game-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42px;
  height: 3px;
  border-radius: 999px;
  background: var(--rm-violet);
}
.dlg-sub { color: var(--rm-soft); }
.dlg-streak {
  border: none; border-radius: 999px;
  background: linear-gradient(90deg, var(--rm-amber), #f59e0b); color: #1a1206;
  box-shadow: 0 4px 16px rgba(251,191,36,.35);
}
.dlg-input-row input {
  border-radius: 12px; border: 2px solid #333; background: var(--rm-card); color: var(--rm-text);
  transition: border-color .15s, box-shadow .15s;
}
.dlg-input-row input:focus { outline: none; border-color: var(--rm-violet); box-shadow: 0 0 0 3px rgba(147,51,234,.25); }
.dlg-suggestions { border-radius: 12px; border: 2px solid #333; background: var(--rm-card); }
.dlg-suggestions li { border-radius: 8px; margin: 4px 6px; padding: 9px 12px; }
.dlg-suggestions li + li { border-top: none; }
.dlg-suggestions li:hover { background: linear-gradient(90deg, rgba(147,51,234,.25), rgba(236,72,153,.25)); color: var(--rm-text); }
.dlg-rows { gap: 12px; }
.dlg-row { border-radius: 14px; background: var(--rm-card); border: 1px solid #26263a; overflow: hidden; }
.dlg-row-head { padding: 10px 12px; background: linear-gradient(90deg, rgba(147,51,234,.18), rgba(236,72,153,.12)); }
.dlg-row-name { color: var(--rm-text); }
.dlg-cell { border-radius: 8px; background: #22222e; color: var(--rm-text); }
.dlg-cell--ok { background: var(--green, #57e35f); color: #15131c; }
.dlg-cell--up, .dlg-cell--down { background: var(--yellow, #ffd600); color: #15131c; }
.dlg-cell--na { background: #22222e; color: var(--rm-soft); }
.dlg-cell--no { background: #e7e1ee; color: #15131c; }
.zk-btn {
  border-radius: 12px; border: none;
  background: linear-gradient(90deg, var(--rm-violet), var(--rm-pink)); color: #fff; font-weight: 800;
  box-shadow: 0 4px 16px rgba(147,51,234,.35);
}
.dlg-modal { border-radius: 20px; border: 1px solid #333; background: var(--rm-card); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.dlg-result-fact { color: var(--rm-soft); border-left: 3px solid var(--rm-pink); padding-left: 10px; }

/* ===== La fresque des projets (graphe des liens) ===== */
.dlg-fresque-toggle { width: 100%; margin: 14px 0 4px; padding: 12px; font-size: 1rem; }
.dlg-fresque { margin-top: 8px; background: var(--rm-card); border: 1px solid #26263a; border-radius: 16px; padding: 10px; }
.dlg-fresque svg { width: 100%; height: auto; display: block; }
.dlg-fresque-edge { stroke: rgba(147,51,234,.45); stroke-width: 1.5; }
.dlg-fresque-node { fill: #1c1c26; stroke: var(--rm-violet); stroke-width: 2; }
.dlg-fresque-node--linked { stroke: var(--rm-pink); stroke-width: 2.5; }
.dlg-fresque-label { fill: #cbd5e1; font-size: 11px; pointer-events: none; }

/* Lien Rennes Musique */
.dlg-rm-line { font-size: .85rem; color: var(--rm-soft); margin: 0 0 10px; }
.dlg-rm-line a { color: var(--rm-pink); font-weight: 800; text-decoration: none; }
.dlg-rm-line a:hover { text-decoration: underline; }

/* Fresque : défilement horizontal sur mobile (labels toujours lisibles) */
.dlg-fresque { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dlg-fresque svg { min-width: 760px; }
.dlg-fresque-label { font-size: 12.5px; font-weight: 600; }

/* Note sous la fresque */
.dlg-fresque-note { margin: 8px 4px 4px; font-size: .85rem; color: var(--rm-soft); }

/* ===== Fresque v2 : graphe sans texte + panneau + liste ===== */
.dlg-fresque svg { min-width: 0 !important; width: 100%; height: auto; }
.dlg-fresque-label { display: none; }
.dlg-fresque-info {
  margin: 10px 6px 4px; padding: 10px 12px; border-radius: 12px;
  background: #1f1f2b; border: 1px solid var(--rm-violet); color: var(--rm-text);
  font-size: .95rem; min-height: 44px;
}
.f-meta { color: var(--rm-soft); font-size: .85rem; margin-left: 6px; }
.f-link { margin: 5px 0 0 8px; font-size: .9rem; color: var(--rm-pink); }
.dlg-fresque-list { margin: 8px 6px 4px; display: grid; gap: 6px; }
.dlg-fresque-item {
  font-size: .88rem; padding: 8px 10px; border-radius: 10px;
  background: #1c1c26; border: 1px solid #2a2a3a; line-height: 1.4;
}
.f-from { color: var(--rm-text); font-weight: 700; }
.f-to { color: var(--rm-violet); font-weight: 700; }
.f-arrow { color: var(--rm-pink); font-weight: 800; }
.f-label { color: var(--rm-soft); }
