:root {
    --max-page-height: calc(100dvh - var(--header-max-height));
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    scrollbar-width: none;
}

body.main-screen {
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg);
}


.peaks-page {
    width: 100%;
    height: var(--max-page-height);
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: stretch;
    overflow: hidden;
    background-color: var(--bg);
    font-family: 'Nunito', sans-serif;
}

.peaks-page-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

html,
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

cp-peaks {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
}

cp-peaks::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

cp-peak-card {
    display: flex;
    flex-direction: row;
    width: min(680px, 100%);
    height: 100%;
    min-height: 0;
    flex: 0 0 100%;
    position: relative;
    box-sizing: border-box;
    padding: 50px 0 30px 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    isolation: isolate;
    overflow: visible;
}


cp-peak-card > .peak-card-content {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

cp-peak-card > .cp-peaks-ambi-host {
    position: absolute;
    inset: 12px 0;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
}

.cp-peaks-ambi-layer {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    will-change: opacity, filter;
}

.cp-peaks-ambi-core {
    inset: -4px;
    filter: blur(14px) saturate(.85);
}

.cp-peaks-ambi-mid {
    inset: -16px;
    filter: blur(34px) saturate(.75);
}

.cp-peaks-ambi-aura {
    inset: -32px;
    filter: blur(64px) saturate(.65);
}

cp-peak-card > .peak-card-aside {
    position: relative;
    z-index: 2;
}


.peak-card-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.peak-card-image {
    flex: 1 1 60%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.peak-card-image picture, 
.peak-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.peak-card-info {
    flex: 0 0 auto;
    width: 100%;
    background-color: #090b01;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.peak-card-info-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.peak-card-heading h2 {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.3;
}


.peak-card-data {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

dot-divider {
    display: block;
    flex: 0 0 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border);
}

.peak-card-diff {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 5px 10px;
    color: #e2e8f0;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.peak-card-diff-badge {
    display: block;
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    background: rgb(30, 144, 30);
    border-radius: 3px;
}

.peak-card-loc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.4;
}

.peak-card-loc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.peak-card-loc-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}



.peak-card-stats {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    margin-bottom: 32px;
}

.peak-card-stats-group {
    display: flex;
    flex: 3;
    justify-content: space-around;
    width: 100%;
    gap: 6px;
    min-width: 0;
}

.peak-card-stats-group:last-child {
    flex: 2;
    gap: 12px;
}

.peak-card-stats-divider {
    width: 1px;
    flex-shrink: 0;
    background: rgba(148, 163, 184, 0.3);
}

.peak-card-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pcs-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 4px;
    white-space: nowrap;
}

.peak-card-stat span:not(.pcs-label) {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
}

.peak-card-stat small {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}



.peak-card-btn-wraper {
    width: 100%;
}

.peak-card-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    border: 1px solid rgba(220, 224, 206, 0.8);
    border-radius: 12px;
    background: #dce0ce;
    color: #0f172a;
    text-decoration: none;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.peak-card-btn:hover {
    background: #e2ecdd;
    border-color: #e2ecdd;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.peak-card-btn:active {
    transform: translateY(0) scale(0.985);
    box-shadow: none;
}

.peak-card-btn:focus-visible {
    outline: 2px solid #d4e0ce;
    outline-offset: 4px;
}

.peak-card-btn-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.pcb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pcb-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke-width: 1.8px;
    transition:
        transform 0.25s ease;
}

.peak-card-btn:hover .pcb-icon svg {
    transform: translate(4px, -4px);
}

@media (prefers-reduced-motion: reduce) {
    .peak-card-btn,
    .pcb-icon svg {
        transition: none;
    }

    .peak-card-btn:hover,
    .peak-card-btn:active {
        transform: none;
    }

    .peak-card-btn:hover .pcb-icon svg {
        transform: none;
    }
}


.pc-autonext-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #d4e0ce;
    width: 0%; 
    z-index: 30;
    transition: width 0.1s linear;
}



.peak-card-aside {
    display: flex; 
    padding: 6px 12px;
    width: 40px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-left: 8px;
}

.pca-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pca-action {
    background: var(--action-btn-sm-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 1px;
    width: 44px;
    height: 44px;
    transition: all 0.2s ease;
}

.pca-action:hover {
    background: var(--action-btn-sm-bg-hover);
}
.pca-action:hover .pca-action-icon svg {
    transform: scale(1.03);
}

.pca-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.pca-action-icon svg {
    width: 21px;
    height: 21px;
    transition: all 0.3s ease;
}

.pca-author {
    display: flex;
    background: rgba(0,0,0,0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 2px #fff solid;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    overflow: hidden;
}

.pca-author-image img {
    width: 100%;
    height: 100%;
}




.desktop-controls {
    position: absolute;
    right: 18px; 
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
}

.peaks-control-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.peaks-control-btn {
    background: var(--action-btn-sm-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.peaks-control-btn:hover {
    background: var(--action-btn-sm-bg-hover);
}

.pctb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.pctb-icon svg {
    width: 20px;
    height: 20px;
}

.peaks-control-btn.pctb-autonext.active {
    color: #c1d82f;
    background: rgba(193, 216, 47, 0.2);
}

@media (max-width: 1440px) {
    .peaks-page-container {
        height: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .desktop-controls {
        display: none;
    }
}

@media (max-width: 500px) {
    cp-peak-card {
        position: relative;
        padding: 0;
    }

    .cp-peaks-ambi-host {
        display: none;
        opacity: 0;
    }

    .peak-card-content {
        border-radius: 0px;
    }

    .peak-card-aside {
        position: absolute !important;
        top: 0.875%;
        left: 0;
        right: 0;
        width: auto;
        margin-left: 0;
        padding: 14px;
        flex-direction: row;
        justify-content: space-between;
        gap: 12px;
        z-index: 5;
        box-sizing: border-box;
    }

    .peak-card-content::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 110px;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.65),
            rgba(0, 0, 0, 0)
        );
        pointer-events: none;
        z-index: 4;
    }

    .pca-author {
        position: relative;
        z-index: 6;
        flex-shrink: 0;
    }

    .pca-actions {
        position: relative;
        z-index: 6;
        flex-direction: row;
        gap: 8px;
    }

    .pca-action {
        width: 38px;
        height: 38px;
        padding: 1px;
    }

    .pca-action-icon {
        width: 24px;
        height: 24px;
    }

    .pca-action-icon svg {
        width: 19px;
        height: 19px;
    }
}