/* css/gods-home.css   Bring the Gods Home (test-gods-home.html, test page), 2026-11-14
   The picture is a small canvas blown up in whole pixels. Everything written is on the page, over it,
   in two pixel faces (DotGothic16 and Press Start 2P, both SIL OFL, in fonts/gods-home/). */
@font-face { font-family: 'GH Dot'; src: url('../fonts/gods-home/dotgothic16-latin-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'GH Start'; src: url('../fonts/gods-home/press-start-2p-latin-400.woff2') format('woff2'); font-display: swap; }

:root { --ink: #05030e; --paper: #f4f0e6; --pink: #ff2bd6; --cyan: #27e6ff; --pick: #ffe94a; --s: 3;
  --t: clamp(15px, 1.1vmin + 11px, 22px); --pad: max(12px, env(safe-area-inset-left)); }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); overflow: hidden; overscroll-behavior: none; }
body.gh { font: 400 var(--t)/1.45 'GH Dot', ui-monospace, Menlo, Consolas, monospace; -webkit-font-smoothing: none; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
p, h1, h2, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

#gh { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; outline: none; background: var(--ink); }

/* ── the counter and the three small buttons ── */
#hud { position: fixed; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: max(10px, env(safe-area-inset-top)) var(--pad) 0; pointer-events: none; z-index: 3; }
#hud > * { pointer-events: auto; }
#counter { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--ink); border: 3px solid var(--paper); font: 400 clamp(9px, .5vmin + 7px, 13px)/1 'GH Start', monospace; text-transform: uppercase; }
#pips { display: flex; gap: 4px; }
#pips i { width: .9em; height: .9em; border: 2px solid var(--paper); box-sizing: border-box; }
#pips i.on { background: var(--paper); }
#tools { display: flex; gap: 8px; align-items: center; }
#tools button, #tools a { font: inherit; font-size: .82em; color: var(--paper); background: var(--ink); border: 2px solid var(--paper); padding: 4px 9px; text-decoration: none; cursor: pointer; }
#tools button:hover, #tools a:hover, #tools button:focus-visible, #tools a:focus-visible { color: var(--pick); border-color: var(--pick); outline: none; }
#exit::before { content: '\2190\00a0'; }
#hud.quiet #counter { opacity: .0; transition: opacity 1.2s; }

/* ── one line at a time: what to do now (bottom), what just happened (top) ── */
#prompt, #toast { position: fixed; left: 50%; transform: translateX(-50%); z-index: 3; max-width: min(92vw, 40em); text-align: center; padding: 6px 14px; background: var(--ink); box-sizing: border-box; }
#prompt { bottom: max(18px, env(safe-area-inset-bottom)); border: 2px solid var(--paper); }
#toast { top: calc(max(10px, env(safe-area-inset-top)) + 3.4em); color: var(--pick); }

/* ── the box: black, a white rule, the god on the left, the words typed out ── */
#box { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; width: min(94vw, 34em); box-sizing: border-box; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px 20px 20px; background: #000; border: 4px solid var(--paper); cursor: pointer; font-size: 1.12em; }
#face { image-rendering: pixelated; image-rendering: crisp-edges; width: auto; height: auto; max-width: 96px; }
#say { white-space: pre-wrap; min-height: 2.9em; }
#also { margin-top: .55em; color: var(--pick); }
#box.voice { border-color: #E03A1F; }
#box.voice #also { color: var(--paper); border-top: 2px solid #E03A1F; padding-top: .5em; }
#face[hidden] + div { grid-column: 1 / -1; }
#more { position: absolute; right: 12px; bottom: 8px; width: 0; height: 0; border: 6px solid transparent; border-top: 8px solid var(--paper); border-bottom: 0; animation: gh-bob .7s steps(2) infinite; }
@keyframes gh-bob { 50% { transform: translateY(3px); } }

/* ── the card: the three rules, before you start and whenever you ask ── */
#title, #end { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 20px var(--pad); box-sizing: border-box; overflow: auto; }
#title { background: rgba(5, 3, 14, .84); }
#title .card, #end .card { width: min(100%, 31em); box-sizing: border-box; padding: 26px 28px 22px; background: #000; border: 4px solid var(--paper); }
.k { font: 400 clamp(8px, .4vmin + 6px, 11px)/1.6 'GH Start', monospace; text-transform: uppercase; letter-spacing: .04em; color: var(--cyan); margin-bottom: 14px; }
h1 { font: 400 clamp(20px, 3.2vmin + 9px, 38px)/1.25 'GH Start', monospace; text-transform: uppercase; text-shadow: .08em 0 0 var(--pink), -.08em 0 0 var(--cyan); margin-bottom: 22px; animation: gh-slip 5s steps(1) infinite; }
@keyframes gh-slip { 0%, 91%, 100% { text-shadow: .08em 0 0 var(--pink), -.08em 0 0 var(--cyan); transform: none; } 92% { text-shadow: -.16em 0 0 var(--pink), .16em 0 0 var(--cyan); transform: translateX(3px); } 94% { text-shadow: .2em .06em 0 var(--cyan), -.1em 0 0 var(--pink); transform: translateX(-4px); } 96% { text-shadow: .08em 0 0 var(--pink), -.08em 0 0 var(--cyan); transform: none; } }
#t-rules { list-style: none; counter-reset: r; display: grid; gap: 8px; margin-bottom: 20px; font-size: 1.02em; }
#t-rules li { counter-increment: r; display: grid; grid-template-columns: 1.7em 1fr; }
#t-rules li::before { content: counter(r); color: var(--pick); font-family: 'GH Start', monospace; font-size: .7em; padding-top: .35em; }
#t-status { margin: -8px 0 18px; font-size: .9em; color: var(--cyan); }
#title:not(.paused) #t-status { display: none; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.btns button, .btns a { font: inherit; font-size: 1.08em; color: var(--paper); background: #000; border: 3px solid var(--paper); padding: 7px 16px; cursor: pointer; text-decoration: none; }
.btns button:hover, .btns a:hover, .btns button:focus-visible, .btns a:focus-visible { color: var(--pick); border-color: var(--pick); outline: none; }
.btns button:disabled { opacity: .5; cursor: progress; }
#start::before, #e-go::before { content: '\2665\00a0'; color: #ff2b2b; }
.keys { font-size: .84em; opacity: .72; }
.out { margin-top: 12px; font-size: .84em; }
.out a { color: var(--paper); }
.out a::before { content: '\2190\00a0'; }
.out a:hover, .out a:focus-visible { color: var(--pick); outline: none; }
#title.paused .out { display: none; }
#end { place-items: end center; pointer-events: none; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
#end .card { pointer-events: auto; }
#end h2 { font: 400 clamp(13px, 1.4vmin + 8px, 20px)/1.4 'GH Start', monospace; text-transform: uppercase; margin-bottom: 14px; }
#e-line { margin-bottom: 10px; }
#e-show { color: var(--pick); margin-bottom: 18px; }
.nojs { position: fixed; inset: auto 0 40%; text-align: center; padding: 0 20px; }
.nojs a { color: var(--pick); }

/* ── the phone: two arrows on the left, a round button on the right ── */
#pad { position: fixed; inset: auto 0 0 0; z-index: 4; display: flex; align-items: flex-end; gap: 12px; padding: 0 max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); pointer-events: none; }
#pad button { pointer-events: auto; touch-action: none; width: 64px; height: 64px; display: grid; place-items: center; background: rgba(5, 3, 14, .55); border: 3px solid var(--paper); padding: 0; }
#pad button[data-k="jump"] { margin-left: auto; width: 78px; height: 78px; border-radius: 50%; }
#pad button.on { background: var(--paper); }
#pad i { width: 0; height: 0; border: 11px solid transparent; }
#pad i.l { border-right: 15px solid var(--paper); border-left: 0; }
#pad i.r { border-left: 15px solid var(--paper); border-right: 0; }
#pad i.u { border-bottom: 15px solid var(--paper); border-top: 0; }
#pad button.on i.l { border-right-color: var(--ink); } #pad button.on i.r { border-left-color: var(--ink); } #pad button.on i.u { border-bottom-color: var(--ink); }
body.pad #prompt, body.pad #box { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 92px); }
@media (orientation: landscape) { body.pad #prompt, body.pad #box { bottom: max(14px, env(safe-area-inset-bottom)); max-width: calc(100vw - 340px); } body.pad #box { width: calc(100vw - 340px); } }
@media (max-width: 520px) { #tools { gap: 5px; } #tools button { font-size: .72em; padding: 4px 6px; white-space: nowrap; } #exit { display: none; } #counter { gap: 7px; padding: 6px 7px; } #pips { gap: 3px; } }

@media (prefers-reduced-motion: reduce) { h1, #more { animation: none; } #hud.quiet #counter { transition: none; } }
