/* =========================================
   CUSTOM SCROLLBAR (GLOBAL)
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
    /* Slightly thinner */
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #050510;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* =========================================
   LUXURY AI MODE BUTTON (REFINED)
   ========================================= */
.ai-mode-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    vertical-align: middle;
}

.ai-mode-chk-input {
    display: none;
}

.ai-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    height: 40px;
    background: #111;
    border: 1px solid #444;
    border-radius: 20px;
    /* Rounded pill shape */
    color: #666;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    text-transform: uppercase;
    user-select: none;
}

.ai-mode-btn span {
    position: relative;
    z-index: 2;
}

/* ON STATE (Checked) */
.ai-mode-chk-input:checked+.ai-mode-btn {
    border-color: #00ffcc;
    color: #fff;
    background: linear-gradient(90deg, #002233, #004444);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.4), inset 0 0 10px rgba(0, 255, 204, 0.2);
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.8);
    animation: neon-pulse 2s infinite alternate;
}

/* Geometric Stars (CSS Shapes) instead of Emojis */
.ai-mode-chk-input:checked+.ai-mode-btn::before,
.ai-mode-chk-input:checked+.ai-mode-btn::after {
    content: "✦";
    position: absolute;
    top: 50%;
    color: #00ffcc;
    font-size: 1.2rem;
    line-height: 0;
    opacity: 0;
    text-shadow: 0 0 5px #fff;
    pointer-events: none;
}

.ai-mode-chk-input:checked+.ai-mode-btn::before {
    left: 10px;
    animation: star-spin-left 2s infinite linear;
}

.ai-mode-chk-input:checked+.ai-mode-btn::after {
    right: 10px;
    animation: star-spin-right 2s infinite linear;
}

@keyframes neon-pulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
        border-color: rgba(0, 255, 204, 0.6);
    }

    100% {
        box-shadow: 0 0 20px rgba(0, 255, 204, 0.8);
        border-color: #00ffcc;
    }
}

@keyframes star-spin-left {
    0% {
        transform: translateY(-50%) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    50% {
        transform: translateY(-50%) rotate(180deg) scale(1.2);
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes star-spin-right {
    0% {
        transform: translateY(-50%) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    50% {
        transform: translateY(-50%) rotate(-180deg) scale(1.2);
    }

    /* Counter rotate */
    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) rotate(-360deg) scale(0.5);
        opacity: 0;
    }
}

/* =========================================
   MOBILE VOLUME OVERLAY
   ========================================= */
.vol-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.vol-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.vol-slider-container {
    background: #111;
    border: 2px solid var(--primary, #00ffcc);
    padding: 30px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.3);
}

/* Vertical Slider Styling */
input[type=range][orient=vertical] {
    writing-mode: vertical-lr;
    direction: rtl;
    -webkit-appearance: none;
    appearance: none;
    width: 8px;
    height: 100%;
    padding: 0 5px;
}

/* =========================================
   RESPONSIVE VISIBILITY UTILITIES
   ========================================= */

/* モバイル専用: デスクトップでは非表示 */
.mobile-only {
    display: none !important;
}

/* モバイルビューポート (768px以下) で表示 */
@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }

    /* ボタンの場合は inline-flex に */
    button.mobile-only {
        display: inline-flex !important;
    }
}

/* デスクトップ専用: モバイルでは非表示 */
.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}