@font-face { font-family: 'VT'; src: url('../fonts/vt323.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Fell'; src: url('../fonts/fell.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'FellSC'; src: url('../fonts/fell-sc.woff2') format('woff2'); font-display: block; }

:root {
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --ink: #d8d0bc; --dim: #8a8270; --glow: #c8ff70; --red: #b02818;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font-family: 'VT', ui-monospace, monospace; font-size: 22px; line-height: 1.25; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
#app { position: fixed; inset: 0; }
#probe { position: absolute; visibility: hidden; pointer-events: none; padding: var(--st) var(--sr) var(--sb) var(--sl); }
#view { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; }
[hidden] { display: none !important; }

button { font: inherit; color: var(--ink); background: #0c0c0a; border: 2px solid #3a3a30; padding: 0.35em 0.9em; cursor: pointer;
  border-radius: 0; min-height: 44px; letter-spacing: 0.04em; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
button:active { background: #1c1c16; }
button.big { font-size: 1.25em; border-color: #6a6450; }
button.tog b { color: var(--glow); font-weight: normal; }
button[disabled] { opacity: 0.4; cursor: default; }
input { font: inherit; color: var(--ink); background: #0c0c0a; border: 2px solid #6a6450; padding: 0.3em 0.5em; width: 100%; text-transform: uppercase;
  border-radius: 0; text-align: center; font-size: 1.3em; -webkit-user-select: text; user-select: text; }

/* full screen pages */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 14px;
  padding: calc(var(--st) + 16px) calc(var(--sr) + 16px) calc(var(--sb) + 16px) calc(var(--sl) + 16px); background: #000; text-align: center; overflow-y: auto; }
.screen.dim { background: rgba(0, 0, 0, 0.82); }
.col { display: flex; flex-direction: column; gap: 10px; width: min(340px, 100%); }
h1 { font-family: 'FellSC', serif; font-weight: normal; font-size: clamp(64px, 17vw, 150px); letter-spacing: 0.08em; margin: 0; color: #c8c0a8;
  text-shadow: 0 0 18px rgba(200, 255, 112, 0.18); }
h2 { font-family: 'FellSC', serif; font-weight: normal; font-size: clamp(34px, 8vw, 56px); margin: 0; letter-spacing: 0.05em; }
.line { font-variant-ligatures: none; font-family: 'Fell', serif; font-style: italic; font-size: clamp(19px, 4.6vw, 30px); max-width: 26em; margin: 0 0 1em; color: #b8b09a; }
.blink { color: var(--dim); animation: blink 1.6s steps(2) infinite; margin: 0; }
@keyframes blink { 50% { opacity: 0.25; } }
.note { color: var(--dim); font-size: 0.85em; margin: 0; }
.txt { max-width: 34em; text-align: left; }
.txt p { margin: 0 0 0.7em; }
.story { font-family: 'Fell', serif; font-size: clamp(20px, 4.5vw, 28px); text-align: center; }
.story .em { color: var(--glow); margin-top: 1em; }
.keys { color: var(--dim); }
.time { font-size: 1.6em; color: var(--glow); margin: 0; }
#title { cursor: pointer; }
#title .line { margin-top: 0.4em; }

.tabs { display: flex; gap: 8px; }
.tab.on { border-color: var(--glow); }
.board { list-style: none; padding: 0; margin: 0; width: min(360px, 100%); min-height: 6em; text-align: left; }
.board li { display: flex; justify-content: space-between; padding: 2px 4px; border-bottom: 1px solid #1c1c16; }
.board li span:first-child { color: var(--dim); width: 2em; }
.board li span:nth-child(2) { flex: 1; }

#nameF { display: flex; flex-direction: column; gap: 8px; width: min(320px, 100%); }
#nameF label { color: var(--dim); }

/* the catch */
.overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; pointer-events: none;
  padding-bottom: calc(var(--sb) + 12%); }
#caught p { font-family: 'Fell', serif; font-size: clamp(22px, 5vw, 34px); color: #e8d8c8; text-shadow: 0 0 6px #000, 0 0 2px #000; animation: fadein 1.2s ease-in both; }
@keyframes fadein { from { opacity: 0; } }

/* in play */
#hud { position: absolute; inset: 0; pointer-events: none; }
#caption { position: absolute; left: 0; right: 0; text-align: center; font-family: 'Fell', serif; font-style: italic; font-size: clamp(18px, 4vw, 28px);
  color: #c8c0a8; text-shadow: 0 0 4px #000, 0 0 2px #000; opacity: 0; transition: opacity 0.9s; pointer-events: none; }
#caption.on { opacity: 1; }
#pause { position: absolute; pointer-events: auto; width: 44px; height: 44px; padding: 0; min-height: 0; background: rgba(0, 0, 0, 0.4); border-color: #2a2a22; color: var(--dim); }
#touch { position: absolute; inset: 0; pointer-events: none; }
#touch.off { display: none; }
#stick { position: absolute; pointer-events: auto; touch-action: none; }
#stick .base { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  border: 2px solid rgba(200, 192, 168, 0.28); background: rgba(20, 20, 16, 0.25); }
#stick .knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(200, 192, 168, 0.35); }
#stick.on .base { border-color: rgba(200, 192, 168, 0.5); }
#btns { position: absolute; pointer-events: none; }
.act { position: absolute; pointer-events: auto; width: 84px; height: 84px; border-radius: 50%; padding: 0; font-size: 20px; touch-action: none;
  background: rgba(20, 20, 16, 0.35); border: 2px solid rgba(200, 192, 168, 0.3); color: rgba(216, 208, 188, 0.85); }
.act.down { background: rgba(200, 192, 168, 0.3); }
#bHide.near { border-color: var(--glow); color: var(--glow); box-shadow: 0 0 12px rgba(200, 255, 112, 0.35); }
#bHide.in { background: rgba(200, 255, 112, 0.22); }

.screen > * { flex-shrink: 0; }
.screen { scroll-padding: calc(var(--st) + 12px) 0 calc(var(--sb) + 12px); }
/* short screens (a phone on its side): menus in two columns, smaller headings */
@media (max-height: 500px) {
  .screen { gap: 8px; }
  h2 { font-size: 32px; }
  .col { display: grid; grid-template-columns: 1fr 1fr; width: min(640px, 100%); gap: 8px; }
  .col .note { grid-column: 1 / -1; }
  button.big { font-size: 1.1em; }
  #title h1 { font-size: 22vh; }
}

/* the catch: the edges of the screen go red */
#app.catch::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 30%, rgba(110, 0, 0, 0.55) 80%, rgba(40, 0, 0, 0.85) 100%); }
#hint { position: absolute; left: 0; right: 0; text-align: center; color: var(--glow); font-size: 20px; text-shadow: 0 0 4px #000, 0 0 2px #000;
  opacity: 0; transition: opacity 0.3s; pointer-events: none; }
#hint.on { opacity: 0.85; }
