/* ================================================================
   Infinity Spiral 98 – Styles
   ================================================================ */

/* ── Wrapper ────────────────────────────────────────────────── */
.is98-wrapper {
    position:   relative;
    width:      100%;
    height:     520px;
    overflow:   hidden;
    background: #04040a;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

/* ── Canvas ─────────────────────────────────────────────────── */
.is98-canvas {
    display: block;
    width:   100% !important;
    height:  100% !important;
    cursor:  grab;
    outline: none;
}
.is98-canvas:active { cursor: grabbing; }

/* ── Controls bar ───────────────────────────────────────────── */
.is98-controls {
    position:        absolute;
    bottom:          20px;
    left:            50%;
    transform:       translateX(-50%);
    display:         flex;
    flex-wrap:       wrap;
    gap:             8px;
    justify-content: center;
    z-index:         10;
    pointer-events:  auto;
}

.is98-formation-btn {
    background:    rgba(255,255,255,0.08);
    border:        1px solid rgba(255,255,255,0.22);
    color:         rgba(255,255,255,0.78);
    padding:       6px 18px;
    border-radius: 100px;
    font-size:     12px;
    font-family:   inherit;
    cursor:        pointer;
    letter-spacing:0.05em;
    transition:    background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter:         blur(8px);
    line-height: 1.5;
}
.is98-formation-btn:hover {
    background:  rgba(255,255,255,0.18);
    border-color:rgba(255,255,255,0.48);
    color:       #fff;
}
.is98-formation-btn.is98-active {
    background:  rgba(107,127,255,0.45);
    border-color:rgba(107,127,255,0.85);
    color:       #fff;
}
.is98-formation-btn:focus-visible {
    outline: 2px solid rgba(107,127,255,0.8);
    outline-offset: 2px;
}

/* ── Formation name ─────────────────────────────────────────── */
.is98-formation-name {
    position:       absolute;
    top:            16px;
    left:           18px;
    color:          rgba(255,255,255,0.4);
    font-size:      10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    z-index:        10;
    pointer-events: none;
    font-family:    inherit;
}

/* ── Gyroscope button ───────────────────────────────────────── */
.is98-gyro-btn {
    position:      absolute;
    top:           14px;
    right:         14px;
    background:    rgba(107,127,255,0.28);
    border:        1px solid rgba(107,127,255,0.55);
    color:         rgba(255,255,255,0.9);
    padding:       7px 14px;
    border-radius: 8px;
    font-size:     12px;
    font-family:   inherit;
    cursor:        pointer;
    z-index:       10;
    transition:    background 0.2s;
    line-height:   1.4;
}
.is98-gyro-btn:hover { background: rgba(107,127,255,0.48); }

/* ── Lightbox ───────────────────────────────────────────────── */
.is98-lightbox {
    position:        fixed;
    inset:           0;
    z-index:         999999;
    display:         flex;
    align-items:     center;
    justify-content: center;
    pointer-events:  none;
    opacity:         0;
    transition:      opacity 0.3s ease;
}
.is98-lightbox.is98-lb-active {
    opacity:        1;
    pointer-events: auto;
}

.is98-lb-backdrop {
    position:               absolute;
    inset:                  0;
    background:             rgba(4,4,10,0.92);
    -webkit-backdrop-filter:blur(12px);
    backdrop-filter:        blur(12px);
}

.is98-lb-inner {
    position:        relative;
    z-index:         1;
    max-width:       92vw;
    max-height:      92vh;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             14px;
    transform:       scale(0.9);
    transition:      transform 0.3s ease;
}
.is98-lightbox.is98-lb-active .is98-lb-inner {
    transform: scale(1);
}

.is98-lb-media img,
.is98-lb-media video {
    display:       block;
    max-width:     88vw;
    max-height:    78vh;
    width:         auto;
    height:        auto;
    border-radius: 10px;
    box-shadow:    0 24px 72px rgba(0,0,0,0.65);
    object-fit:    contain;
}

.is98-lb-caption {
    color:       rgba(255,255,255,0.65);
    font-size:   13px;
    text-align:  center;
    font-family: inherit;
    max-width:   55ch;
    line-height: 1.5;
}

.is98-lb-close {
    position:        fixed;
    top:             18px;
    right:           20px;
    background:      rgba(255,255,255,0.1);
    border:          1px solid rgba(255,255,255,0.2);
    color:           rgba(255,255,255,0.9);
    width:           42px;
    height:          42px;
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    cursor:          pointer;
    font-size:       22px;
    transition:      background 0.2s, border-color 0.2s;
    z-index:         2;
    line-height:     1;
    font-family:     inherit;
    padding:         0;
}
.is98-lb-close:hover {
    background:  rgba(255,255,255,0.22);
    border-color:rgba(255,255,255,0.45);
}
.is98-lb-close:focus-visible {
    outline: 2px solid rgba(107,127,255,0.8);
}

/* ── Body lock ──────────────────────────────────────────────── */
.is98-body-lock { overflow: hidden !important; }

/* ── Editor placeholder ─────────────────────────────────────── */
.is98-editor-placeholder {
    display:         flex;
    align-items:     center;
    justify-content: center;
    min-height:      300px;
}

.is98-editor-label {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             10px;
    color:           rgba(255,255,255,0.55);
    text-align:      center;
    pointer-events:  none;
    padding:         24px;
}
.is98-editor-label p {
    margin:         0;
    font-size:      15px;
    font-weight:    600;
    color:          rgba(255,255,255,0.88);
    letter-spacing: 0.04em;
}
.is98-editor-label small {
    font-size: 11px;
    color:     rgba(107,127,255,0.9);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .is98-wrapper {
        height:       300px;
        touch-action: pan-y; /* allow vertical scroll outside widget */
    }
    .is98-controls {
        bottom: 10px;
        gap:    5px;
    }
    .is98-formation-btn {
        padding:   5px 13px;
        font-size: 11px;
    }
    .is98-lb-close {
        top:   12px;
        right: 12px;
        width: 36px;
        height:36px;
    }
}

@media (max-width: 480px) {
    .is98-wrapper { height: 250px; }
    .is98-lb-media img,
    .is98-lb-media video {
        max-width:  96vw;
        max-height: 70vh;
    }
}
