@font-face { font-family: "Cormorant"; src: url("/fuentes/cormorant-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fuentes/cormorant-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fuentes/inter-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root { --muro: #0d0c0b; --tinta: #f3efe8; --tinta-2: #c9c2b6; --tinta-3: #948d82; --oro: #b8996a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--muro); color: var(--tinta); font-family: "Inter", system-ui, sans-serif; }
canvas#sala { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
canvas#sala:active { cursor: grabbing; }

.entrada { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(13, 12, 11, .72); backdrop-filter: blur(6px); }
.entrada[hidden] { display: none; }
.entrada__caja { max-width: 440px; text-align: center; }
.rotulo { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--oro); }
h1 { font-family: "Cormorant", Georgia, serif; font-weight: 300; font-size: 52px; margin: 10px 0 8px; }
.entrada p { color: var(--tinta-2); line-height: 1.5; margin: 0 0 24px; }
.opciones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ayuda { list-style: none; padding: 0; margin: 24px 0 0; font-size: 14px; color: var(--tinta-3); line-height: 1.8; }
.ayuda b { color: var(--tinta-2); font-weight: 500; }

.boton { font: inherit; font-size: 15px; display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--tinta); background: var(--tinta); color: var(--muro); cursor: pointer; text-decoration: none; }
.boton[hidden] { display: none; }
.boton:disabled { opacity: .5; cursor: wait; }
.boton--linea { background: rgba(13, 12, 11, .55); color: var(--tinta); border-color: rgba(243, 239, 232, .35); backdrop-filter: blur(4px); }
.boton--linea:hover { border-color: var(--tinta); }

.barra { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 0 16px; pointer-events: none; }
.barra[hidden] { display: none; }
.barra > * { pointer-events: auto; font-size: 14px; padding: 10px 18px; }

.ficha { position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 12px; background: rgba(13, 12, 11, .6); backdrop-filter: blur(4px); text-align: center; pointer-events: none; max-width: calc(100% - 32px); }
.ficha[hidden] { display: none; }
.ficha .titulo { font-family: "Cormorant", Georgia, serif; font-size: 24px; }
.ficha .viva { color: var(--oro); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

body.grabando .entrada, body.grabando .barra, body.grabando .ficha { display: none !important; }
@media (pointer: coarse) { .solo-teclado { display: none; } }

/* flechas en pantalla: se mantienen apretadas para caminar y girar */
.cruz { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; user-select: none; -webkit-user-select: none; }
.cruz[hidden] { display: none; }
.flecha { font: inherit; font-size: 22px; border-radius: 14px; border: 1px solid rgba(243, 239, 232, .35); background: rgba(13, 12, 11, .55); color: var(--tinta); backdrop-filter: blur(4px); cursor: pointer; touch-action: none; -webkit-touch-callout: none; }
.flecha:active, .flecha.apretada { background: rgba(184, 153, 106, .55); border-color: var(--oro); }
.flecha--arriba { grid-column: 2; grid-row: 1; }
.flecha--izq { grid-column: 1; grid-row: 2; }
.flecha--abajo { grid-column: 2; grid-row: 2; }
.flecha--der { grid-column: 3; grid-row: 2; }

.pista { position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: 12px; background: rgba(13, 12, 11, .72); backdrop-filter: blur(4px); text-align: center; font-size: 14px; line-height: 1.5; color: var(--tinta-2); pointer-events: none; transition: opacity .8s; }
.pista[hidden] { display: none; }
.pista b { color: var(--tinta); font-weight: 500; }
.pista.apagada { opacity: 0; }

/* en el celular: los botones arriba, la ficha debajo y las flechas abajo al centro */
@media (max-width: 700px) {
  .barra { bottom: auto; top: max(12px, env(safe-area-inset-top)); }
  .barra > * { font-size: 13px; padding: 8px 14px; }
  .ficha { top: 116px; }
  .cruz { left: 50%; transform: translateX(-50%); grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); }
  .pista { bottom: 170px; }
}
body.grabando .cruz, body.grabando .pista { display: none !important; }
