* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0f17;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#arena-wrap { position: fixed; inset: 0; user-select: none; }
#arena-wrap canvas { display: block; }

#hud-top, #killfeed, #crosshair, #overlay, #toast, #fly-info, #hitmark, #dmgfx, #dmgdirs, #hp, #ammo { position: absolute; pointer-events: none; }
#crosshair { transition: opacity 0.12s; }
#reddot {
  position: absolute; pointer-events: none; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: #ff2a2a; box-shadow: 0 0 6px 2px rgba(255, 40, 40, 0.8); opacity: 0; transition: opacity 0.1s;
}
/* zásahový křížek */
#hitmark { left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; }
#hitmark::before, #hitmark::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#hitmark::before { left: 10px; top: 0; width: 2px; height: 22px; }
#hitmark::after { top: 10px; left: 0; height: 2px; width: 22px; }
#hitmark.kill::before, #hitmark.kill::after { background: #ff3030; }
/* zásah do tebe: rudé okraje a šipky směru */
#dmgfx { inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(170, 0, 0, 0.75) 100%); }
#dmgdirs { left: 50%; top: 50%; width: 0; height: 0; }
.dmgdir {
  position: absolute; left: -14px; top: -150px; width: 28px; height: 40px; transform-origin: 14px 150px; opacity: 0;
  background: linear-gradient(to bottom, rgba(255, 40, 40, 0.95), rgba(255, 40, 40, 0));
  clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%);
}
/* životy a náboje */
#hp { left: 16px; bottom: 44px; width: 240px; height: 12px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 3px; overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: #4cd964; transition: width 0.15s; }
#ammo { right: 18px; bottom: 40px; font-size: 26px; font-weight: 800; text-shadow: 0 2px 4px #000; letter-spacing: 1px; }
.you { margin: 0; font-size: 18px; font-weight: 700; }

/* ---------- PENÍZE ---------- */
#money {
  position: absolute; top: 18px; right: 22px; z-index: 5; display: none; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px; border-radius: 999px; font-size: 24px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(rgba(30, 36, 20, 0.92), rgba(16, 20, 10, 0.92)); border: 2px solid #c9a227;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55); color: #ffe27a; text-shadow: 0 2px 3px #000;
}
#money.show { display: flex; }
#money .coin {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3a8, #e0b21e 55%, #9c7408); color: #5a3e00; font-size: 20px; text-shadow: none;
  border: 2px solid #7a5800;
}

