* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    font-family:
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            Roboto,
            Helvetica,
            Arial,
            sans-serif;

    background: #f4f4f4;
    color: #222;
}

.sliders {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
    padding: 20px;
}

.container {
    width: min(600px, 90%);
    padding: 40px;
    /*margin: 20px;*/
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
}

@media (max-width: 800px) {
    .sliders {
        flex-direction: column;
    }
}

h1 {
    margin: 0 0 30px;
    font-size: 28px;

    position: relative;
}

.value {
    margin-bottom: 30px;
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
    color: #777;
}

.status {
    margin-top: 30px;
    font-size: 14px;
    color: #777;
}

.title-wrapper {
    display: flex;
    position: relative;

    margin: 0 0 30px;

    align-items: center;
    justify-content: center;
    right: 0;
}

.title-wrapper h1 {
    margin: 0;
}

.history-wrapper {
    position: absolute;
    top: 50%;
    right: 0px;

    transform: translateY(-50%);
}

.history-icon {
    display: block;

    width: 28px;
    height: 28px;

    cursor: pointer;
}

.history-popup {
    position: absolute;

    top: 50%;
    right: 38px;

    transform: translateY(-50%);

    width: 250px;
    padding: 12px;

    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    display: none;
}

.history-popup ul {
    padding: 0;
}

.history-popup li {
    list-style-type: none;
}

/* Desktop: show while hovering */
#history-wrapper-anni:hover #history-popup-anni {
    display: block;
}
#history-wrapper-luni:hover #history-popup-luni {
    display: block;
}

/* Mobile/click: controlled by JavaScript */
#history-wrapper-anni.open #history-popup-anni {
    display: block;
}
#history-wrapper-luni.open #history-popup-luni {
    display: block;
}
