@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Space+Grotesk:wght@300;400;500;700&display=swap');

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    background: #000;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px rgba(100, 200, 255, 0.5), 0 0 20px rgba(100, 200, 255, 0.3); }
    50% { text-shadow: 0 0 20px rgba(100, 200, 255, 0.8), 0 0 30px rgba(100, 200, 255, 0.5), 0 0 40px rgba(100, 200, 255, 0.3); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    display: block;
}

/* Main Panel - Gộp overlay và controls */
.main-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    max-width: 90vw;
    animation: slideUp 0.8s ease-out;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, left, top;
}

/* Toggle Button */
.toggle-btn {
    position: absolute;
    top: -50px;
    right: 10px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), rgba(124, 77, 255, 0.25));
    border: 2px solid rgba(79, 195, 247, 0.4);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(15px) saturate(180%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(79, 195, 247, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    user-select: none;
}

.toggle-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.35), rgba(124, 77, 255, 0.35));
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(79, 195, 247, 0.4);
}

.toggle-btn:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.toggle-btn .toggle-icon {
    animation: pulse 2s ease-in-out infinite;
}

/* Main Panel Collapsed State */
.main-panel.collapsed {
    bottom: 20px;
    left: auto;
    right: 20px;
    transform: none;
}

.main-panel.collapsed .controls,
.main-panel.collapsed .overlay {
    display: none;
}

.main-panel.collapsed .toggle-btn {
    position: relative;
    top: 0;
    right: 0;
}

.overlay {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: auto;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.7), rgba(0, 10, 30, 0.8));
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(100, 200, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                0 0 60px rgba(100, 200, 255, 0.1),
                inset 0 0 20px rgba(100, 200, 255, 0.05);
    animation: fadeIn 1s ease-out, pulse 4s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
    max-width: 100%;
}

.overlay::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4fc3f7, #7c4dff, #f50057, #ffeb3b);
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
    animation: pulse 3s ease-in-out infinite;
}

.overlay:hover::before {
    opacity: 0.3;
}

.title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', cursive;
    white-space: normal;
    word-break: break-word;
    background: linear-gradient(135deg, #4fc3f7 0%, #7c4dff 50%, #f50057 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#clock {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 4px;
    font-family: 'Orbitron', monospace;
    white-space: nowrap;
    color: #4fc3f7;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5),
                 0 0 20px rgba(79, 195, 247, 0.3),
                 0 0 30px rgba(79, 195, 247, 0.2);
    animation: glow 2s ease-in-out infinite;
}

.game-link {
    position: fixed;
    top: 18px;
    right: 32px;
    z-index: 20;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background: #222b;
    padding: 10px 18px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    box-shadow: 0 2px 8px #0006;
    border: 2px solid #fff3;
    transition: background 0.2s, color 0.2s;
}

.game-link:hover {
    background: #fff;
    color: #222;
    border-color: #fff;
}

.controls {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: flex;
    gap: 12px;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.8), rgba(0, 10, 30, 0.9));
    padding: 18px 24px;
    border-radius: 16px;
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(100, 200, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(100, 200, 255, 0.1),
                inset 0 0 20px rgba(100, 200, 255, 0.05);
    z-index: auto;
    animation: none;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.controls button {
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(124, 77, 255, 0.15));
    border: 2px solid rgba(79, 195, 247, 0.3);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.controls button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(79, 195, 247, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.controls button:hover::before {
    width: 300px;
    height: 300px;
}

.controls button:hover {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.3), rgba(124, 77, 255, 0.3));
    border-color: rgba(79, 195, 247, 0.6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 195, 247, 0.4),
                0 0 30px rgba(79, 195, 247, 0.2);
}

.controls button:active {
    transform: translateY(-1px) scale(0.98);
}

.speed-display {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.2), rgba(124, 77, 255, 0.2));
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(79, 195, 247, 0.4);
    min-width: 60px;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(79, 195, 247, 0.1),
                0 0 20px rgba(79, 195, 247, 0.2);
}

.speed-display span {
    color: #4fc3f7;
    font-weight: 700;
    font-size: 18px;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
    letter-spacing: 1px;
}

.orbit-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(124, 77, 255, 0.15));
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(79, 195, 247, 0.3);
}

