/* ConfiguraciÃ³n General */
@font-face {
    font-family: 'Cherish';
    src: url('fonts/Cherish.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Bangalore';
    src: url('fonts/Bangalore.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Terminal';
    src: url('fonts/terminal-grotesque.ttf');
    font-weight: normal
}



body {
   font-family: 'Terminal', serif;
    margin: 0;
    padding: 20px;
    color: black;
    background-color: transparent;
   background-image: url('assets/fondomuro.webp');
    background-position: center top;
    background-repeat: repeat-y;
    background-size: cover; /* Fixa la imatge per a un millor efecte */

    /* 5. TamaÃ±o: 
       'auto' mantiene el tamaÃ±o original de 2560px. 
       Si quieres que siempre cubra el ancho de la pantalla, usa '100% auto' */
    background-size: auto;
    margin: 0px;
    padding: 0px; 
    margin-bottom: 250px;

    /* Mantenemos el resto de tus estilos */
}

header {
    width: 100%;
    text-align: center;
    position: relative;
    margin-bottom: 30px;
}

header h1 {
    font-family: 'Terminal', serif;
    font-size: 4rem;
    margin-bottom: -30px;
}

body.dark-mode header h1 {
    color: #ff6dfc; 
    
    /* Apliquem l'animació anomenada 'flicker' */
    animation: flicker 3s infinite alternate;
}

/* Definició de l'animació */
@keyframes flicker {
    0%, 90%, 93%, 96%, 100% { 
        /* Estat encès: combinem el teu box-shadow amb un text-shadow potent */
        text-shadow: 
            0 0 7px #ff6dfd80,
            0 0 10px #ff6dfdb5,
            0 0 21px #ff6dfd4a,
            0 0 42px #ff6dfd3a,
            0 0 80px #ff6dfd45;
    }
        
        91%, 94%, 98% {  
        /* Estat "apagat" o tènue: el neó falla momentàniament */
        text-shadow: none;;
        color: #FFCAF3; /* El text es torna fosc com si la llum s'apagués */
    }
}




h2 {
     font-family: 'Terminal', serif;
    font-size: 2rem;
    margin-bottom: -10px;
}

#benvingudi {
    padding-top: 15px;
      animation: 
    rainbow-move 4s linear infinite,
    gentle-wave 4s ease-in-out infinite;
}

p {
    margin: 0;
}

.img-novetats {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 15px;
    border-radius: 7px; 
}

.btn-retro {
    position: fixed;
    z-index: 9999;
    top: 20px;
    border: 2px solid black;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    background-color: black;
    color: #FFCAF3;
    border-radius: 10px;
    font-family: 'Terminal', normal;
    font-weight: bolder;
    font-size: 0.8rem;
    border: 3px solid #FF6DFC;
    outline: 3px solid black;
    text-decoration: none; /* Quita el subrayado del enlace */
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 109, 252, 0.5);
}



.btn-retro:hover {
    background-color: #FF6DFC;
    color: black;
    box-shadow: 0 0 20px rgba(255, 109, 252, 1);
}

/* Posición específica para TEMA */
.tema-toggle {
    right: 20px;
}


/* Posición específica para TORNAR */
.back-toggle {
    left: 20px;
    right: auto; /* <--- ESTO anula el right si heredara de otra clase */
}


/* Layout de 3 columnas */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    max-width: 939px;
    margin: 0 auto;
    align-items: stretch; /* Asegura que todas las .column midan lo mismo */
}

.grid-container-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-width: 939px;
    margin: 0 auto;
    align-items: stretch; /* Asegura que todas las .column midan lo mismo */
}

.column {
    display: flex;
    flex-direction: column;
    height: 100%; 
    max-width: 310px;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
    background-color: rgba(0, 0, 0, 0.4) !important; 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


/* Estilo de las Cajas Negras */
.box {
    background-color: transparent;
    border-top-right-radius: 7px;
    border-top-left-radius: 7px;
    margin-bottom: 0px;
    overflow: visible;
    color: #C19BC0;
    border: 2px solid black;
    margin-top: -10px;
    padding: 0;
}

.grid-container-manteniment {
    display: flex;             /* Mode flexible */
    justify-content: center;   /* Centra horitzontalment */
    align-items: center;       /* Centra verticalment */
    
    width: 100%;               /* Ocupa tota l'amplada */
    height: 100vh;            /* Ocupa tota l'alÃ§ada de la pantalla */
    
    margin: 0;                 /* Treu marges que puguin moure la caixa */
    position: fixed;           /* Fixat a la pantalla perquÃ¨ res el mogui */
    top: 0;
    left: 0;
}

/* Opcional: Per seguretat, ens assegurem que la columna no tingui marges */
.column-manteniment {
    display: flex;
    justify-content: center;
}

#box-manteiniment {
    width: 300px;              /* Amplada fixa de la caixa */
    background-color: black;
    border-radius: 7px;
    color: #C19BC0;
    border: 2px solid black;
    margin: 0;                 /* Treiem el margin-top negatiu */
    z-index: 10;               /* Per sobre de fons si n'hi haguÃ©s */
}

