/* muhsin.combat v3 */
:root {
  --bg: #0a0c0e;
  --panel: rgba(12, 16, 20, .82);
  --panel-strong: rgba(8, 11, 14, .92);
  --ink: #d9dde2;
  --muted: #6b7480;
  --accent: #c8ff00;
  --danger: #ff3344;
  --border: #1f2630;
  --hp: #c8ff00;
  --hp-low: #ff3344;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); touch-action: none; }
body {
  font-family: 'IBM Plex Mono','JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  position: fixed; width: 100%;
}
.hidden { display: none !important; }

/* ============ LOGIN ============ */
#login {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at center, #0e1418 0%, #050709 80%),
    repeating-linear-gradient(0deg, rgba(200,255,0,.04), rgba(200,255,0,.04) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(200,255,0,.04), rgba(200,255,0,.04) 1px, transparent 1px, transparent 40px);
  z-index: 20; padding: 16px;
}
#login::before {
  content:''; position:absolute; inset:0;
  background: radial-gradient(circle at 50% 30%, transparent 30%, rgba(0,0,0,.7) 100%);
  pointer-events:none;
}
#login .card {
  position: relative; border: 1px solid var(--border);
  background: var(--panel); backdrop-filter: blur(10px);
  padding: 36px 28px; width: 100%; max-width: 440px;
  box-shadow: 0 0 80px rgba(0,0,0,.7);
}
#login .card::before {
  content:''; position:absolute; top:-1px; left:-1px; right:-1px;
  height:2px; background: var(--accent);
}
.logo {
  font-size: 36px; font-weight: 800; letter-spacing:-1px;
  margin-bottom: 6px;
  font-family: 'Bebas Neue', Impact, sans-serif;
}
.logo .m { color: var(--ink); }
.logo .dot { color: var(--accent); }
.logo .combat { color: var(--accent); letter-spacing: 4px; }
.tag { color: var(--muted); font-size: 12px; margin-bottom: 22px; line-height: 1.6; }
.tag b { color: var(--accent); font-weight: 600; }
#login input {
  width: 100%; padding: 14px 16px;
  background: #050709; border: 1px solid var(--border);
  color: var(--ink); font-family: inherit; font-size: 14px;
  outline: none; margin-bottom: 12px; letter-spacing: 2px; text-transform: uppercase;
}
#login input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
#login input::placeholder { color: var(--muted); text-transform: none; letter-spacing: 1px; }
#login button {
  width: 100%; padding: 14px;
  background: var(--accent); color: #050709;
  border: none; cursor: pointer;
  font-family: inherit; font-size: 14px;
  font-weight: 800; letter-spacing: 4px;
}
#login button:hover { filter: brightness(1.1); }
#login button:active { transform: translateY(1px); }
.controls-hint { margin-top: 14px; font-size: 10px; color: var(--muted); letter-spacing: 1px; line-height: 1.8; }
.controls-hint b {
  color: var(--accent); display:inline-block; min-width: 16px; text-align:center;
  font-family: 'Bebas Neue', Impact, sans-serif; margin-right: 6px;
}
.is-mobile .controls-hint .d { display:none; }
.is-desktop .controls-hint .m { display:none; }
#login .footer {
  margin-top: 14px; display:flex; justify-content:flex-end;
  font-size: 11px; color: var(--muted);
}
#login .footer .brand { font-style: italic; font-family: Georgia, serif; }

