/* Wplace.live exact layout */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #0c0c10;
  color: #e0e0e5;
  overflow: hidden;
  height: 100vh;
}

.app { position: fixed; inset: 0; }

.map-container {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  cursor: grab;
  background: #0f0f14;
}
.map-container.dragging { cursor: grabbing; }

.canvas-layer {
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
}
.canvas-layer canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(12,12,16,0.92);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
}

.top-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.version {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.zoom-btn {
  width: 32px;
  height: 24px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.zoom-btn:hover { background: rgba(255,255,255,0.12); }

.paint-btn, .help-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.paint-btn:hover, .help-btn:hover { background: rgba(255,255,255,0.12); }

.paint-panel {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 220px;
  background: rgba(18,18,24,0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px;
  z-index: 101;
  backdrop-filter: blur(12px);
}
.paint-panel.hidden { display: none; }
.paint-panel:not(.hidden) { display: block; }

.paint-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.close-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
}
.close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.cooldown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cooldown-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.cooldown-fill {
  height: 100%;
  background: #6366f1;
  width: 100%;
  transition: width 0.15s;
}

#cooldownText {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  min-width: 36px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.palette-color {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
}
.palette-color:hover { transform: scale(1.08); }
.palette-color.selected {
  border-color: #fff;
  box-shadow: 0 0 0 1px #000;
}

.status-badge {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(18,18,24,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  z-index: 100;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.status-dot.connected { background: #22c55e; }
.status-dot.disconnected { background: #ef4444; }

@media (max-width: 500px) {
  .top-bar { padding: 0 10px; }
  .title { font-size: 13px; }
  .version { display: none; }
  .paint-panel { width: calc(100% - 32px); left: 16px; }
}
