/* CS2 panorama menu aesthetic.
   Font: Barlow (SIL OFL) - the closest free equivalent to CS2's menu font
   Stratum2, which is commercial and cannot be redistributed. */

@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-semibold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #16191d;
  --bg-panel: #1f242a;
  --bg-raised: #272d34;
  --line: #333b44;
  --line-bright: #46515d;
  --text: #d6dce2;
  --text-dim: #8b949e;
  --text-faint: #5f6973;
  --accent: #de9b35;        /* CS2 yellow-orange accent */
  --accent-hot: #f0b232;
  --ct: #5e98d9;            /* CS2 CT blue */
  --t: #dea54b;             /* CS2 T yellow */
  --danger: #b4443c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0%, #1d2228 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* The map page fills the viewport instead of scrolling: the board takes
   whatever height is left over from the bar above and the hint below. */
body.mapPage { height: 100vh; overflow: hidden; }
body.mapPage .wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 10px;
}

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  row-gap: 10px;
  flex: none;
}
.topbar h1 { margin: 0; font-size: 22px; }
.topbar .back { margin-bottom: 0; }
/* The tabs group is one flex item on .topbar's own line: when it doesn't
   fit next to the title, the whole group drops to a fresh line below
   instead of folding in on itself next to a title it no longer has room
   beside - the CT/T/Callouts/account buttons still wrap among themselves
   past that point, but never squeezed vertically against "MAPS / <map>". */
.topbar .tabs { margin-bottom: 0; margin-left: auto; flex-wrap: wrap; row-gap: 8px; justify-content: flex-end; }
.topbar .tabBtn { padding: 8px 16px; }

/* ---------- account ---------- */

.authBox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.authAvatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-bright);
  flex: none;
}
.authWho {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.authBtn { color: var(--text); }

/* Same outlined-accent language as an active toggle tab (.toggleBtn.active),
   just shrunk into a badge - a second, differently-styled "(admin)" suffix
   would have been a new pattern for one word. */
.authAdminBadge {
  padding: 2px 7px;
  border: 1px solid var(--accent);
  color: var(--accent-hot);
  background: rgba(222, 155, 53, 0.12);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* CS2 menu panel: clipped corners and a glowing accent seam along the top
   edge, like the game's settings/inventory dialogs, instead of a plain
   centred web modal box. */
.authBox2 {
  width: min(400px, 92vw);
  position: relative;
  clip-path: polygon(
    16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px
  );
  background: linear-gradient(160deg, rgba(222, 155, 53, 0.06), transparent 42%), var(--bg-panel);
}
.authBox2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-hot) 25%, var(--accent-hot) 75%, transparent);
  box-shadow: 0 0 10px 1px rgba(240, 178, 50, 0.55);
}

.authBox2 .videoHeader {
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%, 0 16px);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-panel));
}
.authBox2 .videoHeader span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.authBox2 .videoHeader span::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--accent-hot);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(240, 178, 50, 0.7);
}
.authBox2 .videoHeader button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  font-size: 17px;
  line-height: 1;
}
.authBox2 .videoHeader button:hover { border-color: var(--accent); background: rgba(222, 155, 53, 0.08); }

.authBody { padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }

.faceitBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ff8a3d;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, calc(100% - 10px) 100%, 0 100%, 0 10px);
  background: linear-gradient(180deg, #ff6a1f, #e84e00);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  transition: filter 0.12s, box-shadow 0.12s, transform 0.08s;
}
.faceitBtn:hover { filter: brightness(1.08); box-shadow: 0 0 16px rgba(255, 106, 31, 0.4); }
.faceitBtn:active { transform: scale(0.97); }
.faceitMark {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #ff5500;
  font-weight: 800;
}

/* Steam's own navy/steel-blue identity, cut with the same chamfered corner
   as the FACEIT tile above it so the two read as one family of buttons. */
.steamBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #2a475e;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, calc(100% - 10px) 100%, 0 100%, 0 10px);
  background: linear-gradient(180deg, #1b2838, #0e1620);
  color: #c7d5e0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  transition: filter 0.12s, box-shadow 0.12s, color 0.12s, transform 0.08s;
}
.steamBtn:hover { color: #fff; filter: brightness(1.15); box-shadow: 0 0 16px rgba(102, 192, 244, 0.3); }
.steamBtn:active { transform: scale(0.97); }
.steamMark {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #66c0f4;
  color: #0e1620;
  font-weight: 800;
}

.authDivider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}
.authDivider::before,
.authDivider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.authForm { display: flex; flex-direction: column; gap: 14px; }
.authForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}
.authForm input {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--line-bright);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  background: #14171b;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.authForm input:focus {
  outline: none;
  border-color: var(--line);
  border-bottom-color: var(--accent-hot);
  box-shadow: 0 6px 10px -8px rgba(240, 178, 50, 0.8);
}
.authForm .btnPrimary {
  padding: 11px;
  border: none;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, calc(100% - 10px) 100%, 0 100%, 0 10px);
  background: linear-gradient(180deg, var(--accent-hot), var(--accent));
  color: #1a1408;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: filter 0.12s, box-shadow 0.12s, transform 0.08s;
}
.authForm .btnPrimary:hover { filter: brightness(1.06); box-shadow: 0 0 14px rgba(240, 178, 50, 0.35); }
.authForm .btnPrimary:active { transform: scale(0.97); }

.authSwitch { margin: 0; font-size: 12px; color: var(--text-faint); text-align: center; }
.authSwitch a, .bannerSignIn {
  color: var(--accent-hot);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 178, 50, 0.4);
}
.authSwitch a:hover, .bannerSignIn:hover { border-bottom-color: var(--accent-hot); }

/* ---------- personal notes ---------- */

/* Notes are a side feature and the map is the page, so everything here is
   deliberately quiet: faint colours, no accent bars, no shadows, and all of
   it absolutely positioned against the map frame - opening notes moves and
   resizes nothing. */

/* Small tab glued to the map frame's right edge, in the page padding. */
.notesTab {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  width: 18px;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--line);
  border-left: none;
  color: var(--text-faint);
  cursor: pointer;
  font-family: inherit;
  z-index: 2;
  transition: color 0.12s, border-color 0.12s;
}
.notesTab:hover,
body.notesOpen .notesTab { color: var(--text-dim); border-color: var(--line-bright); }
.notesTabText {
  writing-mode: vertical-rl;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.notesDot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  opacity: 0.7;
  animation: notesDotPulse 1.6s ease-in-out infinite;
}
.notesDot[hidden] { display: none; }
@keyframes notesDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(222, 155, 53, 0.5); }
  50%      { box-shadow: 0 0 0 4px rgba(222, 155, 53, 0); }
}

/* The pane: compact, centred on the tab. Outside the map when there is room
   (default), over the map's right side when not (.over). */
.notesPane {
  position: absolute;
  top: 50%;
  left: calc(100% + 24px);
  transform: translateY(-50%);
  height: min(380px, 100%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: rgba(18, 21, 25, 0.92);
  border: 1px solid var(--line);
}
.notesPane.over { left: auto; right: 10px; }
.notesPane[hidden] { display: none; }

.notesHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 6px 12px;
}
.notesTitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.notesClose {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  cursor: pointer;
}
.notesClose:hover { color: var(--text); }

#notesText {
  flex: 1;
  margin: 0;
  padding: 4px 12px 8px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--line-bright) transparent;
}
#notesText::-webkit-scrollbar { width: 8px; }
#notesText::-webkit-scrollbar-track { background: transparent; }
#notesText::-webkit-scrollbar-thumb {
  background: var(--line-bright);
  border: 2px solid transparent;
  background-clip: padding-box;
}
#notesText::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
#notesText:focus { outline: none; }
#notesText::placeholder { color: var(--text-faint); }

.notesFoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 8px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.notesStatus { color: var(--text-dim); }

/* The area left over after the bar, banner and hint is a size container, so
   the board can be the largest square that fits it exactly - no guessing
   how tall the header is (it wraps on narrow screens, and the edit banner
   comes and goes). */
