:root{ --topbar-h: 56px; --ui-zoom: .85; }

@media (max-width: 980px){
  :root{ --ui-zoom: 1; }
}

html{
  zoom: var(--ui-zoom);
}


/* =========================
   ESTILOS GENERALES
========================= */

body {
    margin: 0;
    padding: 0; /* opcional, cero */
    font-family: system-ui, -apple-system, BlinkMacSystemFont;
    background: #0f0f0f;
    color: #eaeaea;

    /* Sticky footer layout */
    min-height: calc(100vh / var(--ui-zoom));
    display: flex;
    flex-direction: column;
}

/* Contenedor general para páginas full-screen */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto; /* centrado horizontal */
    padding: 0 20px;   /* deja un margen a los lados */
    box-sizing: border-box;
	position: relative;
}

/* Links */
a { color: #6da8ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Encabezados */
h1, h2, h3 { margin: 0; color: #eaeaea; }
h1 { font-size: 22px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

/* Contenedor centrado vertical y horizontal para páginas de formularios */
.centered-page {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Con body en flex, dejamos que el contenido rellene el espacio y el footer
       quede siempre abajo sin forzar scroll */
    flex: 1;
    min-height: 0;
    padding: 20px; /* opcional, para que no toque los bordes */
    box-sizing: border-box;
}


/* =========================
   GALERÍA
========================= */
.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 20px;
}

.thumb img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.thumb img:hover { transform: scale(1.03); }

.thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}


.thumb-author {
    max-width: 150px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(22,22,22,0.92);
    color: #eaeaea;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.35);
    box-sizing: border-box;
}

.thumb:hover .thumb-author {
    border-color: rgba(109,168,255,0.35);
}

.thumb-author.is-dm {
    cursor: pointer;
}
.thumb-author.is-dm:hover {
    border-color: rgba(109,168,255,0.55);
    background: rgba(22,22,22,0.96);
}

.modal-author{
    position:absolute;
    top:10px;
    left:10px;
    z-index: 6;
    max-width: calc(100% - 140px);
    opacity: 0.92;
    user-select: none;
}
.modal-author:hover{
    opacity: 1;
}


/* =========================
   BARRA LATERAL / CHAT
========================= */
.sidebar {
    width: 320px;
    background: #161616;
    display: flex;
    flex-direction: column;
}

.chat {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 14px;
}

.chat div { margin-bottom: 6px; opacity: .9; }
.chat .system { color: #aaa; font-style: italic; }
.chat .disabled { opacity: .4; pointer-events: none; }

/* =========================
   MODAL GENERAL
========================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    display: flex;
    max-width: 90%;
    max-height: 90%;
    padding: 20px;
    box-sizing: border-box;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
}


.modal-content--image {
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.55);
    gap: 16px;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10000;
    padding: 0;
}

.modal-close-btn:hover { opacity: 0.85; }

.modal-sidebar-head {
    padding: 10px 10px 0 10px;
}

.modal-sidebar-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.roomchat--modal {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    padding: 10px;
}

.roomchat-hint {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 12px;
}

.image-modal-delete {
    padding: 0 10px 10px 10px;
}

/* =========================
   MODAL REPORTES
========================= */
.report-modal{justify-content:center;align-items:center;padding:24px;z-index:10050}
.report-modal .report-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10000;
}

.report-box {
    width: min(560px, 92vw);
    background: #111;
    color: #fff;
    border-radius: 12px;
    padding: 18px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.08);
}

.report-title {
    margin: 0 0 12px;
    font-size: 18px;
}

.report-label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    color: #ddd;
}

.report-label--mt {
    margin-top: 12px;
}

.report-select,
.report-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #0b0b0b;
    color: #fff;
    outline: none;
}

.report-textarea {
    resize: vertical;
    min-height: 90px;
}

.report-status {
    margin-top: 10px;
    min-height: 18px;
    font-size: 13px;
    color: #bdbdbd;
}

.report-status[data-error="1"] {
    color: #ff6b6b;
}

.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.header-btn.report-btn {
    background: #b66a00;
}

