/* ===== SYNTHWAVE LEGEND ===== */

:root {
    --neon-pink: #FF00FF;
    --neon-blue: #00FFFF;
    --neon-purple: #9D00FF;
    --neon-green: #39FF14;
    --dark-bg: #0a0e27;
    --darker-bg: #050812;
    --text-primary: #FFFFFF;
    --text-secondary: #00FFFF;
    --glow-size: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100dvh;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0a0e27 0%, #1a0a3e 50%, #0a0e27 100%);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

canvas#ghost {
    position: fixed;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

body {
    width: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.hidden {
    display: none !important;
}

/* ===== BOOT SCREEN ===== */

.bootscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: bootFadeOut 3s ease-out 4s forwards;
    padding: max(0px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
}

.bootscreen.exploding {
    animation: pageExplode 1s ease-out forwards !important;
}

.bootscreen.hidden {
    display: none !important;
}

.vhs-noise {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 0, 255, 0.03) 0px,
        rgba(255, 0, 255, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

.boot-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.scanlines {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 2px,
        transparent 2px,
        transparent 4px
    );
    top: 0;
    left: 0;
}

.boot-text {
    font-size: 1.2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink);
    letter-spacing: 2px;
    animation: bootGlitch 0.3s infinite;
}

.loading-bar {
    width: 300px;
    height: 20px;
    border: 2px solid var(--neon-pink);
    margin: 20px auto;
    box-shadow: 0 0 10px var(--neon-pink);
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
    animation: loading 2s ease-in-out infinite;
}

@keyframes bootFadeOut {
    0% { opacity: 1; }
    95% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes bootGlitch {
    0%, 100% { text-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink); }
    50% { text-shadow: 0 0 5px var(--neon-pink), 0 0 10px var(--neon-blue); }
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 100%; }
}

.boot-prompt {
    color: var(--neon-blue);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    animation: promptPulse 1.5s ease-in-out infinite !important;
    touch-action: manipulation;
}

@keyframes promptPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== MAIN CONTENT ===== */

.main-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== CRT EFFECTS ===== */

.crt-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
}

/* ===== BACKGROUND GRID ===== */

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    pointer-events: none;
}

/* ===== HEADER ===== */

.header {
    position: relative;
    text-align: center;
    padding: 40px 20px;
    z-index: 15;
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(255, 0, 255, 0.3) 0%, transparent 70%);
    filter: blur(60px);
    z-index: -1;
}

.header h1 {
    font-size: 3.5rem;
    color: var(--neon-pink);
    text-shadow:
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 40px var(--neon-blue),
        0 0 60px var(--neon-purple);
    letter-spacing: 5px;
    font-weight: bold;
    margin: 0;
}

/* ===== GLITCH EFFECT ===== */

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-anim1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: var(--neon-blue);
    z-index: -1;
    text-shadow: -2px 0 var(--neon-pink);
}

.glitch::after {
    animation: glitch-anim2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite reverse;
    color: var(--neon-purple);
    z-index: -2;
    text-shadow: 2px 0 var(--neon-blue);
}

@keyframes glitch-anim1 {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 35%, 0 100%);
        transform: translate(-2px, -2px);
    }
    50% {
        clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 80%);
        transform: translate(2px, 2px);
    }
    100% {
        clip-path: polygon(0 0, 100% 100%, 100% 0, 0 100%);
        transform: translate(-2px, 2px);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip-path: polygon(0 25%, 100% 25%, 100% 58%, 0 100%);
        transform: translate(2px, 2px);
    }
    50% {
        clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 20%);
        transform: translate(-2px, -2px);
    }
    100% {
        clip-path: polygon(0 58%, 100% 55%, 100% 100%, 0 0);
        transform: translate(2px, -2px);
    }
}

/* ===== HERO SECTION ===== */

.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 10;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    perspective: 1000px;
}

.neon-cloud-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neon-cloud {
    position: relative;
    width: 100%;
    height: 100%;
    animation: cloudPulse 2s ease-in-out infinite;
}

.cloud-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.8));
}

.cloud-svg path {
    animation: strokePulse 2s ease-in-out infinite;
}

@keyframes cloudPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.8));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 40px rgba(255, 0, 255, 1));
    }
}

@keyframes strokePulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.8));
    }
}

.hero-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 3px solid var(--neon-pink);
    box-shadow: 0 0 30px var(--neon-pink), inset 0 0 30px rgba(255, 0, 255, 0.3);
    object-fit: cover;
}

.hero-text {
    text-align: center;
}

