* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

:root {
    --primary: #4a9eff;
    --accent: #ffd93d;
    --dark: #0a0a2a;
    --glow: 0 0 80px var(--primary);
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at center, var(--dark), #050514);
    color: white;
    min-height: 100vh;
    overflow: hidden;
}

h1 {
    font-size: 4em;
    font-weight: bold;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
    letter-spacing: 2px;
    margin-bottom: 20px;
}


.score {
    font-size: 3.5em;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
    margin: 10px 0;
}

.cps {
    font-size: 1.4em;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.game-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}


.main-area {
    flex: 1;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.starfield {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, white, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 40px 70px, var(--accent), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 160px, var(--primary), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, white, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, var(--accent), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 160px 120px, var(--primary), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 250px 250px;
    animation: starflow 20s linear infinite;
    z-index: -1;
    opacity: 0.8;
}

.starfield:after {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    right: 0;
    height: 100%;
    background-image: inherit;
    background-repeat: repeat;
    background-size: inherit;
}

.asteroid {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 30% 30%, var(--accent), var(--primary));
    border-radius: 50%;
    cursor: pointer;
    margin: 40px auto;
    transition: all 0.2s;
    box-shadow: var(--glow);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.asteroid:hover {
    transform: scale(1.05);
    box-shadow: 0 0 100px var(--accent);
}

.asteroid:active {
    transform: scale(0.95);
}

.side-panel {
    width: 400px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    height: 100vh;
}


.tab-buttons {
    font-size: 0.8em;
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 54px;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.tab-btn {
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    background: none;
    border: none;
    color: white;
    padding: 10px 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1em;
    white-space: normal;
    line-height: 1.2;
}

.tab-btn.active {
    background: rgba(74, 158, 255, 0.2);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.tab-pane {
    display: none;
    padding: 20px;
}

.tab-pane.active {
    display: block;
}

#settingsContainer {
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.settings-section {
    width: 100%;
    margin-bottom: 20px;
    display: block;
}

.settings-section h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

#upgradesContainer .upgrade-item {
    background: rgba(74, 158, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

#upgradesContainer .upgrade-item[data-type="passive"] {
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(74, 158, 255, 0.1), rgba(74, 158, 255, 0.05));
}

#upgradesContainer .upgrade-item[data-type="click"] {
    border-left: 4px solid var(--accent);
    background: linear-gradient(90deg, rgba(255, 217, 61, 0.1), rgba(255, 217, 61, 0.05));
}

#upgradesContainer .upgrade-item:hover {
    transform: translateX(5px);
    background-color: rgba(255, 255, 255, 0.1);
}

#upgradesContainer .upgrade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.stats-grid {
    display: grid;
    gap: 20px;
    padding: 20px;
}

.stat-card {
    background: rgba(20, 30, 60, 0.3);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    border: 1px solid rgba(74, 158, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(30, 40, 70, 0.3);
}

.stat-title {
    color: var(--primary);
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    color: var(--accent);
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.3);
}
#achievementsContainer .upgrade-item {
    background: rgba(74, 158, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid rgba(74, 158, 255, 0.2);
    transition: all 0.3s;
}

#achievementsContainer .upgrade-item h3 {
    font-size: 1.3em;
    color: var(--accent);
    margin-bottom: 8px;
}

#achievementsContainer .upgrade-item.locked {
    opacity: 0.5;
    background: rgba(100, 100, 100, 0.1);
    border: 1px solid rgba(100, 100, 100, 0.2);
}

#achievementsContainer .upgrade-item.locked::before {
    content: "🔒";
    margin-right: 10px;
}

#achievementsContainer .upgrade-item.earned {
    background: linear-gradient(90deg, rgba(74, 158, 255, 0.2), rgba(74, 158, 255, 0.1));
    border: 1px solid var(--primary);
}

#achievementsContainer .upgrade-item.earned::before {
    content: "🏆";
    margin-right: 10px;
}

.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(74, 158, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 15px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.achievement-name {
    color: var(--accent);
    font-size: 1.2em;
    margin: 5px 0;
}

.particle {
    pointer-events: none;
    position: absolute;
    background: white;
    border-radius: 50%;
    width: 4px;
    height: 4px;
    animation: particle 0.8s ease-out forwards;
}

.floating-number {
    position: absolute;
    color: var(--accent);
    font-weight: bold;
    font-size: 28px;
    text-shadow: 0 0 15px var(--accent);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
}

/* Volume Slider Styling */
#masterVolume {
    -webkit-appearance: none;
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    vertical-align: middle;
}

#masterVolume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px var(--primary);
    transition: all 0.2s;
    transform: translateY(-6px);
}

#masterVolume::-webkit-slider-thumb:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 0 0 20px var(--primary);
}

#masterVolume::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px var(--primary);
    border: none;
    transition: all 0.2s;
}

#masterVolume::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--primary);
}

#masterVolume::-moz-range-progress {
    background: var(--primary);
    height: 8px;
    border-radius: 4px;
}

#masterVolume::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
}

.prestige-section {
    padding: 20px;
    color: white;
}

.prestige-info {
    background: rgba(74, 158, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.accent-text {
    color: var(--accent);
    font-weight: bold;
}

.prestige-btn {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border: none;
    border-radius: 4px;
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    margin: 20px 0;
    width: 100%;
    transition: all 0.3s;
}

.prestige-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prestige-upgrade {
    border-color: var(--accent) !important;
}

.prestige-upgrade.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes pulse {
    0% { box-shadow: 0 0 50px var(--primary); }
    50% { box-shadow: 0 0 80px var(--accent); }
    100% { box-shadow: 0 0 50px var(--primary); }
}

@keyframes starflow {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

@keyframes particle {
    0% { transform: translate(0, 0); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)); opacity: 0; }
}

@keyframes floatUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100px); opacity: 0; }
}

@keyframes slideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.theme-option {
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.theme-option.active {
    border: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.theme-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 10px;
}

.tab-buttons {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-buttons::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 0 0 auto;
    min-width: max-content;
}

.prestige-info {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(255, 217, 61, 0.05));
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 25px;
    margin: 15px 0;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.1);
}

.prestige-info h2 {
    font-size: 2em;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.prestige-stats {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.prestige-stats div {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

#prestige-button {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
}

#prestige-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.5);
}

#prestige-button:disabled {
    background: linear-gradient(45deg, #666, #999);
    cursor: not-allowed;
    opacity: 0.7;
}

.prestige-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 20px;
    border-radius: 12px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
}

.prestige-notification h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
}

.prestige-multiplier {
    font-size: 1.8em;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    margin: 15px 0;
    font-weight: bold;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .game-container {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        height: 50vh;
    }

    .tab-content {
        height: calc(50vh - 54px);
    }
}

@media screen and (max-width: 768px) {
    .tab-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 12px;
        font-size: 0.9em;
        min-width: max-content;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-title {
        font-size: 1em;
    }

    .stat-value {
        font-size: 1.4em;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 2em;
    }

    .asteroid {
        width: 150px;
        height: 150px;
    }

    .tab-buttons {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 50%;
        font-size: 0.9em;
        padding: 10px;
    }

    #upgradesContainer .upgrade-item {
        padding: 10px;
    }

    .achievement-notification {
        width: 90%;
        right: 5%;
        font-size: 0.9em;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .asteroid:hover {
        transform: none;
    }

    #upgradesContainer .upgrade-item:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }
}

/* Orientation Specific */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .side-panel {
        width: 40%;
        height: 100vh;
    }

    .tab-content {
        height: calc(100vh - 54px);
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .game-container {
        min-height: -webkit-fill-available;
    }
}
