:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
  min-height: 64px;
}
.header h1 {
  font-size: 22px;
  font-weight: 600;
  flex: 1;
}
.header-meta {
  font-size: 13px;
  color: var(--text-secondary);
}
.back-btn {
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

.content {
  flex: 1;
  padding: 8px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-content {
  padding: 8px 16px 4px;
}

.map-wrapper {
  position: relative;
  flex: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--bg-tertiary);
  background: var(--bg-tertiary);
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #1C1E21;
}

#map-canvas:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus-ring), 0 0 16px var(--focus-glow);
}

.map-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: var(--accent-primary);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  opacity: 0.7;
}

.map-attribution {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(10, 10, 15, 0.75);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.coords-bar {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary {
  background: var(--accent-primary);
  color: #0a0a0f;
}
.nav-item.primary:focus { background: #33ddff; }

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 2px solid transparent;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.3;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-top: 4px;
}
.card-value.small {
  font-size: 16px;
  font-weight: 600;
}

.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  flex: 1;
}
.error-icon { font-size: 48px; }
.error-message {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 400px;
}

.refresh-btn {
  width: 100%;
  margin-top: auto;
}

.hidden { display: none !important; }