.boardArea {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: flex;
  justify-content: center;
  align-items: center;
}
.boardFrame {
  --b: min(100cqw, 100cqh);
  position: relative;
  flex: none;
  width: var(--b);
  height: var(--b);
}
.boardFrame .board { width: 100%; height: 100%; }


h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hint {
  color: var(--text-dim);
  margin-bottom: 24px;
  font-size: 14px;
}

.back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  transition: color 0.12s;
}
.back:hover { color: var(--accent); }

/* ---------- map list ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.mapCard {
  position: relative;
  display: block;
  padding: 22px 16px;
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-bright);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.mapCard:hover {
  background: var(--bg-raised);
  border-left-color: var(--accent);
  transform: translateX(2px);
}

/* ---------- tabs / buttons ---------- */

.tabs {
  display: flex;
  gap: 6px;
  row-gap: 6px;
  margin-bottom: 14px;
  align-items: center;
}

.tabBtn {
  padding: 8px 22px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  transition: all 0.12s;
}
.tabBtn:hover { background: var(--bg-raised); color: var(--text); }
.tabBtn:active { transform: scale(0.97); }

.tabBtn[data-side="CT"].active {
  background: rgba(94, 152, 217, 0.16);
  border-color: var(--ct);
  color: #a9cdf2;
  box-shadow: inset 0 -2px 0 var(--ct);
}
.tabBtn[data-side="T"].active {
  background: rgba(222, 165, 75, 0.16);
  border-color: var(--t);
  color: #f0d6a4;
  box-shadow: inset 0 -2px 0 var(--t);
}

.toggleBtn { margin-left: auto; }
.toggleBtn + .toggleBtn { margin-left: 0; }
.toggleBtn.active {
  background: rgba(222, 155, 53, 0.14);
  border-color: var(--accent);
  color: var(--accent-hot);
}

/* ---------- map panel ---------- */

.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0f1216;
  border: 1px solid var(--line);
  overflow: hidden;
}
.board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
}

.boardImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* ---------- spawn zones ---------- */

.spawnZone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.spawnZone.zoneCT {
  background: repeating-linear-gradient(
    45deg,
    rgba(94, 152, 217, 0.6) 0px, rgba(94, 152, 217, 0.6) 2px,
    transparent 2px, transparent 7px
  );
}
.spawnZone.zoneT {
  background: repeating-linear-gradient(
    45deg,
    rgba(222, 165, 75, 0.6) 0px, rgba(222, 165, 75, 0.6) 2px,
    transparent 2px, transparent 7px
  );
}

.spawnLabel {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.spawnLabel.labelCT { color: rgba(169, 205, 242, 0.8); }
.spawnLabel.labelT { color: rgba(240, 214, 164, 0.8); }

/* ---------- callout names ---------- */

.callout {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(214, 220, 226, 0.5);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

/* ---------- utility markers ---------- */

.marker {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #14161a;
  cursor: pointer;
  z-index: 7;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}
.marker:hover { transform: scale(1.18); }

.hoverPreview {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  width: 200px;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, calc(-100% - 20px));
  background: #000;
  border: 1px solid var(--line-bright);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.12s ease-out;
}
.hoverPreview.open { visibility: visible; opacity: 1; }
.hoverPreview video,
.hoverPreview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- grenade effects ----------
   A small looping effect behind each marker, readable at a glance but kept
   inside ~46px so it never covers the map. transform/opacity only, so many
   markers stay cheap to animate. --phase (set per marker in app.js) offsets
   every animation so markers don't pulse in unison. */

.fx {
  position: absolute;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  pointer-events: none;
  z-index: 6;
}
.fx.locked { opacity: 0.35; }
.fx i {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  opacity: 0;
  animation-iteration-count: infinite;
  animation-delay: var(--phase);
}

/* Smoke: soft puffs drifting up and out, fading as they grow. */
.fx-smoke i {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, rgba(230, 234, 240, 0.85) 0%,
              rgba(205, 211, 219, 0.45) 42%, transparent 70%);
  animation-name: fxSmoke;
  animation-duration: 3.6s;
  animation-timing-function: ease-out;
}
.fx-smoke .p1 { --dx: -9px; }
.fx-smoke .p2 { --dx: 8px;  animation-delay: calc(var(--phase) - 1.2s); }
.fx-smoke .p3 { --dx: 1px;  animation-delay: calc(var(--phase) - 2.4s); }
@keyframes fxSmoke {
  0%   { transform: translate(-50%, -50%) translate(0, 3px) scale(0.6); opacity: 0; }
  20%  { opacity: 0.95; }
  100% { transform: translate(-50%, -50%) translate(var(--dx), -15px) scale(1.55); opacity: 0; }
}

