:root { color-scheme: dark; --bg:#0b1020; --panel:#111827; --panel2:#172033; --text:#e5e7eb; --muted:#94a3b8; --line:#273449; --accent:#38bdf8; --good:#22c55e; --warn:#f59e0b; --bad:#ef4444; }
* { box-sizing: border-box; }
body { margin:0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at top left, #172554 0, #0b1020 34%, #050816 100%); color:var(--text); }
.map-builder-shell { min-height:100vh; padding:18px; }
.map-builder-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; padding:16px 18px; border:1px solid var(--line); border-radius:20px; background:rgba(15,23,42,.88); box-shadow:0 20px 70px rgba(0,0,0,.28); }
.map-builder-header h1 { margin:0 0 6px; font-size:26px; }
.map-builder-header p { margin:0; color:var(--muted); max-width:980px; line-height:1.45; }
a { color:#bfdbfe; text-decoration:none; }
nav { display:flex; gap:10px; flex-wrap:wrap; }
nav a, button { border:1px solid rgba(148,163,184,.28); border-radius:12px; background:#1f2937; color:var(--text); padding:9px 12px; cursor:pointer; font-weight:700; }
button:hover, nav a:hover { border-color:var(--accent); }
button.good { background:#14532d; border-color:#22c55e55; }
button.secondary { background:#111827; }
button.active, .mode.active { background:#075985; border-color:#38bdf8; }
.builder-layout { display:grid; grid-template-columns: 330px minmax(480px, 1fr) 360px; gap:14px; align-items:stretch; }
.builder-panel, .builder-canvas-panel { border:1px solid var(--line); border-radius:20px; background:rgba(15,23,42,.93); box-shadow:0 20px 70px rgba(0,0,0,.25); }
.builder-panel { padding:14px; max-height:calc(100vh - 132px); }
.scrollable { overflow:auto; }
.panel-block { padding:12px; border:1px solid rgba(148,163,184,.16); border-radius:16px; background:rgba(17,24,39,.72); margin-bottom:12px; }
.panel-block h2 { margin:0 0 10px; font-size:15px; letter-spacing:.01em; }
label { display:block; color:var(--muted); font-size:12px; margin:8px 0; }
input, select, textarea { width:100%; background:#060b16; color:var(--text); border:1px solid #334155; border-radius:10px; padding:8px 10px; font:inherit; }
textarea { min-height:310px; resize:vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px; line-height:1.4; }
.grid-two { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.grid-three { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.actions-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.mode-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.mode { text-align:left; font-size:12px; }
.hint, .small { color:var(--muted); font-size:12px; line-height:1.45; }
.small-list { color:var(--muted); padding-left:20px; font-size:12px; line-height:1.45; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.checkline { display:flex; gap:6px; align-items:center; height:36px; }
.checkline input { width:auto; }
.swatch-row { display:flex; align-items:center; gap:8px; }
.swatch { width:22px; height:22px; border-radius:6px; border:1px solid #64748b; display:inline-block; background:#334155; }
.builder-canvas-panel { display:flex; flex-direction:column; min-height:calc(100vh - 132px); overflow:hidden; }
.canvas-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px; border-bottom:1px solid var(--line); background:rgba(15,23,42,.96); }
.canvas-toolbar span { color:var(--muted); font-size:13px; }
.canvas-wrap { flex:1; overflow:auto; padding:18px; background:linear-gradient(45deg, rgba(15,23,42,.7), rgba(2,6,23,.8)); }
#mapCanvas { image-rendering: pixelated; background:#050816; border:1px solid #334155; border-radius:12px; box-shadow:0 15px 50px rgba(0,0,0,.45); }
.validation-box { font-size:12px; line-height:1.45; color:var(--muted); }
.validation-box .ok { color:#86efac; }
.validation-box .warn { color:#fcd34d; }
.validation-box .bad { color:#fca5a5; }
.right-panel { min-width:0; }
code { color:#bae6fd; background:#0f172a; border:1px solid #1e293b; padding:1px 4px; border-radius:6px; }
@media (max-width: 1220px) { .builder-layout { grid-template-columns:1fr; } .builder-panel { max-height:none; } .builder-canvas-panel { min-height:640px; } }
.asset-mini-wrap { max-height: 280px; overflow: auto; border: 1px solid #334155; border-radius: 12px; background:#020617; padding: 8px; margin: 8px 0; }
#vendorCanvas { image-rendering: pixelated; background:#020617; border-radius: 8px; }
#tileMappingBox, #spriteMappingBox { min-height: 120px; }
.asset-builder-block { border-color: rgba(56,189,248,.35); }
.preset-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.preset { font-size:12px; text-align:left; background:#0f172a; border-color:rgba(148,163,184,.24); }
.preset:hover { border-color:#a78bfa; }
.recipe-box { border:1px solid rgba(167,139,250,.35); background:rgba(88,28,135,.18); border-radius:12px; padding:10px; margin-top:10px; }

/* v0.6.8 polish: selection/object manager */
button.danger { background:#7f1d1d; border-color:#ef444455; }
button.danger:hover { border-color:#ef4444; }
.object-manager-block { border-color: rgba(34,197,94,.35); }
.object-list { display:flex; flex-direction:column; gap:6px; max-height:240px; overflow:auto; padding-right:4px; }
.object-list-item { width:100%; display:flex; justify-content:space-between; gap:8px; align-items:center; text-align:left; padding:8px 10px; border-radius:10px; border:1px solid rgba(148,163,184,.18); background:#0f172a; color:var(--text); font-size:12px; }
.object-list-item:hover { border-color:#38bdf8; }
.object-list-item.active { background:#073047; border-color:#38bdf8; }
.object-list-item .kind { color:#93c5fd; font-weight:800; min-width:62px; }
.object-list-item .meta { color:var(--muted); font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:11px; white-space:nowrap; }
.selected-panel-block { border-color: rgba(250,204,21,.35); }
.selected-info { font-size:12px; line-height:1.45; color:var(--muted); padding:8px 10px; border:1px solid rgba(148,163,184,.16); border-radius:12px; background:rgba(2,6,23,.35); margin-bottom:10px; }
.compact-actions button { font-size:12px; padding:8px 10px; }
.nudge-pad { display:grid; grid-template-columns: repeat(3, 42px); grid-template-areas: '. up .' 'left . right' '. down .'; gap:6px; justify-content:center; margin:10px 0 4px; }
.nudge-pad button { padding:8px; }
.nudge-pad button[data-nudge="0,-1"] { grid-area:up; }
.nudge-pad button[data-nudge="-1,0"] { grid-area:left; }
.nudge-pad button[data-nudge="1,0"] { grid-area:right; }
.nudge-pad button[data-nudge="0,1"] { grid-area:down; }
.validation-box button.validation-item { display:block; width:100%; text-align:left; margin:4px 0; padding:7px 9px; border-radius:10px; background:#0f172a; border:1px solid rgba(148,163,184,.16); font-weight:500; }
.validation-box button.validation-item:hover { border-color:#38bdf8; }
.validation-box button.validation-item.bad { color:#fca5a5; border-color:rgba(239,68,68,.28); }
.validation-box button.validation-item.warn { color:#fcd34d; border-color:rgba(245,158,11,.25); }
.validation-box button.validation-item.ok { color:#86efac; border-color:rgba(34,197,94,.2); cursor:default; }
.validation-box .validation-meta { display:block; color:#94a3b8; font-size:11px; margin-top:2px; }

/* v0.6.9 export and multi-map helpers */
.export-instructions {
  border: 1px solid rgba(56,189,248,.28);
  background: rgba(8,47,73,.28);
  border-radius: 12px;
  padding: 10px;
  color: #bfdbfe;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.export-instructions strong { color: #e0f2fe; }
.export-instructions ul { margin: 6px 0 0; padding-left: 18px; }
.transition-edit-box{margin-top:12px;padding:10px;border:1px solid rgba(56,189,248,.25);border-radius:14px;background:rgba(15,23,42,.65)}
.transition-edit-box h3{margin:.1rem 0 .35rem;font-size:1rem;color:#bae6fd}

/* v1.5.2 Map Studio polish */
.hidden-select { display:none; }
.map-studio-block { border-color: rgba(56,189,248,.42); }
.map-card-list { display:flex; flex-direction:column; gap:8px; max-height:250px; overflow:auto; margin:8px 0; padding-right:4px; }
.map-card { display:block; width:100%; text-align:left; padding:10px 11px; border-radius:14px; background:#0f172a; border:1px solid rgba(148,163,184,.22); }
.map-card strong { display:block; color:#e5e7eb; font-size:13px; }
.map-card span { display:block; color:#93c5fd; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:11px; margin-top:3px; }
.map-card small { display:block; color:#94a3b8; margin-top:4px; }
.map-card.active { background:#082f49; border-color:#38bdf8; box-shadow:0 0 0 1px rgba(56,189,248,.18) inset; }
.map-status-box { border:1px solid rgba(56,189,248,.26); background:rgba(8,47,73,.22); border-radius:14px; padding:10px; font-size:12px; line-height:1.55; color:#cbd5e1; }
.status-pill { display:inline-block; border:1px solid rgba(148,163,184,.24); background:#0f172a; border-radius:999px; padding:2px 7px; margin:5px 4px 0 0; color:#cbd5e1; font-size:11px; }
.status-pill.ok { border-color:rgba(34,197,94,.35); color:#86efac; }
.status-pill.warn { border-color:rgba(245,158,11,.42); color:#fcd34d; }
.building-generator-block { border-color: rgba(167,139,250,.38); }
.object-filter-row { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; }
.object-filter { padding:6px 8px; border-radius:999px; font-size:11px; background:#0f172a; }
.object-filter.active { background:#075985; border-color:#38bdf8; }
.object-list-item.has-problem { border-color:rgba(239,68,68,.45); background:rgba(127,29,29,.18); }
.small-list-box { max-height:190px; }
.map-overview-strip { border-top:1px solid var(--line); background:rgba(15,23,42,.92); padding:10px 12px; display:flex; gap:14px; align-items:center; }
#miniMapCanvas { width:180px; image-rendering:pixelated; background:#020617; border:1px solid #334155; border-radius:10px; }
button[data-spawn-id], button[data-transition-key] { font-weight:600; }
@media (max-width: 1220px) { .map-overview-strip { flex-direction:column; align-items:flex-start; } }
