@import url('https://fonts.googleapis.com/css2?family=LXGW+WenKai+TC&display=swap');

:root {
    --fg-1: #FBF6E2;
    --fg-2: #ECCEAE;
    --fg-3: #D6BD98;
    --fg-4: #E68369;
    --bg-1: #677D6A;
    --bg-2: #40534C;
    --bg-3: #1A3636;
}

html {
    width: 100%;
    height: 100%;
}
body {
    height: 100%;
    margin: 0;
    background: var(--bg-3);
    font-family: "LXGW WenKai TC", cursive;
    color: var(--fg-1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

*::-webkit-scrollbar {
    display: none;
}
* {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.title {
    margin: 0;
    width: 48rem;
    height: 15rem;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.title .countdown-select {
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    transition: width 0.5s, height 0.5s;
}
.title .countdown-select div {
    box-sizing: border-box;
    height: 3rem;
    text-align: center;
    opacity: 0;
    scroll-snap-align: center;
    transition: opacity 0.5s;
}
.title .countdown-select div.selected {
    opacity: 1;
}
.title .countdown-select:hover div {
    opacity: 0.1;
}
.title .countdown-select:hover div.selected + div {
    opacity: 0.3;
}
.title .countdown-select:hover div:has(+ div.selected)  {
    opacity: 0.3;
}
.title .countdown-select:hover div.selected {
    opacity: 1;
}
.title .date {
    opacity: 0.5;
    position: absolute;
    translate: 0 3rem;
    font-size: 1.5rem;
    transition: opacity 0.5s;
}
.title .countdown-select:hover + .date {
    opacity: 0;
}

main {
    display: flex;
    flex-direction: column;
}

.countdown {
    width: 48rem;
    height: 12rem;
    font-size: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
}
.countdown-item {
    width: 14rem;
    height: 100%;
    border-radius: 1rem;
    background: var(--bg-2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: hidden;
}
.countdown-item::before {
    content: "______________\A______________";
    white-space: pre;
    color: var(--bg-1);
    opacity: 0.6;
    position: absolute;
    translate: 0 -1rem;
}
.countdown-item .slider {
    width: 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 2rem;
}
.countdown-item .slider span {
    height: 3rem;
}
.countdown-item .slider span:nth-child(1) {
    opacity: 0.1;
}
.countdown-item .slider span:nth-child(2) {
    opacity: 0.2;
}
.countdown-item .slider span:nth-child(3) {
    opacity: 0.5;
}
.countdown-item .slider span:nth-child(5) {
    opacity: 0.5;
}
.countdown-item .slider span:nth-child(6) {
    opacity: 0.2;
}
.countdown-item .slider span:nth-child(7) {
    opacity: 0.1;
}
.countdown-item .unit {
    opacity: 0.5;
    font-size: 1rem;
}

.calendar {
    width: 48rem;
    height: 16rem;
    margin-top: 1rem;
    border-radius: 1rem;
    display: flex;
    gap: 0.1rem;
    overflow: hidden;
}
.calendar div {
    width: 0.3rem;
    height: 1rem;
    background: var(--fg-2);
    transition: width 0.5s, height 0.5s;
}
.calendar div.holiday {
    height: 1.5rem;
    background: var(--fg-3);
}
.calendar div.important {
    height: 2rem;
    background-color: var(--fg-4);
}
.calendar div:hover {
    width: 0.5rem;
    height: 2.5rem;
}

.calendar div::after {
    content: attr(data-summary);
    width: 4rem;
    display: inline-block;
    position: relative;
    top: 3rem;
    letter-spacing: 0;
    word-spacing: 0;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.5s;
}

.calendar div:hover::after {
    opacity: 1;
}

footer {
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media only screen and (max-width: 48rem) {
    .title {
        width: 100%;
        height: 10rem;
        font-size: 1.2rem;
    }
    .title .countdown-select div {
        height: 2rem;
    }
    .title .date {
        font-size: 1rem;
    }
    main {
        width: 100%;
        flex-grow: 1;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    .countdown {
        width: 14rem;
        height: 100%;
        flex-direction: column;
        gap: 1rem;
    }
    .countdown > span {
        display: none;
    }
    .countdown-item {
        flex-basis: 6rem;
        flex-grow: 1;
    }
    .countdown-item .slider span {
        font-size: 1.2rem;
    }
    .countdown-item .unit {
        font-size: 1rem;
    }
    .calendar {
        width: 8rem;
        height: 100%;
        flex-direction: column;
    }
    .calendar div {
        width: 1rem;
        height: 0.5rem;
    }
    .calendar div.holiday {
        width: 1.5rem;
        height: 0.5rem;
        background: var(--fg-3);
    }
    .calendar div.important {
        width: 2rem;
        height: 0.5em;
        background-color: var(--fg-4);
    }
    .calendar div:hover {
        width: 2.5rem;
        height: 0.5rem;
    }
    .calendar div::after {
        width: 4rem;
        display: inline-block;
        position: relative;
        top: 0;
        left: 3rem;
        font-size: 0.8rem;
    }
}