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

body {
  background: #0a0a0a;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

#canvas {
  display: block;
  cursor: grab;
}

#canvas:active {
  cursor: grabbing;
}

/* Toolbar */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
}

.toolbar h1 {
  flex: 1;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.view-only-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 13px;
  color: #888;
}

/* Stats bar */
#stats {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #888;
  display: flex;
  gap: 20px;
  z-index: 100;
}

#stats span span {
  color: #fff;
}

/* Image details panel (read-only) */
.panel {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: 320px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  overflow-y: auto;
  padding: 20px;
}

.panel.hidden {
  display: none;
}

.panel .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.panel .close-btn:hover {
  color: #fff;
}

.panel h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
}

.panel img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 16px;
}

.panel-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-title {
  font-size: 16px;
  font-weight: 500;
}

.info-description {
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
}

.panel-meta {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Error state */
.error-state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  background: #0a0a0a;
  z-index: 300;
}

.error-state.hidden {
  display: none;
}

.error-state h2 {
  font-size: 24px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 12px;
}

.error-state p {
  color: #888;
  font-size: 16px;
  margin-bottom: 24px;
}

.error-state .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.error-state .btn:hover {
  background: #4f46e5;
}