/* ============ LOCK PROMPT ============ */
#lock-prompt {
  position: fixed; inset: 0;
  background: rgba(5,7,9,.92);
  display:flex; align-items:center; justify-content:center;
  z-index: 15; cursor: pointer; text-align:center;
}
#lock-prompt .big {
  font-size: 28px; font-weight: 800; letter-spacing: 6px; color: var(--accent);
  font-family: 'Bebas Neue', Impact, sans-serif;
  animation: pulse 1.4s ease-in-out infinite;
}
#lock-prompt .small { margin-top: 8px; font-size: 11px; color: var(--muted); letter-spacing: 2px; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ============ GAME ============ */
#game { position: fixed; inset: 0; }
#canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* Top bar */
#topbar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  display:flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 6px 14px; backdrop-filter: blur(6px);
  font-size: 11px; letter-spacing: 3px; font-weight: 700;
  z-index: 3; white-space: nowrap;
}
#topbar .dot-sep { color: var(--muted); }
#map-name { color: var(--accent); }
#map-timer { color: var(--ink); font-variant-numeric: tabular-nums; }
#ping-display { color: var(--muted); font-variant-numeric: tabular-nums; display:flex; align-items:center; gap:3px; }
#ping-display .lbl { font-size: 9px; }
#ping-display.good #ping-val { color: #06d6a0; }
#ping-display.ok #ping-val { color: var(--accent); }
#ping-display.bad #ping-val { color: var(--danger); }

/* Crosshair */
#crosshair {
  position: fixed; left: 50%; top: 50%;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none; z-index: 2;
  transition: width .15s, height .15s, opacity .15s;
}
#crosshair span {
  position: absolute; background: var(--accent);
  box-shadow: 0 0 4px rgba(0,0,0,.9);
}
#crosshair span:nth-child(1){left:50%;top:0;width:1px;height:6px;transform:translateX(-50%);}
#crosshair span:nth-child(2){left:50%;bottom:0;width:1px;height:6px;transform:translateX(-50%);}
#crosshair span:nth-child(3){top:50%;left:0;height:1px;width:6px;transform:translateY(-50%);}
#crosshair span:nth-child(4){top:50%;right:0;height:1px;width:6px;transform:translateY(-50%);}
#crosshair i { position:absolute; left:50%; top:50%; width:2px; height:2px; background: var(--accent); transform: translate(-50%,-50%); border-radius:50%; box-shadow: 0 0 4px rgba(0,0,0,.9); }
body.ads-on #crosshair { width: 10px; height: 10px; opacity: 0.6; }

/* HP */
#hp-wrap {
  position: fixed; left: 18px; bottom: 18px;
  width: 220px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 10px 12px; backdrop-filter: blur(6px); z-index: 3;
}
#hp-wrap .row1 { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:6px; }
#hp-wrap .label { font-size: 10px; color: var(--muted); letter-spacing: 3px; }
#hp-num { font-size: 22px; font-weight: 800; font-family: 'Bebas Neue', Impact, sans-serif; line-height: 1; }
#hp-wrap .bar { height: 7px; background: #0a0c0e; border: 1px solid var(--border); overflow:hidden; }
#hp-fill { height:100%; width:100%; background: var(--hp); transition: width .15s linear, background .2s; }
#hp-fill.low { background: var(--hp-low); animation: lowpulse 1s infinite; }
@keyframes lowpulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }

/* Ammo */
#ammo-wrap {
  position: fixed; right: 18px; bottom: 18px;
  min-width: 160px; text-align: right;
  background: var(--panel); border: 1px solid var(--border);
  padding: 10px 14px; backdrop-filter: blur(6px); z-index: 3;
}
#weapon-name {
  font-size: 11px; color: var(--accent); letter-spacing: 3px; font-weight: 700;
}
#ammo-num {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 32px; line-height: 1; margin-top: 4px;
}
#ammo-num .slash { color: var(--muted); margin: 0 4px; font-size: 22px; }
#ammo-max { color: var(--muted); }
#reload-bar { margin-top: 6px; height: 4px; background: #0a0c0e; border: 1px solid var(--border); overflow:hidden; }
#reload-fill { height:100%; width:0%; background: var(--accent); transition: width .05s linear; }

/* Weapons (masaüstü) */
#weapons {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 3;
}
.wslot {
  background: var(--panel); border: 1px solid var(--border);
  padding: 6px 12px; cursor: pointer;
  font-size: 11px; letter-spacing: 2px;
  display:flex; align-items:center; gap:8px;
  min-width: 100px;
}
.wslot .key {
  font-family: 'Bebas Neue', Impact, sans-serif;
  background: rgba(200,255,0,.1); color: var(--accent);
  padding: 1px 6px; border: 1px solid var(--border); font-size: 12px;
}
.wslot.active { border-color: var(--accent); background: rgba(200,255,0,.06); }
.wslot.active .nm { color: var(--accent); }