.hero-text h2 {
    font-size: 2.5rem;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-blue);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtext {
    font-size: 1.8rem;
    color: var(--neon-blue);
    text-shadow: 0 0 15px var(--neon-blue), 0 0 30px var(--neon-purple);
    letter-spacing: 1px;
}

/* ===== SECTIONS ===== */

section {
    position: relative;
    padding: 60px 20px;
    margin: 40px 0;
    z-index: 10;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-purple);
    margin-bottom: 40px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ===== COUNTDOWN ===== */

.countdown-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.countdown-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 600px;
}

.countdown-item {
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid var(--neon-blue);
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.countdown-item:hover {
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.6), inset 0 0 20px rgba(0, 255, 255, 0.2);
    transform: translateY(-5px);
}

.countdown-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-pink);
    text-shadow: 0 0 15px var(--neon-pink);
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

/* ===== MUSIC PLAYER ===== */

.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.music-player {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--neon-blue);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 255, 255, 0.1);
    max-width: 500px;
    width: 100%;
}

.cassette-tape {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #222 0%, #111 50%, #222 100%);
    padding: 20px;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(255, 0, 255, 0.2);
}

.reel {
    width: 60px;
    height: 60px;
    border: 3px solid var(--neon-pink);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.2) 0%, transparent 70%);
    position: relative;
    box-shadow: 0 0 15px var(--neon-pink), inset 0 0 10px rgba(255, 0, 255, 0.3);
}

.reel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid var(--neon-pink);
    border-radius: 50%;
}

.reel-left {
    animation: spinLeft 2s linear infinite;
}

.reel-right {
    animation: spinRight 2s linear infinite;
}

