/* ==========================================================================
   LAKE FLY · style.css
   Estética: tinta negra gruesa, papel, colores planos saturados, tramas de
   puntos y textura de papel. Los colores se inyectan desde js/config.js
   (CONFIG.ui.colors) como variables CSS --c-*.
   ========================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  --c-primary: #F2E21B;
  --c-primary-dark: #C9BA00;
  --c-accent: #E8452C;
  --c-accent-dark: #B8301B;
  --c-secondary: #FFFFFF;
  --c-secondary-dark: #E9E4D6;
  --c-ink: #111111;
  --c-panel: #FBF8EF;
  --c-panel-alt: #F1ECDD;
  --c-muted: #5E5A52;

  --font: "Futura", "Futura PT", "Century Gothic", "Avenir Next", "Jost", "Trebuchet MS", system-ui, sans-serif;
  --line: 3.5px;
  --shadow: 5px 5px 0 var(--c-ink);
  --shadow-lg: 8px 8px 0 var(--c-ink);
  /* Bordes "dibujados a mano": radios irregulares */
  --wobble: 18px 6px 16px 5px / 6px 16px 5px 18px;
  --wobble-2: 6px 20px 7px 16px / 16px 6px 18px 7px;
  --halftone: radial-gradient(var(--c-ink) 1.1px, transparent 1.5px);
  --t-screen: 320ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--c-ink);
  color: var(--c-ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}
button { font: inherit; color: inherit; }
kbd {
  display: inline-block;
  padding: 0 .4em;
  border: 2px solid currentColor;
  border-radius: 5px;
  font: 800 .8em/1.5 var(--font);
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 currentColor;
}
[hidden] { display: none !important; }

/* Textura de papel sobre toda la interfaz */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- 3. Escenario ---------- */
.app { position: fixed; inset: 0; }
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
}
.game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- 4. Pantallas ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) rotate(-.6deg);
  transition: opacity var(--t-screen) ease, transform var(--t-screen) cubic-bezier(.2, .9, .3, 1.3), visibility 0s linear var(--t-screen);
  z-index: 10;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--t-screen) ease, transform var(--t-screen) cubic-bezier(.2, .9, .3, 1.3), visibility 0s;
}
.screen--loading { background: var(--c-primary); z-index: 30; }
.screen--pause, .screen--over { background: rgba(17, 17, 17, .28); }
.screen--maps, .screen--settings { background: rgba(17, 17, 17, .22); }
.screen--ready { pointer-events: none; align-items: stretch; }
.screen--ready .tutorial { pointer-events: auto; }

