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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000000;
    position: relative;
    cursor: none;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#main-canvas {
    z-index: 1;
}

#aurora-layer {
    z-index: 2;
    mix-blend-mode: screen;
    opacity: 0.65;
}

#geometry-layer {
    z-index: 3;
    mix-blend-mode: lighten;
    opacity: 0.85;
}

#particles-layer {
    z-index: 4;
    mix-blend-mode: screen;
}

#attention-beams {
    z-index: 5;
    mix-blend-mode: lighten;
    opacity: 0.75;
}

.context-boundary {
    position: fixed;
    inset: 20px;
    border: 2px solid transparent;
    border-image: linear-gradient(
        90deg,
        rgba(0, 255, 255, 0.35),
        rgba(255, 0, 255, 0.55),
        rgba(0, 255, 255, 0.35)
    ) 1;
    pointer-events: none;
    z-index: 6;
    filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.5));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Memory fade vignettes at corners */
.vignette {
    position: fixed;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 6;
    opacity: 0.4;
}

.vignette-top-left {
    top: 0;
    left: 0;
    background: radial-gradient(circle at 0% 0%, 
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 100%);
}

.vignette-top-right {
    top: 0;
    right: 0;
    background: radial-gradient(circle at 100% 0%, 
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 100%);
}

.vignette-bottom-left {
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 0% 100%, 
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 100%);
}

.vignette-bottom-right {
    bottom: 0;
    right: 0;
    background: radial-gradient(circle at 100% 100%, 
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 100%);
}

.probability-bars {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    z-index: 7;
    pointer-events: none;
}

.prob-bar {
    width: 4px;
    height: 0;
    background: linear-gradient(to top, #00ffff, #ff00ff);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    animation: barPulse 2s ease-in-out infinite;
}

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

.sound-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10;
}

.sound-toggle {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.1), transparent);
}

.sound-toggle:hover {
    border-color: rgba(0, 255, 255, 1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    transform: scale(1.1);
}

.sound-toggle::before,
.sound-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.sound-toggle::before {
    width: 70%;
    height: 70%;
    animation: soundPulse 2s ease-in-out infinite;
}

.sound-toggle::after {
    width: 40%;
    height: 40%;
    animation: soundPulse 2s ease-in-out infinite 1s;
}

@keyframes soundPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.2; }
}

.sound-toggle.muted::before,
.sound-toggle.muted::after {
    animation: none;
    opacity: 0.2;
}

.sound-toggle.muted {
    border-color: rgba(255, 0, 100, 0.6);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
    }
}
