:root {
  --bg: #0f1420;
  --panel: #1b2333;
  --panel-2: #232d42;
  --accent: #4f8cff;
  --accent-2: #34d399;
  --danger: #f87171;
  --text: #eef2f8;
  --muted: #97a3b6;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  height: 100%;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  transition: filter 0.15s ease;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.secondary { background: var(--panel-2); color: var(--text); }
button.danger { background: var(--danger); }
button.green { background: var(--accent-2); color: #05261b; }

input, select {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #33405c;
  background: var(--panel-2);
  color: var(--text);
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
}

.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0 0 8px 0; }

/* ---------- Zoomable map ---------- */
.map-viewport {
  position: relative;
  overflow: hidden;
  background: #0a0d14;
  touch-action: none;
  user-select: none;
  border-radius: var(--radius);
}

.map-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.map-stage img {
  display: block;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.pin {
  position: absolute;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -26px;
  transform-origin: 50% 100%;
  pointer-events: none;
}

.pin.answer { filter: drop-shadow(0 0 4px #34d39990); }
.pin.mine { filter: drop-shadow(0 0 4px #4f8cff90); }
.pin.other { opacity: 0.55; }

.pin svg { width: 100%; height: 100%; }

.zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #0009;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #cfd8e6;
  pointer-events: none;
}

/* ---------- Countdown timer ---------- */
.timer-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: #2a3348;
  overflow: hidden;
}
.timer-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--accent-2);
  transition: width 0.2s linear, background 0.2s linear;
}
.timer-bar-fill.low { background: var(--danger); }

.timer-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ---------- Final leaderboard ---------- */
.final-board { text-align: center; }
.final-board .rank-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  margin: 6px 0;
  font-size: 16px;
}
.final-board .rank-row.first {
  background: linear-gradient(90deg, #4a3b00, #6b5400);
  font-size: 20px;
  font-weight: 800;
}