@keyframes spinLeft {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinRight {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.cassette-label {
    flex: 1;
    text-align: center;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.track-name {
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.artist-name {
    font-size: 0.9rem;
    opacity: 0.8;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-controls-hidden {
    display: none;
}

.control-btn {
    background: transparent;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.control-btn:hover {
    box-shadow: 0 0 20px var(--neon-pink), inset 0 0 10px rgba(255, 0, 255, 0.3);
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--neon-pink);
    color: #000;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
    width: 0%;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    transition: width 0.1s linear;
}

/* ===== MUSIC SECTION ===== */

.music-section {
    position: relative;
    width: 100%;
    padding: 60px 20px;
    z-index: 15;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    animation-delay: 0.6s;
}

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

.music-container {
    position: relative;
    width: 100%;
    max-width: 550px;
}

.music-player {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--neon-blue);
    border-radius: 15px;
    padding: 30px;
    box-shadow:
        0 0 40px rgba(0, 255, 255, 0.4),
        inset 0 0 20px rgba(0, 255, 255, 0.1),
        0 0 20px rgba(255, 0, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.music-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center top, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 15px;
    pointer-events: none;
}

.music-player:hover {
    box-shadow:
        0 0 60px rgba(0, 255, 255, 0.6),
        inset 0 0 30px rgba(0, 255, 255, 0.15),
        0 0 30px rgba(255, 0, 255, 0.3);
    transform: translateY(-5px);
}

/* ===== DETAILS / TERMINAL ===== */

.details-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.terminal-window {
    background: linear-gradient(to bottom, rgba(0, 20, 20, 0.97), rgba(0, 10, 10, 0.99));
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    overflow: hidden;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 255, 255, 0.05);
    z-index: 1002;
}

.terminal-header {
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    padding: 10px 15px;
    color: #000;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Mobile: Header with safe area */
@media (max-width: 768px) {
    .terminal-header {
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
        min-height: 50px;
        font-size: 0.9rem;
    }
}

.terminal-close-btn {
    background: none;
    border: none;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    transition: all 0.2s ease;
    font-weight: bold;
    line-height: 1;
}

/* Mobile: Larger close button for touch */
@media (max-width: 768px) {
    .terminal-close-btn {
        font-size: 28px;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.terminal-close-btn:hover {
    transform: scale(1.3);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Touch: Disable hover effects */
@media (max-width: 768px) {
    .terminal-close-btn:hover {
        transform: none;
    }
    .terminal-close-btn:active {
        transform: scale(0.95);
        background: rgba(0, 0, 0, 0.1);
    }
}

.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 998;
    cursor: pointer;
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.terminal-content {
    padding: 20px;
    font-size: 0.95rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
}

.terminal-content p {
    margin: 8px 0;
    animation: terminalType 0.3s ease-out forwards;
}

@keyframes terminalType {
    from {
        opacity: 0;
        width: 0;
    }
    to {
        opacity: 1;
        width: auto;
    }
}

.terminal-content p:nth-child(odd) {
    color: var(--neon-pink);
}

/* ===== HIDDEN TERMINAL ===== */

.terminal-hidden {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    animation: slideIn 0.4s ease-out;
}

.terminal-hidden.active {
    display: block;
}

/* Mobile: Full-screen fixed overlay */
@media (max-width: 768px) {
    .terminal-hidden {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100vw;
        height: 100dvh;
        z-index: 9999;
    }

    .terminal-hidden.active {
        display: flex;
        flex-direction: column;
    }

    /* Dark backdrop to block background completely */
    .terminal-hidden::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 5, 10, 0.98);
        z-index: -1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Mobile: Simple fade-in instead of scale */
@media (max-width: 768px) {
    @keyframes slideIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

.terminal-interactive {
    max-width: 800px;
    width: 90vw;
    height: 500px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 10, 15, 0.98);
}

@media (max-width: 768px) {
    .terminal-interactive {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        border: none;
        background: rgba(0, 8, 12, 1);
        /* Prevent touch events from bleeding through */
        touch-action: pan-y;
        overscroll-behavior: contain;
        /* Ensure it fills the parent */
        flex: 1;
        position: relative;
    }
}

.terminal-input {
    background: rgba(0, 20, 20, 0.95);
    border: none;
    border-top: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 12px 15px;
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    outline: none;
    box-sizing: border-box;
    caret-color: var(--neon-blue);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1002;
}

.terminal-input:focus {
    background: rgba(0, 30, 30, 0.98);
    box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.2);
}

.terminal-input::placeholder {
    color: rgba(0, 255, 255, 0.4);
}

.terminal-link {
    color: var(--neon-blue);
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid var(--neon-blue);
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

.terminal-link:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink);
    border-bottom-color: var(--neon-pink);
}

/* ===== CHAT MESSAGES CONTAINER ===== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Contain scroll within this element */
    overscroll-behavior: contain;
    /* Solid dark background for visibility */
    background: rgba(0, 5, 10, 0.95);
}

/* Mobile: Enhanced chat area */
@media (max-width: 768px) {
    .chat-messages {
        padding: 16px;
        gap: 14px;
        /* Fully opaque background on mobile */
        background: rgba(0, 8, 12, 1);
        /* Fill available space */
        min-height: 0;
        flex: 1 1 auto;
        /* Ensure scroll stays contained */
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        /* Allow scrolling */
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 20, 20, 0.5);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* Hide scrollbar on mobile for cleaner look */
@media (max-width: 768px) {
    .chat-messages::-webkit-scrollbar {
        display: none;
    }
    .chat-messages {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ===== MESSAGE BUBBLES ===== */

.message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: messageSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-wrapper.user {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.message-wrapper.bot {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    transition: all 0.2s ease;
}

.message-bubble.user-bubble {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15), rgba(255, 0, 255, 0.08));
    border: 1px solid rgba(255, 0, 255, 0.4);
    color: #FFFFFF;
    box-shadow:
        0 0 15px rgba(255, 0, 255, 0.3),
        inset 0 0 10px rgba(255, 0, 255, 0.05);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.message-bubble.user-bubble:hover {
    box-shadow:
        0 0 20px rgba(255, 0, 255, 0.5),
        inset 0 0 15px rgba(255, 0, 255, 0.1);
    transform: translateY(-2px);
}

.message-bubble.bot-bubble {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.12), rgba(0, 255, 255, 0.06));
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: var(--neon-blue);
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.05);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.message-bubble.bot-bubble:hover {
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

.message-text {
    white-space: pre-wrap;
}

/* Mobile: Enhanced bubble visibility */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 14px 18px;
        /* Stronger border for visibility */
        border-width: 2px;
    }

    .message-bubble.user-bubble {
        background: linear-gradient(135deg, rgba(255, 0, 255, 0.25), rgba(255, 0, 255, 0.15));
        border-color: rgba(255, 0, 255, 0.6);
        box-shadow:
            0 0 20px rgba(255, 0, 255, 0.4),
            inset 0 0 15px rgba(255, 0, 255, 0.1);
    }

    .message-bubble.bot-bubble {
        background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 255, 0.1));
        border-color: rgba(0, 255, 255, 0.6);
        box-shadow:
            0 0 20px rgba(0, 255, 255, 0.4),
            inset 0 0 15px rgba(0, 255, 255, 0.1);
    }

    /* Disable hover transforms on touch devices */
    .message-bubble.user-bubble:hover,
    .message-bubble.bot-bubble:hover {
        transform: none;
    }
}

/* ===== CHAT INPUT CONTAINER ===== */

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 15, 20, 1);
    border-top: 2px solid var(--neon-blue);
    align-items: center;
    position: relative;
    flex-shrink: 0;
    /* Prevent container from scrolling */
    overscroll-behavior: none;
}

/* Mobile: Fixed input at bottom with safe areas */
@media (max-width: 768px) {
    .chat-input-container {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        background: rgba(0, 10, 15, 1);
        border-top: 1px solid rgba(0, 255, 255, 0.5);
        /* Ensure it stays at bottom */
        flex-shrink: 0;
        min-height: 60px;
        /* Glow effect for visibility */
        box-shadow: 0 -4px 20px rgba(0, 255, 255, 0.15);
    }
}

.chat-input {
    flex: 1;
    background: rgba(0, 30, 30, 0.8);
    border: 2px solid rgba(0, 255, 255, 0.3);
    color: var(--neon-blue);
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    border-radius: 24px;
    outline: none;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
    transition: all 0.3s ease;
    caret-color: var(--neon-blue);
}

.chat-input:focus {
    background: rgba(0, 40, 40, 0.95);
    border-color: var(--neon-blue);
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.chat-input::placeholder {
    color: rgba(0, 255, 255, 0.4);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    border: 2px solid var(--neon-pink);
    color: #000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow:
        0 0 15px rgba(255, 0, 255, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.chat-send-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(255, 0, 255, 0.3),
        rgba(0, 255, 255, 0.3),
        rgba(255, 0, 255, 0.3)
    );
    animation: btnRotate 4s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes btnRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow:
        0 0 25px rgba(255, 0, 255, 0.8),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.chat-send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ===== TYPING INDICATOR ===== */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.12), rgba(0, 255, 255, 0.06));
    border: 1px solid rgba(0, 255, 255, 0.4);
    border-radius: 18px;
    max-width: fit-content;
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.05);
    animation: typingIndicatorSlideIn 0.3s ease-out;
}

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

