* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a1a2e;
  --bg-light: #16213e;
  --accent: #0f3460;
  --primary: #e94560;
  --text: #eee;
  --text-dim: #999;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #ef4444;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-light);
  font-size: 13px;
  z-index: 1000;
}

.status-bar .title { font-weight: 600; }
.status-bar .player-ident {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}
.status-bar .status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.status-dot.online { background: var(--success); }

/* Map container */
.map-container {
  flex: 1;
  position: relative;
}

#map { width: 100%; height: 100%; }

/* Bottom toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-light);
  z-index: 1000;
}

.toolbar button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
}

.toolbar button:active { opacity: 0.7; }
.toolbar button.primary { background: var(--primary); }
.toolbar button.sync { background: var(--success); color: #000; }

/* Bottom navigation tabs */
.nav-tabs {
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--accent);
}

.nav-tabs button {
  flex: 1;
  padding: 20px 0;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}

.nav-tabs button.active {
  color: var(--primary);
  border-top: 2px solid var(--primary);
}

/* Join screen */
.join-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.join-screen h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.join-screen .event-name {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.join-screen .team-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 32px;
}

.join-screen input {
  width: 100%;
  max-width: 300px;
  padding: 14px 16px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-light);
  color: var(--text);
  font-size: 18px;
  text-align: center;
  outline: none;
}

.join-screen input:focus {
  border-color: var(--primary);
}

.join-screen .join-btn {
  width: 100%;
  max-width: 300px;
  margin-top: 16px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.join-screen .join-btn:disabled {
  opacity: 0.5;
}

.join-screen .loading {
  margin-top: 20px;
  color: var(--text-dim);
}

.join-screen .join-section {
  width: 100%;
  max-width: 320px;
  margin-top: 16px;
}

.join-screen .join-section-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.join-screen .team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.team-btn {
  padding: 10px 18px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-light);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.team-btn:hover {
  border-color: var(--primary);
  background: rgba(255,255,255,0.05);
}

.team-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.team-btn .team-meta {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 4px;
}

.team-btn.active .team-meta {
  opacity: 0.85;
}

.join-screen .pin-input {
  width: 140px;
  text-align: center;
  font-size: 20px;
  letter-spacing: 8px;
  padding: 10px 12px;
}

.join-screen .hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  opacity: 0.7;
}

/* Queue badge */
.queue-badge {
  background: var(--warning);
  color: #000;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* Player tooltip */
.player-tooltip {
  background: rgba(0,0,0,0.8) !important;
  border: none !important;
  color: #fff !important;
  font-size: 11px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

.player-tooltip::before {
  border-top-color: rgba(0,0,0,0.8) !important;
}

/* Leaflet overrides for dark theme */
.leaflet-control-zoom a {
  background: var(--bg-light) !important;
  color: var(--text) !important;
  border-color: var(--accent) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-light);
  color: var(--text);
  border-radius: 8px;
}

.leaflet-popup-tip { background: var(--bg-light); }

/* Pick location overlay */
.pick-instruction {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1001;
  display: flex;
  align-items: center;
}

/* Marker form panel */
.marker-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-light);
  border-radius: 12px 12px 0 0;
  padding: 10px 12px;
  z-index: 1002;
  max-height: 45vh;
  overflow-y: auto;
}

.marker-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.marker-close-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.category-btn.selected {
  background: var(--accent);
}

.category-icon {
  font-size: 14px;
  font-weight: bold;
}

.category-label {
  font-size: 8px;
  margin-top: 2px;
}

.marker-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}

.marker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.marker-photo-btn {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.photo-status {
  font-size: 12px;
  color: var(--text-dim);
}

.priority-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--warning);
  cursor: pointer;
}

.marker-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.marker-submit-btn:disabled {
  opacity: 0.5;
}

/* Team list */
/* Sub-tabs (Hráči / Frekvence) */
.sub-tabs {
  display: flex;
  background: var(--bg-light);
  border-bottom: 1px solid var(--accent);
}
.sub-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.sub-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.team-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Frequencies */
.freq-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.freq-section {
  padding: 8px 16px;
}
.freq-section h3 {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.freq-item {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.freq-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.freq-value {
  font-family: monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--success);
}
.freq-title {
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
}
.freq-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}
.freq-share {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--accent);
}
.freq-add {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
/* Missions */
.mission-card {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.mission-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mission-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}
.mission-status {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
}
.mission-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 4px 0;
}
.mission-tasks {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--accent);
}
.mission-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 13px;
}
.intel-item {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-left: 3px solid var(--success);
}

.freq-empty {
  color: var(--text-dim);
  font-size: 13px;
  padding: 8px 0;
}

.team-member {
  display: grid;
  grid-template-columns: 12px auto 1fr 36px 70px;
  align-items: center;
  gap: 0 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--accent);
  cursor: pointer;
}

.team-member:active { background: var(--accent); }
.team-member.me { background: rgba(233, 69, 96, 0.1); }

.member-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.member-dot.online { background: var(--success); }

.member-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-team {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}

.msg-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #fff;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.member-detail {
  text-align: right;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.member-lastseen {
  display: block;
  font-size: 11px;
  opacity: 0.6;
}