/* Molotov: a flickering glow with small flame tongues licking upward. */
.fx-molotov .p1 {
  width: 34px;
  height: 34px;
  background: radial-gradient(circle, rgba(255, 150, 50, 0.45) 0%,
              rgba(235, 85, 30, 0.2) 50%, transparent 70%);
  animation: fxFireGlow 1.3s ease-in-out infinite alternate;
  animation-delay: var(--phase);
}
@keyframes fxFireGlow {
  from { transform: translate(-50%, -50%) scale(0.9);  opacity: 0.55; }
  to   { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}
.fx-molotov .p2, .fx-molotov .p3, .fx-molotov .p4 {
  width: 7px;
  height: 11px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 70%, #ffe08a 0%, #ff8a24 55%, transparent 78%);
  animation-name: fxFlame;
  animation-duration: 0.95s;
  animation-timing-function: ease-out;
}
.fx-molotov .p2 { --r: -38deg; }
.fx-molotov .p3 { --r: 0deg;   animation-delay: calc(var(--phase) - 0.32s); }
.fx-molotov .p4 { --r: 38deg;  animation-delay: calc(var(--phase) - 0.64s); }
@keyframes fxFlame {
  0%   { transform: translate(-50%, -50%) rotate(var(--r)) translateY(-11px) scaleY(0.6); opacity: 0; }
  30%  { opacity: 0.95; }
  100% { transform: translate(-50%, -50%) rotate(var(--r)) translateY(-18px) scaleY(1.25); opacity: 0; }
}

/* Flash: a quick bright burst with rays, then a calm pause. */
.fx-flash .p1 {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(255, 252, 228, 0.95) 0%,
              rgba(255, 234, 140, 0.5) 35%, transparent 65%);
  animation-name: fxFlashBurst;
  animation-duration: 2.4s;
}
@keyframes fxFlashBurst {
  0%   { transform: translate(-50%, -50%) scale(0.3);  opacity: 0; }
  6%   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
  24%  { transform: translate(-50%, -50%) scale(1.2);  opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.2);  opacity: 0; }
}
.fx-flash .p2 {
  width: 44px;
  height: 44px;
  background: repeating-conic-gradient(rgba(255, 240, 170, 0.75) 0deg 5deg, transparent 5deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 42%, transparent 70%);
  mask: radial-gradient(circle, transparent 28%, #000 42%, transparent 70%);
  animation-name: fxFlashRays;
  animation-duration: 2.4s;
}
@keyframes fxFlashRays {
  0%   { transform: translate(-50%, -50%) scale(0.5) rotate(0deg);  opacity: 0; }
  8%   { opacity: 0.9; }
  30%  { transform: translate(-50%, -50%) scale(1.15) rotate(18deg); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.15) rotate(18deg); opacity: 0; }
}