.orbit-toggle:hover {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), rgba(124, 77, 255, 0.25));
    border-color: rgba(79, 195, 247, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.orbit-toggle input[type="checkbox"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #4fc3f7;
    filter: drop-shadow(0 0 5px rgba(79, 195, 247, 0.5));
}

.orbit-toggle span {
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 20px;
    right: -350px;
    width: 320px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.9), rgba(0, 10, 30, 0.95));
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(100, 200, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(100, 200, 255, 0.15);
    z-index: 20;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.info-panel.show {
    right: 20px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid rgba(79, 195, 247, 0.3);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.1), rgba(124, 77, 255, 0.1));
}

.info-header h3 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #4fc3f7;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

.close-btn {
    background: rgba(245, 0, 87, 0.2);
    border: 2px solid rgba(245, 0, 87, 0.4);
    color: #f50057;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(245, 0, 87, 0.4);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(245, 0, 87, 0.5);
}

.info-content {
    padding: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.8;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.info-content p {
    margin: 10px 0;
    font-size: 14px;
}

.info-content strong {
    color: #4fc3f7;
    font-weight: 600;
}

.info-content::-webkit-scrollbar {
    width: 6px;
}

.info-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.5);
    border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.7);
}

/* Responsive Design */

/* Large Desktop (1920px+) */
@media (min-width: 1920px) {
    .overlay {
        padding: 2rem 3rem;
    }
    .title {
        font-size: 2.5rem;
    }
    #clock {
        font-size: 2.2rem;
    }
    .controls {
        padding: 20px 28px;
        gap: 14px;
    }
    .controls button {
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* Desktop (1200px - 1919px) */
@media (min-width: 1200px) and (max-width: 1919px) {
    .overlay {
        padding: 1.5rem 2.5rem;
    }
    .title {
        font-size: 2rem;
    }
    #clock {
        font-size: 1.8rem;
    }
}

/* Laptop/Tablet Landscape (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .main-panel {
        gap: 15px;
    }
    .overlay {
        padding: 1.2rem 2rem;
    }
    .title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    #clock {
        font-size: 1.6rem;
        letter-spacing: 3px;
    }
    .controls {
        padding: 14px 18px;
        gap: 10px;
    }
    .controls button {
        padding: 10px 16px;
        font-size: 13px;
    }
    .speed-display {
        padding: 8px 16px;
    }
    .speed-display span {
        font-size: 16px;
    }
    .orbit-toggle {
        padding: 8px 14px;
    }
    .orbit-toggle span {
        font-size: 13px;
    }
    .info-panel {
        width: 350px;
    }
}

/* Tablet Portrait (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .main-panel {
        gap: 12px;
        max-width: 92vw;
    }
    .overlay {
        padding: 1rem 1.5rem;
        border-radius: 14px;
    }
    .title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    #clock {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }
    .controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
        max-width: 100%;
    }
    .controls button {
        padding: 10px 14px;
        font-size: 13px;
    }
    .speed-display {
        padding: 8px 14px;
    }
    .speed-display span {
        font-size: 15px;
    }
    .orbit-toggle {
        padding: 8px 12px;
    }
    .orbit-toggle span {
        font-size: 13px;
    }
    .orbit-toggle input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    .info-panel {
        right: -100%;
        width: 70%;
        max-width: 400px;
        max-height: 70vh;
    }
    .info-panel.show {
        right: 10px;
    }
    .info-header h3 {
        font-size: 18px;
    }
    .info-content {
        padding: 16px;
        font-size: 14px;
    }
}

/* Mobile Landscape (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .main-panel {
        gap: 10px;
        bottom: 10px;
    }
    .overlay {
        padding: 0.8rem 1.2rem;
        border-radius: 12px;
    }
    .overlay::before {
        animation: none;
    }
    .title {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
        letter-spacing: 1px;
    }
    #clock {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
    .controls {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }
    .controls button {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 auto;
        min-width: 80px;
    }
    .controls button::before {
        animation: none;
    }
    .speed-display {
        padding: 6px 12px;
        min-width: 50px;
    }
    .speed-display span {
        font-size: 14px;
    }
    .orbit-toggle {
        padding: 6px 10px;
        flex: 1 1 100%;
        justify-content: center;
    }
    .orbit-toggle span {
        font-size: 12px;
    }
    .orbit-toggle input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    .info-panel {
        right: -100%;
        width: 85%;
        max-width: 340px;
        max-height: 65vh;
    }
    .info-panel.show {
        right: 5%;
    }
    .info-header {
        padding: 16px;
    }
    .info-header h3 {
        font-size: 16px;
    }
    .close-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    .info-content {
        padding: 14px;
        font-size: 13px;
        line-height: 1.6;
    }
    .info-content p {
        margin: 8px 0;
    }
}

/* Mobile Portrait (320px - 479px) */
@media (max-width: 479px) {
    .main-panel {
        gap: 10px;
        bottom: 8px;
        max-width: 92vw;
    }
    .overlay {
        padding: 0.8rem 1rem;
        border-radius: 10px;
        animation: fadeIn 0.8s ease-out;
    }
    .overlay::before {
        display: none;
    }
    .overlay:hover::before {
        opacity: 0;
    }
    .title {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
        letter-spacing: 0.5px;
        line-height: 1.2;
    }
    #clock {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    .controls {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
        animation: none;
    }
    .controls button {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
    .controls button::before {
        display: none;
    }
    .controls button:hover {
        transform: scale(1.02);
    }
    .speed-display {
        width: 100%;
        padding: 8px 14px;
    }
    .speed-display span {
        font-size: 15px;
    }
    .orbit-toggle {
        width: 100%;
        padding: 10px 14px;
        justify-content: center;
    }
    .orbit-toggle span {
        font-size: 13px;
    }
    .orbit-toggle input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    .info-panel {
        right: -100%;
        width: 92%;
        max-width: none;
        left: 4%;
        max-height: 60vh;
    }
    .info-panel.show {
        right: auto;
    }
    .info-header {
        padding: 14px;
        flex-wrap: wrap;
    }
    .info-header h3 {
        font-size: 15px;
        flex: 1;
    }
    .close-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    .info-content {
        padding: 12px;
        font-size: 12px;
        line-height: 1.5;
        max-height: calc(60vh - 60px);
    }
    .info-content p {
        margin: 6px 0;
    }
    .info-content strong {
        display: block;
        margin-top: 8px;
    }
}

