:root {
    --ph-green: #16a34a;
    --ph-nav-h: 64px;
}

html, body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- App bar ---------- */
.ph-appbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ph-logo {
    font-weight: 800 !important;
    letter-spacing: -.5px;
}

    .ph-logo span {
        color: var(--mud-palette-primary);
    }

.ph-main {
    padding-bottom: calc(var(--ph-nav-h) + env(safe-area-inset-bottom) + 8px);
}

.ph-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* ---------- Hero con foto real ---------- */
.ph-hero {
    position: relative;
    min-height: 340px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.ph-hero-sm {
    min-height: 200px;
}

.ph-hero-overlay {
    width: 100%;
    padding: 24px 20px;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,0) 100%);
}

    .ph-hero-overlay .mud-typography {
        color: #fff;
    }

/* ---------- Anillos del día ---------- */
.ph-rings {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ph-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    background: var(--mud-palette-surface);
}

/* ---------- Tarjetas con foto ---------- */
.ph-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ph-card {
    position: relative;
    height: 150px;
    border-radius: 18px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transition: transform .15s ease;
}

    .ph-card:active {
        transform: scale(.97);
    }

    .ph-card > div {
        width: 100%;
        padding: 12px;
        background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
        display: flex;
        flex-direction: column;
    }

    .ph-card small {
        opacity: .85;
    }

    .ph-card:first-child {
        grid-column: span 2;
    }

/* ---------- Navegación inferior ---------- */
.ph-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    height: calc(var(--ph-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
}

    .ph-bottomnav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 11px;
        text-decoration: none;
        color: var(--mud-palette-text-secondary);
    }

        .ph-bottomnav a.active {
            color: var(--mud-palette-primary);
            font-weight: 600;
        }

/* ---------- Blazor: carga y errores ---------- */
#blazor-error-ui {
    background: lightyellow;
    color: #222;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 7rem;
    height: 7rem;
    inset: 30vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--ph-green);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(30vh + 2.8rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Cargando");
    }
