/* ==========================================================================
   1. CONFIGURACIÓ GENERAL I FONS (Natura i minimalisme)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f7f4ef; /* Fons sorra molt clar i suau */
    color: #4a4a4a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Contenidor que simula la pantalla del mòbil amb el fons de la imatge */
.app-container {
    background: url('recursos/fons-natura.png') no-repeat center center;
    background-size: cover;
    width: 100%;
    max-width: 410px;
    height: 840px;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.4);
    position: relative;
}

/* ==========================================================================
   2. CAPÇALERA (Logo amb enllaç i Crèdits)
   ========================================================================== */
.app-header {
    text-align: center;
    margin-bottom: 15px;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.02);
}

.brand-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 2px;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #2c3e35; /* Verd fosc subtil i orgànic */
    text-transform: uppercase;
}

.app-subtitle {
    font-size: 0.78rem;
    color: #55635a;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.author-name {
    font-weight: 600;
    color: #2c3e35;
}

/* ==========================================================================
   3. EL TERMÒMETRE HORITZONTAL (Baròmetre de Vidre)
   ========================================================================== */
.barometre-container {
    margin-bottom: 25px;
    width: 100%;
}

/* Etiquetes de text superiors com al dibuix */
.barometre-labels-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #2b3630;
    font-weight: 500;
    margin-bottom: 8px;
    padding: 0 5px;
}

/* La barra del termòmetre amb el degradat suau de la imatge */
.termometre-barra {
    width: 100%;
    height: 24px; /* Una mica més gruixuda, estil vidre */
    background: linear-gradient(to right, rgba(162,210,214,0.6), rgba(200,230,201,0.6), rgba(246,211,153,0.6), rgba(213,151,121,0.6));
    border-radius: 20px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.06), 0 1px 2px rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(3px);
    cursor: pointer;
}

/* El marcador lliscant (La perla blanca setinada) */
.termometre-marcador {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e2e8e4 75%, #b8c2bc 100%);
    border-radius: 50%;
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15), inset -1px -1px 2px rgba(0,0,0,0.08);
    cursor: grab;
    transition: left 0.1s linear;
}

/* ==========================================================================
   4. EL MENÚ DE PEDRES ORGÀNIQUES (Disposició asimètrica de la imatge)
   ========================================================================== */
.menu-pedres {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 5px 10px;
    flex-grow: 1;
    align-content: flex-start;
    transition: opacity 0.3s ease, grid-template-columns 0.3s ease;
}

/* El botó-pedra base (Ara amb la teva textura real de pedra aplicada) */
.pedra-boto {
    background: url('recursos/textura-pedra.png') no-repeat center center;
    background-size: cover; /* Estén la textura per tot el còdol */
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #4a5a50;
    cursor: pointer;
    min-height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    /* Joc d'ombres avançat: dona el relleu 3D a sobre de la foto de la pedra */
    box-shadow: 
        2px 6px 15px rgba(0, 0, 0, 0.05),
        inset -4px -4px 10px rgba(0, 0, 0, 0.04), 
        inset 4px 4px 10px rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Efecte en passar-hi el ratolí o clicar (Il·luminació orgànica) */
.pedra-boto:hover {
    transform: scale(1.04) translateY(inherit);
    filter: brightness(1.03); /* Li dona una llum suau al tocar-la */
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.07),
        inset -2px -2px 6px rgba(0, 0, 0, 0.03),
        inset 2px 2px 6px rgba(255, 255, 255, 0.9);
}
/* --- REPLICACIÓ DE LA IMATGE: Formes i posicions escalonades --- */
/* Pedra 1 (Top Esquerra / Escolta) */
.menu-pedres .pedra-boto:nth-child(1) {
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    transform: translateY(0px) rotate(-1deg);
}

/* Pedra 2 (Top Dreta / Mira) - Baixa una mica (Escalonada) */
.menu-pedres .pedra-boto:nth-child(2) {
    border-radius: 55% 45% 30% 70% / 50% 60% 40% 50%;
    transform: translateY(20px) rotate(2deg);
}

/* Pedra 3 (Bottom Esquerra / Llegeix) */
.menu-pedres .pedra-boto:nth-child(3) {
    border-radius: 40% 60% 45% 55% / 65% 35% 65% 35%;
    transform: translateY(10px) rotate(-2deg);
}

/* Pedra 4 (Bottom Dreta / Atura't) - Baixa una mica (Escalonada) */
.menu-pedres .pedra-boto:nth-child(4) {
    border-radius: 60% 40% 60% 40% / 40% 65% 35% 60%;
    transform: translateY(30px) rotate(1deg);
}

/* Reacció en interactuar */
.pedra-boto:hover {
    transform: scale(1.04) translateY(inherit);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Contingut intern de la pedra */
.pedra-contingut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.pedra-icona {
    font-size: 1.5rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.03));
}

.pedra-titol {
    font-size: 0.95rem;
    font-weight: bold;
    color: #2b3630;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.pedra-subtitol {
    font-size: 0.72rem;
    color: #6a7b70;
    font-style: normal;
}

/* ==========================================================================
   5. PEU DE PÀGINA (Capsula opaca de text i bateria estil original)
   ========================================================================== */
.app-footer {
    background: rgba(253, 252, 249, 0.88); /* Clar i transparent com a la foto */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 22px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    text-align: center;
}

.app-footer p {
    font-size: 0.78rem;
    line-height: 1.4;
    color: #3b4740;
    font-style: normal;
}

/* Estils de la bateria de presència allotjada al peu */
.bateria-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bateria-text {
    font-size: 0.68rem;
    color: #6a7b70;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bateria-cos {
    width: 34px;
    height: 15px;
    border: 1px solid #b3c2b9;
    border-radius: 4px;
    padding: 1.5px;
    position: relative;
}

.bateria-cos::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 3.5px;
    width: 1.5px;
    height: 6px;
    background: #b3c2b9;
}

.bateria-carrega {
    height: 100%;
    background-color: #8fa882;
    border-radius: 1px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.bateria-percentatge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #2b3630;
}

/* ==========================================================================
   6. BOTÓ TORNAR ENRERE
   ========================================================================== */
.boto-enrere-container {
    display: flex;
    justify-content: center;
    margin: 5px 0 10px 0;
}

.boto-enrere {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #3b4740;
    cursor: pointer;
    backdrop-filter: blur(5px);
}