/* ---------- LOBBY ---------- */
#lobby {
  position: absolute; inset: 0; display: flex; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(8, 10, 18, 0.35) 0%, rgba(8, 10, 18, 0.85) 75%);
  overflow-y: auto;
}
#lobby.hidden, #lobby .screen.hidden { display: none; }
#lobby .screen { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 980px; width: 100%; margin: auto; }   /* margin:auto = na středu, ale při přetečení jde rolovat od začátku */
#lobby h1 { margin: 0; font-size: 54px; letter-spacing: 4px; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.8); }
#lobby h2 { margin: 0; font-size: 34px; letter-spacing: 2px; text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8); }
.big-btn {
  font-size: 24px; font-weight: 800; letter-spacing: 2px; padding: 14px 54px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(#3a9a40, #2a7a30); color: #fff; border: 2px solid #7fd987; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, filter 0.1s;
}
.big-btn:hover { transform: scale(1.05); filter: brightness(1.1); }
.link-btn { background: none; border: none; color: #c9cde0; font-size: 16px; cursor: pointer; padding: 6px 12px; }
.link-btn:hover { color: #fff; text-decoration: underline; }
.cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; width: 100%; }
.card {
  flex: 1 1 260px; max-width: 300px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 18px 20px; border-radius: 14px; cursor: pointer; color: #fff; font-family: inherit;
  background: rgba(20, 24, 38, 0.88); border: 2px solid rgba(255, 255, 255, 0.15); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.card:hover { transform: translateY(-4px); background: rgba(30, 36, 56, 0.95); }
.card.easy:hover { border-color: #4cd964; } .card.normal:hover { border-color: #ffcc00; } .card.hard:hover { border-color: #ff3b30; }
.card-title { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.card-tag { font-size: 13px; color: #a8aec8; text-transform: uppercase; letter-spacing: 1px; }
.card ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: #dfe2ee; line-height: 1.5; }
/* výběr mapy: náhledová krajinka */
.map-card:hover { border-color: #7fd9ff; }
.map-thumb { position: relative; display: block; width: 100%; height: 120px; border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.map-thumb::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -40px; height: 90px; border-radius: 50% 50% 0 0; }
.map-thumb .sun { position: absolute; top: 18px; right: 30px; width: 26px; height: 26px; border-radius: 50%; }
.map-thumb.les { background: linear-gradient(#8fb4d8, #cfdbe4 70%); }
.map-thumb.les::after { background: linear-gradient(#5c7a3a, #3e5a28); box-shadow: -60px -18px 0 -10px #2f4a2a, 70px -10px 0 -14px #2f4a2a; }
.map-thumb.les .sun { background: #fff6d8; box-shadow: 0 0 18px 6px rgba(255, 246, 216, 0.7); }
.map-thumb.poust { background: linear-gradient(#e9c88f, #f3e2bf 70%); }
.map-thumb.poust::after { background: linear-gradient(#e0b56e, #b98a4c); box-shadow: -80px -14px 0 -8px #cfa161, 90px -22px 0 -12px #d6a866; }
.map-thumb.poust .sun { width: 34px; height: 34px; background: #fffbe8; box-shadow: 0 0 26px 12px rgba(255, 236, 180, 0.85); }
.map-thumb.snih { background: linear-gradient(#9fadbd, #dfe6ee 70%); }
.map-thumb.snih::after { background: linear-gradient(#ffffff, #d6dee8); box-shadow: -70px -16px 0 -10px #eef2f7, 80px -12px 0 -12px #e4eaf1; }
.map-thumb.snih .sun { background: #f4f6fa; opacity: 0.6; box-shadow: 0 0 22px 10px rgba(240, 244, 250, 0.6); }
.map-thumb .flakes {
  position: absolute; inset: 0; z-index: 1;
  background-image: radial-gradient(#fff 1.2px, transparent 1.6px), radial-gradient(#fff 1px, transparent 1.4px);
  background-size: 22px 22px, 15px 15px; background-position: 0 0, 7px 9px; opacity: 0.85;
}
/* ---------- OBCHOD ---------- */
.shop-btn { background: linear-gradient(#c99a1e, #9c7408); border-color: #ffe27a; font-size: 20px; padding: 10px 40px; }
.equipped { margin: 0; color: #e8dcae; font-size: 15px; font-weight: 600; }
#lobby #scr-shop { max-width: 1100px; }
.shop-hint { margin: 0; color: #a8aec8; font-size: 14px; }
.shop-sec { margin: 6px 0 0; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; color: #c9cde0; align-self: flex-start; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; width: 100%; }
.item {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; text-align: left;
  background: rgba(20, 24, 38, 0.9); border: 2px solid rgba(255, 255, 255, 0.12); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.item.equipped-item { border-color: #4cd964; }
.item .thumb { width: 100%; height: 86px; border-radius: 8px; background: radial-gradient(ellipse at center, #3a4260, #161a28); object-fit: contain; }
.item .name { font-size: 17px; font-weight: 800; }
.item .desc { font-size: 12px; color: #a8aec8; min-height: 16px; }
.stat { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 6px; font-size: 11px; color: #c9cde0; }
.stat .bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcc00, #ff8a00); border-radius: 3px; }
.item button {
  margin-top: 4px; padding: 8px 10px; border-radius: 8px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  border: 2px solid #7fd987; background: linear-gradient(#3a9a40, #2a7a30); color: #fff;
}
.item button.buy { border-color: #ffe27a; background: linear-gradient(#c99a1e, #9c7408); }
.item button.equip { border-color: #8ab8ff; background: linear-gradient(#3a6ab0, #2a4e88); }
.item button:disabled { cursor: default; opacity: 0.55; filter: grayscale(0.4); }
.item button.done { border-color: #4cd964; background: rgba(76, 217, 100, 0.15); color: #7fe08f; opacity: 1; filter: none; }
.gear .item { flex-direction: row; align-items: center; gap: 12px; }
.gear .item .gicon { font-size: 34px; }
.gear .item .gbody { display: flex; flex-direction: column; gap: 2px; flex: 1; }
/* puškohled odstřelovačky */
#scope { position: absolute; inset: 0; pointer-events: none; display: none; }
#scope .scope-ring {
  position: absolute; left: 50%; top: 50%; width: 88vmin; height: 88vmin; transform: translate(-50%, -50%); border-radius: 50%;
  box-shadow: 0 0 0 200vmax #000, inset 0 0 6vmin 1vmin rgba(0, 0, 0, 0.9);
  background:
    linear-gradient(#000, #000) center / 100% 1.5px no-repeat,
    linear-gradient(#000, #000) center / 1.5px 100% no-repeat;
}
#scope .scope-ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #ff2a2a; box-shadow: 0 0 4px #ff2a2a; }
#pause-info { margin: 0; color: #c9cde0; font-size: 16px; }
@media (max-width: 640px) { #lobby h1 { font-size: 34px; } .big-btn { font-size: 20px; padding: 12px 36px; } }
#fly-info {
  left: 14px; bottom: 12px; font-size: 13px; font-weight: 600;
  background: rgba(0,0,0,0.45); padding: 5px 10px; border-radius: 6px; text-shadow: 0 1px 2px #000;
}

#hud-top {
  top: 12px; left: 50%; transform: translateX(-50%);
  text-align: center; text-shadow: 0 2px 4px #000;
}
#score { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
#score small { display: block; font-size: 12px; font-weight: 600; color: #e6e8f0; letter-spacing: 0; }
#zone-info { font-size: 14px; font-weight: 700; color: #ffd0d6; margin-top: 2px; }

#killfeed { top: 12px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#killfeed div { background: rgba(0,0,0,0.55); padding: 2px 8px; border-radius: 4px; font-weight: 700; font-size: 14px; }

#crosshair {
  left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%);
}
#crosshair::before, #crosshair::after {
  content: ""; position: absolute; background: rgba(255,255,255,0.85); box-shadow: 0 0 2px #000;
}
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
#crosshair::after { top: 8px; left: 0; height: 2px; width: 18px; }

#overlay {
  inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; text-shadow: 0 3px 8px rgba(0,0,0,0.8); padding-bottom: 120px;
}
#overlay .big { font-size: 56px; font-weight: 800; -webkit-text-stroke: 1.5px rgba(0,0,0,0.6); }
#overlay .sub { font-size: 18px; font-weight: 700; }

#toast {
  bottom: 40px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); padding: 6px 14px; border-radius: 6px; font-weight: 700; opacity: 0;
}

#start {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(8, 10, 18, 0.72); text-align: center; padding: 16px;
}
#start.hidden { display: none; }
#start h1 { margin: 0; font-size: 46px; letter-spacing: 3px; }
#start .teams { margin: 0; font-size: 22px; font-weight: 800; }
.red { color: #ff5a55; } .blue { color: #4aa3ff; }
#start-btn {
  font-size: 20px; font-weight: 800; padding: 12px 28px; border-radius: 10px; cursor: pointer;
  background: #2e7d32; color: #fff; border: 2px solid #66bb6a;
}
#start-btn:hover { background: #388e3c; }
.keys { font-size: 14px; color: #c9cde0; }
.keys p { margin: 6px 0; }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 2px;
  background: #262c44; border: 1px solid #3a4266; border-bottom-width: 3px; border-radius: 5px;
  font-family: inherit; font-size: 12px; color: #fff;
}