/* Very Small Screens (max-width: 319px) */
@media (max-width: 319px) {
    .overlay {
        padding: 0.6rem 0.8rem;
    }
    .title {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
    #clock {
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
    .controls {
        gap: 6px;
        padding: 8px;
    }
    .controls button {
        padding: 8px 10px;
        font-size: 11px;
    }
    .speed-display {
        padding: 6px 10px;
    }
    .speed-display span {
        font-size: 13px;
    }
    .orbit-toggle {
        padding: 8px 10px;
    }
    .orbit-toggle span {
        font-size: 11px;
    }
    .info-content {
        font-size: 11px;
    }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .main-panel {
        flex-direction: row;
        gap: 15px;
        bottom: 8px;
    }
    .overlay {
        padding: 0.8rem 1.2rem;
    }
    .title {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }
    #clock {
        font-size: 1rem;
    }
    .controls {
        padding: 8px 12px;
        gap: 6px;
    }
    .controls button {
        padding: 6px 10px;
        font-size: 11px;
    }
    .speed-display {
        padding: 4px 10px;
    }
    .speed-display span {
        font-size: 13px;
    }
    .orbit-toggle {
        padding: 6px 8px;
    }
    .orbit-toggle span {
        font-size: 11px;
    }
    .info-panel {
        max-height: 85vh;
        width: 280px;
    }
    .info-content {
        max-height: calc(85vh - 70px);
        font-size: 12px;
    }
}

/* Touch devices - increase touch targets */
@media (hover: none) and (pointer: coarse) {
    .controls button {
        min-height: 44px;
    }
    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
    .orbit-toggle {
        min-height: 44px;
    }
}

/* Stats Panel - FPS Counter & Info */
.stats-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.85), rgba(40, 40, 70, 0.75));
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(79, 195, 247, 0.15);
    animation: fadeIn 0.6s ease-out;
    z-index: 10;
    font-family: 'Space Grotesk', monospace;
}

.stats-panel .fps-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.2);
}

.stats-panel .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-panel .label {
    color: rgba(200, 220, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
}

.stats-panel .value {
    color: #4fc3f7;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

.stats-panel #fpsDisplay {
    font-size: 20px;
}

.stats-panel #fpsDisplay.fps-good {
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.stats-panel #fpsDisplay.fps-medium {
    color: #ffeb3b;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.stats-panel #fpsDisplay.fps-low {
    color: #f44336;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* Minimap */
.minimap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.9), rgba(40, 40, 70, 0.8));
    backdrop-filter: blur(15px) saturate(180%);
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(79, 195, 247, 0.15);
    animation: fadeIn 0.8s ease-out 0.2s both;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.minimap canvas {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.minimap-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    color: rgba(200, 220, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.85), rgba(40, 40, 70, 0.75));
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 50px;
    padding: 8px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(79, 195, 247, 0.15);
    animation: fadeIn 0.6s ease-out 0.3s both;
    z-index: 10;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(124, 77, 255, 0.15));
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.theme-btn:hover {
    transform: scale(1.15);
    border-color: rgba(79, 195, 247, 0.6);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), rgba(124, 77, 255, 0.25));
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.4);
}

