/* Artifact.gg — Core Design System */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Share+Tech+Mono&family=Exo+2:wght@300;400;600&display=swap');

:root {
  --sidebar-width: 215px;
  --bg:            #0a0b0d;
  --bg-elevated:   #0f1114;
  --sidebar-bg:    #0d0f12;
  --accent:        #00ff88;
  --accent-dim:    rgba(0,255,136,0.4);
  --colonist:      #ff4444;
  --colonist-dim:  rgba(255,68,68,0.35);
  --reyab:         #00ccee;
  --reyab-dim:     rgba(0,204,238,0.35);
  --text:          #e8eaed;
  --text-muted:    #6b7280;
  --text-dim:      #3d444d;
  --border:        rgba(255,255,255,0.07);
  --border-subtle: rgba(255,255,255,0.04);
  --font-display:  'Bebas Neue', 'Share Tech Mono', monospace;
  --font-mono:     'Share Tech Mono', 'Courier New', monospace;
  --font-body:     'Exo 2', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button  { cursor: pointer; font-family: inherit; border: none; outline: none; }
button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
input[type=text], input[type=number] { font-family: var(--font-mono); }
code {
  font-family: var(--font-mono); font-size: 0.9em; color: var(--accent);
  background: rgba(0,255,136,0.08); padding: 1px 4px; border-radius: 2px;
}

/* ── App shell ── */
#app     { display: flex; height: 100vh; width: 100vw; overflow: hidden; }
#main    { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#content { flex: 1; display: flex; overflow: hidden; min-height: 0; }

/* ── Map Viewer ── */
#map-viewer {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: stretch; justify-content: stretch;
  background: var(--bg);
}
#map-viewer::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px; pointer-events: none; z-index: 0;
}

/* Zoom viewport — fills the map area, clips overflow */
#zoom-viewport {
  flex: 1; position: relative; overflow: hidden;
  z-index: 1;
}


#map-canvas-wrap {
  /* Size is set by JS after map loads and never changes with viewport.
     All zoom/pan is handled by CSS transform only. */
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
  /* Fallback size before JS sets it */
  width: 1200px;
  height: 720px;
}

#map-image {
  width: 100%; height: 100%; object-fit: contain;
  display: none; -webkit-user-select: none; user-select: none;
  pointer-events: none;
}

#map-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* Map canvas — replaces <img> for display; JS sizes it to zoom×dpr for sharpness */
#map-canvas {
  position: absolute; top: 0; left: 0;
  z-index: 1; pointer-events: none;
  -webkit-user-select: none; user-select: none;
  display: none;
}

/* Draw canvas — no CSS width/height; natural size set by JS, scaled by wrap transform */
#draw-canvas {
  position: absolute; top: 0; left: 0;
  cursor: crosshair; z-index: 10; touch-action: none;
}
#draw-canvas[data-tool="erase"] { cursor: cell; }

/* Players SVG — sits above draw canvas */
#players-svg {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: visible; z-index: 20;
  pointer-events: none;
}

#map-meta { display: none; }

/* ── Top-right controls container ── */
#top-right-controls {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 8px;
  z-index: 100;
}

#btn-discord {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 4px;
  background: rgba(10,11,13,0.85);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background 0.12s, border-color 0.12s;
  text-decoration: none;
}
#btn-discord:hover {
  background: rgba(88,101,242,0.2);
  border-color: rgba(88,101,242,0.6);
}
#btn-discord img {
  width: 20px; height: 20px; object-fit: contain;
  display: block;
}

/* ── Bottom-right controls container ── */
#bottom-right-controls {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  z-index: 100;
}

/* ── Zoom controls ── */
#zoom-controls {
  display: flex; align-items: center; gap: 6px;
  background: rgba(10,11,13,0.85);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 8px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.zoom-btn {
  width: 22px; height: 22px; border-radius: 3px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
  font-family: monospace; padding-bottom: 1px;
}
.zoom-btn:hover { background: rgba(0,255,136,0.1); color: var(--accent); border-color: var(--accent-dim); }
.zoom-level {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  letter-spacing: 1px; min-width: 36px; text-align: center;
}

