:root {
    --cyan: #00FFFF;
    --magenta: #FF00FF;
    --acid-green: #00FF00;
    --yellow: #FFFF00;
    --white: #FFFFFF;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050510;
    font-family: 'Inter', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

button {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, text-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px currentColor;
    text-shadow: 0 0 8px currentColor;
}



canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through unless on a button */
}

#debug-info {
    display: none !important;
}

#instructions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: var(--cyan);
    font-size: 14px;
    text-align: right;
    text-shadow: 2px 2px 0px #000;
    line-height: 1.5;
}

#mobile-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mobile-btn {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid var(--cyan);
    color: var(--cyan);
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    cursor: pointer;
}
.mobile-btn:hover {
    transform: none;
    box-shadow: none;
    text-shadow: none;
}
.mobile-btn:active {
    background: rgba(0, 255, 255, 0.5);
}

.battery-shell {
    width: 90px;
    height: 22px;
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--cyan);
    position: relative;
    padding: 2px;
    box-sizing: border-box;
}

.battery-shell::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 10px;
    background: var(--cyan);
}

.is-paused {
    filter: blur(8px);
    transition: filter 0.3s ease;
}

/* FLYING GEM SHINE & GLOW EFFECT */
.flying-gem-wrapper {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
}

.flying-gem-svg {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.gem-shine {
    position: absolute;
    width: 160%;
    height: 160%;
    z-index: -1;
    border-radius: 50%;
    opacity: 0.6;
    mix-blend-mode: screen;
    filter: blur(4px);
}

.flying-gem-wrapper.yellow .gem-shine {
    background: radial-gradient(circle, rgba(255, 215, 0, 1) 0%, rgba(255, 215, 0, 0) 70%);
}

.flying-gem-wrapper.red .gem-shine {
    background: radial-gradient(circle, rgba(255, 59, 48, 1) 0%, rgba(255, 59, 48, 0) 70%);
}

.flying-gem-wrapper.cyan .gem-shine {
    background: radial-gradient(circle, rgba(0, 122, 255, 1) 0%, rgba(0, 122, 255, 0) 70%);
}

.flying-gem-wrapper.purple .gem-shine {
    background: radial-gradient(circle, rgba(255, 0, 255, 1) 0%, rgba(255, 0, 255, 0) 70%);
}

/* SCORE TEXT ANIMATION */
.score-value {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: inline-block;
}
.score-value.active {
    position: relative;
}

.score-rolling-old {
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 150ms ease-in, opacity 150ms ease-in;
}

.score-rolling-new {
    animation: scoreRollIn 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scoreRollIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0%); opacity: 1; }
}

.flash-red {
    color: #FF3B30 !important;
    text-shadow: 0 0 12px #FF3B30, 0 0 4px #FF3B30 !important;
    transition: none !important; /* Instant flash */
}

.flash-cyan {
    color: #00FFFF !important;
    text-shadow: 0 0 12px #00FFFF, 0 0 4px #00FFFF !important;
    transition: none !important; /* Instant flash */
}

.flash-fade-out {
    transition: color 250ms ease-out, text-shadow 250ms ease-out !important;
    color: #FFFFFF !important;
    text-shadow: none !important;
}


.flash-yellow {
    color: #FFFF00 !important;
    text-shadow: 0 0 12px #FFFF00, 0 0 4px #FFFF00 !important;
    transition: none !important; /* Instant flash */
}


.flash-purple {
    color: #FF00FF !important;
    text-shadow: 0 0 12px #FF00FF, 0 0 4px #FF00FF !important;
    transition: none !important; /* Instant flash */
}


@keyframes blinkRed { 0% { border-color: red; box-shadow: 0 0 10px red; } 50% { border-color: transparent; box-shadow: none; } 100% { border-color: red; box-shadow: 0 0 10px red; } }
.fuel-warning { animation: blinkRed 0.5s infinite; border: 2px solid red; border-radius: 5px; padding: 2px; }

/* Desktop Controls Modal */
.controls-overlay {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%) translateX(120%);
    background: rgba(0, 0, 15, 0.6);
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    font-family: 'Inter', sans-serif;
}

.controls-overlay.visible {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

.controls-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    font-family: monospace;
}

.controls-title {
    color: var(--cyan);
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--cyan);
    text-align: center;
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 280px;
}

.control-label {
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-keys {
    display: flex;
    gap: 5px;
}

.neon-key {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid var(--magenta);
    border-bottom: 4px solid var(--magenta);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.6), inset 0 0 6px rgba(255, 0, 255, 0.4);
    text-transform: uppercase;
    font-family: monospace;
    margin: 2px;
}

.neon-key::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid rgba(255, 0, 255, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.controls-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
    transition: all 0.2s;
}

.controls-btn:hover {
    background: var(--cyan);
    color: #000;
    box-shadow: 0 0 15px var(--cyan);
}

.controls-minimized {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 15, 0.6);
    border: 2px solid var(--cyan);
    color: var(--cyan);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.controls-minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--cyan);
}

/* Active Toggle State */
.active-toggle, .active-toggle:hover {
    background: rgba(0, 255, 255, 0.4) !important;
    box-shadow: 0 0 15px var(--cyan), inset 0 0 10px var(--cyan) !important;
    border-color: var(--cyan);
    color: var(--white);
    transform: none !important;
}

/* Player Swap Text Styles */
.player-swap-btn span {
    transition: opacity 0.3s, text-shadow 0.3s;
}
.player-swap-btn .active-lbl {
    color: var(--white);
    text-shadow: 0 0 8px var(--cyan);
    opacity: 1;
}
.player-swap-btn .inactive-lbl {
    opacity: 0.5;
}