.typing-indicator.hidden {
    display: none;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-blue);
    border-radius: 50%;
    animation: typingDotBounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
        box-shadow: 0 0 12px rgba(0, 255, 255, 1);
    }
}

/* Mobile optimizations for chat */
@media (max-width: 768px) {
    .chat-messages {
        padding: 16px;
        gap: 12px;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 10px 14px;
        box-shadow:
            0 0 10px rgba(0, 255, 255, 0.2),
            inset 0 0 5px rgba(0, 255, 255, 0.05);
    }

    .message-bubble:hover {
        transform: none;
    }

    .chat-input-container {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        gap: 8px;
    }

    .chat-input {
        padding: 10px 14px;
        border-radius: 20px;
        font-size: 16px !important;
    }

    .chat-send-btn {
        width: 44px;
        height: 44px;
    }

    .typing-indicator {
        margin-bottom: 12px;
        padding: 10px 14px;
    }

    .typing-dot {
        width: 7px;
        height: 7px;
    }
}

/* ===== DANCER CONTAINER ===== */

.dancer-container {
    position: relative;
    height: 300px;
    margin: 100px 0;
}

.dancer-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--neon-pink) 20%, var(--neon-blue) 50%, var(--neon-pink) 80%, transparent 100%);
    box-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-blue);
    transform: translateY(-50%);
    z-index: 5;
}

.dancer-character {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: danceMove linear 8s infinite alternate;
    animation-play-state: paused;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8)) drop-shadow(0 0 30px rgba(255, 0, 255, 0.5));
    cursor: pointer;
    z-index: 100;
    mix-blend-mode: screen;
    clip-path: inset(10% 12% 10% 12%);
}

.dancer-character.paused {
    animation-play-state: paused;
}

@keyframes danceMove {
    0% {
        transform: translate(calc(-50% - 200px), -100%);
    }
    100% {
        transform: translate(calc(-50% + 200px), -100%);
    }
}


/* ===== FOOTER ===== */

.footer {
    position: relative;
    text-align: center;
    padding: 40px 20px;
    border-top: 2px solid rgba(255, 0, 255, 0.3);
    margin-top: 60px;
    z-index: 15;
}

.footer p {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin: 10px 0;
    font-size: 0.9rem;
}

.footer p.glitch {
    animation: footerGlitch 0.5s ease-in-out 2s infinite;
}

