:root {
    --icon-hover-scale: 1.8;
}

html,
body {
    height: 100%;
    width: 100%;
}

body {
    overflow: hidden;
}

#main-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    user-select: none;
    background-size: cover;
    background-position: center;
    display: grid;
    grid-template-columns: fit-content(100%) minmax(0, 1fr);
    grid-template-rows: fit-content(100%) minmax(0, 1fr);
    grid-template-areas:
        "map sidebar"
        "bottombar sidebar";
}

#map-image {
    grid-area: map;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    position: relative;
    overflow: visible;
    container-type: size;
}

/* ふりすくスコラ生駒を消滅させる */
#map-image #f7 {
    display: none !important;
}

#map-image #f8 {
    display: none !important;
}

#sidebar,
#bottombar {
    width: 100%;
    height: 100%;
    background-color: #ff9292;
    display: none;
    z-index: 10;

    &.active_bar {
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
    }
}

#sidebar {
    grid-area: sidebar;
}

#bottombar {
    grid-area: bottombar;
}

.news-container {
    list-style: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: min(1rem, 6%);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: min(1rem, 4%);
    position: relative;
    container-type: size;
    background-color: #f8f8f1;
    color: var(--color-text);
    font-weight: 500;

    h1 {
        margin: 0;
        color: inherit;
        font-size: min(12cqw, 20px);
        rotate: 0.05deg;
    }

    .news-item {
        padding: 0.3em 0;
        border-bottom: 0.1em solid #ccc;

        .button-wrapper {
            width: 100%;
            height: 100%;
            display: grid;
            grid-template-columns: fit-content(100%) minmax(0, 1fr);
            grid-template-rows: fit-content(100%);
            grid-template-areas:
                "name name"
                "date tag"
                "content content";
            gap: 0.2em 0.5em;
            text-align: left;
            font-family: inherit;
            font-size: min(10cqw, 12px);
            font-weight: inherit;
            color: inherit;
            background-color: transparent;
            border: none;
            cursor: pointer;
            outline: none;
            padding: 0;
            appearance: none;

            @media (hover: hover) {
                &:hover {
                    background-color: var(--color-button-hover);
                }
            }

            &:focus {
                outline: 0.2em solid var(--color-accent);
            }

            .news-facility-name {
                grid-area: name;
                font-weight: 700;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                rotate: 0.05deg;

                .news-facility-icon {
                    aspect-ratio: 1 / 1;
                    height: 1em;
                    width: auto;
                    margin-right: 0.1em;
                }
            }

            .news-date {
                grid-area: date;
                rotate: 0.05deg;
            }

            .news-tag {
                grid-area: tag;
                width: fit-content;
                font-size: 0.8em;
                padding: 0.2em 0.6em;
                border-radius: 100vmax;
                color: #fff;
                white-space: nowrap;
                rotate: 0.05deg;

                &.regular {
                    background-color: #38a7ff;
                }

                &.special {
                    background-color: #ff86f1;
                }
            }

            .news-content {
                grid-area: content;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                rotate: 0.05deg;
            }
        }
    }
}

#sidebar .news-container {
    width: calc(100% - min(4%, 0.5rem));
}

#bottombar .news-container {
    height: calc(100% - min(4%, 0.4rem));
    padding: min(0.5rem, 6%);

    h1 {
        font-size: min(12cqh, 20px);
    }

    .button-wrapper {
        grid-template-columns: fit-content(100%) fit-content(100%) minmax(0, 1fr);
        grid-template-rows: fit-content(100%);
        grid-template-areas:
            "name name name"
            "date tag content";
        font-size: min(10cqh, 12px);
    }
}

.f_icon {
    position: absolute;
    aspect-ratio: 1 / 1;
    height: 4cqh;
    width: auto;
    opacity: 0;
    z-index: auto;
    container-type: size;

    &.focused {
        z-index: 1000;

        .icon_img {
            scale: var(--icon-hover-scale) !important;
        }
    }

    @media (hover: hover) {
        &:has(.icon_img:hover) {
            z-index: 100;

            .icon_img {
                scale: var(--icon-hover-scale) !important;
            }
        }
    }
}

.icon_img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    translate: -50% -50% !important;
    top: 50%;
    left: 50%;
    cursor: pointer;
    transition: scale 0.2s;
}

