:root {
  --fondo: #1d1f21;
  --panel: rgba(24, 26, 28, 0.92);
  --borde: rgba(255, 255, 255, 0.10);
  --texto: #e9e6e1;
  --tenue: #a29d95;
  --acento: #c9874f;
  --acento-texto: #1b1208;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fondo); color: var(--texto);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#lienzo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

button { font: inherit; color: var(--texto); background: rgba(255,255,255,0.07); border: 1px solid var(--borde);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; }
button:hover { background: rgba(255,255,255,0.13); }
button.primario, button.activo { background: var(--acento); color: var(--acento-texto); border-color: transparent; }

#panel { position: fixed; top: 12px; left: 12px; bottom: 12px; width: 290px; background: var(--panel);
  border: 1px solid var(--borde); border-radius: 10px; overflow-y: auto; backdrop-filter: blur(8px); z-index: 5;
  color-scheme: dark; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.22) transparent; }
#panel.oculto { display: none; }
#panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; }
#panel h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: 0.02em; }
#panel h1 a { color: inherit; text-decoration: none; }
#panel header button { border: 0; background: none; font-size: 20px; padding: 0 4px; }
#panel section { padding: 10px 14px; border-top: 1px solid var(--borde); }
#panel h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tenue); margin: 0 0 8px; font-weight: 600; }
#panel footer { padding: 10px 14px 14px; color: var(--tenue); font-size: 12px; border-top: 1px solid var(--borde); }
.botones { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.botones.chicos button { padding: 3px 8px; font-size: 12px; }
.interruptor { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; cursor: pointer; }
.deslizador { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.deslizador input { flex: 1; accent-color: var(--acento); }
.deslizador .cota { width: 72px; text-align: right; font-family: inherit; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--texto);
  background: rgba(255,255,255,0.05); border: 1px solid var(--borde); border-radius: 5px; padding: 2px 6px; }
.deslizador .cota:focus { outline: 1px solid var(--acento); }
.lista label { display: flex; align-items: center; gap: 8px; padding: 2px 0; cursor: pointer; }
.lista label small { margin-left: auto; color: var(--tenue); font-variant-numeric: tabular-nums; }
input[type=checkbox] { accent-color: var(--acento); }

.flotante { position: fixed; z-index: 6; background: var(--panel); }
#abrir-panel { top: 12px; left: 12px; font-size: 18px; display: none; }
body:has(#panel.oculto) #abrir-panel { display: block; }
#salir-paseo { top: 12px; right: 12px; }

#ficha { position: fixed; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); background: var(--panel);
  border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; z-index: 5; }
#ficha h3 { margin: 0 24px 8px 0; font-size: 14px; font-weight: 600; word-break: break-word; }
#ficha dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; }
#ficha dt { color: var(--tenue); }
#ficha dd { margin: 0; word-break: break-all; }
#cerrar-ficha { position: absolute; top: 6px; right: 6px; border: 0; background: none; font-size: 18px; }

#aviso { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--borde);
  padding: 8px 14px; border-radius: 8px; z-index: 7; }
#mira { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255,255,255,0.8); box-shadow: 0 0 0 1px rgba(0,0,0,0.5); z-index: 4; pointer-events: none; }
#ayuda-paseo { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--panel);
  border: 1px solid var(--borde); padding: 6px 12px; border-radius: 8px; font-size: 12px; z-index: 4; white-space: nowrap; }
#ayuda-paseo p { margin: 0; }
#joystick { position: fixed; left: 24px; bottom: 24px; width: 120px; height: 120px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); background: rgba(0,0,0,0.25); z-index: 4; pointer-events: none; }
#joystick span { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
  background: rgba(255,255,255,0.5); }

#carga { position: fixed; inset: 0; display: grid; place-items: center; background: var(--fondo); z-index: 10; }
#carga .caja { width: 260px; text-align: center; color: var(--tenue); }
#carga .barra { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
#carga .barra span { display: block; height: 100%; width: 0; background: var(--acento); transition: width .2s; }

@media (max-width: 700px) {
  #panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 55vh; }
  #abrir-panel { top: auto; bottom: 12px; }
  #ayuda-paseo { display: none !important; }
  #ficha { bottom: auto; top: 12px; right: 8px; }
}

#panel .ayuda { font-size: 12px; color: var(--tenue); margin: 8px 0 0; line-height: 1.35; }
