:root {
    --bg-dark: #0a0a0c;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-green: #00ff88;
    --neon-red: #ff3e3e;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --skin-current: #00ff88;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-inter);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none; /* Prevent browser handling of gestures */
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Background Effects */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: blobify 20s infinite alternate;
}

.blob-1 {
    background: var(--neon-green);
    top: -100px;
    right: -100px;
}

.blob-2 {
    background: #0055ff;
    bottom: -100px;
    left: -100px;
    animation-delay: -10s;
}

@keyframes blobify {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.2); }
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 4px;
}

h1 span {
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.score-container {
    display: flex;
    padding: 12px 24px;
    gap: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-item .label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.score-item span:not(.label) {
    font-size: 1.2rem;
    font-weight: 800;
}

.score-divider {
    width: 1px;
    background: var(--glass-border);
}

.game-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    width: 100%;
    overflow: hidden;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10;
    animation: fadeIn 0.4s ease-out;
}

.overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu-content {
    text-align: center;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.menu-content h2 {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.menu-content h2 span {
    color: var(--neon-green);
}

.menu-content h2.critical span {
    color: var(--neon-red);
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setting-group h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.options {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.option-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.option-btn.active {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.skin-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.skin-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--skin-color);
    box-shadow: 0 0 10px var(--skin-color);
    transition: transform 0.2s;
}

.skin-btn:hover {
    transform: scale(1.2);
}

.skin-btn.active {
    border-color: white;
    transform: scale(1.2);
}

.primary-btn {
    background: var(--neon-green);
    color: var(--bg-dark);
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 255, 136, 0.4);
    filter: brightness(1.1);
}

.final-score {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.final-score span:first-child {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.final-score span:last-child {
    font-size: 2.5rem;
    font-weight: 800;
}

footer {
    text-align: center;
}

footer p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    h1 {
        font-size: 1.4rem;
    }
}