/* ── Placeholders ── */
.placeholder-map-container {
  width: min(680px, 90%); aspect-ratio: 16/10;
  border: 1px solid rgba(0,255,136,0.25);
  border: 1px solid color-mix(in srgb, var(--map-color, #00ff88) 25%, transparent);
  background: rgba(0,0,0,0.4); position: relative;
  overflow: hidden; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
}
.placeholder-scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,0,0,0.18) 3px,rgba(0,0,0,0.18) 6px);
}
.placeholder-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
.placeholder-content {
  position: relative; z-index: 1; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.placeholder-map-name { font-family: var(--font-display); font-size: 72px; letter-spacing: 12px; color: var(--map-accent,#00ff88); opacity: 0.15; line-height: 1; }
.placeholder-map-env  { font-family: var(--font-mono); font-size: 10px; letter-spacing: 4px; color: var(--map-color,#00ff88); opacity: 0.5; margin-top: -10px; }
.placeholder-instruction { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); padding: 6px 14px; background: rgba(0,0,0,0.4); }
.blink-cursor { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.placeholder-sites, .placeholder-callouts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.site-badge { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; padding: 3px 10px; background: rgba(0,255,136,0.08); border: 1px solid rgba(0,255,136,0.25); color: var(--accent); border-radius: 2px; }
.callout-tag { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; padding: 2px 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-muted); border-radius: 2px; }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-box {
  background: #0f1215; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  overflow: hidden; animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { transform: scale(0.96) translateY(6px); opacity: 0; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}
.modal-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 3px; color: var(--accent); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 2px; transition: color 0.12s; }
.modal-close:hover { color: var(--text); }

/* Colour picker */
.colour-picker-box { width: 240px; }
.colour-picker-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
#colour-wheel { display: block; border-radius: 50%; cursor: crosshair; align-self: center; border: 1px solid var(--border); }
.brightness-row { display: flex; flex-direction: column; gap: 5px; }
.picker-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 2px; color: var(--text-muted); }
.brightness-track-wrap { position: relative; height: 16px; }
#brightness-strip { display: block; border-radius: 3px; width: 100%; height: 16px; cursor: pointer; }
.strip-handle { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 10px; height: 20px; background: white; border-radius: 3px; border: 2px solid rgba(0,0,0,0.5); box-shadow: 0 0 4px rgba(0,0,0,0.6); pointer-events: none; left: 100%; }
.rgb-sliders { display: flex; flex-direction: column; gap: 6px; }
.rgb-row { display: flex; align-items: center; gap: 8px; }
.rgb-label { font-family: var(--font-mono); font-size: 11px; font-weight: bold; width: 12px; flex-shrink: 0; }
.rgb-label-r { color: #ff5555; }
.rgb-label-g { color: #55ff88; }
.rgb-label-b { color: #5588ff; }
.rgb-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px; cursor: pointer; outline: none; background: rgba(255,255,255,0.15); }
.rgb-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: white; cursor: pointer; border: 2px solid rgba(0,0,0,0.4); }
.rgb-num { width: 40px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text); font-size: 11px; text-align: center; padding: 2px 4px; border-radius: 2px; }
.rgb-num:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.hex-row { display: flex; align-items: center; gap: 6px; }
.colour-preview { width: 28px; height: 28px; border-radius: 3px; border: 1px solid var(--border); flex-shrink: 0; background: #00ff88; }
.hex-hash { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.hex-input { flex: 1; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text); font-size: 12px; padding: 4px 8px; border-radius: 2px; text-transform: uppercase; letter-spacing: 1px; }
.hex-input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.confirm-btn { width: 100%; padding: 8px; background: rgba(0,255,136,0.12); border: 1px solid var(--accent); color: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; border-radius: 3px; cursor: pointer; transition: background 0.14s; }
.confirm-btn:hover { background: rgba(0,255,136,0.22); }

/* Shortcuts */
.settings-box { width: 400px; }
.shortcuts-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 80vh; overflow-y: auto; }
.shortcut-group { display: flex; flex-direction: column; gap: 5px; }
.shortcut-group-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 3px; color: var(--accent); opacity: 0.7; padding-bottom: 5px; border-bottom: 1px solid var(--border-subtle); }
.shortcut-row { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); padding: 2px 0; }
.shortcut-row span { flex: 1; }
.shortcut-row--stacked { flex-direction: column; align-items: flex-start; gap: 4px; }
.shortcut-row--stacked-lg { flex-direction: column; align-items: flex-start; gap: 8px; }
.shortcut-group-label--amber { color: #f59e0b; }
.modal-version-label { color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; }
.modal-desc-text { color: var(--text-muted); font-size: 10px; line-height: 1.7; }
.modal-progress-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.modal-progress-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; opacity: 0.8; animation: blink 1.2s step-end infinite; }
.modal-progress-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 2px; color: #f59e0b; opacity: 0.7; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); border-radius: 3px; border-bottom-width: 2px; font-family: var(--font-mono); font-size: 10px; color: var(--text); }

/* ══════════════════════════════════════════
   TEXT BOXES
══════════════════════════════════════════ */
.tbox {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 3px;
  z-index: 30;
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
  min-width: 80px;
  min-height: 32px;
}
.tbox--selected {
  border-color: rgba(0,255,136,0.6);
  box-shadow: 0 0 0 1px rgba(0,255,136,0.12);
}
.tbox:not(.tbox--selected):hover {
  border-color: rgba(255,255,255,0.1);
}
.tbox-text {
  display: block; width: 100%; height: 100%;
  background: transparent; border: none; outline: none;
  resize: none; color: #fff;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.5;
  padding: 6px 8px; caret-color: var(--accent); cursor: text;
  overflow: hidden;
}
.tbox-text::placeholder { color: rgba(255,255,255,0.2); }

.tbox-handle {
  position: absolute; width: 10px; height: 10px;
  background: var(--accent); border: 1px solid #000;
  border-radius: 2px; z-index: 2;
  opacity: 0; pointer-events: none; transition: opacity 0.1s;
}
.tbox--selected .tbox-handle { opacity: 1; pointer-events: auto; }

.tbox-handle--nw { top:-5px; left:-5px;           cursor: nw-resize; }
.tbox-handle--n  { top:-5px; left:calc(50% - 5px); cursor: n-resize;  }
.tbox-handle--ne { top:-5px; right:-5px;           cursor: ne-resize; }
.tbox-handle--e  { top:calc(50% - 5px); right:-5px; cursor: e-resize;  }
.tbox-handle--se { bottom:-5px; right:-5px;        cursor: se-resize; }
.tbox-handle--s  { bottom:-5px; left:calc(50% - 5px); cursor: s-resize; }
.tbox-handle--sw { bottom:-5px; left:-5px;         cursor: sw-resize; }
.tbox-handle--w  { top:calc(50% - 5px); left:-5px;  cursor: w-resize;  }

/* Scrollbars */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ══════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════ */
#top-bar {
  height: 38px; flex-shrink: 0;
  display: flex; align-items: center;
  gap: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 0 8px;
  min-width: 0;
}
#top-bar::-webkit-scrollbar { height: 3px; }
#top-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Keep mode tabs left-aligned, push actions to the right with a spacer */
#mode-tabs { display: flex; gap: 2px; flex-shrink: 0; margin-right: auto; padding-right: 8px; }
#top-bar-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }


.mode-tab {
  padding: 5px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 2px;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.mode-tab:hover  { background: rgba(255,255,255,0.05); color: var(--text); }
.mode-tab.active {
  background: rgba(0,255,136,0.1);
  border-color: var(--accent-dim);
  color: var(--accent);
}


.top-action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.top-action-btn:hover {
  background: rgba(0,255,136,0.08);
  border-color: var(--accent-dim);
  color: var(--accent);
}
.top-action-btn svg { flex-shrink: 0; }
.top-action-btn img { flex-shrink: 0; display: block; opacity: 0.7; transition: opacity 0.12s; }
.top-action-btn:hover img { opacity: 1; }

/* ── Mode panels ── */
.mode-panel { display: none; flex: 1; overflow: hidden; }
.mode-panel.active { display: flex; }

/* Animation filler */
#animation-filler {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.anim-filler-content {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: var(--text-muted);
}
.anim-filler-icon { opacity: 0.4; }
.anim-filler-title {
  font-family: var(--font-display); font-size: 28px; letter-spacing: 6px;
  color: var(--text-muted); opacity: 0.5;
}
.anim-filler-sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 3px;
  opacity: 0.35;
}

/* ══════════════════════════════════════════
   SELECTION & DRAG PREVENTION
══════════════════════════════════════════ */
/* Prevent text selection and image drag across the whole map area */
#zoom-viewport, #map-canvas-wrap {
  -webkit-user-select: none;
  user-select: none;
}
/* Player node numbers must not be selectable */
.player-group text {
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   BRUSH PREVIEW CURSOR
══════════════════════════════════════════ */
#brush-preview {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  display: none;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  transition: width 0.06s, height 0.06s;
}