/* Settings */
.settings-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.settings-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--accent);
}

.settings-section h3 {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.settings-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  opacity: 0.7;
}

.settings-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

.settings-leave-btn {
  width: 100%;
  padding: 12px;
  background: var(--danger);
  border: none;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* Switch team modal */
.switch-team-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.switch-team-panel {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  max-height: 80vh;
  overflow-y: auto;
}

.switch-team-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}

.switch-team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.switch-team-option {
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.switch-team-option:not(:disabled):hover,
.switch-team-option:not(:disabled):active {
  border-color: var(--primary);
  background: rgba(51,136,255,0.1);
}

.switch-team-option.current {
  border-color: var(--success);
  opacity: 0.6;
  cursor: default;
}

.switch-team-option.new-team {
  border-style: dashed;
  color: var(--primary);
}

.switch-team-cancel {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

/* Chat section labels */
.chat-section-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px 4px;
  font-weight: 600;
}

/* Send option buttons */
.send-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 4px;
}
.send-option:active {
  background: rgba(51,136,255,0.15);
}

/* Measure tool */
.measure-label span {
  background: rgba(0,0,0,0.8);
  color: #e94560;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.measure-total span {
  background: rgba(233, 69, 96, 0.9);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* GPS status bar */
.gps-status {
  text-align: center;
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-light);
  color: var(--text-dim);
}
.gps-status.gps-waiting { color: var(--warning); }
.gps-status.gps-active { color: var(--success); }
.gps-status.gps-denied, .gps-status.gps-error, .gps-status.gps-unavailable { color: var(--danger); }
.gps-accuracy-good { color: var(--success) !important; }
.gps-accuracy-ok { color: #e6a817 !important; }
.gps-accuracy-poor { color: var(--warning) !important; }
.gps-accuracy-bad { color: var(--danger) !important; }

/* Radar enemy markers */
.enemy-tooltip {
  background: rgba(239, 68, 96, 0.9) !important;
  color: white !important;
  border: 1px solid #ef4444 !important;
  font-weight: 700;
  font-size: 11px;
}
.enemy-tooltip::before {
  border-top-color: rgba(239, 68, 96, 0.9) !important;
}

/* Radar warning banner (loud mode) */
.radar-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: rgba(239, 68, 96, 0.95);
  color: white;
  text-align: center;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 14px;
  animation: radar-pulse 2s ease-in-out infinite;
}
@keyframes radar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Search panel */
.search-panel {
  position: absolute;
  bottom: 170px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px;
  width: calc(100% - 32px);
  max-width: 360px;
}

.search-tab {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--accent);
  background: none;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.search-tab.active {
  background: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 6px;
}
.search-result-item {
  padding: 8px;
  border-bottom: 1px solid var(--accent);
  cursor: pointer;
}
.search-result-item:active { background: var(--accent); }
.search-result-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Center on me button */
.btn-center-me {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: var(--bg-light);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  touch-action: manipulation;
}
.btn-center-me:active {
  background: var(--primary);
}

/* Heading cone */
.heading-cone {
  background: none !important;
  border: none !important;
}

/* Popup delete button */
.popup-delete-btn {
  margin-top: 6px;
  padding: 4px 10px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* Marker detail card */
.marker-detail-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: var(--bg-light);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.marker-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.marker-card-cat {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
}

.marker-card-title {
  flex: 1;
  font-size: 16px;
}

.marker-card-title b { display: block; }

.marker-card-author {
  font-size: 12px;
  color: var(--text-dim);
}

.marker-card-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}

.marker-card-photo {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.marker-card-text {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.marker-card-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-edit-marker {
  flex: 1;
  padding: 8px;
  background: var(--accent);
  border: none;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-delete-marker {
  padding: 8px 16px;
  background: var(--danger);
  border: none;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-save-marker {
  width: 100%;
  padding: 10px;
  background: var(--success);
  border: none;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mc-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mc-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
}

.mc-cat-btn.selected {
  background: rgba(255,255,255,0.1);
}

/* Marker icon with label */
.marker-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  position: relative;
}
/* Tools menu */
.tools-menu {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: var(--bg-light);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.tools-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.tools-menu-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tools-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.tools-menu-item:active { background: var(--accent); }

.tools-icon { font-size: 20px; }

/* Grid converter rows */
.grid-row {
  margin-bottom: 8px;
}
.grid-row label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.grid-value {
  font-family: monospace;
  font-size: 14px;
  color: var(--text);
  padding: 4px 8px;
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  user-select: all;
}

.marker-icon-label {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  margin-top: 2px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.8);
}

/* Share compact panel */
.share-compact-panel {
  position: fixed;
  bottom: 115px;
  left: 0;
  right: 0;
  z-index: 1003;
  background: var(--bg-light);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 8px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.4);
}

.share-compact-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.share-tab {
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}

.share-tab.active {
  background: var(--accent);
  color: var(--text);
}

.share-section {
  padding: 4px 0;
}

/* Crosshair overlay */
.crosshair {
  position: absolute;
  top: calc(50% - 150px);
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}

/* Marker pulse animation for highlighted/urgent markers */
.marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.3);
  animation: pulse-ring 1.5s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Chat list */
.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--accent);
  cursor: pointer;
}
.chat-item:active { background: var(--accent); }

