@font-face { font-family: 'Jersey 10'; src: url(../assets/fonts/Jersey10-Regular.ttf); font-display: block; }
@font-face { font-family: 'Jersey 15'; src: url(../assets/fonts/Jersey15-Regular.ttf); font-display: block; }
:root {
  --bg: #06090c; --panel: #0c1217; --line: #23303a; --ink: #d8e4ea; --mut: #7d8d97;
  --amber: #f6a623; --vigia: #a8dcff; --red: #ff5a4e; --green: #5ef08a;
  --body: 'Jersey 15', sans-serif; --head: 'Jersey 10', sans-serif;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 20px/1.25 var(--body); overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--amber); }
.hidden { display: none !important; }
#room { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; }
.boot #hud, .boot #room { visibility: hidden; }

/* Arriba: dónde estás y la hora real */
#top { position: fixed; top: calc(var(--st) + 10px); left: 14px; right: 14px; display: flex; justify-content: space-between; font: 20px var(--head); letter-spacing: 1px; color: var(--mut); pointer-events: none; text-transform: uppercase; }
#clock { color: var(--vigia); }

/* Abajo: girar, notas, pista y sonido */
#bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 12px); display: flex; gap: 8px; }
#bar button { height: 44px; min-width: 44px; border: 0; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); padding: 0 14px; font-size: 20px; }
#bar button:active { background: #16212a; }
#bar .ico { padding: 0; width: 44px; display: grid; place-items: center; }
#bar svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: square; }
#snd.off .w { display: none; }
#hint.new { box-shadow: inset 0 0 0 2px var(--amber); }
#notes.new { box-shadow: inset 0 0 0 2px var(--amber); }

/* Diálogo */
#dlg { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 68px); width: min(560px, calc(100% - 20px)); background: rgba(8, 13, 17, .96); box-shadow: inset 0 0 0 2px var(--line), 0 0 0 1px #000; padding: 12px 16px 12px; z-index: 20; }
#dlg .who { font: 18px var(--head); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 2px; }
#dlg .txt { min-height: 50px; font-size: 21px; }
#dlg .txt i { color: var(--mut); font-style: normal; }
#dlg .more { text-align: right; color: var(--mut); font-size: 16px; margin-top: 4px; }
#dlg .ch { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
#dlg .ch:empty { display: none; }
.btn { display: block; width: 100%; text-align: left; min-height: 44px; border: 0; background: #121b22; box-shadow: inset 0 0 0 2px var(--line); padding: 8px 14px; font-size: 20px; color: var(--ink); text-decoration: none; }
.btn:active, .btn:hover { box-shadow: inset 0 0 0 2px var(--amber); }
.btn.main { background: var(--amber); color: #120c02; box-shadow: none; text-align: center; }
.btn.main:active { background: #ffbf4d; }
.btn:disabled { opacity: .45; }
#dlg input, #sheet input { width: 100%; height: 46px; font: 22px var(--body); background: #05080a; color: var(--ink); border: 0; box-shadow: inset 0 0 0 2px var(--line); padding: 0 12px; -webkit-user-select: text; user-select: text; }
#dlg input:focus, #sheet input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--vigia); }

/* De cerca */
#look { position: fixed; inset: 0; background: rgba(3, 5, 7, .94); z-index: 10; display: flex; flex-direction: column; align-items: center; padding: calc(var(--st) + 8px) 10px calc(var(--sb) + 10px); }
#look header { width: min(560px, 100%); display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
#lookT { font: 22px var(--head); letter-spacing: 2px; text-transform: uppercase; color: var(--mut); }
#look .x { height: 44px; border: 0; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); padding: 0 16px; font-size: 20px; }
#lookC { image-rendering: pixelated; touch-action: none; margin: 6px 0; }
#lookActs { width: min(560px, 100%); display: flex; flex-direction: column; gap: 8px; }
#lookActs .meter { height: 14px; box-shadow: inset 0 0 0 2px var(--line); padding: 3px; }
#lookActs .meter i { display: block; height: 100%; width: 0; background: var(--vigia); }
#lookActs p { margin: 0; color: var(--mut); font-size: 18px; text-align: center; }

/* Notas y avisos */
#sheet { position: fixed; inset: 0; background: rgba(3, 5, 7, .9); z-index: 30; display: flex; align-items: center; justify-content: center; padding: calc(var(--st) + 10px) 10px calc(var(--sb) + 10px); }
#sheet .in { width: min(520px, 100%); max-height: 100%; overflow: auto; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); padding: 18px; -webkit-overflow-scrolling: touch; }
#sheet h2 { font: 28px var(--head); letter-spacing: 2px; margin: 0 0 10px; text-transform: uppercase; }
#sheet .note { border-top: 2px solid var(--line); padding: 10px 0; }
#sheet .note b { display: block; font: 18px var(--head); letter-spacing: 1px; color: var(--amber); text-transform: uppercase; }
#sheet .row { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
#sheet .code { font: 40px var(--head); letter-spacing: 4px; text-align: center; color: var(--vigia); padding: 8px; box-shadow: inset 0 0 0 2px var(--line); margin: 8px 0; -webkit-user-select: text; user-select: text; }
#sheet .mut { color: var(--mut); }
#sheet p { margin: 8px 0; }

/* Portada */
#title { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
#title .in { width: min(440px, 100%); }
#title .pre { font: 18px var(--head); letter-spacing: 2px; color: var(--vigia); text-transform: uppercase; margin: 0; }
#title h1 { font: 76px/0.86 var(--head); margin: 14px 0 18px; text-transform: uppercase; letter-spacing: 1px; }
#title .sub { color: var(--mut); margin: 0 0 22px; }
#title #titleBtns { display: flex; flex-direction: column; gap: 8px; }
#title .by { margin-top: 26px; color: var(--mut); font-size: 17px; }
#title.out { opacity: 0; pointer-events: none; transition: opacity .6s; }

/* Mensajes del móvil al empezar */
#title .sms { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
#title .sms .from { font: 17px var(--head); letter-spacing: 1px; color: var(--mut); text-transform: uppercase; }
#title .sms .m { align-self: flex-start; max-width: 88%; background: #131d24; padding: 8px 12px; box-shadow: inset 0 0 0 2px var(--line); }
#title .sms .m.on { animation: pop .25s steps(3); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 50; transition: opacity .5s; }
#fade.on { opacity: 1; }

@media (min-width: 700px) { #title h1 { font-size: 96px; } }
@media (max-height: 520px) { #dlg { bottom: calc(var(--sb) + 62px); } #dlg .txt { min-height: 0; } #title h1 { font-size: 56px; } }
@media (prefers-reduced-motion: reduce) { #title.out, #fade { transition: none; } #title .sms .m.on { animation: none; } }

/* Papeles de cerca */
.paper { width: min(420px, 100%); background: #e6e0d1; color: #1d1a14; padding: 18px 20px; margin: 10px 0; box-shadow: 6px 6px 0 #000; font-size: 20px; transform: rotate(-1deg); -webkit-user-select: text; user-select: text; }
.paper b { font: 22px var(--head); letter-spacing: 2px; display: block; margin-bottom: 8px; }
.paper p { margin: 6px 0; }
.paper span { display: inline-block; min-width: 52px; color: #7a2c1f; }
.paper.postit { width: min(260px, 80%); background: #efcd48; transform: rotate(2deg); }
.paper .hand { font: 30px/1.1 var(--head); letter-spacing: 1px; }
#look .cap { color: var(--mut); text-align: center; margin: 4px 0; font-size: 18px; }
#lookBody { display: flex; flex-direction: column; align-items: center; width: 100%; }
.paper.board { background: #d6dbdf; transform: rotate(0); color: #1f3f73; }
.paper .red { color: #a8352c; outline: 2px solid #a8352c; outline-offset: 4px; display: inline-block; }
#lookActs .meter { position: relative; }
#lookActs .meter.ear { height: 22px; }
#lookActs .meter.ear i { background: #2b4a5c; }
#lookActs .meter span { position: absolute; left: 10px; top: 0; line-height: 22px; font-size: 15px; color: var(--ink); }