@keyframes footerGlitch {
    0%, 100% { color: var(--neon-blue); }
    50% { color: var(--neon-pink); }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .hero-text h2 {
        font-size: 1.8rem;
    }

    .subtext {
        font-size: 1.2rem;
    }

    .countdown-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .neon-cloud-wrapper {
        width: 200px;
        height: 200px;
    }

    .music-section {
        padding: 40px 15px;
    }

    .music-player {
        padding: 20px;
    }

    .cassette-tape {
        margin-bottom: 20px;
        padding: 15px;
    }

    .reel {
        width: 50px;
        height: 50px;
    }

    .reel::after {
        width: 25px;
        height: 25px;
    }

    .track-name {
        font-size: 1rem;
    }

    .artist-name {
        font-size: 0.8rem;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .hero {
        min-height: 40vh;
        padding: 20px;
    }

    .hero-text h2 {
        font-size: 1.3rem;
    }

    .subtext {
        font-size: 1rem;
    }

    .music-player {
        padding: 20px;
    }

    .cassette-tape {
        flex-direction: column;
        gap: 10px;
    }

    .neon-cloud-wrapper {
        width: 150px;
        height: 150px;
    }
}

/* ===== INTERMISSION PAGE ===== */

.intermission-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e27 0%, #1a0a3e 50%, #0a0e27 100%);
    z-index: 999;
    overflow: hidden;
}

.intermission-page.hidden {
    display: none !important;
}

.intermission-page.exploding {
    animation: pageExplode 1s ease-out forwards;
}

.intermission-dancer-container {
    position: relative;
    z-index: 10;
    animation: fadeIn 1s ease-out;
}

.intermission-dancer {
    width: 328px;
    height: 272px;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8)) drop-shadow(0 0 30px rgba(255, 0, 255, 0.5));
    animation: dancerPulse 2s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pageExplode {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

@keyframes dancerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===== DANCERS PAGE ===== */

.dancers-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e27 0%, #1a0a3e 50%, #0a0e27 100%);
    z-index: 998;
    overflow: hidden;
}

.dancers-page.hidden {
    display: none !important;
}

.dancers-grid {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .dancers-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        align-content: stretch;
        justify-content: stretch;
        padding: 0;
        max-width: 100vw;
        margin: 0;
        height: 100%;
        transform: none;
        /* 4 dancers in 2x2 grid, full screen on mobile */
    }
}

.dancer-item {
    position: absolute;
    width: 328px;
    height: 272px;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8)) drop-shadow(0 0 30px rgba(255, 0, 255, 0.5));
}

.dancer-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .dancer-item {
        position: relative !important;
        width: 50vw !important;
        height: 50vh !important;
        aspect-ratio: auto !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
    }

    .dancer-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

.click-prompt {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--neon-pink);
    font-size: 1.5rem;
    text-align: center;
    cursor: pointer;
    animation: pulse-text 1s ease-in-out infinite;
    z-index: 1000;
    pointer-events: none;
}

.click-prompt.active {
    pointer-events: auto;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.7;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* ===== DETAILS SECTION DANCER ===== */

.details-dancer {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    height: 250px;
    z-index: 20;
}

.dancer-cutout {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8)) drop-shadow(0 0 30px rgba(255, 0, 255, 0.5));
    object-fit: cover;
    object-position: center 35%;
    clip-path: inset(15% 12% 15% 12%);
}

/* ===== TALK TO LEGEND BUTTON ===== */

.talk-to-legend-wrapper {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: center;
    margin: 0 0 40px 0;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.talk-to-legend-btn {
    position: relative;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-blue));
    border: 3px solid var(--neon-pink);
    color: #000;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow:
        0 0 10px rgba(255, 0, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6),
        inset 0 0 15px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.talk-to-legend-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(255, 0, 255, 0.3),
        rgba(0, 255, 255, 0.3),
        rgba(255, 0, 255, 0.3)
    );
    animation: rotate 6s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 0, 255, 0.2), transparent);
    pointer-events: none;
}

.talk-to-legend-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow:
        0 0 20px rgba(255, 0, 255, 1),
        0 0 40px rgba(0, 255, 255, 0.8),
        0 10px 30px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
}

.talk-to-legend-btn:active {
    transform: scale(0.98) translateY(-2px);
    box-shadow:
        0 0 15px rgba(255, 0, 255, 0.8),
        0 0 30px rgba(0, 255, 255, 0.6),
        inset 0 0 20px rgba(255, 0, 255, 0.3);
}

