﻿.icon-button-bar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 32px;
    width: 100vw;
    margin: 0 auto;
    padding: 32px 0;
    background: #fff;
    z-index: 1000;
    position: relative;
}

    .icon-button-bar-grid .icon-btn {
        background: linear-gradient(135deg, #e3f0ff 0%, #c2e0ff 100%);
        border: none;
        border-radius: 50%;
        min-width: 100px;
        max-width: 140px;
        min-height: 100px;
        max-height: 140px;
        width: 120px;
        height: 120px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #007bff;
        font-size: 1.8em;
        box-shadow: 0 2px 8px rgba(0,123,255,0.10);
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;
        position: relative;
        place-self: center; /* 各セル内で中央揃え */
        transform-origin: center; /* ★ 拡大時の基準点を中央に */
    }

        .icon-button-bar-grid .icon-btn span {
            font-size: 0.6em;
            color: #007bff;
            margin-top: 2px;
            font-weight: bold;
            text-align: center;
            line-height: 1.1;
            word-break: keep-all;
        }

        .icon-button-bar-grid .icon-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 16px rgba(0,123,255,0.18);
            background: linear-gradient(135deg, #c2e0ff 0%, #e3f0ff 100%);
        }

        .icon-button-bar-grid .icon-btn:active,
        .icon-button-bar-grid .icon-btn:focus {
            background-color: #e0f7fa;
            color: #00796b;
            outline: none;
        }

        .icon-button-bar-grid .icon-btn.selected {
            background: linear-gradient(135deg, #ffe082 0%, #ff7043 100%);
            color: #fff !important;
            box-shadow: 0 0 0 4px #ff704333;
            border: 2px solid #ff7043;
            transition: background 0.2s, color 0.2s, box-shadow 0.2s;
        }

            .icon-button-bar-grid .icon-btn.selected span {
                color: #fff !important;
            }

    .icon-button-bar-grid .home-btn {
        grid-column: 2 / span 2;
        grid-row: 1 / span 2;
        place-self: center;
        z-index: 2;
        font-size: 2.8rem;
        width: 160px;
        height: 160px;
        border-radius: 50%;
        background: linear-gradient(135deg, #fffbe3 0%, #ffe0c2 100%);
        color: #ff9800;
        box-shadow: 0 2px 16px rgba(0,0,0,0.12);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        transform-origin: center;  ★ 拡大時の基準点を中央に 
    }

/*    .icon-button-bar-grid .home-btn {
        grid-column: 2 / span 2;
        grid-row: 1 / span 2;
        place-self: center;
        z-index: 2;
        font-size: 2.8rem;
        width: 160px;
        height: 160px;
        border-radius: 50%;
        background: linear-gradient(135deg, #fffbe3 0%, #ffe0c2 100%);
        color: #ff9800;
        box-shadow: 0 2px 16px rgba(0,0,0,0.12);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transform-origin: center;
    }
*/
        .icon-button-bar-grid .home-btn span {
            color: #ff9800;
            font-size: 1.4rem;
        }

        .icon-button-bar-grid .home-btn.selected {
            background: #1565c0;
            color: #fff;
        }

        .icon-button-bar-grid .home-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 16px rgba(0,123,255,0.18);
            background: linear-gradient(135deg, #ffe0c2 0%, #fffbe3 100%);
        }

@media (max-width: 600px) {
    .icon-button-bar-grid .icon-btn {
        min-width: 54px;
        min-height: 54px;
        max-width: 80px;
        max-height: 80px;
        width: 64px;
        height: 64px;
        font-size: 1.5em;
        place-self: center;
        transform-origin: center;
    }

        .icon-button-bar-grid .icon-btn span {
            font-size: 0.5em;
        }

    .icon-button-bar-grid .home-btn {
        width: 90px;
        height: 90px;
        font-size: 2em;
        place-self: center;
        transform-origin: center;
    }

        .icon-button-bar-grid .home-btn span {
            font-size: 1.1rem;
        }
}
