/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: 'Pixelify Sans', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg,
    hsl(0,85%,65%),
    hsl(60,85%,65%),
    hsl(120,85%,65%),
    hsl(180,85%,65%),
    hsl(240,85%,65%),
    hsl(300,85%,65%),
    hsl(360,85%,65%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.stats-bar {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  transition: all 0.2s;
  white-space: nowrap;
}
.header-btn:hover { border-color: var(--accent); color: var(--accent); }

.help-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  transition: all 0.2s;
  white-space: nowrap;
}
.help-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Beta counter ── */
.beta-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,255,136,0.07);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 8px;
  padding: 5px 12px;
  white-space: nowrap;
  font-size: 11px;
  flex-shrink: 0;
}
.beta-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 700;
}
.beta-remaining { color: var(--text-dim); }
.beta-remaining strong { color: var(--accent); font-weight: 700; }
.beta-bar-track {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.beta-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00cc6a);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.beta-full-state {
  border-color: rgba(255,51,102,0.3);
  background: rgba(255,51,102,0.07);
}
.beta-full { color: var(--accent2); font-weight: 700; }

/* ── Pixel search ── */
.pixel-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.pixel-search:focus-within { border-color: var(--accent); }

.pixel-search-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 7px 12px;
  width: 200px;
  outline: none;
}
.pixel-search-input::placeholder { color: var(--text-dim); opacity: 0.55; }

.pixel-search-btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 12px;
  font-size: 14px;
  transition: all 0.15s;
  line-height: 1;
}
.pixel-search-btn:hover { color: var(--accent); background: rgba(0,255,136,0.07); }

/* ── Canvas Area ── */
.canvas-wrap {
  position: fixed;
  top: 60px; left: 220px; right: 300px; bottom: 0;
  overflow: hidden;
  background: #050508;
  cursor: crosshair;
}

.canvas-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  image-rendering: pixelated;
}

#legendaryCanvas {
  pointer-events: none;
}

.zoom-controls {
  position: absolute;
  bottom: 16px; left: 16px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.zoom-btn {
  width: 36px; height: 36px;
  background: rgba(18,18,26,0.9);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s;
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }

.block-nav-arrow {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  padding-bottom: 2px; /* optical vertical centering for ‹ › glyphs */
}

.block-display {
  height: 36px;
  background: rgba(18,18,26,0.9);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 10px;
  min-width: 64px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  cursor: ns-resize;
  user-select: none;
}
.block-display:hover { border-color: var(--accent); color: var(--accent); }

/* ── Corner pixel coordinates ── */
.corner-coord {
  position: absolute;
  background: rgba(18,18,26,0.78);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  pointer-events: none;
  z-index: 10;
  line-height: 1.4;
}
.corner-coord.tl { top: 8px;    left: 8px;    }
.corner-coord.br { bottom: 56px; right: 8px;   } /* above zoom controls row */

.coords-display {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(18,18,26,0.9);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  z-index: 10;
  white-space: nowrap;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 60px; right: 0;
  width: 300px; bottom: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* ── Brush ── */
.brush-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brush-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.brush-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.brush-value {
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

/* ── Selection ── */
.selection-info {
  background: var(--surface2);
  border-radius: 10px;
  padding: 14px;
}

.selection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
}
.selection-row span:first-child { color: var(--text-dim); }
.selection-row span:last-child  { font-weight: 700; }
.selection-row.total-row {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.buy-btn {
  width: 100%;
  padding: 14px;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--accent), #00cc6a);
  color: #000;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: none;
  border-radius: 10px;
  transition: all 0.2s;
}
.buy-btn:hover    { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,255,136,0.3); }
.buy-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

.clear-btn {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.clear-btn:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── Revenue bar ── */
.revenue-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}
.revenue-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: #000;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 24px;
  border-radius: 10px;
  z-index: 2000;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Mobile menu button (hidden on desktop) ── */
.mobile-menu-btn {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.mobile-menu-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mobile nav panel (hidden on desktop) ── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 52px;
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  flex-direction: column;
  gap: 6px;
  z-index: 98;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.mobile-nav.open { display: flex; }
.mobile-nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 10px 14px;
  border-radius: 6px;
  text-align: left;
  transition: all 0.15s;
}
.mobile-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.mobile-search { width: 100%; }
.mobile-search .pixel-search-input { width: 0; flex: 1; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .canvas-wrap    { left: 0; right: 0; bottom: 50%; touch-action: none; }
  .sidebar        { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 50%; }
  .stats-bar      { display: none; }
  .feed-col       { display: none; }
  .header .pixel-search { display: none; }
  #statsBtn       { display: none; }
  #findFirstBtn   { display: none; }
  .help-btn       { display: none; }
  .mobile-menu-btn { display: flex; align-items: center; }
  .header          { padding: 8px 12px; gap: 8px; justify-content: flex-start; }
  .logo            { font-size: 18px; flex-shrink: 0; }
  .beta-counter    { font-size: 10px; padding: 4px 8px; flex: 1; min-width: 0; overflow: hidden; }
  .beta-bar-track  { display: none; }
  .beta-remaining  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .header-actions  { gap: 6px; flex-shrink: 0; margin-left: auto; }
  .header-btn      { font-size: 10px; padding: 5px 8px; }
  .coords-display { display: none; }
  .corner-coord   { display: none; }
  .block-display,
  #blockPrev,
  #blockNext      { display: none; }
}
