:root {
    --bg: #0F1219;
    --primary: #64748B;
    --accent: #38BDF8;
    --accent-glow: rgba(56, 189, 248, 0.5);
    --text-main: #FFFFFF;
    --text-dim: #94A3B8;
    --danger: #EF4444;
    --coin: #FBBF24;
}

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

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1E293B 0%, var(--bg) 100%);
}

#game-canvas {
    width: 100%;
    height: 100%;
    max-width: 800px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    background: transparent;
    z-index: 10;
}

.stars {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    z-index: 1;
    opacity: 0.5;
    pointer-events: none;
}

.hidden { display: none !important; }

/* HUD */
#hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 50;
    max-width: 800px;
    margin: 0 auto;
}

.hud-item {
    display: flex;
    align-items: baseline;
    gap: 5px;
    background: rgba(15, 18, 25, 0.7);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

.hud-item .label { color: var(--text-dim); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; }
.hud-item .value { font-size: 1.5rem; font-weight: 900; font-family: monospace; }
.accent { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
.coin-badge .value { color: var(--coin); text-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }

/* Overlays */
.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 18, 25, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 18, 25, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 450px;
    width: 90%;
}

/* Glitch Title */
.glitch {
    font-size: 3rem;
    font-weight: 900;
    position: relative;
    color: white;
    margin-bottom: 5px;
    letter-spacing: 2px;
    font-style: italic;
}
.panel p { color: var(--text-dim); margin-bottom: 30px; }

h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--danger);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Skin Selector */
.shop-section {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.05);
}

.shop-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.skin-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.skin-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.skin-btn:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.skin-btn.locked { opacity: 0.5; filter: grayscale(1); }
.skin-btn.locked::after { content: '🔒'; position: absolute; font-size: 1rem; }
.skin-btn.active { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); transform: scale(1.1); }
.skin-btn .skin-preview { width: 24px; height: 24px; border-radius: 4px; }

.coins-total {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    border: none;
    width: 100%;
}

.btn.primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn.secondary {
    background: transparent;
    color: var(--text-main);
    border: 2px solid rgba(255,255,255,0.1);
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.3);
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}
.actions .btn { width: 50%; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
}
.stats-grid .stat:nth-child(3) { grid-column: span 2; }

.stat .label { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 5px; font-weight: 700; }
.stat .value { font-size: 1.5rem; font-weight: 900; font-family: monospace; }

/* Camera Shake Class */
@keyframes shake {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5px, 5px) rotate(1deg); }
    50% { transform: translate(-5px, -5px) rotate(-1deg); }
    75% { transform: translate(-5px, 5px) rotate(1deg); }
    100% { transform: translate(5px, -5px) rotate(-1deg); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@media (max-width: 600px) {
    .panel { padding: 30px 20px; }
    .glitch { font-size: 2.2rem; }
}