/* ══════════════════════════════════════════
   STATE IMPORT / EXPORT MODALS
══════════════════════════════════════════ */
.state-modal-box { width: 480px; }
.state-modal-body {
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.state-modal-hint {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px;
  color: var(--text-muted); line-height: 1.6;
}
.state-code-area {
  width: 100%; height: 120px; resize: vertical;
  background: rgba(0,0,0,0.4); border: 1px solid var(--border);
  border-radius: 3px; color: var(--accent);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px;
  padding: 8px; outline: none; line-break: anywhere;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.state-code-area::-webkit-scrollbar { width: 4px; }
.state-code-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.state-code-area:focus { border-color: var(--accent-dim); }
.state-import-error {
  font-family: var(--font-mono); font-size: 10px; color: #ff6060;
  background: rgba(255,60,60,0.08); border: 1px solid rgba(255,60,60,0.25);
  border-radius: 3px; padding: 6px 10px;
  display: none;
}

/* ── CLEAR ALL BUTTON ── */
.clear-all-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,11,13,0.85);
  border: 1px solid var(--border); border-radius: 4px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, opacity 0.12s;
  opacity: 0.75;
  padding: 0;
}
.clear-all-btn:hover {
  border-color: rgba(255,85,85,0.6);
  background: rgba(255,85,85,0.1);
  opacity: 1;
}
.clear-all-icon {
  width: 18px; height: 18px;
  object-fit: contain;
  display: block;
  filter: brightness(0.8);
  transition: filter 0.12s;
}
.clear-all-btn:hover .clear-all-icon { filter: brightness(1) sepia(1) saturate(4) hue-rotate(-20deg); }

/* ── CHANGELOG MODAL ── */
#changelog-modal { display: none; }
#changelog-modal[aria-hidden="false"],
#changelog-modal.open { display: flex; }

/* ── HEADER BTN ROW ── */
.header-btn-row { display: flex; gap: 4px; align-items: center; }

/* ═══ ANIMATION MODE + TIMELINE ═══ */

/* animation mode panel is empty — timeline overlays the map-viewer */
#mode-animation { display: none; }
#mode-animation.active {
  display: flex !important;
} /* nothing here; overlay handles it */

/* ── Timeline panel — fixed overlay on map-viewer ── */
#timeline-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 80;
  background: rgba(8,12,8,0.88);
  border-top: 1px solid rgba(0,255,136,0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  height: 82px;
  animation: tl-slide-up 0.25s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes tl-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header row ── */
.tl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 4px;
  height: 34px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tl-ctrl-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  color: rgba(255,255,255,0.75);
  height: 22px;
  min-width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
  transition: background 0.12s, color 0.12s;
  padding: 0 6px;
  flex-shrink: 0;
}
.tl-ctrl-btn:hover { background: rgba(0,255,136,0.12); color: #00ff88; border-color: rgba(0,255,136,0.3); }
.tl-play { width: 28px; padding: 0; }

.tl-time-display {
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  letter-spacing: 2px;
  color: #00ff88;
  min-width: 44px;
  flex-shrink: 0;
}
.tl-frame-counter {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}
.tl-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  white-space: nowrap;
}
.tl-header-spacer { flex: 1; }

