/* --- 0. 全体のはみ出し防止ルール（超重要） --- */
*, *::before, *::after {
    box-sizing: border-box !important;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden; 
    margin: 0;
    padding: 0;
}

/* 画像のドラッグ保存・長押し保存を完全ブロック */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none; 
    user-select: none;
}

/* --- 1. 全体設定 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro JP", "SF Pro Text", "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic ProN", Arial, sans-serif;
    background: linear-gradient(to bottom, #000000 70%, #3a005c 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 120px; 
}

/* --- 2. センター固定ロゴ --- */
.logo-wrapper {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: auto;
    z-index: 9999;
    cursor: pointer;
    animation: logo-shake 3s infinite cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.logo-img {
    width: 100%;
    height: auto;
    display: block;
    filter: invert(1) brightness(2);
}
.logo-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    mix-blend-mode: screen;
    opacity: 0;
    animation: rainbow-flash 3s infinite linear;
    -webkit-mask-image: url('logo/nicrlogoblack-02.png');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url('logo/nicrlogoblack-02.png');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}
.logo-wrapper:hover {
    transform: translateX(-50%) scale(1.1);
}
@media (max-width: 768px) {
    .logo-wrapper { width: 100px; top: 20px; }
}

@keyframes logo-shake {
    0%, 90% { transform: translateX(-50%) rotate(0deg); }
    91% { transform: translateX(-50%) rotate(-5deg); }
    92% { transform: translateX(-50%) rotate(5deg); }
    93% { transform: translateX(-50%) rotate(-5deg); }
    94% { transform: translateX(-50%) rotate(5deg); }
    95% { transform: translateX(-50%) rotate(-3deg); }
    96% { transform: translateX(-50%) rotate(3deg); }
    97% { transform: translateX(-50%) rotate(-1deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

@keyframes rainbow-flash {
    0%, 45% { opacity: 0; }
    50% { opacity: 1; filter: brightness(1.5) saturate(1.5); }
    55%, 100% { opacity: 0; }
}

/* --- 3. モーダル設定 --- */
#profile-modal { z-index: 10000; }
#song-modal { z-index: 10010; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    display: block; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
    overflow-y: auto; 
    overflow-x: hidden; 
    padding: 40px 0; 
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s;
}

.modal-content {
    position: relative;
    background: rgba(0, 0, 0, 0.85); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%; 
    max-width: 500px;
    margin: 8vh auto; 
    border-radius: 15px;
    color: #fff;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    padding: 40px 20px 20px; 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro JP", "SF Pro Text", "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic ProN", Arial, sans-serif;
}

#studio-modal {
    z-index: 10010;
    display: flex; 
    align-items: center;
    justify-content: center;
    padding: 0;
}
#studio-modal .modal-content {
    margin: 0 !important;
}

@media (max-width: 768px) {
    .modal-overlay { 
        padding: calc(env(safe-area-inset-top, 0px) + 15px) 0 120px 0; 
    }
    .modal-content { 
        width: 92%; 
        margin: 0 auto; 
        padding: 40px 15px 30px; 
    }
    
    #studio-modal {
        padding: 0 !important;
        align-items: center !important; 
    }
    #studio-modal .modal-content {
        margin: 0 !important;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .modal-overlay { 
        padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 80px 0; 
    }
    .modal-content { 
        width: 90%;
        margin: 0 auto; 
    }
}

.close-btn {
    position: absolute;
    top: 10px;     
    right: 15px;   
    font-size: 35px; 
    font-weight: 300;
    cursor: pointer;
    color: #fff;
    z-index: 20000;
    padding: 10px;  
    line-height: 1;
    background: transparent; 
    border: none;            
}
.close-btn:hover { 
    color: #ff0055; 
    transform: scale(1.1);
}

.studio-label {
    font-size: 0.75rem; 
    color: rgba(255, 255, 255, 0.4); 
    margin-top: 30px;
    margin-bottom: 5px; 
    text-align: left;
    font-weight: 300; 
    letter-spacing: 1px;
}

.studio-gallery-strip {
    display: flex;
    justify-content: center;
    gap: 8px; 
    margin-top: 0;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    flex-wrap: wrap; 
}
.studio-gallery-strip img {
    width: 15%; 
    height: auto;
    object-fit: cover;
    aspect-ratio: 1 / 1; 
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s, filter 0.3s;
    filter: grayscale(50%);
}
.studio-gallery-strip img:hover {
    transform: scale(1.1);
    filter: grayscale(0%);
    border: 1px solid #fff;
}
@media (max-width: 600px) {
    .studio-gallery-strip img { width: 30%; margin-bottom: 5px; }
}

