:root {
  --ink: #e9dcc0;
  --ink-dim: #a69a82;
  --amber: #d9a441;
  --amber-hot: #f2c46a;
  --bg: #07080a;
  --paper: #e6dcc4;
  --paper-ink: #2a241c;
  --cord: #9e1b16;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; color: var(--ink); }
body { font-family: 'VT323', ui-monospace, monospace; -webkit-font-smoothing: none; user-select: none; }

#stage { position: fixed; inset: 0; background: #000; }
#gl, #ui { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#ui { pointer-events: none; }

.screen { position: fixed; inset: 0; display: none; z-index: 5; }
.screen.visible { display: flex; }

/* ---------- click gate ---------- */
#clickgate { background: #050505; align-items: center; justify-content: center; cursor: pointer; z-index: 20; }
.gate-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.gate-ticket {
  background: var(--paper); color: var(--paper-ink); padding: 18px 34px; text-align: center;
  font-family: 'Special Elite', 'Courier New', monospace; transform: rotate(-2deg);
  box-shadow: 0 0 0 1px #0003 inset, 0 10px 40px #000;
  -webkit-mask: radial-gradient(circle 7px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 7px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.gt-line { font-size: 13px; letter-spacing: 3px; opacity: .75; }
.gt-big { font-size: 34px; letter-spacing: 6px; margin: 6px 0; }
.gate-msg { font-size: 24px; letter-spacing: 3px; color: var(--ink-dim); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- title ---------- */
#title { align-items: flex-end; justify-content: flex-start; pointer-events: none;
  background: linear-gradient(90deg, #000c 0%, #0008 38%, #0000 70%); }
.title-wrap { padding: 0 0 8vh 7vw; pointer-events: auto; max-width: 640px; }
.eyebrow { font-size: 18px; letter-spacing: 5px; color: var(--amber); opacity: .85; }
#title h1 {
  font-family: 'IM Fell English SC', 'Times New Roman', serif; font-weight: normal;
  font-size: clamp(56px, 9vw, 118px); line-height: .86; margin: 14px 0 18px; color: #efe3c8;
  text-shadow: 0 0 1px #000, 3px 3px 0 #0009, 0 0 40px #d9a44122; letter-spacing: 1px;
}
.tagline { font-family: 'IM Fell English', serif; font-style: italic; font-size: 20px; color: var(--ink-dim); margin-bottom: 34px; }
.menu { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.menu button, .row button, .t-btn {
  background: none; border: 0; color: var(--ink); font-family: 'VT323', monospace; font-size: 28px;
  letter-spacing: 2px; padding: 4px 0 4px 26px; cursor: pointer; position: relative; text-align: left;
}
.menu button::before { content: ''; position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  background: var(--amber); opacity: 0; transform: scale(.4); transition: .15s; }
.menu button:hover, .menu button:focus-visible { color: var(--amber-hot); outline: none; }
.menu button:hover::before, .menu button:focus-visible::before { opacity: 1; transform: scale(1); }
.menu button[disabled] { color: #5a5448; cursor: default; }
.menu button[disabled]::before { display: none; }
.foot { margin-top: 30px; font-size: 17px; letter-spacing: 2px; color: #776e5e; }

/* ---------- panels ---------- */
.panel { align-items: center; justify-content: center; background: #000b; z-index: 10; }
.panel-inner { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  background: #0d0e10; border: 1px solid #3a3326; padding: 26px 32px; box-shadow: 0 0 0 4px #000, 0 30px 80px #000; }
.panel-inner.narrow { width: min(360px, calc(100vw - 32px)); }
.panel h2 { font-family: 'IM Fell English SC', serif; font-weight: normal; font-size: 40px; margin: 0 0 18px; color: #efe3c8; }
.panel h3 { font-family: 'IM Fell English SC', serif; font-weight: normal; font-size: 24px; margin: 22px 0 4px; color: #efe3c8; }
.opt-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; font-size: 22px; }
.tog { background: #1a1813; border: 1px solid #4a4130; color: var(--amber-hot); font-family: 'VT323', monospace; font-size: 22px;
  min-width: 120px; padding: 2px 10px; cursor: pointer; }
.tog:hover { border-color: var(--amber); }
input[type=range] { width: 160px; accent-color: var(--amber); }
.small { font-size: 18px; color: var(--ink-dim); margin: 4px 0 8px; }
textarea { width: 100%; background: #050505; color: var(--amber-hot); border: 1px solid #3a3326; font-family: 'VT323', monospace; font-size: 18px; padding: 6px; resize: none; }
.row { display: flex; gap: 18px; margin-top: 8px; }
.row.end { justify-content: flex-end; margin-top: 20px; }
.row button { padding-left: 0; font-size: 24px; }
.row button:hover { color: var(--amber-hot); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; font-size: 22px; }
kbd { font-family: 'VT323', monospace; background: #1c1a15; border: 1px solid #4a4130; border-bottom-width: 3px; padding: 0 6px; color: var(--amber-hot); }

/* ---------- end card ---------- */
#endcard { align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, #0000 0%, #000a 60%, #000e 100%); z-index: 8; }
.end-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 16px; max-height: 100vh; overflow: auto; }
.ticket { display: flex; width: min(700px, calc(100vw - 32px)); background: var(--paper); color: var(--paper-ink);
  font-family: 'Special Elite', 'Courier New', monospace; box-shadow: 0 30px 70px #000, 0 0 0 1px #0002 inset;
  transform: rotate(-1.2deg); animation: ticketIn 1.4s cubic-bezier(.2,.8,.2,1) both; position: relative; }
.ticket::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, #0000 0 3px, #00000008 3px 4px), radial-gradient(ellipse at 70% 20%, #0000 40%, #5a3a1022 100%); }
@keyframes ticketIn { from { transform: translateY(60px) rotate(-6deg); opacity: 0; } }
.t-stub { width: 110px; border-right: 2px dashed #2a241c66; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.t-vert { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 26px; letter-spacing: 4px; color: var(--cord); }
.t-main { flex: 1; padding: 20px 26px; }
.t-small { font-size: 13px; letter-spacing: 4px; opacity: .7; }
.t-big { font-family: 'IM Fell English SC', serif; font-size: 52px; line-height: 1; margin: 4px 0 10px; }
.t-list { margin: 0 0 12px; padding-left: 18px; font-size: 15px; line-height: 1.55; }
.t-text { margin: 4px 0 6px; font-size: 19px; line-height: 1.5; font-family: 'IM Fell English', serif; font-style: italic; }
.t-foot { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: 1px; opacity: .8; border-top: 1px solid #2a241c44; padding-top: 8px; }
.t-btn { display: inline-block; margin-top: 14px; padding: 8px 16px; background: var(--paper-ink); color: var(--paper); text-decoration: none; font-size: 22px; }
.t-btn:hover { background: var(--cord); color: #fff; }
.report { width: min(700px, calc(100vw - 32px)); font-size: 21px; color: var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }
.report .r-head { grid-column: 1 / -1; font-family: 'IM Fell English SC', serif; font-size: 26px; color: #efe3c8; border-bottom: 1px solid #3a3326; margin-bottom: 4px; }
.report .r-row { display: flex; justify-content: space-between; border-bottom: 1px dotted #3a332688; }
.report .r-row b { font-weight: normal; color: var(--amber-hot); }
.report .r-note { grid-column: 1 / -1; color: var(--ink-dim); font-size: 19px; margin-top: 6px; font-family: 'IM Fell English', serif; font-style: italic; }
.row-menu { flex-direction: row; gap: 26px; }

@media (max-width: 640px) {
  .title-wrap { padding: 0 16px 6vh; }
  .keys, .report { grid-template-columns: 1fr; }
  .t-stub { display: none; }
}

/* studio intro, played between the click gate and the title */
#intro { background: #000; align-items: center; justify-content: center; z-index: 25; cursor: none; transition: opacity 0.6s ease; }
#intro.fade { opacity: 0; }
#intro video { width: 100%; height: 100%; object-fit: contain; background: #000; }