.box-title {
    background-color: black;
    color: #FFCAF3;
    text-align: center;
    padding: 8px 6px 6px 6px;
    margin: 0;
    font-family: 'Terminal', serif;
    font-size: 1.5rem;  
    font-weight: 0;
}


.box-content {
    background-color: #FFCAF3; /* Fondo blanco dentro de la caja para el texto */
    color: black;
    border-radius: 7px 7px 0px 0px;
    margin-top: -5px;
    padding: 7px 10px 15px 10px;
    min-height: 30px;
    line-height: 1;
    font-size: 1rem;
    text-align: center;
    line-height: 1.2;
}

/* Esto obliga a la última caja de cada columna a ocupar todo el espacio sobrante */
.column .box:last-child {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Y esto asegura que el fondo rosa de la caja también llegue hasta el final */
.column .box:last-child .box-content {
    flex-grow: 1;
}
.links-grid {
    display: flex;       /* Activa el mode flexible */
    flex-wrap: wrap;     /* Permet que els botons baixin a la segÃ¼ent lÃ­nia */
    gap: 10px;           /* Crea l'espai exacte entre botons (horitzontal i vertical) */
    justify-content: center; /* Centra els botons com a la imatge */
    align-items: center;
    padding: 5px 5px 15px 13px;
    margin: 0;
}

/* Ajust puntual per als botons dins d'aquesta graella */
.links-grid .btn {
    margin: 0;           /* Eliminem marges antics perquÃ¨ ara fem servir 'gap' */
    display: inline-block;
    flex-grow: 0;        /* Impedeix que els botons s'estirin per ocupar tota la fila */
    text-align: center;
    padding: 5px;
}


/* Columna Central ASCII */
.center-col {
    background-color: black;
    border-radius: 7px;
    display: flex;
    align-items: flex-start;
    padding: 0 20px;
    border: 2px solid black;
}

.ascii-art {
    color: #FF6DFC;
    font-family: monospace;
    font-size: 8px;
    line-height: 8px;
    margin: 0;
    white-space: pre;
}

/* Responsive para mÃ³viles */

@media (max-width: 960px) {
   .grid-container, .grid-container-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px;
    max-width: 620px;
    margin: 0 auto;
    }
    #benvingudi {
        font-size: 1.38rem;
        margin-top: 30px;

    }
    .center-col {
        display: none;
    }

}

/* Responsive para mÃ³viles */

@media (max-width: 642px) {
   .grid-container, .grid-container-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    }
    #benvingudi {
        font-size: 1.38rem;
        margin-top: 35px;

    }
    .center-col {
        display: none;
    }
}

.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.1); /* Un poco mÃ¡s oscuro */
    backdrop-filter: blur(9px);
    
    /* NUEVO: Truco para centrar vertical y horizontalmente de forma robusta */
    text-align: center;
    white-space: nowrap; /* Necesario para el truco de centrado */
}

/* Elemento fantasma para ayudar al centrado vertical */
.modal::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -0.25em;
}

/* 2. La imagen dentro del modal */
.contenido-modal {
    display: inline-block;
    vertical-align: middle;
    
    /* --- LA SOLUCIÃ“N A LA DEFORMACIÃ“N --- */
    width: auto;  /* Deja que calcule el ancho natural */
    height: auto; /* Deja que calcule el alto natural */
    
    /* LÃ­mites: Nunca mÃ¡s del 95% del ancho o 90% del alto de la pantalla */
    max-width: 95%; 
    max-height: 90vh; 
    /* ----------------------------------- */

    
    border-radius: 2px;
    
    /* Eliminamos los mÃ¡rgenes antiguos que daban problemas */
    margin: 0; 
}

/* BotÃ³n de cerrar (pequeÃ±o ajuste de posiciÃ³n) */
.cerrar-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px;
    background-color: black;
    color: white;
    font-family: 'Press Start 2P', cursive; /* O la teva font pixel */
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;

    /* El truc de la doble vora pixelada */
    border: 3px solid white;    /* Vora clara interior */
    outline: 3px solid black;   /* Vora negra exterior */
    margin: 4px;
    text-align: center;                /* Espai per a l'outline */
}

.cerrar-modal:hover {
    background-color: #FF6DFC; /* Es torna rosa al passar el ratolÃ­ */
    color: black;
}
/* Cursor de lupa para las imÃ¡genes de las cajas */
.img-novetats {
    cursor: zoom-in;
    transition: 0.3s;
}

.img-responsive:hover {
    opacity: 0.5;
}

/* Bustia de petons */
/* Contenidor general */
.bustia-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.labelt {
    margin: 0;
    padding: 0;
}
/* Estil dels inputs retro */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    font-size: 12px;
    border-radius: 7px;
    color: #FFCAF3;
}

.input-group input {
    background: black;
    border: 2px solid #FF6DFC;
    padding: 5px;
    font-family: 'Terminal', sans serif;
    font-size: 1rem;
    color: #FFCAF3;
    outline: none;
    border-radius: 10px;
}
.pixel-divider {
    border: none;               /* Quitamos la lÃ­nea por defecto */
    height: 0px;                /* Le damos grosor */
    margin: 1px 0;             /* Espacio arriba y abajo */
}
#numpetons {
    width: 50px;
    align-items: center;
}
/* El registre amb scroll */
.scroll-registre {
    max-height: 250px; /* AlÃ§ada mÃ xima del registre */
    overflow-y: auto;  /* Activa el scroll vertical */
    border: 2px solid black;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 10px;
}