.studio-content {
    background: transparent; 
    border: none;
    box-shadow: none;
    max-width: 900px;
    padding: 0;
}
#studio-large-img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}
#studio-large-img.fade-out { opacity: 0; }

.ai-photo-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 30px auto 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    display: flex; 
    justify-content: center;
    align-items: flex-end;
}
.ai-photo-wrapper.show {
    opacity: 1;
    transform: translateY(0);
}
.duo-photo {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none; 
}
.click-zone {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    cursor: pointer;
    z-index: 10;
}
.left-zone { left: 0; }
.right-zone { right: 0; }

.speech-bubble {
    position: absolute;
    background: #fff;
    color: #000;
    padding: 10px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 20;
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
.speech-bubble::after {
    content: '';
    position: absolute;
    border-style: solid;
    display: block;
    width: 0;
    z-index: 1;
}
.speech-bubble.active {
    opacity: 1;
    transform: scale(1);
}

.bubble-left { bottom: 75%; left: 5%; } 
.bubble-left::after { bottom: -10px; left: 30%; border-width: 10px 10px 0; border-color: #fff transparent; }

.bubble-right { bottom: 85%; right: 2%; } 
.bubble-right::after { bottom: -10px; right: auto; left: 20%; border-width: 10px 10px 0; border-color: #fff transparent; }

.bubble-right-sub { top: 55%; right: 5%; }
.bubble-right-sub::after { top: -20px; left: 15px; border-width: 0 0 20px 20px; border-color: transparent transparent #fff transparent; }

.floating-links-group {
    position: absolute;
    bottom: -20px;     
    right: 15px;      
    display: flex; 
    gap: 15px; 
    opacity: 0; 
    transform: translateX(20px); 
    transition: opacity 1s ease, transform 1s ease;
    z-index: 30;
}
.floating-links-group.show {
    opacity: 1;
    transform: translateX(0);
}
.link-item {
    width: 50px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}
.link-item img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}
.label-sns {
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    width: 100%;
    text-align: center;
    border-radius: 2px;
    margin-bottom: 4px;
    padding: 2px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
    line-height: 1;
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    animation: badgePulse 2s infinite ease-in-out; 
    transform-origin: center bottom; 
}

.label-new {
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    width: 100%;
    text-align: center;
    border-radius: 2px;
    margin-bottom: 4px;
    padding: 2px 0;
    letter-spacing: 1px;
    line-height: 1;
    background-color: rgba(160, 80, 220, 0.8); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: badgePulse 2s infinite ease-in-out; 
    transform-origin: center bottom; 
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); } 
    100% { transform: scale(1); }
}

@media (max-width: 500px) {
    .floating-links-group { right: 10px; bottom: -15px; gap: 10px; } 
    .link-item { width: 40px; }
    .bubble-right-sub { top: 55%; right: 5px; font-size: 0.8rem; }
    .bubble-right-sub::after { top: -15px; left: 10px; border-width: 0 0 15px 15px; }
}

/* --- 曲詳細モーダル --- */
.song-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; 
}
.song-detail-img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    pointer-events: none; 
    max-width: 100%; 
}
.song-info {
    width: 100%; 
}

@keyframes text-rainbow {
    0%, 90% { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }
    92% { color: rgba(255, 200, 200, 0.9); text-shadow: 0 0 10px rgba(255, 150, 150, 0.4); }
    94% { color: rgba(200, 255, 200, 0.9); text-shadow: 0 0 10px rgba(150, 255, 150, 0.4); }
    96% { color: rgba(200, 200, 255, 0.9); text-shadow: 0 0 10px rgba(150, 150, 255, 0.4); }
    98% { color: rgba(255, 200, 255, 0.9); text-shadow: 0 0 10px rgba(255, 150, 255, 0.4); }
    100% { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }
}

.profile-text h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    animation: text-rainbow 3s infinite linear;
}

.song-info h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;     
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
}

/* ★追加：「楽曲について」のラベル設定 */
.desc-label {
    font-size: 0.75rem;
    color: #bbb;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-weight: normal;
}

