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

:root {
    --primary: #00D4FF;
    --secondary: #FF6B35;
    --accent: #FFE66D;
    --dark: #1a1a2e;
    --darker: #0f0f1a;
    --white: #FAFAFA;
    --shadow: 6px 6px 0px #000;
    --shadow-lg: 10px 10px 0px #000;
}

body {
    font-family: 'Space Mono', monospace;
    background: linear-gradient(180deg, #2d2d44 0%, #1a1a2e 50%, #0f0f1a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
}

/* Welcome Banner */
.welcome-banner {
    background: var(--accent);
    border: 5px solid #000;
    box-shadow: var(--shadow-lg);
    padding: 20px 60px;
    transform: rotate(-1deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-banner.active {
    background: var(--primary);
    transform: rotate(0deg) scale(1.05);
    animation: pulse 0.5s ease-out;
}

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

.welcome-text {
    font-size: 3rem;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 4px;
}

/* Gate Scene */
.gate-scene {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Buildings */
.building {
    position: absolute;
    bottom: 60px;
    width: 150px;
    height: 300px;
    background: var(--dark);
    border: 5px solid #000;
    box-shadow: var(--shadow);
}

.building.left {
    left: 0;
}

.building.right {
    right: 0;
}

.building::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 20px;
    right: 20px;
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        #3d3d5c 0px,
        #3d3d5c 30px,
        var(--dark) 30px,
        var(--dark) 40px
    );
}

.building::after {
    content: '';
    position: absolute;
    top: 100px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: repeating-linear-gradient(
        0deg,
        #3d3d5c 0px,
        #3d3d5c 20px,
        transparent 20px,
        transparent 40px
    ),
    repeating-linear-gradient(
        90deg,
        #3d3d5c 0px,
        #3d3d5c 30px,
        transparent 30px,
        transparent 60px
    );
}

/* Gate Frame */
.gate-frame {
    position: relative;
    width: 400px;
    height: 350px;
    z-index: 10;
}

/* Gate Posts */
.gate-post {
    position: absolute;
    bottom: 0;
    width: 40px;
    height: 320px;
    background: linear-gradient(90deg, #4a4a4a 0%, #2a2a2a 50%, #4a4a4a 100%);
    border: 5px solid #000;
    box-shadow: var(--shadow);
}

.gate-post.left {
    left: 0;
}

.gate-post.right {
    right: 0;
}

.gate-post::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -10px;
    right: -10px;
    height: 30px;
    background: var(--secondary);
    border: 5px solid #000;
    box-shadow: 4px -4px 0px #000;
}

/* Gate Container */
.gate-container {
    position: absolute;
    bottom: 10px;
    left: 40px;
    right: 40px;
    height: 280px;
    display: flex;
    overflow: hidden;
}

/* Gate Panels */
.gate-panel {
    width: 50%;
    height: 100%;
    background: var(--darker);
    border: 5px solid #000;
    position: relative;
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.gate-panel.left {
    border-right: 2px solid #000;
    transform-origin: left center;
}

.gate-panel.right {
    border-left: 2px solid #000;
    transform-origin: right center;
}

/* Gate Open Animation */
.gate-container.open .gate-panel.left {
    transform: translateX(-95%);
}

.gate-container.open .gate-panel.right {
    transform: translateX(95%);
}

/* Gate Bars - Pixel Style */
.gate-bars {
    display: flex;
    justify-content: space-evenly;
    height: 100%;
    padding: 10px 5px;
}

.bar {
    width: 12px;
    height: 100%;
    background: linear-gradient(
        90deg,
        #5a5a5a 0%,
        #3a3a3a 30%,
        #2a2a2a 50%,
        #3a3a3a 70%,
        #5a5a5a 100%
    );
    border: 3px solid #000;
    image-rendering: pixelated;
}

.bar::before {
    content: '';
    display: block;
    width: 100%;
    height: 20px;
    background: var(--secondary);
    margin-top: 20px;
    border-top: 3px solid #000;
    border-bottom: 3px solid #000;
}

.bar::after {
    content: '';
    display: block;
    width: 100%;
    height: 20px;
    background: var(--secondary);
    margin-top: 180px;
    border-top: 3px solid #000;
    border-bottom: 3px solid #000;
}

/* Logo on Gate */
.logo-half {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    width: 80px;
    height: 120px;
    overflow: hidden;
}

.logo-half.left {
    right: 0;
}

.logo-half.right {
    left: 0;
}

.logo-img {
    width: 160px;
    height: auto;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.5));
    image-rendering: auto;
}

.logo-half.left .logo-img {
    transform: translateX(0);
}

.logo-half.right .logo-img {
    transform: translateX(-50%);
}

/* Ground */
.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #2a2a3a;
    border-top: 5px solid #000;
}

.ground::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        #3d3d4d 0px,
        #3d3d4d 30px,
        #2a2a3a 30px,
        #2a2a3a 35px
    );
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--white);
    border: 5px solid #000;
    box-shadow: var(--shadow);
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary);
    border: 3px solid #000;
    animation: blink 2s infinite;
}

.status-indicator.connected {
    background: #4CAF50;
    animation: none;
}

.status-indicator.active {
    background: var(--primary);
    animation: pulse-dot 0.5s ease-out;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

#statusText {
    color: #000;
}

/* Sparkle effect when gate opens */
.sparkle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border: 3px solid #000;
    animation: sparkle 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(2) rotate(180deg);
        opacity: 0;
    }
}

/* Welcome animation */
@keyframes welcome-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-banner.active .welcome-text {
    animation: welcome-bounce 0.6s ease-in-out 2;
}

/* Dock Message */
.dock-message {
    background: var(--white);
    border: 5px solid #000;
    box-shadow: var(--shadow);
    padding: 15px 40px;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease-out;
    pointer-events: none;
}

.dock-message.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#dockText {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000;
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 900px) {
    .building {
        width: 100px;
        height: 200px;
    }

    .gate-frame {
        width: 300px;
        height: 280px;
    }

    .welcome-text {
        font-size: 2rem;
    }

    .gate-post {
        width: 30px;
        height: 250px;
    }

    .gate-container {
        left: 30px;
        right: 30px;
        height: 220px;
    }
}

@media (max-width: 600px) {
    .container {
        gap: 15px;
        padding: 5px 10px;
    }

    .building {
        display: none;
    }

    .gate-scene {
        height: 280px;
    }

    .gate-frame {
        width: 260px;
        height: 240px;
    }

    .gate-post {
        width: 25px;
        height: 210px;
    }

    .gate-container {
        left: 25px;
        right: 25px;
        height: 180px;
    }

    .welcome-text {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .welcome-banner {
        padding: 12px 25px;
    }

    .dock-message {
        padding: 10px 15px;
    }

    #dockText {
        font-size: 1.1rem;
    }

    .status-bar {
        padding: 10px 20px;
        font-size: 1rem;
    }
}
