* { margin: 0; padding: 0; box-sizing: border-box; touch-action: none; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a1a; font-family: 'Segoe UI', system-ui, sans-serif; }
#game-container { width: 100%; height: 100%; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; background: #0a0a1a; }
#game-canvas { display: block; }
.screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; z-index: 100; overflow-y: auto; }
.screen.hidden { display: none; }
#menu-screen { background: linear-gradient(135deg, #0a0a2e 0%, #1a1a3e 50%, #0a0a2e 100%); justify-content: center; }
#menu-screen h1 { font-size: 42px; font-weight: 900; background: linear-gradient(135deg, #f87171, #fbbf24, #4ade80); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; letter-spacing: -1px; }
#menu-screen .subtitle { color: #999; font-size: 14px; letter-spacing: 0.1em; margin-bottom: 40px; }
.menu-btn { background: linear-gradient(135deg, #4ade80, #22c55e); border: none; color: #fff; padding: 16px 48px; border-radius: 30px; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 20px rgba(74,222,128,0.4); margin: 8px; min-width: 220px; transition: transform 0.15s; }
.menu-btn:active { transform: scale(0.95); }
.menu-btn.secondary { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 4px 20px rgba(59,130,246,0.4); }
.menu-btn.tertiary { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 4px 20px rgba(168,85,247,0.4); }
#coins-display { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.5); color: #fbbf24; font-size: 16px; font-weight: 700; padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(251,191,36,0.3); z-index: 50; pointer-events: none; }
#level-indicator { position: absolute; top: 12px; left: 12px; color: #fff; font-size: 16px; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); background: rgba(0,0,0,0.5); padding: 8px 16px; border-radius: 20px; z-index: 50; pointer-events: none; }
#game-ui { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; padding: 12px; z-index: 50; pointer-events: none; }
#game-ui button { pointer-events: auto; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
#game-ui button:active { background: rgba(255,255,255,0.15); transform: scale(0.95); }
#help-btn { background: rgba(251,191,36,0.2) !important; border-color: rgba(251,191,36,0.4) !important; color: #fbbf24 !important; font-weight: 700 !important; min-width: 40px; }
#ingame-upgrade-btn { background: rgba(168,85,247,0.2) !important; border-color: rgba(168,85,247,0.4) !important; color: #a855f7 !important; font-weight: 700 !important; font-size: 16px !important; min-width: 40px; padding: 10px 16px !important; }
#level-select-screen { background: linear-gradient(135deg, #0a0a2e 0%, #1a1a3e 50%, #0a0a2e 100%); overflow-y: auto; padding: 60px 20px 40px; justify-content: flex-start; }
#level-select-screen h2 { color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 20px; }
.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 400px; width: 100%; padding-bottom: 80px; }
.level-btn { background: #1a1a3e; border: 2px solid #333; color: #fff; padding: 12px; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.15s; text-align: center; position: relative; }
.level-btn.unlocked { border-color: #4ade80; }
.level-btn.unlocked:active { transform: scale(0.95); background: #22c55e; }
.level-btn.completed { background: rgba(74,222,128,0.2); border-color: #4ade80; }
.level-btn.completed::after { content: '\2713'; position: absolute; top: 2px; right: 4px; font-size: 10px; color: #4ade80; }
.level-btn.locked { opacity: 0.4; cursor: not-allowed; }
.level-btn .stars { font-size: 8px; display: block; margin-top: 2px; }
#upgrade-screen { background: linear-gradient(135deg, #0a0a2e 0%, #1a1a3e 50%, #0a0a2e 100%); overflow-y: auto; padding: 60px 20px 40px; justify-content: flex-start; }
#upgrade-screen h2 { color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 8px; }
#upgrade-screen .upgrade-coins { color: #fbbf24; font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.upgrade-list { max-width: 400px; width: 100%; display: flex; flex-direction: column; gap: 12px; padding-bottom: 80px; }
.upgrade-card { background: #1a1a3e; border: 1px solid #333; border-radius: 16px; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.upgrade-card .upgrade-info h3 { color: #fff; font-size: 16px; font-weight: 600; }
.upgrade-card .upgrade-info p { color: #999; font-size: 12px; margin-top: 4px; }
.upgrade-card .upgrade-level { color: #fbbf24; font-size: 12px; margin-top: 2px; }
.upgrade-buy { background: linear-gradient(135deg, #fbbf24, #f59e0b); border: none; color: #000; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform 0.15s; white-space: nowrap; }
.upgrade-buy:active { transform: scale(0.95); }
.upgrade-buy:disabled { opacity: 0.4; cursor: not-allowed; }
.back-btn { position: absolute; top: 16px; left: 16px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; z-index: 110; transition: all 0.15s; }
.back-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.2); }
#win-screen, #lose-screen { background: rgba(0,0,0,0.85); justify-content: center; }
#win-screen h2 { font-size: 48px; background: linear-gradient(135deg, #4ade80, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }
#win-screen .reward { color: #fbbf24; font-size: 20px; font-weight: 700; margin-bottom: 24px; }
#win-screen .stars-display { font-size: 36px; margin-bottom: 16px; }
#lose-screen h2 { font-size: 48px; color: #f87171; margin-bottom: 24px; text-shadow: 0 0 20px rgba(248,113,113,0.5); }
#pause-screen { background: rgba(0,0,0,0.85); justify-content: center; }
#pause-screen h2 { font-size: 36px; color: #fff; margin-bottom: 24px; }