/* ---------- 5. Logo ---------- */
.logo {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .28em;
  row-gap: .05em;
  font-size: clamp(56px, 14vmin, 128px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.logo__word { display: inline-flex; gap: .02em; white-space: nowrap; }
.logo__word span {
  display: inline-block;
  color: #fff;
  -webkit-text-stroke: .075em var(--c-ink);
  paint-order: stroke fill;
  text-shadow: .07em .07em 0 var(--c-ink);
  transform: translateY(var(--dy, 0)) rotate(var(--r, 0deg));
  animation: letter-bob 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -.35s);
}
.logo__word + .logo__word span { color: #F8D9D2; }
.logo--sm { font-size: clamp(44px, 11vmin, 84px); }
.logo-img { max-width: min(80vw, 520px); max-height: 30vh; display: block; margin: 0 auto; }
@keyframes letter-bob {
  0%, 100% { transform: translateY(var(--dy, 0)) rotate(var(--r, 0deg)); }
  50% { transform: translateY(calc(var(--dy, 0px) - 6px)) rotate(calc(var(--r, 0deg) * -1)); }
}
.brand { text-align: center; }
.brand__subtitle {
  display: inline-block;
  margin: 10px 0 0;
  padding: 4px 16px 6px;
  background: var(--c-ink);
  color: var(--c-primary);
  font-weight: 900;
  font-size: clamp(16px, 3.4vmin, 24px);
  letter-spacing: .25em;
  text-transform: uppercase;
  border-radius: var(--wobble-2);
  transform: rotate(-2deg);
}
.brand__tagline {
  margin: 0;
  font-weight: 700;
  font-size: clamp(14px, 2.4vmin, 18px);
  text-align: center;
  background: var(--c-panel);
  border: 2.5px solid var(--c-ink);
  padding: 4px 12px;
  border-radius: var(--wobble);
  transform: rotate(1deg);
}

/* ---------- 6. Botones ---------- */
.btn {
  --bg: var(--c-panel);
  --fg: var(--c-ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 22px;
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble);
  background: var(--bg);
  color: var(--fg);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s;
  touch-action: manipulation;
}
.btn:hover { transform: translate(-2px, -2px) rotate(-.6deg); box-shadow: 7px 7px 0 var(--c-ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--c-ink); }
.btn:focus-visible, .icon-btn:focus-visible, .map-card:focus-visible, .setting:focus-visible {
  outline: 3px dashed var(--c-ink);
  outline-offset: 4px;
}
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0 var(--c-ink);
  background-image: var(--halftone);
  background-size: 6px 6px;
  opacity: .55;
}
.btn--primary { --bg: var(--c-accent); --fg: #fff; }
.btn--primary:hover { --bg: #F0573C; }
.btn--paper { --bg: var(--c-panel); }
.btn--paper:hover { --bg: var(--c-primary); }
.btn--danger { --bg: var(--c-accent); --fg: #fff; }
.btn--ghost { --bg: transparent; box-shadow: none; border-style: dashed; }
.btn--ghost:hover { box-shadow: none; --bg: var(--c-panel-alt); }
.btn--lg { min-height: 58px; font-size: 20px; }
.btn--xl { min-height: 72px; font-size: 30px; padding: 12px 34px; letter-spacing: .12em; }
.btn--primary.btn--xl { animation: cta-wiggle 3s ease-in-out infinite; }
@keyframes cta-wiggle {
  0%, 86%, 100% { transform: rotate(0); }
  90% { transform: rotate(-2.5deg) scale(1.03); }
  95% { transform: rotate(2deg) scale(1.03); }
}
.btn--xl:hover { animation: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: var(--line) solid var(--c-ink);
  border-radius: 50% 46% 52% 44% / 46% 52% 44% 50%;
  background: var(--c-panel);
  color: var(--c-ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--c-ink);
  transition: transform .12s, box-shadow .12s, background-color .15s;
  touch-action: manipulation;
}
.icon-btn:hover { background: var(--c-primary); transform: translate(-1px, -1px) rotate(-4deg); }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--c-ink); }
.icon-btn.is-off { background-image: var(--halftone); background-size: 6px 6px; }
.icon-btn .ico, .setting .ico { display: inline-grid; place-items: center; }
.corner-btn { position: absolute; top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); }

/* ---------- 7. Paneles y piezas ---------- */
.panel {
  background: var(--c-panel);
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble-2);
  box-shadow: var(--shadow-lg);
  padding: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--c-panel);
  border: 2.5px solid var(--c-ink);
  border-radius: 999px 900px 999px 950px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip--ink { background: var(--c-ink); color: var(--c-primary); }
.chip__swatch {
  width: 18px; height: 18px;
  border: 2.5px solid var(--c-ink);
  border-radius: 50%;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 2px solid var(--c-ink);
  border-radius: 6px 3px 7px 3px;
  background: var(--c-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.progress {
  position: relative;
  height: 16px;
  border: 2.5px solid var(--c-ink);
  border-radius: 999px 900px 999px 950px;
  background: var(--c-panel);
  overflow: hidden;
}
.progress--lg { height: 22px; width: min(320px, 70vw); margin: 22px auto 10px; }
.progress--sm { height: 11px; border-width: 2px; }
.progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background-color: var(--c-primary);
  background-image: var(--halftone);
  background-size: 6px 6px;
  border-right: 2.5px solid var(--c-ink);
  transition: width .9s cubic-bezier(.2, .8, .2, 1);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.stats > div {
  text-align: center;
  padding: 6px 4px;
  border: 2.5px solid var(--c-ink);
  border-radius: var(--wobble);
  background: #fff;
}
.stats dt { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); }
.stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 900; line-height: 1; }
.next-unlock { font-size: 14px; font-weight: 700; }
.next-unlock__head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hint { margin: 12px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--c-muted); }
.note { margin: 14px 4px 0; font-size: 13px; color: var(--c-muted); }
.note--warn { color: var(--c-accent-dark); font-weight: 800; }

/* ---------- 8. Menú ---------- */
.menu {
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2.2vh, 18px);
  padding: 6px 8px 12px;
  scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.menu__actions { width: 100%; display: grid; gap: 14px; }
.menu__actions .btn--xl { width: 100%; }
.menu__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.menu__info { width: 100%; }
.menu__keys {
  margin: 0;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--c-panel);
  border: 2px solid var(--c-ink);
  border-radius: 8px;
  text-align: center;
}