/* HE: a hot core flash and two shockwave rings, then a pause. */
.fx-he .p1 {
  width: 26px;
  height: 26px;
  background: radial-gradient(circle, rgba(235, 248, 255, 0.95) 0%,
              rgba(126, 200, 227, 0.45) 45%, transparent 70%);
  animation-name: fxHeCore;
  animation-duration: 2.6s;
}
@keyframes fxHeCore {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  5%   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
  25%  { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
}
.fx-he .p2, .fx-he .p3 {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(126, 200, 227, 0.85);
  animation-name: fxHeRing;
  animation-duration: 2.6s;
  animation-timing-function: ease-out;
}
.fx-he .p3 { border-width: 1px; animation-delay: calc(var(--phase) - 0.15s); }
@keyframes fxHeRing {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  5%   { opacity: 0.9; }
  45%  { transform: translate(-50%, -50%) scale(2);   opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(2);   opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fx { display: none; }
}

/* The point being placed (type picked, landing spot not yet chosen): a
   pulsing ring says "waiting for you", and it lets clicks through to the map. */
.marker.preview {
  pointer-events: none;
  animation: markerPlacing 1.1s ease-in-out infinite;
}
@keyframes markerPlacing {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.75), 0 0 0 3px rgba(255, 255, 255, 0.0); }
  50%      { box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.75), 0 0 0 5px rgba(255, 255, 255, 0.55); }
}

/* Your own points: dashed ring, so they never get mistaken for the guide. */
.marker.mine {
  box-shadow: 0 0 0 2px #0f1216, 0 0 0 3.5px rgba(255, 255, 255, 0.85),
              0 2px 6px rgba(0, 0, 0, 0.5);
}
.marker.mine::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
/* In edit mode, points you cannot change are dimmed. */
.marker.locked,
body.editing .marker.locked { opacity: 0.45; cursor: pointer; }

.markerIcon {
  width: 13px;
  height: 13px;
  background: #11141a;
  -webkit-mask-image: var(--icon);
  mask-image: var(--icon);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  pointer-events: none;
}

body.editing .marker { cursor: grab; }
body.editing .marker:active { cursor: grabbing; }
body.editing { user-select: none; }

.targetHandle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: rgba(15, 18, 22, 0.85);
  cursor: grab;
  z-index: 7;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
  transition: transform 0.1s;
}
.targetHandle:hover { transform: scale(1.25); }
.targetHandle:active { cursor: grabbing; }

/* ---------- utility wheel ---------- */

.wheel {
  position: absolute;
  /* shift so the circle center (y=107 inside the svg) lands on the click */
  transform: translate(-50%, -107px);
  z-index: 30;
  display: none;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.8));
}
.wheel.open {
  display: block;
  animation: wheelIn 0.11s ease-out;
}
@keyframes wheelIn {
  from { opacity: 0; transform: translate(-50%, -107px) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -107px) scale(1); }
}

.wheelBg {
  fill: rgba(11, 13, 16, 0.9);
  stroke: rgba(70, 81, 93, 0.55);
  stroke-width: 1;
}

.wheelItem { cursor: pointer; }

.wheelSeg {
  fill: rgba(31, 36, 42, 0.92);
  stroke: rgba(9, 11, 14, 0.9);
  stroke-width: 1.5;
  transition: fill 0.09s;
}
.wheelItem:hover .wheelSeg {
  fill: color-mix(in srgb, var(--seg-color) 26%, rgba(31, 36, 42, 0.95));
  stroke: var(--seg-color);
}

/* CS2's own grenade icons, tinted via CSS mask */
.wheelIcon {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.09s;
  -webkit-mask-image: var(--icon);
  mask-image: var(--icon);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.wheelIcon.hot { opacity: 1; }

.wheelLabel {
  fill: var(--text-faint);
  font-family: "Barlow", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill 0.09s;
}
.wheelItem:hover .wheelLabel { fill: var(--text); }

.wheelHub {
  fill: rgba(16, 19, 23, 0.97);
  stroke: rgba(70, 81, 93, 0.7);
  stroke-width: 1.5;
  cursor: pointer;
  transition: stroke 0.09s;
}
.wheelHub:hover { stroke: var(--danger); }

.wheelHubHint {
  fill: var(--text-faint);
  font-family: "Barlow", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-anchor: middle;
  dominant-baseline: central;
}

.wheelHubName {
  font-family: "Barlow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-anchor: middle;
}

.coordReadout {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(10, 12, 15, 0.88);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: "Barlow", monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 5px 9px;
  display: none;
  z-index: 20;
}
.coordReadout.show { display: block; }

/* ---------- edit mode ---------- */

.editBanner {
  overflow: hidden;
  max-height: 0;
  margin: 0;
  padding: 0 13px;
  opacity: 0;
  background: rgba(222, 155, 53, 0.08);
  border: 1px solid rgba(222, 155, 53, 0.35);
  border-left: 3px solid var(--accent);
  color: #e8c68a;
  font-size: 13px;
  transition: max-height 0.18s ease-out, opacity 0.15s ease-out,
    padding 0.18s ease-out, margin 0.18s ease-out;
}
/* Slides down + fades in rather than popping into the layout. */
body.editing .editBanner {
  max-height: 60px;
  margin: 0 0 12px;
  padding: 9px 13px;
  opacity: 1;
}
body.editing .board { cursor: crosshair; }
body.picking .board { cursor: cell; }

/* ---------- modal ---------- */

.videoModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.82);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.videoModal.open { display: flex; animation: modalBackdropIn 0.15s ease-out; }