/* Botón autor (mismo estilo que report, pero gris para simetría) */
.header-btn.author-btn{
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #f2f2f2;
}
.header-btn.author-btn:hover{
    background: rgba(255,255,255,0.18);
    color: #fff;
}

/* Imagen dentro del modal */
#image-wrapper {
    position:relative;
    margin:auto;
    cursor:pointer;
    width:70vw;
    height:90vh;
    max-width:70vw;
    max-height:90vh;
    display:flex;
    align-items:center;
    justify-content:center;
}

/* Botón reportar flotante en el modal (esquina superior derecha del contenedor de imagen) */
.report-float-btn{
    position:absolute;
    top:10px;
    right:10px;
    z-index: 6;
    padding: 8px 10px;
    border-radius: 10px;
    opacity: 0.92;
}
.report-float-btn:hover{
    opacity: 1;
}

/* Botón autor flotante (esquina opuesta al report) */
.author-float-btn{
    position:absolute;
    top:10px;
    left:10px;
    z-index: 6;
    padding: 8px 10px;
    border-radius: 10px;
    opacity: 0.92;
    margin-bottom: 0;
    max-width: calc(100% - 140px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.author-float-btn:hover{
    opacity: 1;
}

#image-wrapper img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    user-select: none;
    object-fit: contain;
}
#flags-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}


.image-protected {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #fff;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 5;
    user-select: none;
    pointer-events: none;
}

.image-protected__text { font-size: 18px; }

#flags-container { z-index: 4; }

/* Marcadores */
.marker {
    width: 24px;
    height: 24px;
    pointer-events: none;
    opacity: 0.55;
    transform: scale(1);
    transition: transform 120ms ease, opacity 120ms ease;
}

.marker.is-active {
    opacity: 1;
    transform: scale(1.35);
}

/* =========================
   BOTONES UNIFICADOS
========================= */
.header-btn, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-align: center;
    line-height: 1.1;
    min-height: 36px;
    text-decoration: none;

    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1;
    white-space: nowrap;

}