/* ---------- 9. HUD ---------- */
.hud {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: start;
  padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity .25s, transform .25s;
}
.hud.is-visible { opacity: 1; transform: none; }
.hud > * { pointer-events: auto; }
.hud__pause { transition: opacity .2s, transform .12s; }
.hud__pause.is-hidden { opacity: 0; pointer-events: none; }
.hud__score {
  justify-self: center;
  pointer-events: none;
  font-size: clamp(56px, 11vmin, 92px);
  font-weight: 900;
  line-height: 1;
}
.hud__score span {
  display: inline-block;
  color: #fff;
  -webkit-text-stroke: .09em var(--c-ink);
  paint-order: stroke fill;
  text-shadow: .06em .06em 0 var(--c-ink);
}
.hud__score span.is-pulse { animation: score-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes score-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35) rotate(-6deg); }
  100% { transform: scale(1); }
}
.hud__shields { justify-self: end; display: flex; gap: 4px; pointer-events: none; }
.shield { color: var(--c-primary); display: inline-grid; transition: transform .3s, opacity .3s; }
.shield svg { filter: drop-shadow(2px 2px 0 var(--c-ink)); }
.shield.is-used { opacity: .35; transform: scale(.8) rotate(-15deg); color: #fff; }
body[data-screen="pause"] .hud { opacity: .4; }

/* ---------- 10. Preparado ---------- */
.ready {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: clamp(80px, 14vh, 130px);
}
.ready__top { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tutorial { width: 100%; transform: rotate(-.8deg); }
.tutorial__title { margin: 0 0 10px; font-size: 22px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.tutorial__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.tutorial__list li { display: flex; gap: 10px; align-items: flex-start; }
.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 2.5px solid var(--c-ink);
  border-radius: 50%;
  background: var(--c-primary);
  font-weight: 900;
  font-size: 14px;
}
.tap-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: clamp(70px, 16vh, 150px); }
.tap-hint__hand { animation: tap 1s ease-in-out infinite; transform-origin: 50% 80%; }
.tap-hint__text {
  padding: 6px 16px 8px;
  background: var(--c-ink);
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--wobble);
  transform: rotate(-2deg);
}
@keyframes tap {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(8px) scale(.92); }
}