body.dark-mode .scroll-registre {
    background: none;
    border: 2px solid #FF6DFC;
}

/* Cada entrada del registre */
.entrada-bes {
    border-bottom: 1px dashed black;
    padding: 10px 0;
    margin-bottom: 5px;
}
.entrada-bes.ancorat {
    border: 2px solid #FF6DFC; /* Color dorat */
    background-color: white; 
}

body.dark-mode .entrada-bes.ancorat {
    background-color: #000000;
}

.pin {
    display: block;
    font-size: 0.8em;
    color: #FF6DFC;
    font-weight: bold;
    margin-bottom: 5px;
}

.detalls-bes {
    font-size: 14px;
    margin-bottom: 5px;
    /* Aquestes línies són vitals: */
    word-wrap: break-word; 
    overflow-wrap: break-word;
    line-height: 1.4; /* Millora la lectura amb els nous salts de línia */
}


/* Personalitzar el scrollbar per fer-lo retro */
.scroll-registre::-webkit-scrollbar {
    width: 8px;
}
.scroll-registre::-webkit-scrollbar-track {
    background: black;
     border-radius: 5px;
}
.scroll-registre::-webkit-scrollbar-thumb {
    background: #FF6DFC;
    border: 1px solid white;
    border-radius: 5px;
}
.peto-pixel {
    width: 28px;   /* Ajusta segons el teu dibuix */
    height: auto;
    image-rendering: pixelated; /* PerquÃ¨ no es vegi borrosa */
    margin-right: 2px;
}
/* Contenidor invisible per als petons animats */
.animacio-peto {
    position: fixed;
    pointer-events: none; /* PerquÃ¨ no molestin si cliques a sobre */
    z-index: 9999;
    image-rendering: pixelated;
    width: 40px; 
    height: auto;
    animation: volar-peto 2s ease-out forwards;
}

@keyframes volar-peto {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(1.5); /* Puja i es fa gran */
        opacity: 0;
    }
}
.calendar-grid {
    display: grid;
    /* Cambiamos 1fr por minmax para evitar desbordamientos */
    grid-template-columns: repeat(7, minmax(0, 1fr)); 
    gap: 4px; /* Un poco más de espacio ayuda visualmente */
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.dia-cal {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2px; /* Redúcelo un poco si es necesario */
    border: 1px solid black;
    background: rgba(255, 255, 255, 0.1);
    font-size: clamp(0.5rem, 2vw, 0.7rem); /* Fuente fluida según el ancho */
    box-sizing: border-box;
    width: 100%; /* Asegura que ocupe su celda y nada más */
    overflow: visible; /* Evita que el contenido rompa la caja */
    border-radius: 3px;
    position: relative;
}

.dia-cal.bue {
    border: none;
    background: transparent;
}

.num-dia {
    align-self: flex-start;
}

/* Contenidor i icones de la lluna */
.contenidor-lluna {
    width: 100%;
    flex-grow: 1; /* Que ocupe el espacio central */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0; /* Importante en flexbox */
}

.icona-lluna {
    max-width: 80%; /* No deja que la luna toque los bordes */
    max-height: 80%;
    height: auto;
    object-fit: contain;
    image-rendering: pixelated;
}
/* NavegaciÃ³ del calendari */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    margin-top: 10px;
}

#mes-any {
    font-size: 1rem;
    min-width: 120px;
    text-align: center;
    color: black;
}
.dark-mode #mes-any {
color: #fbcaf3;
}

/* Dates HistÃ²riques (Rosa) */
.dia-especial {
    background-color: #FF6DFC !important;
    color: black;
    font-weight: bold;
    cursor: help;
    z-index: 10;
}

/* --- TOOLTIP (Text flotant al passar el ratolÃ­) --- */
/* --- TOOLTIP UNIVERSAL --- */

/* Es mostrarÃ  en qualsevol dia que tingui l'atribut data-titol i no estigui buit */
.dia-cal[data-titol]:not([data-titol=""]):hover::after,
.dia-cal[data-titol]:not([data-titol=""]).actiu::after {
    content: attr(data-titol);
    position: absolute;
    bottom: 125%; 
    left: 50%;
    transform: translateX(-50%);
    background-color: black;
    color: #FF6DFC;
    padding: 8px 12px; /* Una mica més de padding per llegibilitat */
    font-size: 0.75rem;
    
    /* CANVIS CLAU AQUÍ: */
    white-space: normal;       /* Permet el salt de línia */
    width: max-content;        /* S'ajusta al text si és curt */
    max-width: 200px;          /* No deixa que sigui infinitament ample */
    min-width: 100px;          /* Evita que quedi massa estret */
    text-align: center;
    
    border: 2px solid #FF6DFC;
    z-index: 9999;
    box-shadow: 3px 3px 0px rgba(0,0,0,1);
    pointer-events: none;
    display: block;
}

.dia-cal[data-titol]:not([data-titol=""]):hover::before,
.dia-cal[data-titol]:not([data-titol=""]).actiu::before {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #FF6DFC transparent transparent transparent;
    z-index: 9999;
    display: block;
}