.song-info p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #ddd;
    text-align: center;  /* ⬅︎ center に変更！ */
    width: 100%;     
    word-break: break-word;
    overflow-wrap: break-word;
    font-weight: 400; 
    font-family: inherit;
}

.profile-text p {
    font-size: 1rem;
    line-height: 1.8;
    color: #e0e0e0;
    font-weight: 400;
}

#featuring-area {
    width: 100%;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: none; 
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}
#featuring-area.show {
    opacity: 1;
    transform: translateY(0);
}

.feat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.feat-content-wrapper {
    position: relative;
    display: inline-block;
}
.feat-img {
    width: 130px;
    height: 130px;
    border-radius: 50%; 
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.feat-content-wrapper:hover .feat-img {
    transform: scale(1.05);
    border-color: rgba(255, 85, 0, 0.8); 
}

.feat-name {
    margin-top: 15px;
    font-size: 1.2rem;
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
}
.feat-access-btn {
    position: absolute;
    top: 0;
    right: -10px;
    background: linear-gradient(45deg, #ff5500, #ff8800); 
    color: white;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 20px; 
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    text-decoration: none;
    letter-spacing: 0.5px;
    animation: badgePulse 2s infinite ease-in-out; 
}
.feat-access-btn:hover {
    filter: brightness(1.1);
}

#soundcloud-area {
    width: 100%;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    display: none; 
    animation: fadeInPlayer 1s ease forwards;
    text-align: center; 
}
.store-msg { font-size: 0.8rem; color: #aaa; margin-bottom: 15px; line-height: 1.4; }

.linkfire-btn { display: inline-block; width: 150px; transition: transform 0.3s, opacity 0.3s; opacity: 0.9; }
.linkfire-btn:hover { transform: scale(1.05); opacity: 1; }
.linkfire-btn img { width: 100%; height: auto; filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)); }

@keyframes fadeInPlayer {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sc-notice-mobile {
    display: none;
}

.nav-arrow {
    position: fixed; 
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 50px;
    cursor: pointer;
    z-index: 20010; 
    padding: 10px;
    user-select: none;
    transition: color 0.3s;
}
.nav-arrow:hover { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.8); }
.prev-arrow { left: 10px !important; }
.next-arrow { right: 10px !important; }

@media (max-width: 768px) {
    .song-detail-img { width: 200px; height: 200px; }
    .song-info h2 { font-size: 1.4rem; }
    .song-info p { font-size: 0.9rem; }
    
    .nav-arrow { 
        font-size: 40px; 
        padding: 5px; 
        top: 50% !important; 
        transform: translateY(-50%);
    }
    
    #song-modal .nav-arrow {
        top: 155px !important; 
        transform: translateY(-50%); 
        margin-top: 0; 
    }

    .prev-arrow { left: 0 !important; }
    .next-arrow { right: 0 !important; }

    .sc-notice-mobile {
        display: block;
        font-size: 0.75rem;
        color: #bbb;
        text-align: left;
        margin-top: 10px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
        border-left: 3px solid #ff5500; 
    }
    .sc-notice-mobile p { margin: 3px 0; font-size: 0.75rem; line-height: 1.4; }
    .sc-notice-mobile span { font-weight: bold; color: #fff; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .nav-arrow { font-size: 30px; top: 50% !important; }
    .prev-arrow { left: 10px !important; }
    .next-arrow { right: 10px !important; }

    .sc-notice-mobile {
        display: block;
        font-size: 0.75rem;
        color: #bbb;
        text-align: left;
        margin-top: 10px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 5px;
        border-left: 3px solid #ff5500; 
    }
    .sc-notice-mobile p { margin: 3px 0; font-size: 0.75rem; line-height: 1.4; }
    .sc-notice-mobile span { font-weight: bold; color: #fff; }
}

/* --- 4. 流れるテキスト --- */
.marquee-wrapper {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    z-index: 50;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.marquee-text {
    white-space: nowrap;
    font-size: 12vw; 
    font-weight: 900;
    letter-spacing: -0.05em;
    color: #fff;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    text-shadow: none;
    animation: scroll-text 60s linear infinite; 
    mix-blend-mode: exclusion; 
    opacity: 0.9;
    font-family: "Helvetica Neue", Arial, sans-serif !important; 
}
@media (max-width: 768px) {
    .marquee-text { animation-duration: 40s; font-size: 15vw; }
}
@keyframes scroll-text {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

/* --- 5. ギャラリー基本設定 --- */
#gallery {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px;
    gap: 15px;
    padding: 15px;
    padding-top: 100px; 
    position: relative;
    z-index: 10;
}

.size-small { grid-column: span 1; grid-row: span 1; }
.size-wide  { grid-column: span 2; grid-row: span 1; }
.size-tall  { grid-column: span 1; grid-row: span 2; }
.size-big   { grid-column: span 2; grid-row: span 2; }

.photo-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards; 
    transition: transform 0.3s ease;
}
.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2);
    transition: filter 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
    cursor: pointer;
}

