* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #050508;
    --bg-surface: #0d0d12;
    --neon-cyan: #00fff7;
    --neon-pink: #ff2d95;
    --neon-purple: #b14aed;
    --neon-orange: #ff6b2c;
    --white: #ffffff;
    --gray: #6b7280;
    --gray-light: #9ca3af;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: 'Rajdhani', sans-serif;
    color: var(--white);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(177, 74, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 255, 247, 0.06) 0%, transparent 50%),
        var(--bg-dark);
}

#game-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    z-index: 1;
}

/* Score Display */
#score-display {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
    pointer-events: none;
}

#time-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 255, 247, 0.5);
    line-height: 1;
}

#hit-count {
    font-size: 1rem;
    color: var(--gray);
    margin-top: 4px;
}

#lives-display {
    font-size: 1rem;
    color: var(--neon-pink);
    margin-top: 4px;
    font-weight: bold;
}

.label {
    font-size: 0.6em;
    opacity: 0.7;
}

/* Overlay Screens */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 8, 0.97);
    z-index: 100;
    text-align: center;
    padding: 20px;
    overflow-y: auto;
}

.overlay.hidden {
    display: none;
}

/* Background Pattern */
.menu-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 247, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.menu-content,
.screen-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Main Menu */
.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, var(--white) 0%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(0, 255, 247, 0.4));
}

.game-title sup {
    font-size: 0.5em;
    vertical-align: super;
    background: linear-gradient(180deg, var(--neon-pink) 0%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(255, 45, 149, 0.6));
}

.menu-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 255, 247, 0.4);
}

/* Achievements Screen */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.25s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-value-large {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 247, 0.3);
    margin-bottom: 0.25rem;
}

.stat-label-small {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--gray);
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* Shape Selector */
.shape-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 60px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.shape-option:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.shape-option.locked {
    opacity: 0.3;
    cursor: not-allowed;
    position: relative;
}

.shape-option.locked::after {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.8rem;
    opacity: 0.6;
}

.shape-option.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 247, 0.08);
    box-shadow: 0 0 20px rgba(0, 255, 247, 0.2), inset 0 0 15px rgba(0, 255, 247, 0.05);
}

.shape-preview {
    width: 35px;
    height: 35px;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 247, 0.3), inset 0 0 10px rgba(0, 255, 247, 0.1);
}

.shape-preview.circle {
    border-radius: 50%;
}

.shape-preview.square {
    border-radius: 4px;
}

.shape-preview.triangle {
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: transparent;
    border: none;
    position: relative;
}

.shape-preview.triangle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 0;
    background: var(--bg-dark);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.shape-preview.triangle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--neon-cyan);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    z-index: -1;
}

.shape-option.selected .shape-preview {
    box-shadow: 0 0 15px rgba(0, 255, 247, 0.5), inset 0 0 15px rgba(0, 255, 247, 0.2);
}

.shape-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--gray-light);
}

.shape-option.selected .shape-name {
    color: var(--neon-cyan);
}

/* Menu Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 260px;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--gray-light);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    transform: translateY(-2px);
}

.menu-btn.primary {
    background: linear-gradient(135deg, rgba(0, 255, 247, 0.15), rgba(177, 74, 237, 0.15));
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, rgba(0, 255, 247, 0.25), rgba(177, 74, 237, 0.25));
    box-shadow: 0 0 30px rgba(0, 255, 247, 0.3), inset 0 0 20px rgba(0, 255, 247, 0.1);
    color: var(--white);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    flex: 1;
    text-align: left;
}

/* Screen Titles */
.screen-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
    color: var(--white);
    position: relative;
}

.screen-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 2px;
}

/* Options Screen */
.options-section {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--white);
}

.option-desc {
    font-size: 0.8rem;
    color: var(--gray);
}

.option-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(0, 255, 247, 0.2);
    border-color: var(--neon-cyan);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(28px);
    background: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 247, 0.5);
}

/* Speed Selector */
.speed-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    margin-bottom: 1rem;
}

.speed-option {
    padding: 0.4rem 0.8rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.speed-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.speed-option.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 247, 0.08);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 247, 0.2);
}

.option-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--neon-cyan);
    min-width: 50px;
    text-align: right;
}

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--gray-light);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* Shop Screen */
.shop-currency {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 44, 0.15), rgba(255, 45, 149, 0.15));
    border: 1px solid rgba(255, 107, 44, 0.3);
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.currency-icon {
    font-size: 1rem;
    color: var(--neon-orange);
    text-shadow: 0 0 10px rgba(255, 107, 44, 0.5);
}

.currency-amount {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.currency-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--gray);
}

/* Shop Items */
/* Shop Tabs */
.shop-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.shop-tab {
    padding: 0.4rem 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.shop-tab.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 247, 0.08);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 247, 0.2);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 480px;
    margin-bottom: 1.5rem;
}

.shop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.shop-item:hover:not(.locked):not(.owned) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.shop-item.selected {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 247, 0.2), inset 0 0 15px rgba(0, 255, 247, 0.05);
}

.shop-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item.owned:not(.selected) {
    border-color: rgba(0, 255, 247, 0.3);
}

.item-preview {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    position: relative;
}

.item-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    filter: blur(10px);
}

.item-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--white);
    margin-bottom: 0.4rem;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--neon-orange);
}

.item-price.free {
    color: var(--gray);
}

.item-owned {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--neon-cyan);
}

.item-equipped {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--neon-pink);
    margin-top: 2px;
}

/* Game Over Screen */
.overlay h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    color: var(--neon-pink);
    text-shadow: 0 0 30px rgba(255, 45, 149, 0.5);
}

.final-score {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 40px rgba(0, 255, 247, 0.6);
    line-height: 1;
}

.best-score {
    font-size: 1.25rem;
    color: var(--neon-pink);
    margin-bottom: 0.4rem;
    text-shadow: 0 0 10px rgba(255, 45, 149, 0.3);
}

.final-hits {
    font-size: 1rem;
    color: var(--gray);
    margin-top: 0.4rem;
    margin-bottom: 1.5rem;
}

.restart-hint {
    font-size: 0.8rem;
    color: var(--gray);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Pause Screen */
#pause-screen {
    cursor: pointer;
}

#pause-screen h2 {
    color: var(--neon-cyan);
    text-shadow: 0 0 30px rgba(0, 255, 247, 0.5);
    margin-bottom: 1rem;
}

.pause-hint {
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 0.75rem;
    animation: pulse 2s ease-in-out infinite;
}

.pause-sub {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #score-display {
        top: 16px;
        left: 16px;
    }

    #time-score {
        font-size: 1.75rem;
    }

    #hit-count {
        font-size: 0.875rem;
    }

    .menu-stats {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 2rem;
    }

    .stat-divider {
        width: 40px;
        height: 1px;
    }

    .shop-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-content > *,
.screen-content > * {
    animation: fadeIn 0.4s ease backwards;
}

.menu-content > *:nth-child(1) { animation-delay: 0.05s; }
.menu-content > *:nth-child(2) { animation-delay: 0.1s; }
.menu-content > *:nth-child(3) { animation-delay: 0.15s; }

.screen-content > *:nth-child(1) { animation-delay: 0.05s; }
.screen-content > *:nth-child(2) { animation-delay: 0.1s; }
.screen-content > *:nth-child(3) { animation-delay: 0.15s; }
.screen-content > *:nth-child(4) { animation-delay: 0.2s; }