/* Afegim cursor help a qualsevol dia amb text */
.dia-cal[data-titol]:not([data-titol=""]) {
    cursor: help;
}
/* AixÃ² fa que el tooltip surti tant amb el hover (PC) com amb la classe .actiu (MÃ²bil) */
.dia-especial:hover::after,
.dia-especial.actiu::after {
    display: block;
    opacity: 1;
    visibility: visible;
}

.dia-especial:hover::before,
.dia-especial.actiu::before {
    display: block;
    opacity: 1;
    visibility: visible;
}
@media (max-width: 600px) {
    .dia-especial:hover::after,
    .dia-especial.actiu::after {
        white-space: normal; /* Permet que el text baixi de lÃ­nia */
        width: 150px;        /* Limitem l'amplada perquÃ¨ no ocupi tota la pantalla */
    }
}

@media (max-width: 480px) {
    .dia-cal[data-titol]:not([data-titol=""]):hover::after,
    .dia-cal[data-titol]:not([data-titol=""]).actiu::after {
        max-width: 160px; /* Una mica més estret en mòbils petits */
        font-size: 0.7rem;
        bottom: 115%;     /* Una mica més a prop del dia */
    }
}

/* Dia actual al calendari */
.dia-cal.dia-avui {
    border: 2px solid #FF6DFC !important; /* Vora rosa neÃ³ */
    background: rgba(255, 109, 252, 0.15) !important; /* Fons rosat transparent */
    box-shadow: inset 0 0 5px #FF6DFC; /* Petit resplendor interior */
}

/* En mode nit, podem fer que brilli una mica mÃ©s */
body.dark-mode .dia-cal.dia-avui {
    border-color: #ffffff !important;
    box-shadow: 0 0 8px #FF6DFC;
}

/* Contenidor per a la purpurina */
#glitter-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* PerquÃ¨ puguis clicar a travÃ©s d'ells */
    z-index: -1; /* Per darrere de tot el contingut */
    overflow: hidden;
}

/* El pÃ­xel individual */
.sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    box-shadow: 0 0 4px 1px white; /* Efecte resplendor */
    opacity: 0;
    animation: destello 2s ease-in-out infinite;
}

/* AnimaciÃ³ de parpelleig i creixement */
@keyframes destello {
    0%, 100% { 
        transform: scale(0); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.5); 
        opacity: 0.8; 
        /* Efecte de reflex: canvi de color rÃ pid */
        box-shadow: 0 0 6px 2px #FF6DFC, 0 0 2px 1px white;
    }
}


/* --- ESTILS MODE NIT --- */

body.dark-mode {
    /* Canviem el fons pel fitxer fosc */
    background-image: url('assets/fondomuroO.webp') !important;
    background-color: #1a1a2e; 
    color: #FF6DFC; 
}

/* Millorem el contrast de les caixes en mode fosc */
body.dark-mode .box-content {
    background-color: transparent; /* Un fons fosc per a les caixes */
    color: #FFCAF3;
}

body.dark-mode .img-2Massanes {
    filter: invert(100%)
}

body.dark-mode .les-dues {
    color: white;
}

body.dark-mode .subt-div-2M {
    color: white;
}

body.dark-mode .box-title {
    background-color: #000000;
    color: #FF6DFC;
}

/* Fem que el botÃ³ de TEMA ressalti en el fosc */
body.dark-mode .tema-toggle {
    border-color: #FF6DFC;
    color: #fbcaf3;
}

body.dark-mode .tema-toggle:hover {
    color: black;
} 

body.dark-mode #box-manteiniment {
    border-color: #FF6DFC;
}

body.dark-mode #box-manteiniment .box-content {
    background-color: transparent; /* Color fosc per dins de la caixa */
    color: #FFCAF3;
}

.dark-mode #titol {
color: #fbcaf3;

}
.dark-mode #benvingudi {
        color: #fbcaf3;

  /* 5. Animacions */
  animation: 
    rainbow-move 4s linear infinite,
    gentle-wave 4s ease-in-out infinite;
}
/* --- POPUP --- */
.overlay-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Fons fosc semi-transparent */
    backdrop-filter: blur(8px);           /* L'efecte de desenfocament */
    display: flex;                        /* Per centrar el contingut */
    justify-content: center;
    align-items: center;
    z-index: 10000;                       /* Per sobre de tot (inclÃ²s el header) */
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.box-popup {
        background-color: rgba(0, 0, 0, 0.4) !important; 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid black;
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(255, 109, 252, 0.5);
    margin: auto;
    margin: 25px;
}

.box-title-popup {
    display: flex;
    justify-content: space-between; /* TÃ­tol esquerra, botons dreta */
    align-items: flex-start;        /* Enganxats al sostre */
    background-color: black;
    color: #FFCAF3;
    padding: 5px 4px 5px 4px;               /* Padding ajustat */
    margin: 0;
}

.titol-text-popup {
    text-align: left;               /* Text del tÃ­tol a l'esquerra */
    font-family: 'Terminal', serif;
    font-size: 1.8rem;
    padding: 0px 30px 0px 0px;
}

.box-controls-popup {
    display: flex;
    gap: 10px;
    margin-top: -3px;               /* Puja els botons per enganxar-los a dalt */
}

