:root {
  --bg: #0a0612;
  --panel: #150a28;
  --panel2: #1d1036;
  --line: #3a1d6e;
  --fg: #ffffff;
  --muted: #c4b3f0;
  --dim: #8a78bf;
  --yellow: #fff200;
  --purple: #7f00ff;
  --magenta: #b11de1;
  --pink: #ff2e9a;
  --hot: #ff2e88;
  --blue: #3a2fd0;
  --blue2: #2700ff;
  --ok: #7cff4f;
  --grad: linear-gradient(135deg, #ff2e9a 0%, #b11de1 40%, #7f00ff 65%, #3a2fd0 100%);
  --display: "Montserrat", "Arial Black", "Segoe UI Black", Impact, sans-serif;
  --body: "Montserrat", "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  min-height: 100vh;
  min-height: 100dvh;
  background-image:
    radial-gradient(900px 640px at 0% 100%, rgba(177, 29, 225, .26), transparent 62%),
    radial-gradient(860px 620px at 100% 0%, rgba(39, 0, 255, .30), transparent 62%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--yellow); }
h1, h2, h3, .display { font-family: var(--display); font-weight: 900; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.yellow { color: var(--yellow); }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 56px; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 22px rgba(127, 0, 255, .55); }
.brand b { font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: .02em; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar .sp { flex: 1; }

/* ---------- neon frame ---------- */
.neon {
  position: relative;
  border-radius: 18px;
  padding: 3px;
  background: var(--grad);
  box-shadow: 0 0 26px rgba(127, 0, 255, .45), 0 0 4px rgba(255, 46, 154, .6);
}
.neon > .in { border-radius: 15px; background: var(--panel); overflow: hidden; height: 100%; }
.neon > img, .neon > .in > img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 15px; background: #000; }

.card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px; }
.card h2 { font-size: 20px; color: var(--yellow); margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }

/* ---------- buttons & inputs ---------- */
button, .btn {
  font-family: var(--body); font-weight: 800; font-size: 15px;
  border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--panel2); color: var(--fg);
  padding: 11px 18px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, border-color .15s, background .15s, opacity .15s;
  touch-action: manipulation;
}
button:hover, .btn:hover { border-color: var(--purple); }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--yellow); color: #0a0612; border-color: var(--yellow); }
.btn-primary:hover { border-color: #fff; }
.btn-grad { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 18px rgba(127, 0, 255, .5); }
.btn-danger { color: #ff8fa9; }
.btn-danger:hover { border-color: var(--hot); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 16px 26px; font-size: 18px; }
.btn-xl { padding: 20px 30px; font-size: 21px; width: 100%; }
button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

input, textarea, select {
  font-family: var(--body); font-size: 16px; color: var(--fg);
  background: #0f0820; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
label.f { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--yellow); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 800; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.pill.y { background: var(--yellow); color: #0a0612; border-color: var(--yellow); }
.pill.hot { background: rgba(255, 46, 136, .16); color: #ff9cc6; border-color: rgba(255, 46, 136, .5); }
.pill.ok { background: rgba(124, 255, 79, .12); color: var(--ok); border-color: rgba(124, 255, 79, .4); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 8px currentColor; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--panel2); border: 1.5px solid var(--purple); color: #fff; font-weight: 700;
  padding: 12px 20px; border-radius: 14px; z-index: 9999; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  max-width: calc(100vw - 32px);
}
.toast.err { border-color: var(--hot); }

/* ---------- ring timer ---------- */
.ring { position: relative; aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
.ring .track { stroke: #24123f; }
.ring .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; color: var(--yellow);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.ring.hot .num { color: var(--hot); }
.ring.done .num { color: var(--hot); }
.ring .bg { position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle, #1a0b33, #0d0619); }

/* ---------- map markers ---------- */
.mk-team { pointer-events: none; } /* maplibre positions the root absolutely */
.mk-team .pin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #0a0612; box-shadow: 0 0 0 2px #fff, 0 0 14px currentColor; background: currentColor; }
.mk-team .lbl {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: rgba(10, 6, 18, .88); color: #fff; font-weight: 800; font-size: 13px;
  padding: 3px 8px; border-radius: 8px; border: 1.5px solid currentColor; white-space: nowrap;
}
.mk-team .lbl span { color: #fff; }
.mk-correct { width: 46px; height: 46px; display: grid; place-items: center; pointer-events: none; }
.mk-correct .core {
  width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); border: 4px solid #0a0612;
  box-shadow: 0 0 0 3px var(--yellow), 0 0 26px 8px rgba(255, 242, 0, .6); display: grid; place-items: center;
  font-size: 18px; color: #0a0612; font-weight: 900;
}
.mk-correct::after {
  content: ""; position: absolute; left: 0; top: 0; width: 46px; height: 46px; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--yellow);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.mk-me .pin { width: 28px; height: 28px; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-group { background: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* pause icon drawn in CSS (the ⏸ glyph differs per device/font) */
.pi { display: inline-block; width: .62em; height: .74em; border-left: .22em solid currentColor; border-right: .22em solid currentColor; margin-right: .3em; vertical-align: -.06em; box-sizing: border-box; }
