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

:root {
  --bg: #06090f;
  --panel: #10182bee;
  --accent: #4ade80;
  --text: #e2e8f0;
}

html, body {
  height: 100vh;
  height: 100dvh;            /* mobilde adres cubugunu hesaba katar */
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* Canvas gorunen alani tam kaplar; boyut JS'te px cinsinden ayarlanir */
#game { position: fixed; inset: 0; display: block; cursor: crosshair; }

/* Overlay ekranlar */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060a12cc;
  backdrop-filter: blur(6px);
  z-index: 10;
}
.overlay.hidden { display: none; }

.panel {
  background: var(--panel);
  border: 1px solid #2b3a5c;
  border-radius: 20px;
  padding: 38px 44px;
  text-align: center;
  box-shadow: 0 24px 80px #000a, inset 0 1px 0 #ffffff14;
  max-width: 92vw;
}

.panel h1 {
  font-size: 2.1rem;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #86efac, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.panel h1 .tld { -webkit-text-fill-color: #4ade80; opacity: .65; font-weight: 700; }
.panel .sub { color: #94a3b8; margin-bottom: 22px; }

input#nameInput {
  width: 250px;
  max-width: 70vw;
  padding: 13px 16px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid #3b4d75;
  background: #0a1120;
  color: var(--text);
  outline: none;
  text-align: center;
}
input#nameInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #4ade8033; }

button {
  margin-top: 16px;
  padding: 13px 38px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #4ade80, #22c55e);
  color: #052012;
  cursor: pointer;
  transition: transform .08s, filter .15s;
  box-shadow: 0 6px 20px #22c55e44;
}
button:hover { filter: brightness(1.1); }
button:active { transform: scale(.96); }

.hint { margin-top: 22px; font-size: .85rem; color: #64748b; line-height: 1.7; }

/* Top oyuncular paneli (ana sayfa) */
#topPanel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #2b3a5c;
  text-align: left;
}
.tp-title {
  font-size: .78rem; font-weight: 800; letter-spacing: 1.5px;
  color: #fbbf24; text-align: center; margin-bottom: 12px;
}
#topList { list-style: none; display: flex; flex-direction: column; gap: 4px; }
#topList li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 10px;
  background: #0a1120; border: 1px solid #1e293b;
  font-size: .92rem;
}
#topList li:nth-child(1) { border-color: #fbbf2455; background: #2a220a; }
#topList li:nth-child(2) { border-color: #cbd5e155; }
#topList li:nth-child(3) { border-color: #b4530955; }
.tp-rank {
  flex: 0 0 22px; text-align: center; font-weight: 800;
  color: #94a3b8; font-size: .9rem;
}
#topList li:nth-child(1) .tp-rank { color: #fbbf24; }
.tp-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-score { font-weight: 800; color: #4ade80; font-variant-numeric: tabular-nums; }
.tp-empty { justify-content: center; color: #64748b; font-size: .85rem; }

/* HUD */
#hud {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}
#hud.hidden { display: none; }
.hud-left { display: flex; flex-direction: column; gap: 8px; }

#score, #weapon {
  background: var(--panel);
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  border: 1px solid #2b3a5c;
  box-shadow: 0 4px 16px #0006;
  width: fit-content;
}
#weapon .ammo { color: var(--accent); margin-left: 6px; }

#leaderboard {
  background: var(--panel);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #2b3a5c;
  font-size: .9rem;
  min-width: 160px;
  box-shadow: 0 4px 16px #0006;
}
#leaderboard .lb-title { font-weight: 700; margin-bottom: 6px; color: #94a3b8; font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; }
#leaderboard .lb-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
#leaderboard .lb-row .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* Ses dugmesi */
#muteBtn {
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid #2b3a5c;
  font-size: 1.1rem;
  width: fit-content;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 16px #0006;
}
#muteBtn:hover { border-color: var(--accent); }

/* Oldurme bildirimleri */
#killfeed {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.kf-entry {
  background: var(--panel);
  border: 1px solid #2b3a5c;
  border-radius: 10px;
  padding: 6px 16px;
  font-size: .92rem;
  box-shadow: 0 4px 16px #0006;
  animation: kfIn .25s ease-out;
  transition: opacity .5s;
  white-space: nowrap;
}
.kf-entry.mine { border-color: #4ade80; box-shadow: 0 0 18px #4ade8044; }
.kf-entry.out { opacity: 0; }
@keyframes kfIn {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mini harita */
#minimap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  border-radius: 12px;
  border: 1px solid #2b3a5c;
  background: #0a1120cc;
  box-shadow: 0 4px 16px #0006;
}
#minimap.hidden { display: none; }

/* Mobil ates butonu */
#fireBtn {
  position: absolute;
  left: 22px;
  bottom: 26px;
  z-index: 6;
  width: 84px; height: 84px;
  margin: 0;
  border-radius: 50%;
  font-size: 2rem;
  background: #7f1d1dcc;
  border: 2px solid #ef4444;
  box-shadow: 0 6px 24px #ef444455;
}
#fireBtn.hidden { display: none; }

#boostBtn {
  position: absolute;
  left: 120px;
  bottom: 26px;
  z-index: 6;
  width: 84px; height: 84px;
  margin: 0;
  border-radius: 50%;
  font-size: 2rem;
  background: #1e3a8acc;
  border: 2px solid #60a5fa;
  box-shadow: 0 6px 24px #60a5fa55;
}
#boostBtn.hidden { display: none; }

@media (hover: hover) and (pointer: fine) {
  #fireBtn, #boostBtn { display: none !important; }
}