.terminal-open-btn {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
    border: 2px solid var(--neon-pink);
    color: #000;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), inset 0 0 10px rgba(255, 0, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    display: block;
}

.terminal-open-btn:hover {
    box-shadow: 0 0 20px var(--neon-pink), 0 0 30px var(--neon-blue), inset 0 0 20px rgba(255, 0, 255, 0.2);
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-blue));
}

.terminal-open-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 10px var(--neon-pink), inset 0 0 10px rgba(255, 0, 255, 0.3);
}

@media (max-width: 1024px) {
    .details-dancer {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Mobile viewport fixes */
    html {
        height: 100dvh;
    }

    body {
        min-height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Touch target optimization */
    button,
    a,
    input,
    .control-btn,
    .terminal-open-btn,
    .clickPrompt {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }

    /* Input font size to prevent zoom */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Disable hover effects on touch devices */
    @supports (hover: none) {
        button:hover,
        a:hover {
            background-color: inherit;
        }
    }

    /* Layout optimizations */
    .details-section {
        position: relative;
    }

    .details-dancer {
        display: none;
    }

    /* Responsive text sizing */
    .header h1 {
        font-size: 2.5rem;
    }

    .boot-text {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    /* Grid canvas optimization for mobile */
    canvas#gridCanvas {
        display: none;
    }

    /* Terminal optimization */
    .terminal-window {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .terminal-input {
        font-size: 16px;
    }

    /* Mobile terminal overlay optimization */
    .terminal-overlay {
        background: radial-gradient(
            ellipse at center,
            rgba(0, 0, 0, 0.5) 0%,
            rgba(0, 0, 0, 0.9) 100%
        );
    }

    /* Countdown optimization */
    .countdown-container {
        gap: 0.8rem;
    }

    .countdown-value {
        font-size: 1.5rem;
    }

    .countdown-label {
        font-size: 0.7rem;
    }

    /* Prevent double-tap zoom */
    a, button, input {
        touch-action: manipulation;
    }

    /* Safe area support for notch devices */
    .header {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    /* Optimize particle count for mobile performance */
    .particle {
        display: none;
    }

    /* Dancers page optimization */
    .dancers-page {
        height: 100dvh;
        padding: max(0px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
    }

    .dancers-grid {
        width: 100%;
        height: 100%;
    }

    /* Click prompt positioning for mobile */
    .click-prompt {
        font-size: 1rem;
        bottom: 30px;
        padding: 0 20px;
    }

    /* Talk to Legend button mobile styling */
    .talk-to-legend-wrapper {
        margin: 30px 0;
    }

    .talk-to-legend-btn {
        padding: 14px 30px;
        font-size: 1rem;
        letter-spacing: 1.5px;
        border: 2px solid var(--neon-pink);
    }

    .talk-to-legend-btn:hover {
        transform: scale(1.03) translateY(-3px);
    }

/* ===== BARBARA TRIBUTE WALL ===== */

/* Tribute Section */
.tribute-section {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(255, 0, 255, 0.05));
    border-top: 2px solid var(--neon-pink);
    margin: 40px 0;
}

@media (min-width: 1024px) {
    .tribute-section {
        display: none !important;
    }
}

.tribute-button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.tribute-trigger-btn {
    position: relative;
    padding: 16px 40px;
    font-size: 1.1rem;
    letter-spacing: 2px;
    border: 3px solid var(--neon-pink);
    background: transparent;
    color: var(--neon-pink);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    overflow: hidden;
}

.tribute-trigger-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--neon-pink);
    z-index: -1;
    transition: left 0.3s ease;
}

.tribute-trigger-btn:hover::before {
    left: 0;
}

.tribute-trigger-btn:hover {
    color: var(--dark-bg);
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 0 20px var(--neon-pink);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
}

.tribute-trigger-btn:hover .btn-glow {
    animation: glowPulse 0.6s ease-in-out;
}

/* Modal Styles */
.tribute-modal-hidden {
    display: none;
}

.tribute-modal-hidden.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tribute-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9001;
    pointer-events: auto;
}

.tribute-modal-window {
    position: relative;
    z-index: 9002;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--darker-bg);
    border: 3px solid var(--neon-pink);
    box-shadow: 0 0 40px rgba(255, 0, 255, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease-out;
    overflow: hidden;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--neon-pink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 0, 255, 0.05);
}

.modal-header span {
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--neon-pink);
    text-transform: uppercase;
}

.modal-close {
    background: none;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--neon-pink);
    color: var(--dark-bg);
    transform: scale(1.1);
}

