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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b0b0f;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ------------------------------
   Canvas
------------------------------ */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ------------------------------
   Gravity Selector UI
------------------------------ */
#gravity-selector {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    gap: 12px;

    padding: 10px 14px;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    opacity: 0.85;
    transition: opacity 0.3s ease;
}

#gravity-selector:hover {
    opacity: 1;
}

/* ------------------------------
   Gravity Buttons
------------------------------ */
#gravity-selector button {
    appearance: none;
    border: none;
    outline: none;
    cursor: pointer;

    width: 42px;
    height: 42px;
    border-radius: 50%;

    font-size: 18px;
    line-height: 1;

    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        background 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.gravity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gravity-item span {
    font-size: 11px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.5); /* ~50% opacity */
    user-select: none;
    pointer-events: none;
}


/* Hover Effect */
#gravity-selector button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

/* Active Gravity Mode */
#gravity-selector button.active {
    background: rgba(120, 180, 255, 0.25);
    box-shadow: 0 0 12px rgba(120, 180, 255, 0.6);
}

/* ------------------------------
   Cursor Effect Toggle Button
------------------------------ */
#cursor-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;

    appearance: none;
    border: none;
    outline: none;
    cursor: pointer;

    width: 50px;
    height: 50px;
    border-radius: 50%;

    font-size: 22px;
    line-height: 1;

    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    opacity: 0.85;
    transition:
        background 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.3s ease;
}

#cursor-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    opacity: 1;
}

/* Active state (cursor effects enabled) */
#cursor-toggle.active {
    background: rgba(120, 255, 180, 0.25);
    box-shadow: 0 0 12px rgba(120, 255, 180, 0.6);
}

/* Inactive state (cursor effects disabled) */
#cursor-toggle.inactive {
    background: rgba(255, 120, 120, 0.25);
    box-shadow: 0 0 12px rgba(255, 120, 120, 0.6);
}

/* ------------------------------
   Mobile Adjustments
------------------------------ */
@media (max-width: 600px) {
    #gravity-selector {
        bottom: 14px;
        gap: 10px;
        padding: 8px 12px;
    }

    #gravity-selector button {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    #cursor-toggle {
        width: 44px;
        height: 44px;
        font-size: 20px;
        bottom: 14px;
        right: 14px;
    }
}

/* ------------------------------
   Mode Indicator (Galactic Text)
------------------------------ */
#mode-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    
    pointer-events: none;
    user-select: none;
    
    opacity: 0;
    
    transition: none;
    
    z-index: 1000;
}

/* Galactic text effect */
#mode-indicator.show {
    animation: galaxyPopup 1.5s ease-out forwards;
}

@keyframes galaxyPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* Color themes for each mode */
#mode-indicator.planet {
    color: #78b4ff;
    text-shadow: 
        0 0 10px #78b4ff,
        0 0 20px #78b4ff,
        0 0 30px #4d9fff,
        0 0 40px #4d9fff,
        0 0 60px #4d9fff,
        0 0 80px #2d7fff;
}

#mode-indicator.star {
    color: #ffd966;
    text-shadow: 
        0 0 10px #ffd966,
        0 0 20px #ffd966,
        0 0 30px #ffcc33,
        0 0 40px #ffcc33,
        0 0 60px #ffb800,
        0 0 80px #ff9900;
}

#mode-indicator.blackhole {
    color: #1a0033;
    text-shadow: 
        0 0 10px #9966ff,
        0 0 20px #7744cc,
        0 0 30px #5522aa,
        0 0 40px #440099,
        0 0 60px #330077,
        0 0 80px #220055,
        0 0 100px #110033;
    -webkit-text-stroke: 2px #9966ff;
}

#mode-indicator.insane {
    color: #ff6699;
    text-shadow: 
        0 0 10px #ff6699,
        0 0 20px #ff3377,
        0 0 30px #ff0055,
        0 0 40px #ff0055,
        0 0 60px #cc0044,
        0 0 80px #990033;
}

#mode-indicator.rupture {
    color: #ff3333;
    text-shadow: 
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        0 0 30px #cc0000,
        0 0 40px #990000;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
    #mode-indicator {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }
}