.new-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(160, 80, 220, 0.8); 
    color: white;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 6px;
    border-radius: 3px;
    z-index: 20; 
    box-shadow: 0 0 5px rgba(160, 80, 220, 0.5);
    animation: pulse-purple 2s infinite;
    pointer-events: none; 
    letter-spacing: 1px;
}
@keyframes pulse-purple {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); box-shadow: 0 0 10px rgba(160, 80, 220, 0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.photo-container img.viewed { opacity: 0.25; filter: grayscale(100%); }
.photo-container:hover img { filter: grayscale(0%); transform: scale(1.05); z-index: 100; }
.photo-container:hover { z-index: 100; }
.photo-container:hover img.viewed { opacity: 0.6; filter: grayscale(30%); }

/* --- レスポンシブ グリッド制御 --- */
@media (max-width: 768px) {
    body { padding-bottom: 150px !important; }
    #gallery {
        grid-template-columns: repeat(4, 1fr) !important; 
        grid-auto-rows: calc((100vw - 20px) / 4) !important; 
        gap: 4px !important;
        padding: 4px !important;
        padding-top: 80px !important;
    }
    .photo-container {
        aspect-ratio: auto !important; 
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    body { padding-bottom: 100px !important; }
    #gallery {
        grid-template-columns: repeat(6, 1fr) !important; 
        grid-auto-rows: calc((100vw - 40px) / 6) !important; 
        gap: 4px !important;
        padding: 10px !important;
        padding-top: 60px !important;
    }
    .photo-container {
        aspect-ratio: auto !important; 
    }
}

/* --- 6. フッター固定 --- */
.footer-stores {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0) 100%);
    padding: 30px 20px 20px; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; 
    z-index: 999; 
    flex-wrap: wrap;
    border: none;
}
.store-link {
    display: flex; 
    align-items: center;
    height: 50px; 
    transition: opacity 0.3s, transform 0.3s;
}
.store-icon {
    height: 40px; 
    width: auto;
    max-height: none; 
    max-width: none; 
    opacity: 0.95; 
    cursor: pointer;
    filter: grayscale(100%) brightness(500%) contrast(200%);
    drop-shadow: 0 4px 6px rgba(0,0,0,0.9);
    mix-blend-mode: normal; 
}
.store-icon[alt="Beatport"],
.store-icon[alt="YouTube"] { height: 35px; }
.store-link:hover .store-icon { opacity: 1; transform: scale(1.15); }

@media (max-width: 768px) {
    .footer-stores { padding: 30px 10px 15px !important; gap: 15px !important; }
    .store-icon { height: 28px !important; }
}
@media (max-height: 500px) {
    .footer-stores { padding: 25px 10px 10px !important; gap: 15px !important; }
    .store-icon { height: 25px !important; }
}

.official-mark {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    z-index: 1000;
    letter-spacing: 1px;
    font-weight: 300;
    pointer-events: none;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro JP", "SF Pro Text", "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic ProN", Arial, sans-serif;
}
@media (max-width: 768px) {
    .official-mark { font-size: 8px; bottom: 5px; }
}
@keyframes fadeIn { to { opacity: 1; } }

#glitch-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 999999; 
    pointer-events: none;
    opacity: 0;
    display: none;
}
#glitch-overlay.active {
    display: block;
    animation: glitch-flash 0.2s linear;
}
@keyframes glitch-flash {
    0% { opacity: 0; }
    33% { opacity: 0.6; background: rgba(200, 0, 0, 0.15); backdrop-filter: invert(10%); transform: translateX(5px); }
    66% { opacity: 0.6; background: rgba(0, 200, 255, 0.15); backdrop-filter: invert(10%); transform: translateX(-5px); }
    100% { opacity: 0; transform: translateX(0); }
}