/* Cineco — thèmes de la communauté, fond d'écran personnel, pages « Proposer un thème » et « Thèmes » (admin).
   Les couleurs d'un thème arrivent par des variables (--cx-*) posées sur <body>, validées côté serveur. */

/* Décor isolé : iframe plein écran, derrière les messages, qui ne reçoit jamais les clics */
.th-ext { background: #0d1117; }
.th-ext .th-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; color-scheme: dark; }
.th-ext img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th-veil { position: absolute; inset: 0; background: #05070a; pointer-events: none; }
.thp-prev .th-ext .th-frame { width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; }

/* Fond d'écran personnel : au-dessus du décor du thème, toujours voilé pour la lisibilité */
.th-wall { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; pointer-events: none; animation: th-wall-in .7s ease both; transition: opacity .7s ease; }
.th-wall .th-veil { opacity: .38; }
.th-wall.out { opacity: 0; }
@keyframes th-wall-in { from { opacity: 0; } }

/* Bulles, en-tête et barre d'écriture d'un thème de la communauté */
.chat-th-ext .th-top { background: var(--cx-hd, rgba(14, 17, 22, .62)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.chat-th-ext .msg.mine {
  color: var(--cx-tm, inherit); background: var(--cx-bm, rgba(203, 213, 223, .26));
  border-radius: var(--cx-r, 22px) var(--cx-r, 22px) 6px var(--cx-r, 22px);
  box-shadow: 0 0 22px -6px color-mix(in srgb, var(--cx-ac, #b8c4d0) calc(var(--cx-halo, .2) * 100%), transparent),
    inset 0 0 0 1px rgba(255, 255, 255, var(--cx-ct, .1));
  -webkit-backdrop-filter: blur(var(--cx-fl, 12px)); backdrop-filter: blur(var(--cx-fl, 12px));
}
.chat-th-ext .msg.theirs {
  color: var(--cx-ta, inherit); background: var(--cx-ba, rgba(255, 255, 255, .08));
  border-radius: var(--cx-r, 22px) var(--cx-r, 22px) var(--cx-r, 22px) 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, var(--cx-ct, .1));
  -webkit-backdrop-filter: blur(var(--cx-fl, 12px)); backdrop-filter: blur(var(--cx-fl, 12px));
}
.chat-th-ext .msg time, .chat-th-ext .msg-day, .chat-th-ext .th-note { text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.chat-th-ext .dm-bar2 { background: var(--cx-in, rgba(14, 17, 22, .78)); }
.chat-th-ext .dm-bar2 .bar-send { background: var(--cx-bt, #dfe6ee); color: var(--cx-btt, #0d1117); }

/* Page « Proposer un thème » : quatre étapes en cartes de verre */
.pt-page { display: grid; gap: 14px; }
.pt-page h2 { margin-bottom: 0; }
.pt-intro { margin: 0; }
.pt-h { margin: 6px 2px 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.pt-card { padding: 16px; border-radius: 22px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.pt-step { display: grid; gap: 14px; }
.pt-step-h { display: flex; gap: 12px; align-items: flex-start; }
.pt-step-h h3 { margin: 2px 0 4px; font-size: 16px; }
.pt-step-h p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.pt-num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .10); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.pt-wide { width: 100%; justify-content: center; text-align: center; }
.pt-choices, .pt-list { display: grid; gap: 8px; }
.pt-list { padding: 8px; }
.pt-choice, .pt-prop { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .06); color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background .2s ease; }
.pt-choice:hover, .pt-prop:hover { background: rgba(255, 255, 255, .10); }
.pt-choice .grow, .pt-prop .grow { display: grid; gap: 2px; min-width: 0; }
.pt-choice small, .pt-prop small { font-size: 12.5px; color: var(--ink-2); }
.pt-choice .chev, .pt-prop .chev { color: var(--ink-2); font-size: 20px; }
.pt-drop { display: grid; gap: 2px; place-items: center; padding: 18px 14px; border-radius: 16px; border: 1.5px dashed rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .03); text-align: center; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.pt-drop:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .3); }
.pt-drop small { font-size: 12px; color: var(--ink-2); }
.pt-drop.sm { padding: 12px 14px; }
.pt-drop.on { border-style: solid; border-color: rgba(120, 200, 160, .45); background: rgba(120, 200, 160, .08); }
.pt-drop b { overflow-wrap: anywhere; }
.pt-form { display: grid; gap: 10px; }
.pt-form textarea { resize: vertical; min-height: 84px; }
.pt-form .form-error:empty { display: none; }
#pt-check-res:empty { display: none; }
.pt-doc { margin-top: 8px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.pt-doc h3, .pt-doc h4, .pt-doc h5 { margin: 18px 0 6px; }
.pt-doc h3:first-child, .pt-doc h4:first-child { margin-top: 0; }
.pt-doc p, .pt-doc ul, .pt-doc ol { margin: 6px 0; }
.pt-doc ul, .pt-doc ol { padding-left: 20px; }
.pt-doc code { padding: 1px 5px; border-radius: 6px; background: rgba(255, 255, 255, .08); font-size: .92em; }
.pt-code { position: relative; margin: 10px 0; }
.pt-code pre { margin: 0; padding: 14px 14px 44px; max-height: 340px; overflow: auto; border-radius: 14px; background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.pt-code .btn { position: absolute; right: 8px; bottom: 8px; }
.pt-table { overflow-x: auto; margin: 8px 0; }
.pt-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.pt-table th, .pt-table td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.pt-res { margin-top: 0; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.pt-res.ok { background: rgba(120, 200, 160, .10); }
.pt-res.ko { background: rgba(230, 140, 130, .10); }
.pt-res ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.pt-st { flex: none; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink-2); white-space: nowrap; }
.pt-st.st-publiee, .pt-st.st-acceptee, .pt-st.st-actif { background: rgba(120, 200, 160, .16); color: #bfe6cf; }
.pt-st.st-modifs, .pt-st.st-examen, .pt-st.st-desactive { background: rgba(230, 200, 130, .14); color: #ecd9a8; }
.pt-st.st-refusee, .pt-st.st-retire { background: rgba(230, 140, 130, .14); color: #efc0b8; }

/* Fils (Bug / Avis / Thème) : fichiers joints et outils de l'administrateur */
.rp-files { display: grid; gap: 6px; margin-top: 8px; }
.rp-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 13px; }
.rp-file a { overflow-wrap: anywhere; }
.rp-file .grow { flex: 1; min-width: 0; }
.rp-tools { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); }
.rp-tools .seg { flex-wrap: wrap; }

/* Menu admin « Thèmes » : onglets Propositions / Publiés / Désactivés / Retirés */
.at-page { display: grid; gap: 14px; }
.at-page h2 { margin-bottom: 0; }
.at-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.at-tabs button { min-width: 0; padding-left: 4px; padding-right: 4px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .at-tabs button { font-size: 11.5px; } .at-n { min-width: 16px; height: 16px; margin-left: 2px; padding: 0 4px; font-size: 10px; } }
.at-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; font-size: 11px; background: rgba(255, 255, 255, .14); }
#at-list { display: grid; gap: 10px; }
.at-help { margin: 0 2px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.at-empty { text-align: center; }
.at-empty p { margin: 6px 0; }
.at-card { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px; border-radius: 20px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); }
.at-card .thp-prev { position: relative; display: block; height: 124px; border-radius: 14px; overflow: hidden; background: #0d1117; }
.at-txt { display: grid; gap: 4px; align-content: center; min-width: 0; }
.at-txt small { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.at-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { .th-wall { animation: none; } }
#form-reply .form-error:empty { display: none; }

/* Rapport d'analyse de sécurité (fil d'une proposition, administrateur) */
.rp-scan { margin-top: 6px; }
.rp-scan .pt-res { padding: 10px 12px; font-size: 13px; }
.pt-res.warn { background: rgba(230, 200, 130, .10); }
