* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
    color: #0f0;
    -webkit-tap-highlight-color: transparent;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#settings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(0, 20, 0, 0.95);
    border: 2px solid #0f0;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    display: none;
    backdrop-filter: blur(5px);
}

#settings h2 {
    color: #0f0;
    margin-bottom: 20px;
    border-bottom: 2px solid #0f0;
    padding-bottom: 10px;
    font-size: 1.3em;
    text-align: center;
    text-shadow: 0 0 10px #0f0;
}

#settings h3 {
    color: #0f0;
    margin: 15px 0 10px 0;
    font-size: 1.1em;
    border-left: 3px solid #0f0;
    padding-left: 8px;
}

.setting-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 30, 0, 0.3);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

label {
    display: block;
    margin: 8px 0 5px 0;
    font-size: 0.95em;
    color: #8f8;
}

input[type="range"] {
    width: 100%;
    margin: 8px 0;
    background: #002200;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 4px;
    border: 1px solid #0a0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #0f0;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 5px #0f0;
}

input[type="color"] {
    width: 100%;
    height: 35px;
    border: 1px solid #0f0;
    background: #000;
    cursor: pointer;
    border-radius: 4px;
}

select {
    width: 100%;
    padding: 8px;
    background: #001100;
    color: #0f0;
    border: 1px solid #0f0;
    font-family: 'Courier New', monospace;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 0.95em;
}

button {
    width: 100%;
    padding: 10px;
    background: #002200;
    color: #0f0;
    border: 1px solid #0f0;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    margin: 8px 0;
    transition: all 0.3s;
    border-radius: 4px;
    font-size: 0.95em;
    letter-spacing: 1px;
    touch-action: manipulation;
}

button:hover, button:active {
    background: #004400;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

.toggle-button {
    display: flex;
    border: 1px solid #0f0;
    margin: 12px 0;
    border-radius: 4px;
    overflow: hidden;
}

.toggle-button button {
    flex: 1;
    margin: 0;
    border-radius: 0;
    border: none;
    background: #001100;
}

.toggle-button button.active {
    background: #006600;
    box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.7);
    text-shadow: 0 0 5px #0f0;
}

.hidden {
    display: none;
}

.color-group {
    display: flex;
    gap: 12px;
    margin: 12px 0;
}

.color-group > div {
    flex: 1;
}

.info-text {
    font-size: 0.8em;
    color: #8f8;
    margin-top: 5px;
    font-style: italic;
}

#keyInfo {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #0f0;
    font-size: 0.9em;
    background: rgba(0, 20, 0, 0.7);
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #0a0;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.setting-note {
    color: #8f8;
    font-size: 0.8em;
    margin-top: 5px;
    padding: 5px;
    background: rgba(0, 40, 0, 0.3);
    border-radius: 3px;
    border-left: 2px solid #0f0;
}

/* Status Indicator */
#statusIndicator {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    color: #0f0;
    font-size: 0.9em;
    background: rgba(0, 20, 0, 0.7);
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #0a0;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0f0;
    animation: pulseStatus 2s infinite;
}

.status-dot.paused {
    background: #ff3300;
    animation: none;
}

@keyframes pulseStatus {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Mobile Control Bar */
#mobileControls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 20px;
    pointer-events: none;
}

.mobile-btn {
    flex: 1;
    max-width: 120px;
    padding: 12px 0;
    background: rgba(0, 40, 0, 0.85);
    color: #0f0;
    border: 1px solid #0f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    cursor: pointer;
    text-align: center;
    touch-action: manipulation;
    user-select: none;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

.mobile-btn:active {
    background: rgba(0, 60, 0, 0.95);
    transform: scale(0.95);
}

/* Mobile-only elements */
.mobile-only {
    display: none;
}

/* Desktop-only elements */
.desktop-only {
    display: block;
}

/* Pulsing effect for settings */
@keyframes pulse {
    0% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.8); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.5); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* --- SECRET DIALOG SYSTEM --- */
#secretOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#secretDialog {
    padding: 40px;
    min-width: 350px;
    max-width: 600px;
    transition: all 0.5s ease;
}

/* Style Options for Secret Dialog */
.style-operator {
    background: #000;
    border: 1px solid #0f0;
    box-shadow: 0 0 15px #0f0;
}

.style-override {
    background: #100;
    border: 2px solid #f00;
    box-shadow: 0 0 30px #f00;
    color: #f00 !important;
}

.style-oracle {
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #0f0;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(10px);
}

#secretInput {
    background: transparent;
    border: none;
    border-bottom: 2px solid currentColor;
    color: inherit;
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    width: 100%;
    outline: none;
    margin-top: 20px;
}

#secretMessage {
    margin-top: 20px;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 1.1em;
    min-height: 100px;
}

#flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 200;
    display: none;
}

/* Hidden Easter Egg Elements */
.hidden-egg {
    position: absolute;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s;
    display: inline-block;
}

/* Right-facing rabbit */
#whiteRabbit {
    transform: scaleX(-1); /* Flips horizontally to face right */
}

/* Collision button special styles */
#collisionHorizontal, #collisionVertical {
    animation: collisionPulse 3s infinite;
    font-weight: bold;
    text-shadow: 0 0 5px currentColor;
}

#collisionHorizontal:hover, #collisionHorizontal:active {
    background: #550000 !important;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
}

#collisionVertical:hover, #collisionVertical:active {
    background: #005500 !important;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

@keyframes collisionPulse {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}

/* Easter Egg Control Button */
#eggControlBtn {
    animation: eggControlPulse 2s infinite;
}

@keyframes eggControlPulse {
    0% { box-shadow: 0 0 5px rgba(255, 100, 100, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 100, 100, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 100, 100, 0.5); }
}

@media (max-width: 768px) {
    #settings {
        width: 95%;
        padding: 15px;
    }
    
    .color-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    #mobileControls {
        display: flex;
    }
}

@media (min-width: 769px) {
    #mobileControls {
        display: none !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Deactivation button disabled state */
.deactivation-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #555 !important;
}

.deactivation-btn:disabled:hover {
    box-shadow: none !important;
    opacity: 0.5 !important;
}