/* simulai.xyz - Pixel Art Arcade */

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

:root {
    --bg: #0D0221;
    --surface: #1A0A3E;
    --text-primary: #F0F0FF;
    --text-secondary: #B8B0D0;
    --neon-cyan: #00F5D4;
    --neon-pink: #FF2D78;
    --neon-yellow: #FFE600;
    --marble: #4A3B6B;
    --grid-line: #2A1A5E;
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text-secondary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    height: 100%;
    overflow: hidden;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(13, 2, 33, 0.03) 2px,
        rgba(13, 2, 33, 0.03) 3px
    );
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scanline-overlay.active {
    opacity: 1;
}

/* Pixel Grid */
.pixel-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
}

/* Marble Texture */
.marble-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Horizontal Scroll Container */
.arcade-scroll {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 2;
}

.arcade-scroll::-webkit-scrollbar {
    display: none;
}

/* Screen */
.screen {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Boot Screen */
.screen--boot {
    flex-direction: column;
}

.boot-content {
    text-align: center;
}

.boot-title {
    font-family: 'Silkscreen', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--neon-cyan);
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    opacity: 0;
}

.boot-title.visible {
    opacity: 1;
}

.boot-title .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.boot-title .char.visible {
    opacity: 1;
}

.boot-prompt {
    font-family: 'Silkscreen', cursive;
    font-size: 0.75rem;
    color: var(--neon-pink);
    animation: promptBlink 1s step-end infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.boot-prompt.visible {
    opacity: 1;
}

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

/* Transition Strip */
.transition-strip {
    flex: 0 0 48px;
    width: 48px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 3;
}

.strip-pattern {
    width: 100%;
    height: 100%;
}

.strip-pattern--chevron {
    background: repeating-linear-gradient(
        135deg,
        var(--neon-pink) 0px,
        var(--neon-pink) 4px,
        transparent 4px,
        transparent 12px,
        var(--neon-cyan) 12px,
        var(--neon-cyan) 16px,
        transparent 16px,
        transparent 24px
    );
    opacity: 0.4;
}

.strip-pattern--dots {
    background: radial-gradient(circle 2px at 12px 12px, var(--neon-cyan) 100%, transparent 100%);
    background-size: 24px 24px;
    opacity: 0.4;
}

.strip-pattern--zigzag {
    background: repeating-linear-gradient(
        45deg,
        var(--neon-yellow) 0px,
        var(--neon-yellow) 4px,
        transparent 4px,
        transparent 12px,
        var(--neon-pink) 12px,
        var(--neon-pink) 16px,
        transparent 16px,
        transparent 24px
    );
    opacity: 0.4;
}

/* Cabinet Screens */
.screen--cabinet {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    padding: 48px;
}

.screen__diorama {
    position: relative;
    flex: 0 0 auto;
}

.pixel-art {
    width: 320px;
    height: 320px;
    border: 2px solid var(--neon-pink);
    box-shadow: 4px 4px 0 var(--surface);
    overflow: hidden;
    image-rendering: pixelated;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s var(--spring), transform 0.6s var(--spring);
}

.pixel-art.visible {
    opacity: 1;
    transform: translateY(0);
}

.pixel-svg {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.diorama-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 230, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
    transition: opacity 0.4s var(--spring);
}

.screen__diorama:hover .diorama-glow {
    opacity: 1.5;
}

/* Screen Text */
.screen__text {
    max-width: 380px;
    padding: 32px;
    opacity: 0;
    transition: opacity 0.3s ease 0.4s;
}

.screen__text.visible {
    opacity: 1;
}

.screen__label {
    font-family: 'Silkscreen', cursive;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    display: block;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

.screen__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.screen__body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.counter {
    color: var(--neon-yellow);
    font-weight: 700;
}

/* Convergence Screen */
.screen--convergence {
    flex-direction: column;
    gap: 3rem;
}

.convergence-circle {
    position: relative;
    width: 300px;
    height: 300px;
    animation: rotateCircle 30s linear infinite;
}

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

.convergence-thumb {
    position: absolute;
    width: 64px;
    height: 64px;
    top: 50%;
    left: 50%;
    transform: rotate(var(--angle)) translateY(-130px) rotate(calc(-1 * var(--angle)));
    margin: -32px 0 0 -32px;
    border: 1px solid var(--neon-cyan);
    image-rendering: pixelated;
}

.convergence-thumb svg {
    animation: counterRotate 30s linear infinite;
}

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

.pixel-svg-sm {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
}

.convergence-lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.convergence-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.02em;
}

/* Credits Screen */
.screen--credits {
    flex-direction: column;
    position: relative;
}

.credits-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 230, 0, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

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

.credits-line {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.credits-line--label {
    font-family: 'Silkscreen', cursive;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
}

.credits-domain {
    font-family: 'Silkscreen', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--neon-cyan);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.sprite-rest {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pixel-svg-sprite {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

/* HUD */
.hud {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(13, 2, 33, 0.9);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 24px;
    z-index: 500;
    font-family: 'Silkscreen', cursive;
    font-size: 0.75rem;
}

.hud__screen {
    color: var(--neon-cyan);
    white-space: nowrap;
}

.hud__sim {
    color: var(--text-secondary);
    white-space: nowrap;
}

.hud__sprite-track {
    flex: 1;
    position: relative;
    height: 16px;
}

.hud__sprite {
    position: absolute;
    left: 0%;
    top: 0;
    width: 16px;
    height: 16px;
    transition: left 0.6s var(--spring);
}

.hud__sprite svg {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

.hud__sprite.jump {
    animation: spriteJump 0.4s var(--spring);
}

@keyframes spriteJump {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .screen--cabinet {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
    }

    .pixel-art {
        width: 200px;
        height: 200px;
    }

    .screen__text {
        max-width: 100%;
        padding: 16px;
    }

    .convergence-circle {
        width: 200px;
        height: 200px;
    }

    .convergence-thumb {
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
        transform: rotate(var(--angle)) translateY(-80px) rotate(calc(-1 * var(--angle)));
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.3s !important;
    }

    .scanline-overlay {
        display: none;
    }

    .pixel-art,
    .screen__text,
    .boot-title,
    .boot-prompt {
        opacity: 1;
        transform: none;
    }
}