.videoBox {
  width: min(820px, 92vw);
  background: var(--bg-panel);
  border: 1px solid var(--line-bright);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
}
/* Dialogs fade + settle in rather than snapping open. */
.videoModal.open .videoBox { animation: modalBoxIn 0.15s ease-out; }
@keyframes modalBackdropIn {
  from { background-color: rgba(8, 10, 12, 0); }
  to { background-color: rgba(8, 10, 12, 0.82); }
}
@keyframes modalBoxIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.videoHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.videoHeader button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.videoHeader button:hover { color: var(--accent); }

.videoBody {
  aspect-ratio: 16 / 9;
  background: #000;
}
.videoBody video,
.videoBody iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.videoBody .noVideo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-faint);
  text-align: center;
  padding: 24px;
  font-size: 13px;
}

/* ---------- edit form ---------- */

.editBox { width: min(470px, 92vw); }

.editForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  padding: 18px;
}
.editForm label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}
.editForm label.wide { grid-column: 1 / -1; }
.editForm input,
.editForm select {
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: #14171b;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.editForm input:focus,
.editForm select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(222, 155, 53, 0.18);
}

.editCoords {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.5px;
}
.btnGhost {
  padding: 5px 12px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border-color 0.12s, color 0.12s, transform 0.08s;
}
.btnGhost:hover { border-color: var(--accent); color: var(--accent-hot); }
.btnGhost:active { transform: scale(0.96); }

.editActions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.editActions button {
  padding: 9px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  transition: filter 0.12s, background 0.12s, transform 0.08s;
}
.editActions button:active { transform: scale(0.97); }
.btnPrimary {
  background: var(--accent);
  color: #1a1408;
}
.btnPrimary:hover { background: var(--accent-hot); }
.btnDanger {
  background: transparent;
  border-color: var(--danger);
  color: #e08078;
  margin-right: auto;
}
.btnDanger:hover { background: rgba(180, 68, 60, 0.18); }

.editStatus {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #e08078;
  min-height: 16px;
}

.editHint {
  margin: 0;
  flex: none;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.4px;
}
.editHint strong { color: var(--text-dim); font-weight: 600; }
.editHint code {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 1px 6px;
  font-family: "Barlow", monospace;
}

/* ---------- video upload row (edit form) ---------- */

.uploadRow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
/* While a file is uploading, the whole row becomes the progress bar - a
   translucent fill that grows left to right, percentage overlaid. */
.uploadProgress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 23, 27, 0.7);
  z-index: 1;
}
.uploadProgress[hidden] { display: none; }
.uploadProgressFill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(222, 155, 53, 0.32);
  transition: width 0.1s linear;
}
.uploadProgressLabel {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-hot);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

/* ---------- inline preview in the edit form ---------- */

.fPreview {
  grid-column: 1 / -1;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: -4px;
  background: #000;
  border: 1px solid var(--line);
}
.fPreview video,
.fPreview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.uploadRow input[type="file"] {
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  border: 1px dashed var(--line-bright);
  background: #14171b;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: normal;
  text-transform: none;
}
.uploadRow input[type="file"]::file-selector-button {
  padding: 4px 9px;
  margin-right: 8px;
  border: 1px solid var(--line-bright);
  background: var(--bg-raised);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}