/* ── Track / ruler area ── */
.tl-track-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}
.tl-ruler-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Playhead ── */
.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  pointer-events: all;
  cursor: ew-resize;
  z-index: 2;
  transform: translateX(-50%);
}
.tl-playhead-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #00ff88;
  color: #000;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  box-shadow: 0 1px 6px rgba(0,255,136,0.4);
  cursor: ew-resize;
  -webkit-user-select: none;
  user-select: none;
}
.tl-playhead-stem {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: #00ff88;
  box-shadow: 0 0 4px rgba(0,255,136,0.5);
}

/* ═══ EXPORT MODAL — dual action buttons ═══ */
.state-modal-actions {
  display: flex;
  gap: 8px;
}
.state-modal-actions .confirm-btn { flex: 1; }
.confirm-btn--alt {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: rgba(255,255,255,0.6) !important;
}
.confirm-btn--alt:hover {
  background: rgba(0,255,136,0.08) !important;
  border-color: rgba(0,255,136,0.3) !important;
  color: #00ff88 !important;
}
/* ══════════════════════════════════════════
   PLAYER LEGEND
══════════════════════════════════════════ */
#player-legend {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 60;
  background: rgba(8, 10, 12, 0.82);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  min-width: 100px;
  max-width: 200px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}

.legend-num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: bold;
  min-width: 13px;
  text-align: right;
  opacity: 0.75;
  flex-shrink: 0;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ══════════════════════════════════════════
   TOAST NOTIFICATION
══════════════════════════════════════════ */
#artifact-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(10,14,10,0.92);
  border: 1px solid rgba(0,255,136,0.35);
  color: var(--accent); font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 1.5px; padding: 8px 20px;
  border-radius: 3px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  z-index: 9999; pointer-events: none; opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease; white-space: nowrap;
}
#artifact-toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
#artifact-toast.toast-hide { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* ══════════════════════════════════════════
   COMMUNITY STRATS BUTTON — WIP STYLE
══════════════════════════════════════════ */
.top-action-btn--wip {
  border-color: rgba(245,158,11,0.3) !important;
  color: rgba(245,158,11,0.7) !important; position: relative;
}
.top-action-btn--wip::after {
  content: '🚧'; font-size: 8px; position: absolute;
  top: -4px; right: -4px; line-height: 1;
}
.top-action-btn--wip:hover {
  background: rgba(245,158,11,0.08) !important;
  border-color: rgba(245,158,11,0.6) !important;
  color: rgba(245,158,11,1) !important;
}

/* ══════════════════════════════════════════
   SIMULATION MODE — COMING SOON SCREEN
══════════════════════════════════════════ */
.sim-coming-soon {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg); position: relative; overflow: hidden;
}
.sim-coming-soon::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px; pointer-events: none;
}
.sim-coming-soon::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0,255,136,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.sim-cs-inner {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; gap: 14px; text-align: center;
}
.sim-cs-icon { color: var(--accent); opacity: 0.45; animation: sim-spin 18s linear infinite; }
@keyframes sim-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sim-cs-title {
  font-family: var(--font-display); font-size: 32px; letter-spacing: 8px;
  color: var(--text); opacity: 0.35; line-height: 1;
}
.sim-cs-sub {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 6px;
  color: var(--accent); opacity: 0.7; margin-top: -6px;
  animation: sim-pulse 2.8s ease-in-out infinite;
}
@keyframes sim-pulse { 0%,100%{opacity:0.4} 50%{opacity:0.9} }
.sim-cs-desc {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px;
  line-height: 1.8; color: var(--text-muted); opacity: 0.55;
  max-width: 340px; margin-top: 4px;
}
.sim-cs-badge {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 3px;
  color: var(--accent); border: 1px solid var(--accent-dim);
  background: rgba(0,255,136,0.06); padding: 4px 14px;
  border-radius: 2px; margin-top: 4px; opacity: 0.8;
}

/* ══════════════════════════════════════════
   MAP THUMBNAIL SKELETON / SHIMMER
══════════════════════════════════════════ */
.map-list-thumb--loading { position: relative; overflow: hidden; }
.map-list-thumb--loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }