:root { --bg: #000; --fg: #f1e9d8; --muted: #a89f8c; --accent: #d4af6a; --panel: #17121d; --err: #ff8a7a; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 18px/1.4 system-ui, sans-serif; overflow: hidden; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.panel { max-width: 520px; margin: 0 auto; padding: 8vh 20px 20px; height: 100%; overflow-y: auto; }
h1 { font-family: Georgia, serif; color: var(--accent); font-weight: normal; font-size: 40px; text-align: center; margin: 0 0 32px; }
label { display: block; margin: 20px 0 8px; color: var(--muted); }
input { width: 100%; font-size: 28px; padding: 14px 16px; border-radius: 12px; border: 2px solid #3a3145; background: var(--panel); color: var(--fg); }
#code { text-transform: uppercase; letter-spacing: 8px; text-align: center; }
button { font: inherit; cursor: pointer; }
form > button[type=submit] { width: 100%; margin-top: 24px; padding: 18px; font-size: 22px; border: 0; border-radius: 12px; background: var(--accent); color: #1a1206; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 16px; width: 100%; }
.screen-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.screen-list button { padding: 18px 10px; border-radius: 12px; border: 2px solid #3a3145; background: var(--panel); color: var(--fg); font-size: 20px; }
.screen-list button.sel { border-color: var(--accent); background: #2a2133; }
.error { color: var(--err); min-height: 1.4em; text-align: center; }

#stage { position: fixed; inset: 0; background: #000; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.layer.on { opacity: 1; }
.idle { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: opacity .45s; }
.idle.off { opacity: 0; }
#idle-title { font-family: Georgia, serif; font-size: 34px; color: var(--accent); margin: 18px 0 4px; }
.sigil { width: 90px; height: 90px; border: 3px solid var(--accent); border-radius: 50%; opacity: .6; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.94); } }
.tap-hint { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 15px; opacity: .8; }
.corner { position: absolute; top: 0; right: 0; width: 72px; height: 72px; background: none; border: 0; padding: 0; }
.dot { position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: #c44; opacity: .7; }
.dot.ok { background: #3c6; opacity: .35; }
.dot.wait { background: #e9b23a; }
.menu { position: absolute; top: 16px; right: 16px; width: 300px; padding: 16px; border-radius: 14px; background: rgba(23,18,29,.96); border: 1px solid #3a3145; }
.menu p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.menu button:not(.link) { display: block; width: 100%; margin: 8px 0; padding: 14px; border-radius: 10px; border: 1px solid #3a3145; background: #241d2c; color: var(--fg); font-size: 18px; }

/* Text handouts */
.doc { overflow-y: auto; -webkit-overflow-scrolling: touch; pointer-events: none; touch-action: pan-y; background: #f3ead6; color: #2a2118;
  font: 21px/1.55 Georgia, "Times New Roman", serif; padding: 48px max(24px, calc((100% - 860px) / 2)) 80px; }
.doc.on { pointer-events: auto; }
.doc h1, .doc h2, .doc h3 { font-weight: normal; line-height: 1.2; margin: 1.2em 0 .4em; }
.doc h1 { color: inherit; font-family: inherit; font-size: 40px; text-align: center; letter-spacing: .04em; } .doc h2 { font-size: 30px; } .doc h3 { font-size: 24px; }
.doc blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid #b59a6a; color: #4a3d2c; }
.doc hr { border: 0; border-top: 1px solid #c8b48c; margin: 1.6em 0; }
.doc .tbl { overflow-x: auto; } .doc table { border-collapse: collapse; width: 100%; font-size: 18px; }
.doc td, .doc th { border: 1px solid #c8b48c; padding: 8px 10px; vertical-align: top; }
.doc code { font-family: ui-monospace, monospace; font-size: .9em; }