.bubble {
    --bubble-height: 700cqh;

    background-color: var(--color-card);
    border: calc(var(--bubble-height) / 60) solid transparent;
    border-radius: calc(var(--bubble-height) / 20);
    padding: calc(var(--bubble-height) / 30) 0;
    padding-bottom: calc(var(--bubble-height) / 6);
    aspect-ratio: 7 / 3;
    height: var(--bubble-height);
    width: auto;
    position: absolute;
    translate: 0% 0%;
    visibility: hidden;
    opacity: 0;
    overflow: visible;
    transition: background-color 0.5s, border-color 0.5s;
    container-type: size;

    &.top {
        top: 200%;
    }

    &.bottom {
        bottom: 200%;
    }

    &.left {
        left: 0%;
    }

    &.right {
        right: 0%;
    }

    &:has(.splide__slide:nth-child(1).is-active) {
        background-color: #ffb3b3;
        border-color: #ff7575;
    }

    &:has(.splide__slide:nth-child(2).is-active) {
        background-color: #fff176;
        border-color: #ffd773;
    }

    &:has(.splide__slide:nth-child(3).is-active) {
        background-color: #b2f7c1;
        border-color: #7ed6a7;
    }

    &:has(.splide__slide:nth-child(4).is-active) {
        background-color: #b3e5fc;
        border-color: #4fc3f7;
    }

    &:has(.splide__slide:nth-child(5).is-active) {
        background-color: #e1cfff;
        border-color: #b085f5;
    }
}

.bubble {
    .splide {
        width: 100%;
        height: 100%;
        cursor: default;
    }

    .splide.is-initialized,
    .splide.is-rendered {
        visibility: inherit;
    }

    .splide__track {
        width: 100%;
        height: 100%;
    }

    .splide__pagination {
        margin: 0;
        padding: 5cqh 0;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0 4cqw;
        width: 100%;
        height: 20cqh;
        position: absolute;
        translate: -50% 0;
        left: 50%;
        top: 100%;
        bottom: 0;

        li {
            display: flex;
            justify-content: center;
            align-items: center;
            aspect-ratio: 1 / 1;
            height: 100%;
            width: auto;
        }
    }

    .splide__pagination__page {
        background-color: #ccc;
        margin: 0;
        width: 100%;
        height: 100%;

        &.is-active {
            background-color: #fff;
            transform: scale(1.2);
        }
    }

    .splide__arrow {
        width: 6%;
        height: 30%;
        border-radius: 100vmax;

        svg {
            aspect-ratio: 1 / 1;
            width: 60%;
            height: auto;
        }
    }

    .splide__arrow--prev {
        left: 0;
    }

    .splide__arrow--next {
        right: 0;
    }
}

.activity_container,
.more_activities_container,
.no_activities_container {
    width: 100%;
    height: 100%;
    padding: 2% 3%;
    border-radius: 10cqh;
    border: 4cqh solid transparent;
    display: grid;
    container-type: size;
    background-color: var(--color-card);
    color: var(--color-text);
    font-weight: 500;
}

.activity_container {
    grid-template-columns: minmax(0, 1fr) 30%;
    grid-template-rows: minmax(0, 3fr) minmax(0, 8fr) minmax(0, 2fr);
    grid-template-areas:
        "name image"
        "message image"
        "date image";

    &.special {
        background: linear-gradient(135deg, #fbeaf3 0%, #fdf3e6 25%, #fffbe5 50%, #eaf6fc 75%, #e3f2fd 100%);
        border-image: linear-gradient(135deg, #f48fb1 0%, #ffd9b3 25%, #fff7b3 50%, #90caf9 75%, #b39ddb 100%) 1;
    }
}

.more_activities_container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 3fr) minmax(0, 10fr);
    grid-template-areas:
        "name"
        "link";

    .more_activities_link {
        grid-area: link;
        text-decoration: none;
        color: inherit;
        font-size: 15cqh;
        width: 70%;
        height: 60%;
        margin: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 100vmax;
        background-color: #efefef;
        box-shadow: -4cqh -4cqh 8cqh #fff, 4cqh 4cqh 8cqh rgb(0 0 0 / 24%);
        rotate: 0.05deg;
        transition: 0.2s;

        &:visited {
            color: inherit;
        }

        &:hover,
        &:focus {
            box-shadow: -2cqh -2cqh 4cqh #fff, 2cqh 2cqh 4cqh rgb(0 0 0 / 24%);
        }

        div {
            width: fit-content;
            height: fit-content;
        }
    }
}

.no_activities_container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 3fr) minmax(0, 10fr);
    grid-template-areas:
        "name"
        "message";

    .no_activities_message {
        grid-area: message;
        padding: 2% 0;
        font-size: 16cqh;
        rotate: 0.05deg;
    }
}

.facility_name {
    grid-area: name;
    font-weight: 800;
    white-space: nowrap;
    rotate: 0.05deg;
}

.activity_message {
    grid-area: message;
    padding: 2% 0;
    word-break: break-all;
    white-space: pre-wrap;
    overflow: hidden;
    font-size: 12cqh;
    rotate: 0.05deg;
}

.activity_date {
    grid-area: date;
    font-size: 11cqh;
    rotate: 0.05deg;
}

.activity_image {
    grid-area: image;
    padding: 5%;

    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}