.header-btn:hover, .button:hover { background: #6da8ff; color: white; }

.header-btn:hover{ text-decoration: none; }

.delete-btn { background: #a00; }
.delete-btn:hover { background: #c00; }

.danger-btn { background: #a00; }
.danger-btn:hover { background: #c00; }

.header-btn.download-btn {
    background: #28a745;
}
.header-btn.download-btn:hover {
    background: #1e7e34;
}


/* =========================
   INPUTS Y SELECT UNIFICADOS
========================= */
.input-field,
.room-form input[type="text"],
.room-form input[type="number"],
.room-form select,
.alias-box input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 5px;
    border: none;
    background: #161616;
    color: #eaeaea;
    font-size: 14px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.input-field::placeholder { color: #777; }

.room-form input[type="checkbox"],
input[type="checkbox"] { margin-right: 5px; }

/* =========================
   FORMULARIOS
========================= */
.room-form label,
.room-form p { display: block; margin: 10px 0 5px; }

/* =========================
   MODAL DE ALIAS
========================= */
.alias-modal {
    display: none;
    justify-content: center;
    align-items: center;
}

.alias-box {
    background: #161616;
    border-radius: 10px;
    padding: 20px;
    width: 360px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    color: #eaeaea;
}

/* =========================
   VOTOS
========================= */
.votes {
    display: flex;
    gap: 10px;
    margin: 5px 0;
}

.vote-btn { cursor: pointer; opacity: .7; }
.vote-btn:hover { opacity: 1; }

/* --- Resumen de salas --- */
.summary-box {
    margin: 10px 0;
    padding: 10px;
    background: #222;
    border-radius: 5px;
    font-size: 14px;
}

/* --- Modal pequeño --- */
.modal-small {
    background: #111;
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

/* --- Botón cerrar modal --- */
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    cursor: pointer;
    font-size: 20px;
}

/* --- Mensaje de error --- */
.error-msg {
    color: #f66;
    margin-top: 10px;
    display: none;
}


/* --- Salas uniformes --- */
.room-item {
    padding: 8px;
    background: #222;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 8px;
    cursor: pointer;
	transition: background 0.2s;
	transition: background 0.15s ease, transform 0.15s ease;
}


.room-item:hover {
    background: #333;          /* hover sutil */
	transform: translateY(-1px);
}

/*.room-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}*/

.room-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.room-name{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* En index: permitir wrap de badges en pantallas estrechas */
.room-badges--index{
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

/* En index, el contador va en esquina superior izquierda */
.room-badges--index .active-users-square span,
.room-badges--index .image-count-square span{
    right: auto;
    left: -6px;
}

.image-count-square svg{
    display: block;
    color: #eaeaea;
}

/* Si expira, darle un aviso visual sin romper layout */
.status-time.expired{
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.25);
}


.room-info span {
    color: #333;
}

.room-item .room-actions a {
    white-space: nowrap;
    font-size: 14px;
    padding: 4px 10px;
}

.badge {
    padding: 1px 5px;
    font-size: 14px;
    border-radius: 4px;
    background: rgba(100,100,100,0.9) /* muy sutil si se usa */
}

/* Badge opcional (puede usarse solo para indicar privada) */
.private-badge {
    padding: 1px 5px;
    font-size: 14px;
    border-radius: 4px;
    background: rgba(255,0,0,0.2); /* muy sutil si se usa */
}

.room-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
    display: block;
    pointer-events: auto;
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.empty-thumb {
    width: 60px;
    height: 60px;
    background: #222;
    display: block;
    margin-right: 10px;
    border-radius: 6px;
    flex-shrink: 0;
}

.room-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    border-radius: 6px;
}

/* Responsive móviles */
@media (max-width: 600px) {
    .room-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 5px 10px;
    }
    .room-info{
        width: 100%;
    }
    .room-actions {
        width: 100%;
        margin-top: 4px;
    }
}

/* Contenido del modal */
.modal-content.modal-small {
    background: #111;
    border-radius: 10px;
    padding: 25px 20px;
    max-width: 500px;   /* más ancho para que el texto no se quiebre */
    width: 90%;          /* responsive en móviles */
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    color: #eaeaea;
    text-align: center;
}

/* Título */
.modal-content.modal-small h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

/* Input */
.modal-content.modal-small .input-field {
    width: 100%;
    padding: 8px 10px;
    border-radius: 5px;
    border: none;
    background: #161616;
    color: #eaeaea;
    font-size: 14px;
    box-sizing: border-box;
}

/* Botón */
.modal-content.modal-small .button {
    width: 100%;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    background: #6da8ff;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.modal-content.modal-small .button:hover {
    background: #5a94e0;
}

/* Error */
.modal-content.modal-small .error-msg {
    color: #f66;
    margin-top: 10px;
    display: none;
}

/* Cerrar modal */
.modal-content.modal-small .modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    cursor: pointer;
    font-size: 20px;
}

/* =========================
   MODAL TUTORIAL SALA PRIVADA
========================= */
.modal-content.modal-tutorial{
  position: relative;
  text-align: left;
}

.modal-content.modal-tutorial h2{
  margin: 0 0 6px 0;
  text-align: left;
}

.modal-content.modal-tutorial p{
  margin: 0 0 8px 0;
}

.modal-content.modal-tutorial .tutorial-steps{
  margin: 0 0 10px 18px;
  padding: 0;
}

.modal-content.modal-tutorial .tutorial-steps li{
  margin: 6px 0;
}

.modal-content.modal-tutorial .tutorial-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.modal-content.modal-tutorial .tutorial-actions .header-btn{
  margin-bottom: 0;
  min-height: 34px;
  padding: 7px 12px;
}

 (max-width: 600px){
  .modal-content.modal-tutorial .tutorial-actions{
    flex-direction: column;
  }
  .modal-content.modal-tutorial .tutorial-actions .header-btn{
    width: 100%;
  }
}

/* =========================================================
   Room layout
========================================================= */

/* Layout de la página room.php: header (topbar) + toolbar + contenido scrollable */
body.room-page{
  min-height: calc(100vh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
}

.room-page-content{
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* clave para permitir scroll interno */
}

body.room-page .container.room-page-content{
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
}


.room-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

.gallery-container {
    flex: 1;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow-y: auto;
}


/* =========================================================
   Modals
========================================================= */


.modal .sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.modal .chat {
    flex: 1;
    overflow-y: auto;
}


/* =========================================================
   Image modal
========================================================= */


#image-wrapper img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    user-select: none;
    object-fit: contain;
}

.room-timer {
    display: inline-block;
    padding: 1px 5px;
    font-size: 14px;
    border-radius: 4px;
    background: rgba(100,100,100,0.9);
    color: #ddd;
    white-space: nowrap;
}

.room-timer.expired {
    background: #3a2a2a;
    color: #f0b3b3;
}

.room-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-count,
.private-badge,
.room-timer {
    flex-shrink: 0;
}

.topbar{
  min-height: var(--topbar-h);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  /* Header pegado al top y al borde izquierdo */
  padding: 0 12px 0 0;
  margin: 0;
  background: #0f0f0f;
  border-bottom: none;
}

.brand{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.brand-logo{
  height:53px;
  width:auto;
  display:block;
}

.lang-switch{
  display:flex;
  gap:10px;
  align-items:center;

  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);

  font-size:14px;
  opacity:0.9;
}

.lang-switch a{
  color:#ccc;
  text-decoration:none;
}

.lang-switch a.active{
  color:#fff;
  font-weight:bold;
  text-decoration:underline;
}

.room-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 0 14px;
}

.room-title-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;      /* CLAVE para que el texto pueda recortar */
  flex:1;
}

.room-title{
  margin:0;
  min-width:0;
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:22px;
}

.room-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

/* En la barra de acciones no queremos el margen inferior global de los botones */
.room-actions .header-btn,
.room-actions .button{
  margin-bottom: 0;
}

.room-actions form{ margin:0; }





/* Badges de estado de sala (privada / watermark) */
.room-badges{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

/* Tiempo restante (icono ancho + texto encima) */
.status-time{
  width: 120px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 6px;
  background: #333;
  flex: 0 0 auto;
  overflow: hidden;
}

.status-time img{
  height: 32px;
  width: auto;
  display: block;
}

.status-time__text{
  position: absolute;
  top: 10px;
  left: 56%;
  transform: translateX(-50%);
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  color: #333;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  pointer-events: none;
}

.status-square{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  background:#333;
  flex:0 0 auto;
}

.status-square img{
  width:32px;
  height:32px;
  display:block;
}

/* Index: indicador de master activo */
.index-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 15px;
}

.index-actions .header-btn,
.index-actions .button{
  margin-bottom: 0;
}

.index-actions .master-indicator{
  margin: 0;
}

/* Contador de usuarios activos (cuadrado con favicon + número) */
.active-users-square{
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 6px;
  background: #333;
  flex: 0 0 auto;
}

.active-users-square img{
  width: 28px;
  height: 28px;
  display: block;
}

.active-users-square span{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  background: #6da8ff;
  color: #111;
  box-sizing: border-box;
}

/* Room: márgenes laterales pequeños y galería sin padding extra */
body.room-page{
  /*
    Evita que el botón flotante (subir imagen) tape el footer.
    Ajusta estos valores si cambias el alto del footer o el tamaño del FAB.
  */
  --fab-upload-bottom: 96px;
  --room-gallery-pad-bottom: 190px;
}

body.room-page .gallery-container{
  padding: 10px 0 var(--room-gallery-pad-bottom);
}

body.room-page .room-container{
  gap: 16px;
}

/* Botón flotante (subir imagen) */
.fab-upload{
  position: fixed;
  left: calc(18px + env(safe-area-inset-left));
  bottom: calc(var(--fab-upload-bottom, 18px) + env(safe-area-inset-bottom));
  height: 66px;
  border-radius: 16px;
  background: #333;
  border: 1px solid #444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9000;
  user-select: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.fab-upload img{
  height: 60px;
  display: block;
}

.fab-upload:hover{ background:#3b3b3b; }
.fab-upload:active{ transform: scale(0.98); }
.fab-upload:focus-visible{
  outline: 2px solid #6da8ff;
  outline-offset: 2px;
}

@media (max-width: 480px){
  .status-time{ width: 130px; }
  .status-time img{ height: 24px; }
}


/* En páginas centradas, evita margen vertical extra del .container */
.centered-page .container{ margin: 0 auto; }

/* Create room: botón principal */
.room-form .button{ background:#6da8ff; }
.room-form .button:hover{ background:#5a94e0; }

/* -------- Footer legal -------- */
.site-footer{
  margin-top: auto; /* empuja el footer al fondo si la página es corta */
  padding: 12px 0;
  border-top: 1px solid #2a2a2a;
  opacity: 0.85;
}
.site-footer__inner{ max-width: 1000px; margin: 0 auto; padding: 0 14px; display:flex; flex-direction:column; gap:8px; }
.site-footer__links{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; opacity: .70; }
.site-footer__links a{ color:#d8d8d8; text-decoration:none; font-size: 12.5px; }
.site-footer__links a:hover{ text-decoration: underline; }
.site-footer__meta{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; opacity:.45; font-size: 12px; }
.site-footer .sep{ opacity:.55; }

/* =========================
   Upload rules (modal)
========================= */

.upload-policy {
  margin: 12px 0 14px; /* deja aire antes del botón de subir */
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  font-size: 13px;
}

/* Botón de subir: separarlo del bloque legal */
#upload-modal #upload-form .header-btn{
  margin-top: 12px;
}

.upload-policy__title {
  font-weight: 650;
  margin-bottom: 6px;
  opacity: .95;
}

.upload-policy__list {
  margin: 0 0 10px 18px;
  padding: 0;
  line-height: 1.45;
  opacity: .9;
}

.upload-policy__confirm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 8px;
  opacity: .95;
}

.upload-policy__confirm input {
  margin-top: 2px;
}

.upload-policy__links {
  font-size: 12px;
  opacity: .75;
}

.upload-policy__links .sep {
  margin: 0 6px;
  opacity: .6;
}

/* =========================
   PÁGINAS LEGALES
========================= */

.legal-container {
  max-width: 900px;
}

.legal-lead {
  margin-top: 0;
  opacity: .9;
  line-height: 1.6;
}

.legal-note {
  opacity: .8;
  line-height: 1.6;
  margin: 10px 0 0;
}

.legal-section {
  margin-top: 22px;
}

.legal-section h2 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.legal-h3 {
  margin: 14px 0 6px;
  font-size: 15px;
  opacity: .95;
}

.legal-section p,
.legal-section ul {
  line-height: 1.55;
  opacity: .95;
}

.legal-updated {
  margin-top: 24px;
  font-size: 13px;
  opacity: .75;
}

/* =========================
   AGE GATE
========================= */

.age-container {
  max-width: 520px;
}

.age-lead {
  margin-top: 0;
  opacity: .85;
  line-height: 1.6;
}

.age-form {
  margin-top: 14px;
}

.age-form--secondary {
  margin-top: 10px;
}

.age-label {
  display: block;
  margin-bottom: 6px;
  opacity: .9;
}

.age-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid #333;
  padding: 10px 12px;
  background: #121212;
  color: #eaeaea;
}

.age-alert {
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0;
}

.age-alert--warning {
  border-color: #7a5b2a;
}

.age-alert--error {
  border-color: #8a2f2f;
}

.age-btn-primary,
.age-btn-danger {
  width: 100%;
}

.age-input {
  margin-bottom: 18px; /* separa fecha y botones (más estético) */
}

.age-btn-primary {
  background: #1f6f3b;
  border: 1px solid #2a8a4c;
  margin-bottom: 0;
}

.age-btn-primary:hover {
  filter: brightness(1.08);
}

.age-btn-danger {
  background: #7a2d2d;
  border: 1px solid #a33b3b;
  margin-bottom: 0;
}

.age-btn-danger:hover {
  filter: brightness(1.08);
}

.age-form--secondary {
  margin-top: 14px; /* más aire entre botones */
}



.age-links {
  margin-top: 16px;
  opacity: .85;
  line-height: 1.5;
}

/* -------------------------------------------------
   DMs (panel global)
------------------------------------------------- */

.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.dm-toggle{
  position:relative;
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color:#fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.dm-toggle:hover{
  background: rgba(0,0,0,0.35);
}

.dm-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background: rgba(255,0,0,0.75);
  border:1px solid rgba(255,255,255,0.18);
  color:#fff;
  font-size:11px;
  line-height:18px;
  font-weight:700;
  text-align:center;
}

.dm-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  /* Por encima del modal de imagen (z=9999) pero por debajo del modal de reportes (z=10050) */
  z-index: 10040;
}

/* Respeta el atributo [hidden] aunque el componente tenga display:flex en CSS */
.dm-overlay[hidden],
.dm-panel[hidden]{
  display:none !important;
}

.dm-panel{
  position:fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 12px;
  height: calc(100vh - var(--topbar-h) - 24px);
  width: min(520px, 96vw);
  background: rgba(15,16,20,0.96);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:16px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.55);
  z-index: 10041;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.dm-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px;
  border-bottom:1px solid rgba(255,255,255,0.10);
}

.dm-title{
  font-weight:800;
  letter-spacing:0.2px;
}

.dm-close{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color:#fff;
  cursor:pointer;
}

.dm-close:hover{
  background: rgba(255,255,255,0.08);
}

.dm-body{
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns: 200px 1fr;
}

.dm-threads{
  min-height:0;
  overflow:auto;
  border-right:1px solid rgba(255,255,255,0.10);
}

.dm-thread{
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  color:#fff;
  cursor:pointer;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
  border-bottom:1px solid rgba(255,255,255,0.06);
}

.dm-thread:hover{
  background: rgba(255,255,255,0.05);
}

.dm-thread.is-active{
  background: rgba(255,255,255,0.08);
}

.dm-thread__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.dm-thread__name{
  font-weight:800;
  font-size:13px;
}

.dm-thread__unread{
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background: rgba(255,0,0,0.75);
  border:1px solid rgba(255,255,255,0.18);
  color:#fff;
  font-size:11px;
  line-height:18px;
  font-weight:700;
  text-align:center;
}

.dm-thread__preview{
  font-size:12px;
  color: rgba(255,255,255,0.72);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.dm-chat{
  min-height:0;
  display:flex;
  flex-direction:column;
}

.dm-chat-head{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,0.10);
}

.dm-back{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color:#fff;
  cursor:pointer;
  display:none;
}

.dm-peer{
  font-weight:800;
}

.dm-messages{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.dm-msg{
  max-width:80%;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color:#fff;
  font-size:13px;
  line-height:1.25;
  white-space:pre-wrap;
  word-break:break-word;
}

.dm-msg.is-me{
  align-self:flex-end;
  background: rgba(0,180,255,0.10);
  border-color: rgba(0,180,255,0.25);
}

.dm-compose{
  display:flex;
  gap:8px;
  padding:16px 12px;
  border-top:1px solid rgba(255,255,255,0.10);
  align-items:flex-end;
}

.dm-input{
  flex:1;
  min-width:0;
  resize:none;
  min-height:64px;
  height:64px;
  max-height:160px;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  color:#fff;
  outline:none;
}

.dm-send{
  width:96px;
  height:64px;
  border-radius:12px;
  border:1px solid rgba(0,180,255,0.35);
  background: rgba(0,180,255,0.18);
  color:#fff;
  cursor:pointer;
  font-weight:800;
}

.dm-send:hover{
  background: rgba(0,180,255,0.24);
}

.dm-empty{
  padding:12px;
  color: rgba(255,255,255,0.75);
  font-size:13px;
}

@media (max-width: 720px){
  .dm-panel{
    right: 8px;
    left: 8px;
    width: auto;
  }

  .dm-body{
    grid-template-columns: 1fr;
  }

  .dm-threads{
    border-right:0;
  }

  .dm-back{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  .dm-panel[data-view="threads"] .dm-chat{
    display:none;
  }

  .dm-panel[data-view="chat"] .dm-threads{
    display:none;
  }
}
