/* ladro.casa: el cierre de la ruta 3 (libreta). La sopa de letras la pintan los motores
 * de agua y lápiz (herramientas/sopa/render.js); aquí solo va el papel y el correo. */
:root {
  --papel: #fceed3;
  --tinta: #493d37;
  --vestido: #c44f4f;
  --tenue: rgba(73, 61, 55, 0.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--papel) url("/papel.jpg") center / 1400px auto repeat;
  color: var(--tinta);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
main {
  flex: 1;
  padding: 48px 16px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
h1 { margin: 0; width: min(100%, 600px); }
.sopa { display: block; width: 100%; height: auto; overflow: visible; mix-blend-mode: multiply; }
.sopa .letras text { font-family: "Archivo", sans-serif; font-weight: 600; font-size: 134px; text-anchor: middle; }
.sopa .rotulo { font-family: "Archivo", sans-serif; font-weight: 500; font-size: 68px; letter-spacing: 0.28em; text-anchor: middle; }

/* Crayolas: una hoja encima del papel y debajo de la sopa, para iluminar las casillas. */
#hoja {
  position: absolute;
  top: 0; left: 0;
  z-index: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  touch-action: none;
}
body.pintando #hoja { pointer-events: auto; cursor: crosshair; }
main, .pie { position: relative; z-index: 1; }
body.pintando main, body.pintando .pie { pointer-events: none; }
body.pintando #aviso, body.pintando .pie a { pointer-events: auto; }
.crayolas {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.crayola {
  width: 14px; height: 46px;
  padding: 0; border: 0;
  border-radius: 7px 7px 3px 3px;
  background: var(--c);
  transform: translateY(8px);
  transition: transform 0.15s;
  cursor: pointer;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.12);
}
.crayola:hover { transform: translateY(4px); text-decoration: none; }
.crayola[aria-pressed="true"] { transform: translateY(-4px); }
.crayola:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
@media (max-width: 700px) {
  .crayolas { position: relative; left: auto; bottom: auto; justify-content: center; padding: 0 16px 18px; }
}
.c-rojo { --c: #c34e4e; } .c-amarillo { --c: #e5c464; } .c-verde { --c: #c1bb5f; } .c-naranja { --c: #f8b178; } .c-cafe { --c: #4b3e39; }
.borrar {
  margin-left: 6px;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tenue);
  background: none;
}
.borrar:hover { color: var(--tinta); }
#aviso {
  width: min(100%, 360px);
  margin-top: clamp(28px, 5vh, 48px);
}
.pie {
  padding: 0 16px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--tenue);
}
.pie a { color: var(--tinta); text-decoration: none; }
.pie a:hover, .pie a:focus-visible { color: var(--vestido); text-decoration: underline; text-underline-offset: 3px; }
.fila { position: relative; display: flex; align-items: baseline; padding-bottom: 4px; }
.fila::after { /* raya a lápiz, del mismo motor que la cuadrícula */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 12px;
  background: url("/linea.png") center / 100% 100% no-repeat;
  pointer-events: none;
  transition: opacity 0.15s;
  opacity: 0.75;
}
input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--tinta);
  caret-color: var(--vestido);
}
input[type="email"]::placeholder { color: var(--tenue); }
input[type="email"]:focus { outline: none; }
.fila:focus-within::after { opacity: 1; }
button {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 0 10px 16px;
  border: 0;
  background: transparent;
  color: var(--vestido);
  cursor: pointer;
}
button:hover { text-decoration: underline; text-underline-offset: 4px; }
button:focus-visible { outline: 2px solid var(--vestido); outline-offset: 3px; border-radius: 2px; }
::selection { background: #e5c464; color: var(--tinta); }
button:disabled { opacity: 0.5; cursor: default; }
#mensaje { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; text-align: center; }
.oculto, .trampa {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.trampa { left: -9999px; }