.control-btn-popup {
    color: #FFCAF3;
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 16px;
    cursor: default;
    user-select: auto;
}
.control-btn-popup:hover {
    color: #FF6DFC;
}

/* --- CONTINGUT I COLORS --- */
.box-content-popup {
    background-color: #ffcaf4;      /* Color Light Mode */
    color: black;
    padding: 15px;
    text-align: center;             /* Tot el contingut centrat */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 950;
}

.box-content p {
    margin-bottom: 10px;
    text-align: center;
}

.overlay-blur.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- MODE NIT (DARK MODE) --- */
body.dark-mode .box-content {
    background-color: transparent;      /* Color Dark Mode */
    color: #fbcaf3;
}

body.dark-mode .control-btn, 
body.dark-mode .titol-text {
    color: #FF6DFC;                 /* Els controls brillen mÃ©s en fosc */
}
/* Botones con estilo retro */
.btn {
    display: block;
    width: fit-content;
    margin: 10px auto 6px;
    background-color: black;
    color: #FFCAF3;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Terminal', normal;
    font-weight: bolder;
    font-size: 0.9rem;
    border: 3px solid #FF6DFC;    /* Vora clara interior */
    outline: 3px solid black;   /* Vora negra exterior */
    box-shadow: 0 0 10px rgba(255, 109, 252, 0.5);

}

.btn:hover {
    background-color: #FF6DFC;
    color: black;
    box-shadow: 0 0 20px rgba(255, 109, 252, 1);
}

#ExpoVirtual {
    padding-top: 18px;
}

