/* Skirmish tarayıcı istemcisi: tam ekran tuval, üstünde gösterge, menü ve dokunmatik düğmeler. */
:root {
  --accent: #ffb84d;
  --red: #ff4033;
  --panel: rgba(8, 12, 16, 0.62);
  --text: #f2f7ff;
  --dim: rgba(242, 247, 255, 0.55);
  --font: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --ui: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f15; color: var(--text); font-family: var(--ui); -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#status { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 600 22px var(--font); letter-spacing: 0.06em; text-shadow: 0 2px 8px #000; }
button, input, select { font: inherit; color: inherit; }

/* --- Açılış ekranı: sahne ve sunucu bağlantısı hazır olana kadar her şeyin üstünde durur. ---- */
#loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(ellipse at 50% 40%, #1a2130 0%, #0b0f15 70%); transition: opacity 0.45s ease; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .mark { font: 700 34px var(--font); letter-spacing: 0.12em; color: #f0d39a; }
#loading .track { width: min(320px, 70vw); height: 4px; background: rgba(255, 255, 255, 0.14); border-radius: 2px; overflow: hidden; }
#loading .track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
#loading p { margin: 0; font: 500 15px var(--ui); color: #aeb6c6; letter-spacing: 0.02em; min-height: 1.3em; }
#loading.failed .track i { background: var(--red); }

/* --- Gösterge --------------------------------------------------------------------------- */
#hud { position: fixed; inset: 0; zoom: var(--ui-scale, 1); pointer-events: none; font-family: var(--font); font-weight: 700; text-shadow: 1.5px 1.5px 0 rgba(0, 0, 0, 0.55); }
#hud .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.28) 100%); }
#hud .vignette.dead { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 30%, rgba(0, 0, 0, 0.75) 100%); }
#hud .hurt { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 35%, rgba(190, 5, 0, 0.75) 100%); }
#hud .hurt.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.5); } }

.crosshair { position: absolute; left: 50%; top: 50%; --gap: 5px; }
.crosshair.hide { visibility: hidden; }
.crosshair i { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.crosshair .l, .crosshair .r { width: 8px; height: 2px; top: -1px; }
.crosshair .u, .crosshair .d { width: 2px; height: 8px; left: -1px; }
.crosshair .l { right: var(--gap); } .crosshair .r { left: var(--gap); }
.crosshair .u { bottom: var(--gap); } .crosshair .d { top: var(--gap); }
.crosshair b { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; background: #fff; }
#hud .reload { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px; transform: rotate(-90deg); opacity: 0; --progress: 0; }
#hud .reload.show { opacity: 1; }
#hud .reload circle { fill: none; stroke-width: 3; }
#hud .reload .track { stroke: rgba(255, 255, 255, 0.18); }
#hud .reload .fill { stroke: var(--accent); stroke-dasharray: 138.2; stroke-dashoffset: calc(138.2 * (1 - var(--progress))); stroke-linecap: round; }
.reload-label { position: absolute; left: 50%; top: calc(50% + 38px); transform: translateX(-50%); font-size: 15px; color: var(--dim); letter-spacing: 0.08em; opacity: 0; }
.reload-label.show { opacity: 1; }

.hit { position: absolute; left: 50%; top: 50%; opacity: 0; --c: #fff; }
.hit.show { animation: hit 0.28s ease-out forwards; }
.hit.kill { --c: var(--red); animation-duration: 0.5s; }
.hit.head { --c: var(--accent); }
.hit i { position: absolute; width: 11px; height: 3px; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); transform-origin: left center; left: 0; top: -1.5px; }
.hit.kill i { width: 15px; }
.hit i:nth-child(1) { transform: rotate(45deg) translateX(8px); }
.hit i:nth-child(2) { transform: rotate(135deg) translateX(8px); }
.hit i:nth-child(3) { transform: rotate(225deg) translateX(8px); }
.hit i:nth-child(4) { transform: rotate(315deg) translateX(8px); }
@keyframes hit { 0% { opacity: 1; scale: 0.8; } 70% { opacity: 1; scale: 1.15; } 100% { opacity: 0; scale: 1.25; } }

.damage { position: absolute; left: 50%; top: 50%; }
.damage i { position: absolute; left: -165px; top: -165px; width: 330px; height: 330px; border-radius: 50%; border: 10px solid transparent; border-top-color: rgba(255, 40, 25, 0.85); -webkit-mask: conic-gradient(from -20deg, #000 40deg, transparent 40deg); mask: conic-gradient(from -20deg, #000 40deg, transparent 40deg); animation: fade 1.1s ease-out forwards; }
@keyframes fade { 0% { opacity: 1; } 100% { opacity: 0; } }

.top { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); width: 320px; height: 46px; background: var(--panel); display: flex; align-items: center; justify-content: space-between; }
.top .clock { font-size: 28px; position: absolute; left: 50%; transform: translateX(-50%); }
.top .clock.low { color: var(--red); }
.top .mine, .top .rival { display: flex; align-items: baseline; gap: 12px; padding: 0 16px; height: 100%; align-items: center; --color: #fff; }
.top .mine { border-left: 5px solid var(--color); }
.top .rival { border-right: 5px solid var(--color); }
.top .rival.hide { visibility: hidden; }
.top b { font-size: 28px; color: var(--color); }
.top small { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; }
.limit { position: absolute; left: 50%; top: 68px; transform: translateX(-50%); font-size: 12px; color: var(--dim); letter-spacing: 0.08em; }
.perf { position: absolute; left: 24px; top: 20px; font-size: 13px; color: var(--dim); letter-spacing: 0.05em; }

.panel { position: absolute; bottom: 28px; width: 250px; height: 64px; background: var(--panel); border-left: 3px solid var(--accent); }
.panel small { position: absolute; left: 16px; top: 9px; font-size: 12px; color: var(--dim); letter-spacing: 0.06em; }
.panel b { position: absolute; left: 16px; top: 22px; font-size: 36px; line-height: 1; }
.panel.low b { color: var(--red); }
.health { left: 28px; }
.health .bar { position: absolute; left: 92px; top: 36px; width: 140px; height: 10px; background: rgba(255, 255, 255, 0.14); -webkit-mask: repeating-linear-gradient(90deg, #000 0 33px, transparent 33px 35px); mask: repeating-linear-gradient(90deg, #000 0 33px, transparent 33px 35px); }
.health .bar i { display: block; height: 100%; background: #fff; }
.health.low .bar i { background: var(--red); }
.ammo { right: 28px; }
.ammo span { position: absolute; left: 76px; top: 36px; font-size: 19px; color: var(--dim); font-weight: 500; }
.ammo .bullets { position: absolute; left: 128px; top: 38px; width: 108px; height: 12px; background: rgba(255, 255, 255, 0.13); --step: 3.33%; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(var(--step) * 0.62), transparent calc(var(--step) * 0.62) var(--step)); mask: repeating-linear-gradient(90deg, #000 0 calc(var(--step) * 0.62), transparent calc(var(--step) * 0.62) var(--step)); }
.ammo .bullets i { display: block; height: 100%; background: rgba(255, 255, 255, 0.9); }

.feed { position: absolute; right: 28px; top: 84px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.feed .row { background: rgba(8, 12, 16, 0.5); padding: 4px 12px; font-size: 17px; animation: feed 5s linear forwards; }
.feed .row.mine { background: rgba(8, 12, 16, 0.75); outline: 1px solid rgba(255, 255, 255, 0.5); }
.feed em { font-style: normal; margin: 0 10px; color: rgba(255, 255, 255, 0.7); }
.feed em.head { color: var(--accent); }
@keyframes feed { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

.protect { position: absolute; left: 50%; top: calc(50% + 100px); transform: translateX(-50%); font-size: 17px; color: rgba(128, 230, 255, 0.85); letter-spacing: 0.1em; opacity: 0; }
.protect.show { opacity: 1; }
#hud .banner { position: absolute; left: 50%; top: calc(50% + 130px); transform: translateX(-50%); font-size: 30px; color: var(--accent); white-space: pre; opacity: 0; transition: opacity 0.3s; }
#hud .banner.show { opacity: 1; }
.dead { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; display: none; }
.dead.show { display: block; }
.dead h1 { margin: 0; font-size: 54px; color: var(--red); letter-spacing: 0.04em; }
.dead p { margin: 6px 0; font-size: 24px; }
.dead .respawn { font-weight: 500; }
.dead .progress { width: 260px; height: 4px; margin: 10px auto 0; background: rgba(255, 255, 255, 0.18); }
.dead .progress i { display: block; height: 100%; background: var(--accent); }

.scores { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); text-align: center; display: none; }
.scores.show { display: block; }
.scores h1 { margin: 0; font-size: 56px; }
.scores p { margin: 4px 0 14px; font-size: 20px; color: var(--dim); font-weight: 500; }
.scores .board { background: rgba(5, 8, 12, 0.86); border-top: 4px solid var(--accent); padding: 14px 16px 12px; text-align: left; }
.scores h2 { margin: 0 0 8px 8px; font-size: 22px; }
.scores table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 20px; }
.scores th { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; text-align: right; padding: 0 12px; }
.scores th:first-child { text-align: left; }
.scores td { background: rgba(255, 255, 255, 0.05); padding: 6px 12px; text-align: right; }
.scores tr.mine td { background: rgba(255, 255, 255, 0.12); }
.scores td:first-child { text-align: left; border-left: 4px solid var(--color); color: var(--color); }
#hud.intermission .panel, #hud.intermission .top, #hud.intermission .limit, #hud.intermission .feed { display: none; }

/* --- Menü ------------------------------------------------------------------------------- */
#menu { position: fixed; inset: 0; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: rgba(5, 8, 13, 0.25); display: flex; }
#menu .card { flex: 1; background: linear-gradient(90deg, rgba(11, 15, 21, 0.9) 0%, rgba(11, 15, 21, 0.78) 45%, rgba(11, 15, 21, 0.25) 100%); border: 1px solid #383c46; border-radius: 20px; padding: 22px 26px; overflow: hidden; display: flex; flex-direction: column; }
#menu section { display: flex; flex-direction: column; gap: 12px; max-width: 620px; min-height: 0; flex: 1; overflow-y: auto; }
#menu section[data-page="lobby"] { max-width: none; }
.brand { color: #b4b9c7; font-weight: 600; letter-spacing: 0.04em; }
.eyebrow { color: #e7bc79; font-size: 14px; font-weight: 600; letter-spacing: 0.06em; }
#menu h1 { margin: 6px 0; font-size: clamp(32px, 6vh, 46px); line-height: 1.18; font-weight: 600; }
#menu h2 { margin: 0; font-size: 24px; }
#menu h3 { margin: 10px 0 4px; font-size: 13px; color: #e7bc79; letter-spacing: 0.06em; }
.lead { margin: 0; color: #bcc2cf; font-size: 18px; max-width: 520px; }
.hint, .muted { color: #9aa2b1; font-size: 14px; margin: 0; }
.status { color: #b9c0cf; font-size: 15px; margin: 0; }
.message { color: #f0d39a; margin: 0; }
#menu input:not([type="checkbox"]), #menu select { background: #151a22; border: 1px solid #3a4150; border-radius: 9px; padding: 11px 14px; outline: none; min-width: 0; -webkit-user-select: text; user-select: text; }
#menu input:focus { border-color: #9aa9c7; }
#menu button, #pause button, #banner button { background: #262b35; border: 1px solid #4a5160; border-radius: 12px; padding: 11px 16px; cursor: pointer; min-height: 44px; text-align: center; }
#menu button:hover, #pause button:hover, #banner button:hover { background: #343b48; }
#menu button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: #e7b563 !important; border-color: #f4cd86 !important; color: #17212c; font-weight: 700; }
button.primary:hover { background: #f4cb80 !important; }
#menu section[data-page="welcome"] button.primary, #menu section[data-page="home"] button { min-height: 56px; font-size: 17px; }
#menu header { display: flex; align-items: center; gap: 12px; }
#menu header h2 { flex: 1; }
.profile, .line, .actions, .tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile { background: #181d26; border: 1px solid #333a47; border-radius: 14px; padding: 10px 14px; }
.profile input { flex: 1; }
.profile .sep { width: 1px; height: 28px; background: #3a4150; margin: 0 6px; }
#search-results:not(:empty) { margin-top: 10px; }
.tabs button { flex: 1; background: #161b23 !important; border-color: #303744 !important; color: #a7afbf; }
.tabs button.on { background: #3a4252 !important; border-color: #a9b6d0 !important; color: #fff; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; touch-action: pan-y; }
.box { background: #181d26; border: 1px solid #333a47; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.box h3 { margin-top: 0; }
.line input { flex: 1; }
.line label { display: flex; align-items: center; gap: 6px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 10px; background: #141921; border: 1px solid #2c3340; border-radius: 12px; padding: 8px 12px; }
.row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { color: #9aa2b1; font-size: 13px; }
.row.empty { opacity: 0.6; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #6f7786; flex: none; }
.dot.host, .dot.s2 { background: #e7bc79; } .dot.s1 { background: #7fd48f; } .dot.s3 { background: #7fb6e7; }

#banner { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 5; }
#banner .invite { display: flex; align-items: center; gap: 12px; background: rgba(13, 17, 23, 0.94); border: 1px solid #e7b563; border-radius: 14px; padding: 10px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

#pause { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.35); z-index: 4; }
#pause .card { width: min(400px, 92vw); background: rgba(10, 14, 19, 0.94); border-top: 3px solid var(--accent); border-radius: 10px; padding: 24px 26px; display: flex; flex-direction: column; gap: 12px; }
#pause h2 { margin: 0 0 4px; font: 700 30px var(--font); letter-spacing: 0.04em; }
#pause label { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #c0c7d4; }
#pause input[type="range"] { flex: 1; max-width: 210px; accent-color: var(--accent); }
#pause select { background: #151a22; border: 1px solid #3a4150; border-radius: 8px; padding: 8px 10px; }
#pause .note { margin: 0; font-size: 13px; color: #98a0ae; }

/* --- Dokunmatik ------------------------------------------------------------------------- */
#touch { position: fixed; inset: 0; zoom: var(--ui-scale, 1); z-index: 2; font-family: var(--font); }
#touch button { position: absolute; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.9); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; padding: 0; touch-action: none; }
#touch button.down { background: rgba(255, 255, 255, 0.42); border-color: rgba(255, 255, 255, 0.9); }
#touch .fire { width: 124px; height: 124px; right: calc(84px + env(safe-area-inset-right)); bottom: calc(92px + env(safe-area-inset-bottom)); border-color: rgba(255, 184, 77, 0.6); background: rgba(255, 184, 77, 0.16); font-size: 19px; }
#touch .fire.down { background: rgba(255, 184, 77, 0.45); border-color: var(--accent); }
#touch .aim { width: 88px; height: 88px; right: calc(248px + env(safe-area-inset-right)); bottom: calc(52px + env(safe-area-inset-bottom)); }
#touch .jump { width: 88px; height: 88px; right: calc(26px + env(safe-area-inset-right)); bottom: calc(250px + env(safe-area-inset-bottom)); }
#touch .reload { width: 76px; height: 76px; right: calc(218px + env(safe-area-inset-right)); bottom: calc(206px + env(safe-area-inset-bottom)); }
#touch .swap { width: 76px; height: 76px; right: calc(128px + env(safe-area-inset-right)); bottom: calc(306px + env(safe-area-inset-bottom)); }
#touch .pause { width: 50px; height: 50px; right: calc(18px + env(safe-area-inset-right)); top: calc(16px + env(safe-area-inset-top)); background: rgba(0, 0, 0, 0.35); border: 0; font-size: 18px; }
#touch .scores-toggle { width: 340px; height: 74px; left: 50%; top: 0; transform: translateX(-50%); border: 0; background: transparent; border-radius: 0; }
#touch .stick { position: absolute; left: calc(150px + env(safe-area-inset-left)); bottom: 150px; width: 0; height: 0; pointer-events: none; }
#touch .stick::before { content: ""; position: absolute; left: -64px; top: -64px; width: 128px; height: 128px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.16); }
#touch .stick.on { bottom: auto; }
#touch .stick.on::before { left: -80px; top: -80px; width: 160px; height: 160px; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); }
#touch .stick i { position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
#touch .stick.on i { background: rgba(255, 255, 255, 0.32); }
/* Dokunmatik düzende sağ alt köşe düğmelere ayrılır: cephane sol alta, canın yanına geçer. */
body.touch .ammo { right: auto; left: 290px; }
body.touch .feed { right: 96px; }
#rotate { display: none; }
@media (orientation: portrait) {
  body.touch #rotate { display: flex; position: fixed; inset: 0; z-index: 9; align-items: center; justify-content: center; background: #0b0f15; font: 600 20px var(--font); letter-spacing: 0.06em; text-align: center; padding: 30px; }
}
@media (max-height: 520px) {
  #menu h1 { font-size: 30px; }
  #menu .card { padding: 14px 18px; }
  #menu section[data-page="home"] .controls { display: none; }
}
