:root {
  --tinta: #f6ead2;
  --tinta-suave: #d8c6a4;
  --fondo: #1d1712;
  --papel: #f3e6c8;
  --papel-tinta: #2b1f16;
  --acento: #e8a33d;
  --peligro: #e2553a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--tinta); font-family: var(--sans); overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas#lienzo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; cursor: pointer; }

#globos { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.globo {
  position: absolute; left: 0; top: 0; max-width: 220px; padding: 6px 11px 7px;
  background: var(--papel); color: var(--papel-tinta); border-radius: 12px; font: 600 15px/1.25 var(--serif);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35); white-space: nowrap; transition: opacity .2s;
}
.globo::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--papel); border-bottom: 0; }
.globo.grito { background: #fff4d6; font-size: 17px; }
.globo.chico { font-size: 13px; padding: 4px 9px; }

.velo {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(ellipse at center, rgba(29, 23, 18, .55), rgba(16, 12, 9, .92));
  z-index: 20;
}
.velo[hidden] { display: none; }
.tarjeta { max-width: 560px; text-align: center; }
.sobrelinea { font: 600 12px/1 var(--sans); letter-spacing: .22em; color: var(--acento); text-transform: uppercase; margin: 0 0 14px; }
h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0 0 12px; line-height: 1.02; }
h1 { font-size: clamp(42px, 8vw, 78px); }
h2 { font-size: clamp(30px, 5vw, 46px); }
h1 em, h2 em { color: var(--acento); font-style: italic; }
.bajada { font: 20px/1.4 var(--serif); color: var(--tinta-suave); margin: 0 0 26px; }
.nota { font-size: 14px; color: var(--tinta-suave); opacity: .85; margin-top: 18px; line-height: 1.5; }
.principal {
  background: var(--acento); color: #23180f; border: 0; border-radius: 999px; padding: 13px 30px;
  font-weight: 700; font-size: 17px; box-shadow: 0 6px 18px rgba(232, 163, 61, .25); margin: 4px;
}
.principal:hover { filter: brightness(1.08); }
.secundario { background: transparent; color: var(--tinta); border: 1px solid rgba(246, 234, 210, .4); border-radius: 999px; padding: 11px 22px; margin: 4px; }
.secundario:hover { border-color: var(--tinta); }
.enlace { background: none; border: 0; color: var(--tinta-suave); text-decoration: underline; margin-top: 10px; }
.pie { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .18em; color: rgba(246, 234, 210, .45); }

.hud { position: fixed; z-index: 10; pointer-events: none; }
.hud * { pointer-events: auto; }
#arriba { top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#titulo-nivel { font: 600 22px/1.1 var(--serif); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
#titulo-nivel small { display: block; font: 600 11px/1.4 var(--sans); letter-spacing: .2em; color: var(--acento); text-transform: uppercase; }
.botonera { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chico-boton {
  background: rgba(20, 15, 11, .7); color: var(--tinta); border: 1px solid rgba(246, 234, 210, .25);
  border-radius: 10px; padding: 7px 11px; font-size: 14px; backdrop-filter: blur(4px);
}
.chico-boton:hover { border-color: var(--tinta); }
.chico-boton[aria-pressed="true"] { background: var(--acento); color: #23180f; }
#aviso {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 10;
  max-width: min(640px, 92vw); text-align: center; font: 18px/1.35 var(--serif);
  background: rgba(20, 15, 11, .78); padding: 10px 18px; border-radius: 14px; backdrop-filter: blur(4px);
  transition: opacity .3s;
}
#aviso:empty { opacity: 0; }
#aviso kbd, .nota kbd, .tarjeta kbd { font: 600 13px var(--sans); border: 1px solid rgba(246, 234, 210, .45); border-radius: 5px; padding: 1px 6px; }
@media (max-width: 640px) {
  #titulo-nivel { font-size: 18px; }
  .chico-boton { padding: 6px 9px; font-size: 13px; }
  #aviso { font-size: 16px; bottom: 12px; }
}
