
/* SUNIVA SCOPE V2 Phase1 — 2026-08-20
   Range outside: discovery scope.
   Range inside <=40m: 360-degree experience ring.
*/
#sunivaScopeVisual { isolation:isolate; }

.suniva-scope-v2-ring {
    position:absolute;
    z-index:100120;
    left:50%;
    top:55%;
    width:min(92vw,430px);
    height:310px;
    transform:translate(-50%,-50%);
    pointer-events:none;
    perspective:900px;
}
.suniva-scope-v2-ring[hidden]{display:none!important}

.suniva-scope-v2-ring__orbit {
    position:absolute;
    inset:0;
    transform-style:preserve-3d;
    pointer-events:auto;
    touch-action:none;
    user-select:none;
    -webkit-user-select:none;
}
.suniva-scope-v2-card {
    position:absolute;
    left:50%;
    top:50%;
    width:118px;
    min-height:142px;
    margin:-71px 0 0 -59px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:12px 9px;
    border:1px solid rgba(207,171,91,.76);
    border-radius:20px;
    background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(255,248,232,.96));
    box-shadow:0 14px 34px rgba(12,31,40,.24);
    color:#17384d;
    font:inherit;
    text-align:center;
    cursor:pointer;
    backface-visibility:visible;
    transform-style:preserve-3d;
    will-change:transform,opacity;
}
.suniva-scope-v2-card__icon {
    display:grid;
    width:52px;
    height:52px;
    place-items:center;
    border-radius:50%;
    background:linear-gradient(145deg,#fff8df,#efd9a0);
    font-size:28px;
}
.suniva-scope-v2-card strong{font-size:13px;line-height:1.25}
.suniva-scope-v2-card small{color:#7b8b91;font-size:9px;line-height:1.35}
.suniva-scope-v2-card.is-front {
    border-color:#d5a93d;
    box-shadow:0 18px 42px rgba(167,116,18,.34);
}
.suniva-scope-v2-card.is-front .suniva-scope-v2-card__icon {
    background:linear-gradient(145deg,#fff5cb,#ddb34e);
}

.suniva-scope-v2-hint {
    position:absolute;
    z-index:100121;
    left:50%;
    bottom:max(86px,calc(env(safe-area-inset-bottom) + 66px));
    transform:translateX(-50%);
    max-width:86%;
    padding:7px 14px;
    border:1px solid rgba(207,171,91,.46);
    border-radius:999px;
    background:rgba(15,36,47,.74);
    color:#fff7dc;
    font-size:10px;
    font-weight:700;
    text-align:center;
    pointer-events:none;
    backdrop-filter:blur(10px);
}

.suniva-scope-v2-planters {
    position:absolute;
    inset:0;
    transform-style:preserve-3d;
    pointer-events:auto;
    touch-action:none;
}
.suniva-scope-v2-planter {
    position:absolute;
    left:50%;
    top:50%;
    width:104px;
    height:118px;
    margin:-59px 0 0 -52px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    border:1px solid rgba(202,164,82,.7);
    border-radius:18px 18px 28px 28px;
    background:linear-gradient(180deg,#fffdf7,#dfcda5);
    box-shadow:0 14px 32px rgba(12,31,40,.25);
    color:#17384d;
    cursor:pointer;
}
.suniva-scope-v2-planter__plant {
    width:42px;height:46px;display:grid;place-items:center;
    font-size:30px;
}
.suniva-scope-v2-planter strong{font-size:11px}
.suniva-scope-v2-planter small{font-size:8px;color:#78898f}
.suniva-scope-v2-planter[data-color="red"]{--pc:#d95c57}
.suniva-scope-v2-planter[data-color="orange"]{--pc:#e79340}
.suniva-scope-v2-planter[data-color="gold"]{--pc:#d8ae39}
.suniva-scope-v2-planter[data-color="green"]{--pc:#5ba66b}
.suniva-scope-v2-planter[data-color="aqua"]{--pc:#50b9c7}
.suniva-scope-v2-planter[data-color="blue"]{--pc:#4b7cc5}
.suniva-scope-v2-planter[data-color="purple"]{--pc:#8c65bd}
.suniva-scope-v2-planter::after{
    content:"";position:absolute;left:12px;right:12px;bottom:7px;height:4px;
    border-radius:99px;background:var(--pc,#c89b43);opacity:.9;
}

.suniva-scope-v2-back {
    position:absolute;z-index:100123;left:16px;top:50%;
    width:42px;height:42px;transform:translateY(-50%);
    border:1px solid rgba(220,184,91,.8);border-radius:50%;
    background:rgba(18,43,55,.82);color:white;font-size:24px;
    pointer-events:auto;
}
.suniva-scope-v2-mode {
    position:absolute;z-index:100124;left:50%;top:28%;
    transform:translateX(-50%);
    padding:7px 12px;border-radius:999px;
    background:rgba(19,43,54,.76);color:#fff7dc;
    font-size:10px;font-weight:800;pointer-events:none;
}
.suniva-scope-v2-mode.is-outside::before{content:"遠くの光を見つける  ";}
.suniva-scope-v2-mode.is-inside::before{content:"この場所を体験する  ";}

@media(max-width:600px){
    .suniva-scope-v2-ring{top:57%;height:290px}
    .suniva-scope-v2-card{width:104px;min-height:128px;margin:-64px 0 0 -52px}
    .suniva-scope-v2-card__icon{width:46px;height:46px;font-size:25px}
    .suniva-scope-v2-planter{width:94px;height:108px;margin:-54px 0 0 -47px}
}


/* SCOPE V2 Phase1.1 — range-out directional portal field */
.suniva-scope-v2-directional {
    position:absolute;
    z-index:100110;
    inset:90px 0 120px;
    overflow:hidden;
    pointer-events:none;
}
.suniva-scope-v2-directional[hidden]{display:none!important}
.suniva-scope-v2-directional__portal{
    position:absolute;
    left:50%;
    top:50%;
    width:112px;
    transform:translate(-50%,-50%);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
    opacity:0;
    transition:opacity .16s linear;
    pointer-events:auto;
    touch-action:manipulation;
    will-change:transform,opacity,left,top;
}
.suniva-scope-v2-directional__portal img{
    width:86px;
    height:105px;
    object-fit:contain;
    filter:drop-shadow(0 10px 14px rgba(6,22,29,.28));
}
.suniva-scope-v2-directional__portal strong{
    max-width:130px;
    padding:5px 9px;
    border:1px solid rgba(211,171,78,.76);
    border-radius:12px;
    background:rgba(255,250,236,.92);
    color:#17384d;
    font-size:10px;
    line-height:1.25;
    text-align:center;
    box-shadow:0 8px 22px rgba(15,35,44,.2);
}
.suniva-scope-v2-directional__portal small{
    padding:3px 7px;
    border-radius:999px;
    background:rgba(18,43,55,.78);
    color:#fff8df;
    font-size:8px;
    font-weight:800;
}
.suniva-scope-v2-directional__guide{
    position:absolute;
    left:50%;
    top:10px;
    transform:translateX(-50%);
    padding:6px 11px;
    border-radius:999px;
    background:rgba(18,43,55,.74);
    color:#fff8df;
    font-size:9px;
    font-weight:800;
    white-space:nowrap;
    backdrop-filter:blur(8px);
}
body.suniva-scope-v2-outside .suniva-portal-layer,
body.suniva-scope-v2-outside #sunivaGateNameplate{
    opacity:0!important;
    pointer-events:none!important;
}
@media(max-width:600px){
    .suniva-scope-v2-directional{inset:105px 0 125px}
    .suniva-scope-v2-directional__portal img{width:76px;height:94px}
}


/* SCOPE CLOSE FIX V1 — keep the real close controls above AR overlays */
#sunivaScopePanel #sunivaScopeCollapse,
#sunivaScopePanel .suniva-scope-collapse,
#sunivaScopeClose {
    position: relative !important;
    z-index: 2147483001 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

/* The directional AR field never owns the whole screen's tap surface.
   Only an individual portal card can receive taps. */
.suniva-scope-v2-directional {
    pointer-events: none !important;
}
.suniva-scope-v2-directional__portal {
    pointer-events: auto !important;
}

/* The inside-range roulette ring stays below the close button as well. */
.suniva-scope-v2-ring,
.suniva-scope-v2-hint,
.suniva-scope-v2-mode {
    z-index: 100120 !important;
}

/* SUNIVA SCOPE V2 INTEGRATED V1 */
#sunivaScopeSpatialDiag{display:none!important}
body.suniva-scope-v2-discovery #sunivaScopeStage .suniva-spatial-building,
body.suniva-scope-v2-discovery #sunivaScopeStage .suniva-spatial-flower,
body.suniva-scope-v2-discovery #sunivaScopeStage .suniva-spatial-planter,
body.suniva-scope-v2-discovery #sunivaGateNameplate{
    opacity:0!important;
    pointer-events:none!important;
}
body.suniva-scope-v2-experience .suniva-scope-v2-directional{
    display:none!important;
}
body.suniva-scope-v2-experience #sunivaScopeStage{
    pointer-events:auto!important;
}
.suniva-scope-v2-directional__portal.is-in-range{
    filter:drop-shadow(0 0 16px rgba(224,180,70,.62));
}
.suniva-scope-v2-directional__portal.is-in-range strong::after{
    content:"  体験できます";
    color:#a47a22;
    font-size:8px;
}

/* SCOPE V2 DISCOVERY / EXPERIENCE V2 */
#sunivaScopeSpatialDiag{display:none!important}

/* Discovery owns the visual field. Hide every legacy spatial object and old gate/nameplate. */
body.suniva-scope-v2-discovery #sunivaScopeStage,
body.suniva-scope-v2-discovery #sunivaGateNameplate,
body.suniva-scope-v2-discovery .suniva-portal-layer{
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
}
body.suniva-scope-v2-discovery .suniva-scope-v2-directional{
    visibility:visible!important;
    opacity:1!important;
    pointer-events:none!important;
}

/* Only each discovered portal is interactive. */
.suniva-scope-v2-directional__portal{
    pointer-events:auto!important;
    z-index:2;
}
.suniva-scope-v2-directional__portal.is-primary{
    z-index:8;
}
.suniva-scope-v2-directional__portal.is-in-range{
    filter:drop-shadow(0 0 18px rgba(222,177,59,.72));
}

/* Experience: legacy selected building becomes the center anchor; discovery cards disappear. */
body.suniva-scope-v2-experience #sunivaScopeStage{
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
}
body.suniva-scope-v2-experience .suniva-scope-v2-directional{
    display:none!important;
}
body.suniva-scope-v2-experience #sunivaGateNameplate{
    visibility:visible!important;
    opacity:1!important;
}

/* SCOPE PERFORMANCE V1 */
html:not(.suniva-scope-perf-active) .suniva-scope-v2-directional__portal{
    will-change:auto!important;
}
.suniva-scope-v2-directional__portal{
    contain:layout paint style;
}

/* SUNIVA SCOPE PERFORMANCE V2 */
.suniva-scope-perf-v2{position:absolute;inset:0;z-index:100115;pointer-events:none}.suniva-scope-perf-v2[hidden]{display:none!important}
.suniva-scope-perf-v2__ranges{position:absolute;left:50%;top:21%;transform:translateX(-50%);display:flex;gap:4px;padding:4px;border-radius:999px;background:rgba(17,40,51,.76);backdrop-filter:blur(10px);pointer-events:auto;z-index:20}
.suniva-scope-perf-v2__ranges button{border:0;border-radius:999px;background:transparent;color:#fff8e7;padding:6px 9px;font:700 9px/1 sans-serif}.suniva-scope-perf-v2__ranges button.is-active{background:#fff8e7;color:#17384d}
.suniva-scope-perf-v2__field{position:absolute;inset:0;pointer-events:none}.suniva-scope-perf-v2__portal{position:absolute;left:var(--x,50%);top:var(--y,50%);width:112px;transform:translate(-50%,-50%) scale(var(--s,.8));opacity:var(--o,1);display:flex;flex-direction:column;align-items:center;gap:5px;border:1px solid rgba(255,255,255,.62);border-radius:22px;padding:9px 7px;background:rgba(255,255,255,.78);box-shadow:0 10px 30px rgba(8,27,35,.20);transition:left .2s ease-out,top .2s ease-out,transform .2s ease-out,opacity .2s linear;contain:layout paint style;pointer-events:auto;touch-action:manipulation}.suniva-scope-perf-v2__portal[hidden]{display:none!important}.suniva-scope-perf-v2__portal img{width:76px;height:88px;object-fit:contain}.suniva-scope-perf-v2__portal strong{max-width:100%;padding:4px 7px;border:1px solid #d6b55d;border-radius:999px;background:#fffaf0;color:#17384d;font-size:10px;text-align:center}.suniva-scope-perf-v2__portal small{padding:3px 7px;border-radius:999px;background:#38545d;color:#fff;font-size:8px;font-weight:800}.suniva-scope-perf-v2__portal.is-primary{z-index:8}.suniva-scope-perf-v2__portal.is-in-range{filter:drop-shadow(0 0 14px rgba(223,179,65,.72))}
body.suniva-scope-perf-v2-active #sunivaScopeV2Directional,body.suniva-scope-perf-v2-active #sunivaScopeStage,body.suniva-scope-perf-v2-active #sunivaGateNameplate,body.suniva-scope-perf-v2-active .suniva-portal-layer{visibility:hidden!important;opacity:0!important;pointer-events:none!important}


/* ===== SUNIVA SCOPE RESCUE V1 =====
   Highest priority: X and common bottom nav must always work. */
#sunivaScopeCollapse,
#sunivaScopeClose,
.suniva-scope-collapse {
    position: relative !important;
    z-index: 2147483646 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}
.suniva-context-nav,
[data-suniva-context-nav],
nav.suniva-context-nav {
    z-index: 2147483645 !important;
    pointer-events: auto !important;
}
.suniva-context-nav *,
[data-suniva-context-nav] * {
    pointer-events: auto !important;
}

/* Stable discovery owns only the middle camera field; it never blocks chrome/navigation. */
.suniva-scope-stable-v1 {
    position:absolute;
    left:0; right:0;
    top:118px;
    bottom:118px;
    z-index:100500;
    pointer-events:none;
    overflow:hidden;
}
.suniva-scope-stable-v1[hidden]{display:none!important}
.suniva-scope-stable-v1__ranges{
    position:absolute;left:50%;top:8px;transform:translateX(-50%);
    display:flex;gap:4px;padding:4px;
    border-radius:999px;background:rgba(18,43,55,.82);
    backdrop-filter:blur(10px);pointer-events:auto;
}
.suniva-scope-stable-v1__ranges button{
    border:0;border-radius:999px;background:transparent;color:#fff8e7;
    padding:7px 9px;font:700 10px/1 sans-serif;white-space:nowrap;
}
.suniva-scope-stable-v1__ranges button.is-active{
    background:#fff8e7;color:#17384d;
}
.suniva-scope-stable-v1__portal{
    position:absolute;
    left:var(--x,50%);
    top:var(--y,50%);
    width:108px;
    transform:translate(-50%,-50%) scale(var(--s,.8));
    opacity:var(--o,1);
    display:flex;flex-direction:column;align-items:center;gap:5px;
    padding:8px 6px;
    border:1px solid rgba(255,255,255,.72);
    border-radius:20px;
    background:rgba(255,255,255,.84);
    box-shadow:0 10px 26px rgba(10,28,35,.2);
    pointer-events:auto;
    touch-action:manipulation;
    contain:layout paint style;
    transition:left .18s ease-out,top .18s ease-out,transform .18s ease-out,opacity .18s linear;
}
.suniva-scope-stable-v1__portal[hidden]{display:none!important}
.suniva-scope-stable-v1__portal img{width:72px;height:82px;object-fit:contain}
.suniva-scope-stable-v1__portal strong{
    max-width:100%;padding:4px 7px;border:1px solid #d6b55d;border-radius:999px;
    background:#fffaf0;color:#17384d;font-size:10px;line-height:1.2;text-align:center;
}
.suniva-scope-stable-v1__portal small{
    padding:3px 7px;border-radius:999px;background:#38545d;color:#fff;
    font-size:8px;font-weight:800;
}
.suniva-scope-stable-v1__portal.is-primary{z-index:8}
.suniva-scope-stable-v1__portal.is-in-range{filter:drop-shadow(0 0 14px rgba(223,179,65,.72))}

/* When rescue discovery is active, remove every older discovery representation. */
body.suniva-scope-rescue-active #sunivaScopeV2Directional,
body.suniva-scope-rescue-active #sunivaScopePerfV2,
body.suniva-scope-rescue-active #sunivaScopeStage,
body.suniva-scope-rescue-active #sunivaGateNameplate,
body.suniva-scope-rescue-active .suniva-portal-layer {
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
}


/* SUNIVA SCOPE STABILITY FIX V1 */
.suniva-spatial-side-garden,
.suniva-spatial-side-garden--left,
.suniva-spatial-side-garden--right{
    display:none!important;
}
#sunivaMobilePortalAccess{
    z-index:2147483647!important;
}
#sunivaMobilePortalAccess.is-open{
    pointer-events:auto!important;
}