/* Scoreboard */
#scoreboard {
  position: fixed; top: 18px; right: 18px;
  width: 220px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 10px 12px; backdrop-filter: blur(6px); z-index: 3;
}
#scoreboard .head { font-size: 10px; color: var(--accent); letter-spacing: 3px; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
#scoreboard .row { display:flex; align-items:center; gap:8px; padding: 3px 0; font-size: 12px; }
#scoreboard .row .swatch { width:8px; height:8px; flex-shrink:0; }
#scoreboard .row .nm { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#scoreboard .row .kd { color: var(--muted); font-variant-numeric: tabular-nums; }
#scoreboard .row.me .nm { color: var(--accent); font-weight: 700; }

/* Kill feed */
#killfeed {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  width: 360px; display: flex; flex-direction: column; gap: 4px;
  pointer-events: none; z-index: 2;
}
.feed-item {
  background: var(--panel); border-left: 2px solid var(--accent);
  padding: 6px 10px; font-size: 12px;
  display:flex; align-items:center; gap:6px; animation: feedIn .3s ease;
}
.feed-item.you { border-left-color: var(--danger); }
.feed-item .killer { font-weight: 700; }
.feed-item .arrow { color: var(--accent); }
.feed-item .w { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
@keyframes feedIn { from{opacity:0;transform:translateX(20px);} to{opacity:1;transform:translateX(0);} }

#status { position: fixed; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); letter-spacing: 2px; z-index: 3; }
#status .live { color: #06d6a0; }
#status .dead { color: var(--danger); }

/* Dead overlay */
#dead {
  position: fixed; inset: 0;
  background: rgba(255, 51, 68, .12);
  backdrop-filter: blur(2px);
  display:flex; align-items:center; justify-content:center; flex-direction:column;
  text-align:center; pointer-events:none; z-index: 5;
}
#dead .big {
  font-size: 56px; font-weight: 800; letter-spacing: 10px;
  color: var(--danger); font-family: 'Bebas Neue', Impact, sans-serif;
  text-shadow: 0 0 30px rgba(255, 51, 68, .6);
}
#dead .small { font-size: 13px; color: var(--ink); letter-spacing: 4px; text-transform: uppercase; margin-top: 8px; }

#map-change {
  position: fixed; inset: 0;
  display:flex; align-items:center; justify-content:center; flex-direction:column;
  pointer-events:none; z-index: 6;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
  animation: fadeOut 2s ease forwards;
}
#map-change .big { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 36px; letter-spacing: 8px; color: var(--accent); }
#map-change-name { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 64px; letter-spacing: 12px; color: var(--ink); margin-top: 8px; }
@keyframes fadeOut { 0%,80% { opacity: 1; } 100% { opacity: 0; } }

.damage-flash {
  position: fixed; inset: 0;
  background: radial-gradient(circle, transparent 30%, rgba(255,51,68,.55) 100%);
  pointer-events:none; z-index: 4; animation: dmg .3s ease-out;
}
@keyframes dmg { from { opacity: 1; } to { opacity: 0; } }

/* ============ MOBILE ============ */
#mobile-ctrl { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#mobile-ctrl > * { pointer-events: auto; }

#joy {
  position: absolute; left: 24px; bottom: 28px;
  width: 130px; height: 130px;
  background: rgba(12,16,20,.45);
  border: 1px solid var(--border);
  border-radius: 50%;
  touch-action: none;
  backdrop-filter: blur(4px);
}
#joy-knob {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px;
  background: rgba(200,255,0,.25);
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(200,255,0,.3);
}