/* Form-Only Modal */
.tribute-modal-window-form {
    position: relative;
    z-index: 9002;
    width: 90%;
    max-width: 500px;
    background: var(--darker-bg);
    border: 3px solid var(--neon-pink);
    box-shadow: 0 0 40px rgba(255, 0, 255, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease-out;
    overflow: hidden;
}

.modal-body-form {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    max-height: 70vh;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    padding: 40px;
}

/* Tribute Form */
.tribute-form-container {
    padding-right: 20px;
    border-right: 2px solid rgba(255, 0, 255, 0.2);
}

.tribute-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--neon-blue);
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-input {
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid var(--neon-blue);
    color: var(--text-primary);
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-pink);
    background: rgba(255, 0, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.char-count {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.file-upload-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-input {
    display: none;
    visibility: hidden;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    border: 2px dashed var(--neon-pink);
    background: rgba(255, 0, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    user-select: none;
    z-index: 1;
    pointer-events: auto;
}

.file-label:hover {
    background: rgba(255, 0, 255, 0.1);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.1);
}

.file-label:active {
    transform: scale(0.98);
}

.upload-icon {
    font-size: 2rem;
}

.file-label span {
    color: var(--text-secondary);
}

.image-preview {
    max-width: 100%;
    max-height: 150px;
    margin-top: 10px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 2px solid var(--neon-pink);
    border-radius: 4px;
}

.form-group small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.submit-btn {
    position: relative;
    padding: 14px 30px;
    font-size: 1rem;
    letter-spacing: 2px;
    border: 2px solid var(--neon-pink);
    background: transparent;
    color: var(--neon-pink);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    margin-top: 20px;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--neon-pink);
    z-index: -1;
    transition: left 0.3s;
}

.submit-btn:hover::before {
    left: 0;
}

.submit-btn:hover {
    color: var(--dark-bg);
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 0 20px var(--neon-pink);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tribute Wall - Main Page Display */
.tribute-wall-container-main {
    margin-top: 40px;
    width: 100%;
}

.wall-title-main {
    color: var(--neon-blue);
    font-size: 1.2rem;
    margin-bottom: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.tribute-wall-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    width: 100%;
    grid-auto-rows: auto;
    max-width: 100%;
}

/* Legacy: Modal Tribute Wall Container */
.tribute-wall-container {
    padding-left: 0;
    overflow-y: auto;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wall-title {
    color: var(--neon-blue);
    font-size: 1.1rem;
    margin-bottom: 25px;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.tribute-wall {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    flex: 1;
}

/* MASONRY CARD LAYOUT: Image Top, Text Below */
.tribute-card {
    background: rgba(0, 255, 255, 0.04);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: cardFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tribute-card:nth-child(1) { animation-delay: 0.05s; }
.tribute-card:nth-child(2) { animation-delay: 0.1s; }
.tribute-card:nth-child(3) { animation-delay: 0.15s; }
.tribute-card:nth-child(4) { animation-delay: 0.2s; }
.tribute-card:nth-child(5) { animation-delay: 0.25s; }
.tribute-card:nth-child(6) { animation-delay: 0.3s; }
.tribute-card:nth-child(n+7) { animation-delay: 0.35s; }

.tribute-card:hover {
    background: rgba(0, 255, 255, 0.12);
    border-color: rgba(255, 0, 255, 0.5);
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 255, 255, 0.15),
                0 0 30px rgba(255, 0, 255, 0.1);
}

/* Image container (top) */
.tribute-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    transition: transform 0.4s ease-out;
    display: block;
}

.tribute-card:hover .tribute-card-image {
    transform: scale(1.03);
}

/* Text container (below image) */
.tribute-card-text {
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: 60px;
}

.tribute-card-text > div:first-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tribute-card-date {
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(0, 255, 255, 0.1);
    padding-top: 8px;
}

.loading-spinner {
    text-align: center;
    padding: 30px 20px;
    grid-column: 1 / -1;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(255, 0, 255, 0.15);
    border-top: 4px solid var(--neon-pink);
    border-right: 4px solid var(--neon-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tablet Responsive (1024px and below) */
@media (max-width: 1024px) {
    .tribute-wall {
        grid-template-columns: 1fr;
    }

    /* Keep 2-column grid on tablet, adjust spacing */
    .tribute-wall-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .tribute-card-text {
        padding: 11px;
        font-size: 0.78rem;
    }
}

/* Mobile Responsive (768px and below) */
@media (max-width: 768px) {
    .tribute-wall-container-main {
        margin-top: 30px;
    }

    /* Keep 2-column grid on mobile, optimize spacing */
    .tribute-wall-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 8px;
    }

    .tribute-card-text {
        padding: 10px;
        font-size: 0.7rem;
        min-height: 50px;
    }

    .tribute-card-text > div:first-child {
        -webkit-line-clamp: 2;
    }

    .tribute-card-date {
        font-size: 0.6rem;
        margin-top: 6px;
        padding-top: 6px;
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 25px;
    }

    .tribute-form-container {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid rgba(255, 0, 255, 0.2);
        padding-bottom: 25px;
    }

    .tribute-wall-container {
        padding-left: 0;
        max-height: 70vh;
    }

    .tribute-wall {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tribute-modal-window,
    .tribute-modal-window-form {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
    }

    .modal-body-form {
        padding: 20px;
        padding-bottom: 0;
        flex: 1;
        overflow-y: auto;
        max-height: none;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile tribute form - sticky submit button at bottom */
    .tribute-form {
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    /* Form fields wrapper - takes remaining space */
    .tribute-form .form-group {
        flex-shrink: 0;
    }

    .tribute-form .submit-btn {
        position: sticky;
        bottom: -1px; /* Slight overlap to prevent gap */
        left: 0;
        right: 0;
        margin: 20px -20px 0 -20px; /* Extend to edges */
        width: calc(100% + 40px);
        border-radius: 0;
        padding: 18px 30px;
        z-index: 100;
        background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
        box-shadow: 0 -4px 20px rgba(255, 0, 255, 0.5);
        font-size: 1.1rem;
        font-weight: bold;
        min-height: 60px;
        flex-shrink: 0;
    }

    /* Reduce image preview height on mobile */
    .image-preview {
        max-height: 100px;
    }

    .image-preview img {
        max-height: 100px;
    }

    /* Reduce textarea height on mobile */
    #tributeMessage {
        min-height: 80px;
        max-height: 120px;
    }

    .modal-header {
        flex-direction: column;
        gap: 15px;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .file-label {
        padding: 20px;
    }
}

    /* Optimize animations for mobile */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* Portal Button Styles */
.portal-button {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    scale: 0;
    animation: portalScaleIn 1s ease-out forwards;
    animation-delay: 10s;
}

.portal-button:hover svg circle {
    filter: brightness(1.3) drop-shadow(0 0 20px #00FFFF);
}

.portal-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.portal-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Portal Circle Animations */
.circle-rotate-cw {
    transform-origin: 50% 50%;
    animation: rotateCW 2s linear infinite;
}

.circle-rotate-ccw {
    transform-origin: 50% 50%;
    animation: rotateCCW 4s linear infinite;
}

.portal-glow {
    filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.8))
            drop-shadow(0 0 24px rgba(255, 0, 255, 0.4));
}

/* Portal Click Feedback */
.portal-click-feedback {
    animation: portalBrighten 0.2s ease-out;
}

/* White Out Overlay */
.white-out-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    animation: whiteOut 0.3s ease-in forwards;
    pointer-events: none;
    z-index: 2000;
}

/* Keyframe Animations */
@keyframes rotateCW {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateCCW {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

@keyframes portalScaleIn {
    from {
        opacity: 0;
        scale: 0;
    }
    to {
        opacity: 1;
        scale: 1;
    }
}

@keyframes portalBrighten {
    0% {
        filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.8))
                drop-shadow(0 0 24px rgba(255, 0, 255, 0.4)) brightness(1);
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 1))
                drop-shadow(0 0 32px rgba(255, 0, 255, 0.6)) brightness(1.4);
    }
    100% {
        filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.8))
                drop-shadow(0 0 24px rgba(255, 0, 255, 0.4)) brightness(1);
    }
}

@keyframes whiteOut {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Enter Button (for returning from main to dancers) */
.enter-button {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #00FFFF;
    background: transparent;
    border: 2px solid #00FFFF;
    cursor: pointer;
    z-index: 1000;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.enter-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 1);
    border-color: #FF00FF;
    color: #FF00FF;
}

.enter-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Responsive Portal Sizing */
@media (max-width: 768px) {
    .portal-button {
        width: 110px;
        height: 110px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .portal-button {
        width: 150px;
        height: 150px;
    }
}

@media (min-width: 1025px) {
    .portal-button {
        width: 200px;
        height: 200px;
    }
}

/* Hide tribute section on desktop */
@media (min-width: 769px) {
    #tributeSection {
        display: none;
    }
}
