* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0f1e; font-family: 'Nunito', system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#game { position: relative; width: 100%; height: 100%; }
#c { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; padding: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.hud-left { display: flex; flex-direction: column; gap: 8px; }
.score-box, .coin-box { background: rgba(10,14,30,.65); backdrop-filter: blur(6px); border: 2px solid rgba(255,255,255,.15); border-radius: 14px; padding: 8px 16px; color: #fff; font-family: 'Baloo 2', sans-serif; display: flex; align-items: center; gap: 10px; min-width: 150px; }
.score-box .label { font-size: 12px; opacity: .7; letter-spacing: 2px; }
#score { font-size: 28px; font-weight: 800; color: #ffe066; text-shadow: 0 2px 0 #b8860b; }
.coin-icon { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff7b0, #ffcc00 50%, #b8860b); box-shadow: 0 0 8px #ffcc00aa; }
#coins { font-size: 22px; font-weight: 800; color: #ffd84d; }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: auto; }
#pauseBtn { width: 46px; height: 46px; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); background: rgba(10,14,30,.65); color: #fff; font-weight: 800; font-size: 18px; cursor: pointer; }
#powerups { display: flex; flex-direction: column; gap: 6px; }
.pu { background: rgba(10,14,30,.7); border-radius: 10px; padding: 6px 10px; color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 130px; }
.pu .bar { flex: 1; height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
.pu .bar i { display: block; height: 100%; background: #4df0ff; border-radius: 3px; transition: width .1s linear; }
.pu.magnet .bar i { background: #ff4d8d; }
.pu.shield .bar i { background: #7cff4d; }
.pu.boost .bar i { background: #ffb84d; }
#multiplier { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); font-family: 'Baloo 2', sans-serif; font-size: 22px; font-weight: 800; color: #fff; opacity: .85; text-shadow: 0 2px 6px #000; }
#multiplier.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.5); color: #ffe066; } 100% { transform: translateX(-50%) scale(1); } }

/* Overlays */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(15,20,45,.55), rgba(5,8,20,.85)); z-index: 10; }
.panel { background: linear-gradient(160deg, #1b2350, #101636); border: 3px solid #3c4a9a; border-radius: 26px; padding: 36px 44px; text-align: center; color: #fff; box-shadow: 0 20px 60px #000a, inset 0 2px 0 #ffffff22; max-width: 92vw; animation: rise .5s cubic-bezier(.2,.9,.3,1.2); }
.panel.small { padding: 28px 36px; }
@keyframes rise { from { transform: translateY(30px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.panel h1 { font-family: 'Baloo 2', sans-serif; font-size: 58px; line-height: .95; font-weight: 800; color: #ffe066; text-shadow: 0 4px 0 #b8860b, 0 8px 20px #0008; letter-spacing: 2px; }
.panel h1 span { color: #4df0ff; text-shadow: 0 4px 0 #1a8fa8, 0 8px 20px #0008; }
.panel h2 { font-family: 'Baloo 2', sans-serif; font-size: 36px; color: #ffe066; text-shadow: 0 3px 0 #b8860b; margin-bottom: 14px; }
.sub { margin: 14px 0 6px; opacity: .8; font-size: 15px; }
.best { margin: 10px 0 20px; font-size: 15px; opacity: .9; }
.best b { color: #ffe066; font-size: 18px; }
.big-btn { display: block; width: 100%; font-family: 'Baloo 2', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: 2px; padding: 14px 30px; border: none; border-radius: 16px; background: linear-gradient(180deg, #ffd84d, #ff9f1c); color: #3a2200; box-shadow: 0 6px 0 #b35a00, 0 12px 24px #0006; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #b35a00, 0 16px 28px #0006; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b35a00; }
.ghost-btn { margin-top: 12px; background: transparent; border: 2px solid #ffffff44; color: #fff; padding: 10px 22px; border-radius: 12px; font-weight: 800; cursor: pointer; font-family: inherit; }
.ghost-btn:hover { background: #ffffff18; }
.controls { margin-top: 22px; font-size: 13px; opacity: .75; display: flex; flex-direction: column; gap: 6px; }
kbd { display: inline-block; background: #2a356e; border: 1px solid #5566bb; border-bottom-width: 3px; border-radius: 6px; padding: 1px 7px; font-family: inherit; font-weight: 800; margin: 0 2px; }
.stats { display: flex; gap: 22px; justify-content: center; margin: 10px 0 18px; }
.stats div { display: flex; flex-direction: column; }
.stats span { font-size: 12px; opacity: .7; letter-spacing: 2px; }
.stats b { font-family: 'Baloo 2', sans-serif; font-size: 30px; color: #ffe066; }
#newRecord { font-family: 'Baloo 2', sans-serif; font-size: 22px; color: #7cff4d; margin-bottom: 14px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .4; } }

.spinner { width: 50px; height: 50px; border: 5px solid #ffffff33; border-top-color: #ffe066; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Vuruş flash'ı */
#game.hit::after { content: ''; position: absolute; inset: 0; background: rgba(255,40,40,.35); pointer-events: none; animation: fade .4s forwards; }
@keyframes fade { to { opacity: 0; } }

@media (max-width: 600px) {
  .panel { padding: 26px 22px; }
  .panel h1 { font-size: 44px; }
  .controls { display: none; }
  #score { font-size: 22px; }
}
