/* SUNIVA Context Navigation Phase1.2 — 2026-08-20
   1 HOME / 2 DISCOVER / 3 ACTION / 4 CONNECTION / 5 ME
   LIFE and WORLD share the same physical positions on PC and mobile.
*/
.suniva-context-nav {
    position: fixed;
    z-index: 7000;
    right: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    display: grid;
    width: min(620px, calc(100% - 18px));
    min-height: 64px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 7px 8px;
    transform: translateX(50%);
    border: 1px solid rgba(205, 188, 154, .72);
    border-radius: 34px;
    background: rgba(251, 250, 247, .94);
    box-shadow: 0 16px 42px rgba(17, 43, 57, .18);
    backdrop-filter: blur(22px) saturate(1.12);
    -webkit-backdrop-filter: blur(22px) saturate(1.12);
}

.suniva-context-nav__item {
    display: flex;
    min-width: 0;
    min-height: 49px;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    padding: 3px 2px;
    border: 0;
    border-radius: 22px;
    outline: 0;
    background: transparent;
    color: #566a73;
    font: inherit;
    text-decoration: none !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.suniva-context-nav__item > span {
    display: grid;
    min-width: 31px;
    min-height: 28px;
    place-items: center;
    color: currentColor;
    font-size: 23px;
    line-height: 1;
}

.suniva-context-nav__item > small {
    overflow: hidden;
    max-width: 100%;
    color: currentColor;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.suniva-context-nav__item.is-home,
.suniva-context-nav__item.is-me,
.suniva-context-nav__item.is-active {
    color: #17384d;
}

.suniva-context-nav__item.is-action > span {
    width: 47px;
    height: 47px;
    margin-top: -21px;
    border: 3px solid rgba(255,255,255,.96);
    border-radius: 50%;
    background: linear-gradient(140deg, #ebc96d, #c68a1d);
    color: #fff;
    font-size: 25px;
    box-shadow: 0 9px 23px rgba(184, 125, 24, .30);
}

.suniva-context-nav--world {
    border-color: rgba(198, 175, 126, .76);
    background: rgba(250, 247, 239, .94);
}

.suniva-context-nav--world .suniva-context-nav__item.is-action > span {
    background: linear-gradient(145deg, #214c39, #b88a31);
}

.suniva-context-nav__item:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(181, 135, 44, .5);
}

/* LIFE: the contextual shell replaces the old site bottom bar and floating duplicates. */
body:has(.suniva-life-v3) .sn-live-bottom,
body:has(.suniva-life-v3) .suniva-life-nav,
body:has(.suniva-life-v3) .suniva-message-entry--floating,
body:has(.suniva-life-v3) .suniva-official-line-entry--floating {
    display: none !important;
}

body:has(.suniva-life-v3) .suniva-context-nav {
    display: grid !important;
}

/* LIFE is an app-like surface; keep only the LIFE header inside the page. */
@media (max-width: 767px) {
    body:has(.suniva-life-v3) .sn-live-header,
    body:has(.suniva-life-v3) .sn-live-drawer,
    body:has(.suniva-life-v3) .sn-live-backdrop {
        display: none !important;
    }

    .suniva-context-nav {
        width: calc(100% - 16px);
        min-height: 62px;
        padding: 7px 6px;
    }

    .suniva-context-nav__item > span {
        font-size: 22px;
    }

    .suniva-context-nav__item > small {
        font-size: 8.5px;
    }
}

/* PC keeps exactly the same order and meaning. */
@media (min-width: 768px) {
    .suniva-context-nav {
        bottom: 14px;
        width: min(620px, calc(100% - 40px));
    }
}

/* SUNIVA COMMON NAV
   LIFE / WORLD 共通5ナビに「ご縁」がある画面では
   重複する浮遊メッセージを表示しない */
body:has(.suniva-context-nav) .suniva-world-message-entry {
    display: none !important;
}


/* WORLD ENTRY COMMON NAV V1 2026-08-20
   /user_data/sunivaworld も /world/map と同じ5位置へ統一 */
body:has(.suniva-context-nav--world) .sworld-map-nav,
body:has(.suniva-context-nav--world) .sn-live-bottom {
    display: none !important;
}

/* 「ご縁」が共通5ナビにあるため、WORLD内の直接出力・Subscriber出力とも重複させない */
body:has(.suniva-context-nav) .suniva-world-message-entry {
    display: none !important;
}

/* 地図操作を下部ナビの背後へ隠さない */
body:has(.suniva-context-nav--world) #sunivaWorldMapMode,
body:has(.suniva-context-nav--world) .suniva-world-stage {
    padding-bottom: 82px;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    body:has(.suniva-context-nav--world) .suniva-context-nav {
        z-index: 12050;
    }
}