/* ---------- 11. Diálogos (pausa, game over, modal) ---------- */
.panel--dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: 100%;
  overflow: auto;
  text-align: center;
  padding: 24px 22px;
  scrollbar-width: none;
}
.dialog-title {
  margin: 0 0 16px;
  font-size: clamp(34px, 7vmin, 48px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.dialog-title--sm { font-size: 28px; }
.panel--over .dialog-title { font-size: clamp(26px, 5.4vmin, 38px); margin-bottom: 12px; }
.stack { display: grid; gap: 12px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.kicker { margin: 0 0 6px; font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.over-score {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 30px 10px;
  background: var(--c-primary);
  border: var(--line) solid var(--c-ink);
  border-radius: 50% 46% 52% 44% / 46% 52% 44% 50%;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.over-score__label { font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.over-score__value { font-size: clamp(56px, 12vmin, 80px); font-weight: 900; line-height: 1; }
.stats--over { margin-top: 18px; }
.stamp {
  position: absolute;
  top: 14px;
  right: -6px;
  padding: 8px 12px;
  background: var(--c-accent);
  color: #fff;
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(12deg);
  box-shadow: 3px 3px 0 var(--c-ink);
  animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) .5s both;
}
@keyframes stamp { from { transform: rotate(30deg) scale(2.2); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: 1; } }
.unlock-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 12px;
  padding: 10px 12px;
  background: var(--c-ink);
  color: var(--c-primary);
  font-weight: 800;
  border-radius: var(--wobble-2);
  animation: unlock-in .6s cubic-bezier(.2, 1.6, .4, 1) .3s both;
}
@keyframes unlock-in { from { transform: scale(.6) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.screen--over .panel--over { animation: none; }
.screen--over.is-active .panel--over { animation: drop-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes drop-in { from { transform: translateY(-40px) rotate(4deg); } to { transform: none; } }

.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(17, 17, 17, .45);
  background-image: radial-gradient(rgba(17, 17, 17, .5) 1.2px, transparent 1.6px);
  background-size: 7px 7px;
  opacity: 0;
  transition: opacity .2s;
}
.modal.is-open { opacity: 1; }
.modal__box { transform: scale(.9); transition: transform .2s cubic-bezier(.2, 1.4, .4, 1); }
.modal.is-open .modal__box { transform: none; }
.modal__text { margin: 0; font-weight: 600; line-height: 1.4; }

/* ---------- 12. Hojas (mapas / ajustes) ---------- */
.sheet {
  width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  background: var(--c-panel);
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sheet--narrow { width: min(480px, 100%); max-height: 100%; height: fit-content; align-self: center; }
.sheet__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: var(--line) solid var(--c-ink);
  background: var(--c-primary);
}
.sheet__title { margin: 0; font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.sheet__badge {
  margin-left: auto;
  padding: 6px 12px;
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--wobble);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sheet__badge b { color: var(--c-primary); font-size: 18px; }
.scrollable { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }

.map-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 18px;
  padding: 18px;
  align-content: start;
}
.map-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  background: #fff;
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  touch-action: manipulation;
}
.map-card:nth-child(even) { border-radius: var(--wobble-2); }
.map-card:hover { transform: translate(-2px, -3px) rotate(-.8deg); box-shadow: 8px 8px 0 var(--c-ink); }
.map-card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--c-ink); }
.map-card.is-selected { background: var(--c-primary); }
.map-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--map-sky, #ccc);
  border-bottom: var(--line) solid var(--c-ink);
  overflow: hidden;
}
.map-thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
.map-card__lock {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  background-color: rgba(17, 17, 17, .55);
  background-image: radial-gradient(rgba(17, 17, 17, .8) 1.3px, transparent 1.7px);
  background-size: 6px 6px;
}
.map-card__lock svg { width: 34px; height: 34px; }
.map-card__lock b { padding: 2px 10px; background: var(--c-accent); border: 2.5px solid var(--c-ink); border-radius: 999px; font-size: 14px; letter-spacing: .06em; }
.map-card.is-locked .map-card__lock { display: flex; }
.map-card.is-locked .map-thumb { filter: grayscale(1) contrast(1.1); }
.map-card.is-locked { background: var(--c-panel-alt); }
.map-card__selected {
  position: absolute;
  top: 8px; left: 8px;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 6px;
  background: var(--c-ink);
  color: var(--c-primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.map-card.is-selected .map-card__selected { display: inline-flex; }
.map-card__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.map-card__code { font-size: 11px; font-weight: 900; letter-spacing: .16em; color: var(--c-muted); }
.map-card__name { margin: 0; font-size: 24px; font-weight: 900; line-height: 1; text-transform: uppercase; }
.map-card__desc { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 500; flex: 1; }
.map-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; }
.map-card.is-shake { animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-2deg); }
  40% { transform: translateX(7px) rotate(2deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

.settings { padding: 16px; display: grid; gap: 12px; }
.setting {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  background: #fff;
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble);
  box-shadow: 3px 3px 0 var(--c-ink);
  font-weight: 800;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background-color .15s;
  touch-action: manipulation;
}
.setting:hover { background: var(--c-primary); }
.setting:active { transform: translate(3px, 3px); box-shadow: none; }
.setting__label { flex: 1; }
.setting .state {
  min-width: 44px;
  padding: 2px 10px;
  border: 2.5px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-primary);
  text-align: center;
  font-weight: 900;
}
.setting.is-off .state { background: #fff; background-image: var(--halftone); background-size: 5px 5px; }
.setting--danger { color: var(--c-accent-dark); }
.setting--danger:hover { background: var(--c-accent); color: #fff; }
.setting--danger .state { background: #fff; color: var(--c-ink); }

/* ---------- 13. Carga y avisos ---------- */
.loading { text-align: center; }
.loading__text { margin: 0; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.toasts {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
}
.toast {
  padding: 9px 16px;
  background: var(--c-panel);
  border: var(--line) solid var(--c-ink);
  border-radius: var(--wobble);
  box-shadow: 4px 4px 0 var(--c-ink);
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  animation: toast-in .35s cubic-bezier(.2, 1.5, .4, 1);
  transition: opacity .35s, transform .35s;
}
.toast--unlock { background: var(--c-primary); }
.toast.is-leaving { opacity: 0; transform: translateY(10px); }
@keyframes toast-in { from { transform: translateY(20px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 16px; background: #fff; text-align: center; }

/* ---------- 14. Adaptación ---------- */
@media (max-width: 480px) {
  .btn { font-size: 16px; padding: 10px 14px; }
  .btn--xl { font-size: 26px; min-height: 66px; }
  .sheet__title { font-size: 24px; }
  .sheet__badge { font-size: 11px; padding: 5px 8px; }
  .stats dd { font-size: 22px; }
  .hud { grid-template-columns: 56px 1fr 56px; }
}
/* Móvil en horizontal: pantallas bajas */
@media (max-height: 520px) {
  .menu { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 24px; }
  .menu .brand { grid-column: 1; grid-row: 1 / span 2; }
  .brand__tagline, .menu__keys { display: none; }
  .menu__actions { grid-column: 2; }
  .menu__info { grid-column: 2; padding: 12px; }
  .logo { font-size: clamp(48px, 20vh, 110px); }
  .btn--xl { min-height: 56px; font-size: 24px; }
  .stats { margin: 8px 0; }
  .ready { padding-top: 62px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
  .tutorial { padding: 12px 14px; }
  .tutorial__list { font-size: 13px; gap: 5px; }
  .tap-hint { margin-bottom: 8px; }
  .panel--dialog { padding: 16px; }
  .dialog-title { margin-bottom: 10px; }
  .stats--over { margin-top: 10px; }
}
/* Pantallas táctiles: ocultamos las pistas de teclado */
@media (hover: none) and (pointer: coarse) {
  .menu__keys, .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