.chat-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
}

.chat-avatar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-light);
}

.chat-item-info { flex: 1; overflow: hidden; }
.chat-item-name { font-weight: 600; font-size: 14px; }
.chat-item-preview { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-meta { font-size: 11px; color: var(--text-dim); text-align: right; flex-shrink: 0; }

.chat-unread {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 4px;
}

/* Chat messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }

.chat-msg-sender { font-size: 11px; font-weight: 600; margin-bottom: 2px; }

.chat-msg-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg.mine .chat-msg-bubble { background: var(--accent); color: var(--text); border-bottom-right-radius: 4px; }
.chat-msg.theirs .chat-msg-bubble { background: var(--accent); color: var(--text); border-bottom-left-radius: 4px; }

.chat-msg-time { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.chat-msg-toggle-original { font-size: 10px; color: var(--text-dim); margin-top: 4px; cursor: pointer; font-style: italic; opacity: 0.7; }
.chat-msg-original { font-size: 11px; color: var(--text-dim); margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.1); font-style: italic; }

/* Chat input bar */
.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-light);
  border-top: 1px solid var(--accent);
}

/* Chat badge */
.chat-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Chat toast notification */
.chat-toast {
  position: fixed;
  top: 50px;
  left: 10px;
  right: 10px;
  z-index: 2000;
  background: rgba(22, 33, 62, 0.97);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}

.chat-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.chat-toast-from { font-size: 12px; font-weight: 700; color: var(--primary); }
.chat-toast-close { background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; }
.chat-toast-text { font-size: 14px; color: var(--text); }

/* Chat toast actions */
.chat-toast-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.chat-toast-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-accept {
  background: var(--success);
  color: #fff;
}

.toast-dismiss {
  background: var(--danger);
  color: #fff;
}

.chat-toast-text {
  cursor: pointer;
}
.chat-toast-text:active {
  opacity: 0.7;
}

.chat-toast-time {
  font-size: 11px;
  color: var(--text-dim);
}

/* Admin toast - gold border + gradient */
.chat-toast-admin {
  border-left-width: 5px;
  background: linear-gradient(135deg, var(--bg-light) 0%, rgba(255,215,0,0.1) 100%);
}

/* Chat send button */
.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send-btn:active { opacity: 0.7; }

/* === AR View === */
#ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  overflow: hidden;
}

#ar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#ar-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ar-object {
  position: absolute;
  text-align: center;
  pointer-events: none;
  transition: left 0.12s linear, top 0.12s linear, transform 0.12s linear;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.ar-reticle {
  width: 44px;
  height: 44px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: rgba(0,0,0,0.4);
  text-shadow: 0 0 8px currentColor, 0 0 16px currentColor;
  box-shadow: 0 0 12px currentColor, inset 0 0 8px rgba(0,0,0,0.3);
}

.ar-label {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
  margin-top: 2px;
}

.ar-distance {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  font-family: monospace;
}

#ar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10001;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ar-range-display {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10001;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: monospace;
}

#ar-nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: rgba(0,0,0,0.7);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#ar-nav-arrow {
  font-size: 40px;
  color: var(--warning);
  transition: transform 0.15s ease-out;
  text-shadow: 0 0 12px var(--warning);
}

#ar-nav-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#ar-nav-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

#ar-nav-dist {
  color: var(--warning);
  font-size: 20px;
  font-weight: 700;
  font-family: monospace;
}

.ar-edge-arrow {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
  transition: top 0.12s linear;
}

.ar-edge-arrow-icon {
  font-size: 20px;
  text-shadow: 0 0 8px currentColor;
  line-height: 1;
}

.ar-edge-arrow-label {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-edge-arrow-dist {
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  font-family: monospace;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.ar-edge-arrow.left {
  left: 6px;
  flex-direction: row;
}

.ar-edge-arrow.right {
  right: 6px;
  flex-direction: row-reverse;
}

/* Collapsible left toolbar */
.map-left-toolbar {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.map-left-toolbar .toolbar-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.2s, transform 0.2s;
}

.map-left-toolbar.collapsed .toolbar-buttons {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  position: absolute;
}

.map-left-toolbar .btn-center-me {
  position: relative;
  right: auto;
  bottom: auto;
}

.toolbar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.map-left-toolbar.collapsed .toolbar-toggle {
  transform: rotate(180deg);
}

/* Jammer overlay */
#jammer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#jammer-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0.4;
}

#jammer-text {
  position: relative;
  z-index: 1;
  text-align: center;
}

.jammer-title {
  font-size: 28px;
  font-weight: 800;
  color: #ff3333;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 20px #ff0000, 0 0 40px #ff000066;
  animation: jammer-blink 1.5s ease-in-out infinite;
}

.jammer-countdown {
  font-size: 18px;
  font-family: monospace;
  color: #ff6666;
  margin-top: 16px;
  text-shadow: 0 0 10px #ff000066;
}

@keyframes jammer-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