.rainbow-text {
  font-family: 'Bangalore', sans-serif;
  font-weight: bold;
  font-size: 1.2rem;
 display: block;      /* Canviem inline-block per block */
  margin: 0 auto;      /* Això centra elements de tipus block */
  width: fit-content;
  
  /* 1. Degradat simètric per evitar talls */
  /* Fem servir 5 punts perquè el primer i l'últim siguin idèntics */
  background: linear-gradient(
    45deg,
    #FF6DFC 0%,
    #ffcaf4 25%,
    #FF6DFC 50%,
    #ffcaf4 75%,
    #FF6DFC 100%
  );

  /* 2. Mida del fons */
  /* El posem al 200% d'amplada per tenir "pista" per recórrer */
  background-size: 200% 100%;

  /* 3. Aplicar al text */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* 4. Drop Shadow per al contorn */
  filter: drop-shadow(2px 2px 0px #000000) 
          drop-shadow(-1px -1px 0px #000000);

  /* 5. Animacions */
  animation: 
    rainbow-move 4s linear infinite,
    gentle-wave 4s ease-in-out infinite;
}

/* CLAU PER EVITAR EL TALL: */
/* Movent de 0% a 100% en un fons del 200%, el cicle es tanca perfectament */
@keyframes rainbow-move {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

@keyframes gentle-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.caixa-contador {
    background: black;
    border: 1.5px solid #FF6DFC;
    border-radius: 10px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0px auto;
    max-width: 400px;
    margin-left: auto;
}
.text-contador {
    white-space: nowrap; /* Això impedeix que el text salti de línia encara que no hi hagi espai */
}

#contador-total {
    font-size: 0.9rem;
    font-weight: bold;
    color: #FFCAF3;
    display: inline;
    line-height: 1;
}

.peto-pixel-gran {
   width: 15px;   /* Ajusta segons el teu dibuix */
    height: auto;
    image-rendering: pixelated; /* PerquÃ¨ no es vegi borrosa */
    margin-right: 2px;
    margin-left: 5px;
}


.grid-container-1 {
    display: grid;
    grid-template-columns: 1fr;
    justify-items:center;
    max-width: 930px;
    margin: 0 auto;
    align-items: stretch; /* Asegura que todas las .column midan lo mismo */
}
.column-1 {
    display: flex;
    flex-direction: column;
    height: 100%; 
    max-width: 930px;
}

.les-dues {
    font-family: 'Jacquard 12', serif; /* Asegúrate de declarar la familia */
    color: black;
    text-align: right;
    font-size: 6.9rem; 
    margin-bottom: 0px;
    font-weight: 50;
    
    /* EL TRUCO PARA PIXEL FONTS */
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    text-rendering: optimizeSpeed;
}
#Massanes {
     font-family: 'Terminal', serif;
    font-weight: 100;
    margin-top: -25px;
}

.img-2Massanes {
    /* Aquesta és la clau: diu al navegador que no suavitzis els píxels */
    image-rendering: pixelated;
    
    /* Per a compatibilitat amb navegadors més antics (com Firefox) */
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;

    /* Ara pots posar la mida que vulguis i es veurà nítid */
    width: 400px; /* Per exemple, 4 vegades la seva mida original */
    height: auto;
   margin: -10px 20px 40px 10px;
    flex-shrink: 0;
}

.subt-2M {
    font-family: 'Terminal', serif;
    font-size: 1.29rem;
    margin: -10px -5px 50px 0;       
    flex: 1;                /* Fa que el text ocupi la resta de l'espai disponible */
    font-weight: 50;
}


.subt-div-2M{
    display: flex;          /* Fa que els fills es posin de costat */
    align-items: center;    /* Centra la imatge i el text verticalment */
    gap: 20px;              /* Espai entre la imatge i el text */
    margin-top: 20px;
}
.img-expo-2M {
    max-width: 600px;
}


/* --- CODI DE LA CARTELA (fora de la media query perquè es vegi sempre) --- */
.cartela {
    display: flex;
    flex-direction: row; 
    align-items: flex-start;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px 50px;
    gap: 50px;
     font-family: 'Terminal', serif;
    max-width: 1000px;
    margin: 40px auto;
    color: black;
    box-sizing: border-box;
    margin: 30px 25px;
}

.cartela-info {
    flex: 1;
    min-width: 200px;
}

.cartela-descripcio {
    flex: 2;
    line-height: 1.6;
    text-align: left;
}

.cartela-info p, .cartela-descripcio p {
    margin-bottom: 12px;
}

.enllac-rosa {
    color: #FF6DFC;
    text-decoration: none;
    font-weight: bold;
}

.enllac-rosa:hover {
    text-decoration: underline;
}

body.dark-mode .cartela {
    background-color: #1e1e1e;
    color: #FFCAF3; 
}

@media (max-width: 600px) {
    /* 1. La columna s'adapta amb un 5% de marge a cada costat */
    .grid-container-1 {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .column-1 {
        width: 90%; /* Això deixa automàticament un 5% a cada costat (100-90 = 10 / 2) */
        margin: 0 auto;
        display: flex;
        flex-direction: column;
    }

    /* 2. Títol petit i aliniat a la dreta */
    .les-dues {
        font-size: 4.8rem;
        text-align: right;
        margin-right: 0;
        width: 100%;
    }
    
    #Massanes {
        font-size: 3.2rem;
        margin-top: -10px;
        text-align: right;
    }

    /* 3. Contenidor de la primera imatge i subtítol */
    .subt-div-2M {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-top: 20px;
    }

    /* Primera imatge: 5% esquerra, 25% dreta (ample total 70%) */
    .img-2Massanes {
        width: 85% !important; 
        margin-left: 5% !important;
        margin-right: 25% !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        display: block;
    }

    /* 4. Subtítol a sota de la imatge */
    .subt-2M {
        font-size: 1.1rem;
        width: 100%;
        margin: 10px 0;
        padding: 0;
        text-align: justify;
        line-height: 1.2;
        font-weight: 400;
    }

    /* 5. Segona imatge ocupant TOTA la pantalla (trencant el marge del 5%) */
    .img-expo-2M {
        width: 90vw !important;
        margin-left: 0.0% !important;
        margin-top: 40px;
        max-width: none !important;
        height: auto;
        display: block;
    }

    /* 6. Cartela amb columnes una sobre l'altre */
    .cartela {
        flex-direction: column;
        width: 100%;
        padding: 20px;
        gap: 15px;
        margin: 30px 0;
        box-sizing: border-box;
    }

    .cartela-info, .cartela-descripcio {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .cartela-info {
        border-bottom: 1px solid rgba(0,0,0,0.1);
        padding-bottom: 15px;
    }
}

.align p {
    text-align: justify;
}
.box-plus {
    margin-bottom: 25px;
}

.desc-petita {
    font-size: 0.8rem;
    line-height: 1.3;
    text-align: left;
}

/* Compra */

.producte-container {
  display: flex;
  flex-wrap: wrap; /* Perquè en mòbils es posin un sota l'altre */
  gap: 40px;
  padding: 20px;
  align-items: flex-start;
}

.producte-imatge {
  flex: 1; /* Ocupa el 50% aprox */
  min-width: 300px;
}

.producte-imatge img {
  width: 100%; /* La imatge s'adapta al contenidor */
  height: auto;
  border: 2px solid #000; /* Estètica retro */
}

.producte-info {
  flex: 1;
  min-width: 300px;
  padding: 20px;
  border-radius: 8px;
  height: auto;
}

/* Estils pel formulari */
form label, form input {
  display: block;
  width: 100%;
  margin-bottom: 10px;
}

.input-compres {
    margin-bottom: 10px;
    width: auto;
}

/* El contenidor ara semblarà l'input */
.input-wrapper {
  background-color: black;    /* Com els teus altres inputs */
  border-radius: 10px; 
  border: 2px solid #ff6dfc;       /* Ajusta-ho segons el teu radi de vora */
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 10px;        /* Espaiat entre camps */  
}

/* L'input de dins es torna "invisible" perquè només es vegi el número */
.input-wrapper .input-compres {
  background: transparent !important;
  border: none !important;   /* El color del text del número */
  margin: 0 !important;
  padding: 5px 5px 5px 0 !important;
  width: 100%;                /* Que ocupi tot l'espai */
  outline: none;
}

/* El símbol de l'euro */
.currency {            /* O el color que tinguis per als placeholders */
  font-family: inherit;
  font-weight: bold;
  padding-right: 5px;
}

#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Al fons de tot */
    pointer-events: none; /* Deixa que es pugui clicar el que hi hagi a sota */
}
pre:not(.ascii-art) {
    white-space: pre-wrap;       
    word-wrap: break-word;       
    width: 100%;                 /* Força a ocupar exactament l'espai disponible */
    max-width: 100%;             
    box-sizing: border-box;      /* LA CLAU: Fa que el padding no engreixi la caixa */
    overflow-x: auto;
   color: #ff6dfc;
    
    /* Toc estètic */
  
    padding: 15px;               
    border-radius: 8px;          
  
        background-color: white;
    border: 1px solid #fbcaf3; 
}
pre code {
    white-space: pre-wrap;
    word-break: break-all;
    color: #ff6dfc;
}

body.dark-mode pre:not(.ascii-art) {
    border: 1px solid #ff6dfc;
        background-color: #1a1a1a; 
}

.guia {
    font-family: 'Terminal', sans-serif;
}

body.dark-mode .guia h2 {
    font-family: 'Terminal', sans-serif;
    padding-bottom: 15px;
    color: #ff6dfc;
}

body .guia h2 {
    font-family: 'Terminal', sans-serif;
    padding-bottom: 15px;
    color: black;
}

.guia {
    gap: 0
}

.guia img {
    margin-top: 10px;
}
/* --- ESTILS PER A L'ÍNDEX INTERACTIU --- */
.index-interactiu {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ff6dfc; /* Línia fúcsia per separar de la intro */
}

.index-interactiu h2 {
    color: #ff6dfc;
    margin-top: 0;
}

.index-interactiu ul {
    list-style-type: none; /* Treu els puntets rodons per defecte */
    padding-left: 0;

}

.index-interactiu li {
    margin-bottom: 12px;
}

.index-interactiu a {
    color: inherit;
    text-decoration: none;
    font-size: 1.1rem;
    display: inline-block;
    transition: all 0.3s ease; /* Fa que l'animació sigui suau */
}

/* Efecte hacker al passar el ratolí */
.index-interactiu a:hover {
    color: #ff6dfc;
    transform: translateX(8px); /* Desplaça el text 8px cap a la dreta */
}

.guia h1 {
    font-size: 2.4rem;
}

.guia p {
    padding-bottom: 8px;
}
.guia a:not(.index-interactiu a) {
    color: #ff6dfc;
}

.guia strong {
       color: #ff6dfc; 
}

.img-compra {
    margin: auto 0
}

body.dark-mode .finsaki {
    color: #fbcaf3;
}

/* --- ESTILS PER AL SLIDER D'IMATGES --- */
.slider-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-images {
    width: 100%;
    position: relative;
}

.slider-images img {
    display: none; /* Amaguem totes les imatges per defecte */
    width: 100%;
    border-radius: 7px;
}

.slider-images img.activa {
    display: block; /* Només mostrem la que té la classe 'activa' */
}

/* Fletxes de navegació retro */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #FF6DFC;
    border: 2px solid #FF6DFC;
    font-size: 18px;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 5px;
    font-family: 'Terminal', sans-serif;
    transition: 0.3s;
}