.mbtn {
  position: absolute;
  background: rgba(12,16,20,.55);
  border: 1.5px solid var(--border);
  color: var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-weight: 800; letter-spacing: 2px;
  font-family: 'Bebas Neue', Impact, sans-serif;
  user-select: none;
  touch-action: none;
  backdrop-filter: blur(4px);
  transition: transform .05s;
}
.mbtn:active { transform: scale(0.93); }
#btn-fire {
  right: 28px; bottom: 100px;
  width: 110px; height: 110px;
  border-radius: 50%;
  font-size: 20px;
  border-color: rgba(255, 51, 68, .5);
  color: #ff8899;
  background: radial-gradient(circle, rgba(255,51,68,.15) 0%, rgba(12,16,20,.55) 70%);
}
#btn-fire:active { background: rgba(255,51,68,.3); border-color: var(--danger); color: var(--danger); }
.mbtn.small { width: 60px; height: 60px; border-radius: 50%; font-size: 11px; }
#btn-ads    { right: 158px; bottom: 220px; border-color: rgba(200,255,0,.45); color: var(--accent); }
#btn-ads.active { background: rgba(200,255,0,.3); border-color: var(--accent); color: #050709; }
#btn-jump   { right: 158px; bottom: 110px; }
#btn-reload { right: 36px; bottom: 230px; }
#btn-pov    { right: 100px; bottom: 300px; }

#mobile-weapons {
  position: absolute;
  top: 50px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px;
  background: rgba(12,16,20,.5);
  padding: 4px; border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.mw {
  padding: 6px 10px;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 14px; letter-spacing: 2px;
  color: var(--muted);
  border: 1px solid transparent;
  touch-action: none;
}
.mw.active { color: var(--accent); border-color: var(--border); background: rgba(200,255,0,.08); }

/* Mobil için arayüz daraltma */
@media (max-width: 720px), (pointer: coarse) {
  body.is-mobile #scoreboard {
    width: 150px; padding: 8px 10px; font-size: 11px;
    top: 12px; right: 12px;
  }
  body.is-mobile #scoreboard .head { font-size: 9px; }
  body.is-mobile #scoreboard .row { font-size: 11px; padding: 2px 0; }
  body.is-mobile #hp-wrap {
    width: 150px; padding: 8px 10px;
    bottom: auto; top: 12px; left: 12px;
  }
  body.is-mobile #hp-num { font-size: 18px; }
  body.is-mobile #ammo-wrap {
    right: auto; left: 174px; bottom: 28px;
    min-width: 90px; padding: 6px 10px;
    background: rgba(12,16,20,.5);
  }
  body.is-mobile #ammo-num { font-size: 22px; }
  body.is-mobile #weapons { display: none; }
  body.is-mobile #topbar { font-size: 9px; padding: 4px 8px; top: 8px; gap: 6px; }
  body.is-mobile #killfeed { width: 70%; top: 100px; font-size: 10px; }
  body.is-mobile #dead .big { font-size: 40px; letter-spacing: 6px; }
  body.is-mobile #map-change-name { font-size: 40px; letter-spacing: 6px; }
}

/* Çok dar (telefon dikey) */
@media (max-width: 480px) {
  body.is-mobile #scoreboard {
    width: 130px;
  }
  body.is-mobile #hp-wrap { width: 130px; }
  body.is-mobile #ammo-wrap { left: 152px; min-width: 80px; }
  #btn-fire { width: 95px; height: 95px; right: 18px; bottom: 90px; font-size: 17px; }
  .mbtn.small { width: 52px; height: 52px; font-size: 10px; }
  #btn-ads { right: 130px; bottom: 190px; }
  #btn-jump { right: 130px; bottom: 100px; }
  #btn-reload { right: 22px; bottom: 200px; }
  #btn-pov { right: 84px; bottom: 256px; }
  #joy { width: 110px; height: 110px; left: 18px; bottom: 22px; }
  #joy-knob { width: 50px; height: 50px; }
  #mobile-weapons { top: 44px; }
  .mw { padding: 5px 8px; font-size: 12px; }
}
