/* Ajustes propios de upload.manicomio.work (encima de la web compilada; sin código fuente).
   Si se cambia, súbase como manicomio-extra.v7.css: la carpeta /static se guarda en caché 1 año. */

/* ---- Orden: lo subido justo debajo de la zona de subida; tus estadísticas al final ---- */
.wrapper.fauux-wrapper { display: flex; flex-direction: column; }
.wrapper.fauux-wrapper > .stats-section { order: 5; }
.wrapper.fauux-wrapper > .footer-credit { order: 10; }
/* Los datos del disco del servidor no le sirven a quien sube */
.server-stats-section { display: none !important; }
.view-toggle { width: 800px; max-width: 100%; margin: 10px auto 10px !important; box-sizing: border-box; }

/* ---- Texto de «suelta aquí» del arrastre, en español ---- */
.drop-zone::after { content: "▸ SUELTA PARA SUBIR ◂" !important; }

/* ---- Tarjeta de cada archivo ---- */
.uploaded-files { width: 800px !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important; box-sizing: border-box; }
.uploaded-files .file { letter-spacing: normal; }
.uploaded-files .file .name { letter-spacing: 1px !important; }
.uploaded-files .file .link { letter-spacing: 0 !important; min-width: 0; font-size: .85rem; }
.uploaded-files .file .details button { min-width: 36px; }
.uploaded-files .file .footer { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; letter-spacing: .5px; margin-top: 4px; }
.uploaded-files .file .footer > div:last-child { flex-basis: 100%; }
.uploaded-files .file .footer .date { margin-right: 0; }
.mc-expira { color: #c1b492; }
.mc-expira.mc-pronto { color: #d2738a; }
/* Recién subido: la tarjeta se «enciende» como una pantalla CRT (estilos al final) */

/* Barra de «cancelar» en cada subida en curso */
.progress-item { position: relative; }
.mc-cancelar { position: absolute; top: 0; right: 0; font-family: 'VT323', 'Courier New', monospace; font-size: 15px; letter-spacing: 2px;
  background: transparent; color: #d2738a; border: 1px solid #9370DB; padding: 2px 10px; cursor: pointer; }
.mc-cancelar:hover { background: rgba(147, 112, 219, .2); color: #c1b492; }
.progress-item .progress-header { padding-right: 110px; }

/* ---- Música: botón y volumen fijos abajo a la derecha ---- */
.mc-musica { position: fixed; right: 14px; bottom: 14px; z-index: 1001; display: flex; align-items: center; gap: 8px;
  background: #000; border: 1px solid #9370DB; box-shadow: black 0 5px 10px; padding: 6px 10px;
  font-family: 'VT323', 'Courier New', monospace; color: #c1b492; letter-spacing: 2px; }
.mc-musica button { font-family: inherit; font-size: 17px; letter-spacing: 2px; background: transparent; color: #c1b492;
  border: 1px solid transparent; padding: 2px 6px; cursor: pointer; min-height: 32px; }
.mc-musica button:hover, .mc-musica button:focus-visible { border-color: #9370DB; outline: none; }
.mc-musica.mc-on button { color: #9370DB; text-shadow: 0 0 6px rgba(147, 112, 219, .8); }
.mc-musica input[type=range] { width: 90px; accent-color: #9370DB; cursor: pointer; }
.mc-musica .mc-vol-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Aviso propio (p. ej. tras borrar con enlace) ---- */
.mc-aviso { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1002; padding: 10px 18px;
  background: #000; border: 1px solid #9370DB; color: #c1b492; font-family: 'VT323', 'Courier New', monospace; font-size: 18px;
  letter-spacing: 2px; box-shadow: 0 0 12px rgba(147, 112, 219, .5); max-width: calc(100% - 40px); text-align: center; }

/* ---- Pantallas estrechas: los recuadros de 800 px se adaptan ---- */
@media (max-width: 1100px) {
  [data-bg-deco] { display: none !important; }
}
@media (max-width: 840px) {
  .wrapper.fauux-wrapper { padding: 0 !important; }
  .fauux-header, .fauux-article {
    width: auto !important; max-width: none !important; box-sizing: border-box !important;
    margin-left: 8px !important; margin-right: 8px !important;
  }
  .fauux-header { padding: 24px 10px !important; margin-top: 12px !important; }
  .fauux-article { padding: 14px 10px !important; margin-top: 12px !important; margin-bottom: 12px !important; letter-spacing: 3px !important; }
  .wired-title { font-size: 22px !important; letter-spacing: 4px !important; }
  .fauux-header .blinkFrame { width: 50% !important; }
  .fauux-header .navline, .fauux-header .fauux-phrase { letter-spacing: 4px !important; }
  .fauux-article .info-text { letter-spacing: 1px !important; font-size: 12px !important; }
  .fauux-article .upload-label { padding: 22px 10px !important; }
  .fauux-article .upload-label-text { white-space: normal !important; font-size: 1.25rem !important; }
  .fauux-article .drag-indicator { letter-spacing: 1px !important; }
  .fauux-article h3 { letter-spacing: 4px !important; }
  .drop-zone::after { font-size: 1rem !important; letter-spacing: 3px !important; }
  .uploaded-files, .view-toggle { padding: 0 8px; }
  .uploaded-files .file .details button { min-width: 42px; min-height: 40px; }
  .uploaded-files .file .link { font-size: .8rem; }
  .preview-actions button, .btn-cancel, .btn-confirm { letter-spacing: 3px !important; }
  .mc-musica { right: 8px; bottom: 8px; padding: 4px 6px; }
  .mc-musica input[type=range] { width: 70px; }
}

/* Cifras de las estadísticas en una sola línea */
.stats-section .stat-value { letter-spacing: 2px !important; white-space: nowrap; }

/* Las figuras decorativas del fondo (Lain) quedan detrás de los recuadros */
.wrapper.fauux-wrapper { position: relative; z-index: 1; }

/* ---- /terms abierta como página suelta ---- */
body.mc-terms { padding: 20px 8px 40px; }
body.mc-terms section { width: 800px; max-width: 100%; box-sizing: border-box; margin: 20px auto; padding: 26px 28px;
  background-image: url("/static/bg-rip-02-purple.gif"); border: 1px solid #9370DB; box-shadow: black 0 5px 10px;
  font-family: 'Noto Sans Mono', 'Courier New', monospace; font-size: 13px; letter-spacing: 1px; line-height: 1.75; color: #c1b492; }
body.mc-terms section:first-of-type { padding: 12px 20px; text-align: center; font-size: 18px; letter-spacing: 6px; }
body.mc-terms h2 { font-family: 'Times New Roman', Times, serif; font-size: 24px; letter-spacing: 6px; text-align: center; margin: 0 0 20px; }
body.mc-terms strong { color: #9370DB; font-weight: normal; }
body.mc-terms .section-divider { border-top: 1px solid #9370DB55; margin: 18px 0; }
body.mc-terms .last-update { color: #c1b492; }
@media (max-width: 600px) { body.mc-terms section { padding: 18px 14px; font-size: 12px; } body.mc-terms h2 { font-size: 19px; letter-spacing: 3px; } }

/* ---- /delete: el aviso dentro de un recuadro, legible ---- */
.delete-container { width: 800px; max-width: calc(100% - 16px); box-sizing: border-box; margin: 20px auto !important; padding: 24px 20px !important;
  background-image: url("/static/bg-rip-02-purple.gif"); border: 1px solid #9370DB; box-shadow: black 0 5px 10px; text-align: center; }
.delete-container, .delete-container * { letter-spacing: 2px !important; }
.delete-container .actions { justify-content: center; }

/* La lista de archivos vacía no se dibuja (si no, su borde queda como una raya suelta) */
.uploaded-files:not(:has(.file)) { display: none !important; }

/* Móvil: solo el botón de la música (el volumen va con los botones del teléfono) */
@media (max-width: 600px) {
  .mc-musica { padding: 2px 4px; }
  .mc-musica input[type=range] { display: none; }
  .mc-musica button { font-size: 15px; }
}

/* ---- Vista de cuadrícula: las tarjetas se ajustan a su columna (antes el enlace y los botones
   las ensanchaban y la página se salía de la pantalla del móvil) ---- */
.uploaded-files.grid-view { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important; gap: 10px !important; }
.uploaded-files.grid-view .file { min-width: 0; margin: 0 !important; }
.uploaded-files.grid-view .file .details { flex-wrap: wrap; }
.uploaded-files.grid-view .file .link { flex: 1 1 100%; }
.uploaded-files.grid-view .file .details button { flex: 1 1 0; min-width: 0 !important; }
.uploaded-files.grid-view .file .footer .date { white-space: normal; }
.uploaded-files.grid-view .file .thumbnail { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
@media (max-width: 480px) {
  .uploaded-files.grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .uploaded-files.grid-view .file { padding: 8px 6px; }
  .uploaded-files.grid-view .file .name { font-size: .95rem; }
  .uploaded-files.grid-view .file .footer { font-size: .72rem; }
}

/* ---- Animaciones sin repintar la página (antes se redibujaba todo ~60 veces por segundo) ----
   Mismo aspecto, pero el navegador solo mueve capas: opacidad y transform en lugar de color,
   text-shadow y top. */
/* Línea de escaneo: se desplaza con transform en vez de con top */
.main-section.fauux-article::after { top: 0 !important; animation: mc-scan 4s linear infinite !important; will-change: transform; }
@keyframes mc-scan { from { transform: translateY(-100vh); } to { transform: translateY(200vh); } }
/* Parpadeos: fundido a negro con opacidad (están sobre fondo negro, se ve igual) */
@keyframes mc-blink { 50% { opacity: 0; } }
.blink, .Bfast, .del1s, .del1s5ms, .del2s, .del4s, .del5s, .del6s { animation-name: mc-blink !important; }
/* Brillos: una copia del texto con el brillo ya pintado que solo cambia de opacidad
   (la crea /static/js/manicomio-extra.v2.js) */
@keyframes mc-glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.mc-quieto { animation: none !important; }
.mc-brillo-host { position: relative; z-index: 0; }
.mc-brillo { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; box-sizing: border-box;
  pointer-events: none; user-select: none; -webkit-user-select: none; }
.mc-brillo * { animation: none !important; }
.mc-brillo-detras { z-index: -1; }
.mc-brillo-detras, .mc-brillo-detras * { color: transparent !important; text-shadow: none !important; }
.mc-brillo-detras .wiredAnim, .mc-brillo-detras .wdel1s, .mc-brillo-detras .wdel2s, .mc-brillo-detras .wdel3s {
  text-shadow: #9370DB 1px 4px 5px !important; opacity: 0; animation: mc-glow 2s ease-in-out infinite !important; }
.mc-brillo-detras .wdel1s { animation-delay: .4s !important; }
.mc-brillo-detras .wdel2s { animation-delay: .8s !important; }
.mc-brillo-detras .wdel3s { animation-delay: 1.2s !important; }
.mc-brillo-delante { z-index: 1; opacity: 0; animation: mc-glow 1s ease-out infinite; }
.mc-brillo-delante, .mc-brillo-delante * { color: #c1b492 !important; text-shadow: #c1b492 1px 1px 6px !important; }

/* ---- Términos y privacidad: legibles (antes heredaban 8 px de espacio entre letras y
   ocupaban todo el ancho de la pantalla) ---- */
dialog:has(.terms-container) { width: min(720px, calc(100vw - 24px)); max-width: none; max-height: 86vh; padding: 20px 26px; box-sizing: border-box; }
.terms-container { letter-spacing: normal !important; font-family: 'Courier New', Consolas, monospace; font-size: 15px; line-height: 1.65; }
.terms-container h2 { font-family: 'Times New Roman', Times, serif; font-size: 22px; letter-spacing: 4px; margin: 0 0 14px; }
.terms-container p { margin: .75rem 0; line-height: 1.65; letter-spacing: normal; }
.terms-container strong { color: #9370DB; font-weight: bold; }
.terms-container .last-update { font-size: 13px; color: #a89c80; }
body.mc-terms section { letter-spacing: normal !important; }
@media (max-width: 600px) {
  dialog:has(.terms-container) { padding: 16px 14px; }
  .terms-container { font-size: 14px; }
  .terms-container h2 { font-size: 19px; letter-spacing: 3px; }
}

/* ---- Subidas: «transmitiendo a la Wired» ----
   Solo opacidad y transform: no obligan a redibujar la página. */
.progress-section h3::before { content: "> conectando con la Wired… "; color: #9370DB; }
.progress-item .progress-name::before { content: "> transmitiendo "; color: #9370DB; }
.progress-item .progress-name::after { content: " █"; color: #c1b492; animation: mc-cursor 1s steps(1) infinite; }
@keyframes mc-cursor { 50% { opacity: 0; } }
.progress-item .progress-details > span::before { content: "· "; color: #9370DB; }
.progress-item .progress-details > span:first-child::before { content: "> "; }
.progress-item .progress-bar-container::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 18%;
  background: linear-gradient(90deg, transparent, rgba(193, 180, 146, .35), transparent); pointer-events: none;
  animation: mc-barrido 1.6s linear infinite; will-change: transform; }
@keyframes mc-barrido { from { transform: translateX(-100%); } to { transform: translateX(560%); } }
.progress-item .progress-name, .progress-item .progress-details { letter-spacing: 1px !important; }
@media (max-width: 600px) { .progress-item .progress-name::before { content: "> "; } }
.progress-item .progress-bar-container { background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px); }

/* ---- Archivo recién subido: encendido de pantalla CRT ---- */
.uploaded-files .file.mc-nuevo { animation: mc-crt .7s cubic-bezier(.2, .8, .2, 1) both; transform-origin: center; }
.uploaded-files .file.mc-nuevo::after { content: ""; position: absolute; inset: 0; background: #c1b492; pointer-events: none;
  animation: mc-destello .7s ease-out both; }
@keyframes mc-crt {
  0% { transform: scale(.55, .015); opacity: .2; }
  35% { transform: scale(1, .015); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes mc-destello { 0%, 30% { opacity: .9; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .uploaded-files .file.mc-nuevo, .uploaded-files .file.mc-nuevo::after,
  .progress-item .progress-bar-container::after, .progress-item .progress-name::after { animation: none !important; }
  .uploaded-files .file.mc-nuevo::after { display: none; }
}
