* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; font-family: sans-serif; font-size: 13px; }

#map {
  height: 100%;
  width: calc(100% - 240px);
  margin-left: 240px;
}

#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  z-index: 900;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header */
#sidebar-header {
  padding: 14px;
  border-bottom: 1px solid #e0e0e0;
}
#sidebar-header h3 { font-size: 16px; margin-bottom: 4px; }

/* Auth section */
.auth-section {
  padding: 12px 14px;
  border-bottom: 1px solid #e0e0e0;
}

.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
}
.auth-form button[type="submit"] {
  padding: 7px 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.auth-form button[type="submit"]:hover { background: #1d4ed8; }

.auth-toggle {
  background: none; border: none;
  color: #2563eb; cursor: pointer;
  font-size: 11px; padding: 0;
  text-decoration: underline;
}

.auth-error {
  color: #c0392b;
  font-size: 11px;
  margin-top: 2px;
}

/* User info */
.user-info { display: flex; flex-direction: column; gap: 6px; }
.user-info .username { font-weight: 600; font-size: 14px; }
.user-info .currency { font-size: 12px; color: #666; }
.user-info .currency span { color: #d4a84b; font-weight: 600; }
.btn-signout {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 11px;
}
.btn-signout:hover { background: #eee; }

/* Cell panel */
.cell-panel {
  padding: 12px 14px;
  border-bottom: 1px solid #e0e0e0;
}
.cell-panel h4 { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.cell-panel .close-btn {
  background: none; border: none;
  cursor: pointer; font-size: 16px; color: #999;
}
.cell-panel .close-btn:hover { color: #333; }
.cell-info { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.cell-info .label { color: #888; font-size: 10px; text-transform: uppercase; }

.btn-capture {
  margin-top: 8px;
  padding: 8px 12px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
}
.btn-capture:hover { background: #15803d; }

.capture-error {
  color: #c0392b;
  font-size: 11px;
  margin-top: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 6px;
}
.badge-own { background: #dcfce7; color: #16a34a; }
.badge-other { background: #fef2f2; color: #ef4444; }

/* Status */
#status {
  padding: 6px 14px;
  font-size: 11px;
  color: #555;
  border-bottom: 1px solid #e0e0e0;
  min-height: 28px;
}

/* Legend */
#legend {
  padding: 10px 14px;
  flex: 1;
}
#legend h4 { font-size: 12px; margin-bottom: 6px; color: #333; }
.legend-row { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.legend-swatch {
  width: 13px; height: 13px;
  border-radius: 2px; flex-shrink: 0;
}
.legend-dot {
  width: 11px; height: 11px;
  border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.3);
}