.slider-btn:hover {
    background-color: #FF6DFC;
    color: black;
}

.prev-btn {
    left: 5px;
}

.next-btn {
    right: 5px;
}

.col-compra {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Inputs del formulari de l'arxiu respectant el teu estil */
.input-retro, .input-retro-full {
    background-color: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid #FF6DFC;
    padding: 5px 10px;
    font-family: 'Terminal', sans-serif;
    color: #FFCAF3;
    outline: none;
    border-radius: 7px;
    margin: 5px;
}
.input-retro-full {
    width: 90%;
    margin-bottom: 10px;
}

/* Graella de 3 columnes */
.grid-arxiu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 939px;
    margin: 0 auto;
}

/* Targeta individual de cada arxiu */
.arxiu-item {
     background-color: rgba(0, 0, 0, 0.4) !important; 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid #FF6DFC;
    border-radius: 7px;
    position: relative;
    overflow: hidden; /* Important per amagar el text flotant */
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.arxiu-item img {
    width: 100%;
    height: 350px;
    object-fit: cover; /* Retalla la imatge proporcionalment */
    border-bottom: 2px solid #FF6DFC;
}

.arxiu-info {
    padding: 10px;
    color: #FFCAF3;
    text-align: center;
}

.arxiu-info h4 { margin: 5px 0; font-size: 1.2rem; }
.arxiu-info h5 { margin: 0; color: #C19BC0; font-weight: normal; }
.arxiu-info small { display: block; margin-top: 10px; opacity: 0.7; }

/* El text ocult (overlay) que apareix al clicar */
.arxiu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Scroll si el text és llarg */
    transform: translateY(100%); /* L'amaguem cap a baix */
    transition: transform 0.3s ease-in-out;
    pointer-events: none;
}

/* Quan JS li afegeixi la classe .actiu (al clicar), l'overlay puja */
.arxiu-item.actiu .arxiu-overlay {
    transform: translateY(0);
    pointer-events: auto;
    border-top: 2px solid #FF6DFC;
}

/* Responsive: 2 columnes en tauletes, 1 en mòbils */
@media (max-width: 960px) { .grid-arxiu { grid-template-columns: 1fr 1fr; } }
@media (max-width: 642px) { .grid-arxiu { grid-template-columns: 1fr; } }

.tag-manager { width: 100%; margin-bottom: 15px; text-align: left; font-family: 'Terminal'; }
.tags-container { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; min-height: 25px; }

.tag-badge {
    background: #FF6DFC;
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tag-badge span { cursor: pointer; font-weight: bold; }

.search-box { position: relative; }
.dropdown-suggeriments {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: black;
    border: 1px solid #FF6DFC;
    z-index: 100;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}
.dropdown-item { padding: 8px; cursor: pointer; color: #FFCAF3; border-bottom: 1px solid #333; }
.dropdown-item:hover { background: #333; }
.dropdown-item.nou { color: #FF6DFC; font-style: italic; }

/* --- ENLLAÇOS DINS DE L'ARXIU --- */
.enllac-arxiu {
    color: #FF6DFC;
    text-decoration: underline;
    font-weight: bold;
    word-break: break-all; /* Això evita que un enllaç molt llarg surti fora de la caixa */
    transition: all 0.2s ease-in-out;
}

.enllac-arxiu:hover {
    color: white;
    text-shadow: 0 0 8px #FF6DFC;
    text-decoration: none;
}
.petons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 109, 252, 0.3);
}

.btn-peto-arxiu {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.btn-peto-arxiu:hover {
    transform: scale(1.3);
}

.comptador-petons {
    color: #FF6DFC;
    font-weight: bold;
    font-size: 0.9rem;
}

.btn-peto-arxiu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mida de la imatge del petó */
.img-peto-btn {
    width: 25px !important;   /* Ajusta-ho si ho vols més gran */
    height: auto !important;
    border: none !important;
    display: block;
}

/* Efecte en passar el ratolí */
.btn-peto-arxiu:hover {
    transform: scale(1.4) rotate(-10deg);
}

/* Efecte en clicar (feedback visual) */
.btn-peto-arxiu:active {
    transform: scale(0.9);
}

.search-box { 
    position: relative; 
    z-index: 999; /* Donem prioritat a la caixa del cercador */
}

.dropdown-suggeriments {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: black;
    border: 1px solid #FF6DFC;
    z-index: 1000; /* Donem la màxima prioritat al desplegable */
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

.caixeta h2 {
    background-color: transparent !important; /* Traiem el negre sòlid perquè es vegi la foto */
    background-size: cover;
    background-position: center;
    image-rendering: pixelated; /* Manté l'efecte Pixel Art nítid */
}

.box-title {
    background-image: linear-gradient(rgb(0, 0, 0), rgb(31, 2, 30)), url('assets/2M-6.webp');
}@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* --- PAGINACIÓ ÚLTIMES CREACIONS --- */
.creacio-item {
    display: none; /* Amaguem totes les obres per defecte */
}

.creacio-item.visible {
    display: block; /* Mostrem només les que decideixi el JS */
}

/* ==========================================
   SISTEMA DE COMENTARIS (Arxiu i Referents)
   ========================================== */

.seccio-comentaris {
    margin-top: 15px;
    border-top: 1px dashed #FFCAF3;
    padding-top: 10px;
}

.llista-comentaris {
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.comentari-item {
    margin-bottom: 8px;
    font-size: 0.85rem;
    border-left: 2px solid #FF6DFC;
    padding-left: 8px;
    text-align: left;
}

.comentari-nom {
    color: #FF6DFC;
}

.comentari-text {
    color: #fff;
    word-break: break-word;
}

.comentari-buit {
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
}

.form-comentari {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nom-comentari, .text-comentari {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;
}

.text-comentari {
    resize: none;
}

.btn-enviar-comentari {
    position: relative;
    width: 100%;
    margin: 5px 0 0 0;
    font-size: 0.8rem;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
}

/* 1. Per a navegadors basats en WebKit (Chrome, Safari, Edge, Opera) */

/* Defineix l'amplada total de la barra */
::-webkit-scrollbar {
    width: 10px; /* Barra vertical */
    height: 10px; /* Barra horitzontal */
}

/* El fons de la barra (track) */
::-webkit-scrollbar-track {
    background: #121212; /* Un negre fosc que combini amb el teu fons */
}

/* La part que l'usuari arrossega (thumb) */
::-webkit-scrollbar-thumb {
    background: #FF6DFC; /* El teu rosa característic */
    border-radius: 5px;  /* Arrodonit */
    border: 2px solid #121212; /* Espai visual entre el thumb i el track */
}

/* Efecte en passar el ratolí per sobre del thumb */
::-webkit-scrollbar-thumb:hover {
    background: #ff99f1;
}

/* 2. Per a Firefox (utilitza propietats estàndard) */
* {
    scrollbar-width: thin;          /* "auto", "thin" o "none" */
    scrollbar-color: #FF6DFC #121212; /* color del thumb + color del track */
}

/* --- BOTONS DE CONTROL DEL CREADOR (EDITAR/ELIMINAR) --- */
.controls-creador {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10; /* Per assegurar-nos que estan per sobre de la imatge */
}

.btn-creador {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #FF6DFC;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-creador:hover {
    background-color: #FF6DFC;
    color: black;
    transform: scale(1.1);
}

.btn-eliminar-creador {
    border-color: #FF6DFC;
    color: #FF6DFC;
}

.btn-eliminar-creador:hover {
    background-color: #FF6DFC;
    color: white;
}