.theme-btn.active {
    border-color: rgba(79, 195, 247, 0.8);
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.35), rgba(124, 77, 255, 0.35));
    box-shadow: 0 0 25px rgba(79, 195, 247, 0.6);
    transform: scale(1.1);
}

.theme-btn:active {
    transform: scale(0.95);
}

/* Button Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.controls button,
.theme-btn,
.toggle-btn {
    position: relative;
    overflow: hidden;
}

.controls button::after,
.theme-btn::after,
.toggle-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 195, 247, 0.4), transparent);
    pointer-events: none;
}

.controls button:active::after,
.theme-btn:active::after,
.toggle-btn:active::after {
    animation: ripple 0.6s ease-out;
}

/* Speed Display Glow Animation */
@keyframes speedGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(79, 195, 247, 0.3),
                    inset 0 0 10px rgba(79, 195, 247, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 195, 247, 0.5),
                    0 0 30px rgba(79, 195, 247, 0.3),
                    inset 0 0 15px rgba(79, 195, 247, 0.2);
    }
}

.speed-display {
    animation: speedGlow 2s ease-in-out infinite;
}

/* Info Panel Border Animation */
@keyframes borderPulse {
    0%, 100% {
        border-color: rgba(79, 195, 247, 0.4);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3),
                    0 0 20px rgba(79, 195, 247, 0.2);
    }
    50% {
        border-color: rgba(79, 195, 247, 0.7);
        box-shadow: 0 4px 35px rgba(0, 0, 0, 0.4),
                    0 0 40px rgba(79, 195, 247, 0.4),
                    0 0 60px rgba(79, 195, 247, 0.2);
    }
}

.info-panel.show {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1),
               borderPulse 3s ease-in-out 0.5s infinite;
}

/* Theme Color Variables */
body[data-theme="default"] {
    --nebula-color-1: rgba(138, 43, 226, 0.12);
    --nebula-color-2: rgba(34, 211, 238, 0.1);
    --nebula-color-3: rgba(236, 72, 153, 0.09);
    --bg-gradient-1: #0a0015;
    --bg-gradient-2: #000000;
}

body[data-theme="warm"] {
    --nebula-color-1: rgba(255, 140, 0, 0.15);
    --nebula-color-2: rgba(255, 69, 0, 0.12);
    --nebula-color-3: rgba(255, 215, 0, 0.1);
    --bg-gradient-1: #1a0a00;
    --bg-gradient-2: #0a0500;
}

body[data-theme="cold"] {
    --nebula-color-1: rgba(0, 191, 255, 0.12);
    --nebula-color-2: rgba(30, 144, 255, 0.1);
    --nebula-color-3: rgba(100, 149, 237, 0.09);
    --bg-gradient-1: #00050a;
    --bg-gradient-2: #000a15;
}

body[data-theme="neon"] {
    --nebula-color-1: rgba(255, 0, 255, 0.15);
    --nebula-color-2: rgba(0, 255, 255, 0.12);
    --nebula-color-3: rgba(255, 20, 147, 0.12);
    --bg-gradient-1: #0a000a;
    --bg-gradient-2: #050010;
}

/* Responsive Styles for New Elements */
@media (max-width: 768px) {
    .stats-panel {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
        gap: 8px;
    }
    
    .stats-panel .label {
        font-size: 11px;
    }
    
    .stats-panel .value {
        font-size: 14px;
    }
    
    .stats-panel #fpsDisplay {
        font-size: 18px;
    }
    
    .minimap {
        bottom: 10px;
        right: 10px;
        width: 120px;
        height: 120px;
        padding: 8px;
    }
    
    .theme-switcher {
        top: 10px;
        right: 10px;
        gap: 8px;
        padding: 6px 10px;
    }
    
    .theme-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        padding: 8px 12px;
        gap: 6px;
    }
    
    .stats-panel .label {
        font-size: 10px;
    }
    
    .stats-panel .value {
        font-size: 12px;
    }
    
    .stats-panel #fpsDisplay {
        font-size: 16px;
    }
    
    .minimap {
        width: 100px;
        height: 100px;
        padding: 6px;
    }
    
    .minimap-label {
        font-size: 9px;
    }
    
    .theme-switcher {
        gap: 6px;
        padding: 5px 8px;
    }
    
    .theme-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}