:root {
  color-scheme: dark;
  --paper: #fff5e4;
  --gold: #efc58b;
  --muted: #c1c5ce;
  --line: #444858;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--paper);
  background: radial-gradient(ellipse at 48% 14%,#2c2b39,#191e2a 57%,#131822);
  font: 16px/1.65 "Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
}

.house {
  width: min(100%,748px);
  margin: auto;
  padding: 0 clamp(16px,4vw,38px) 30px;
}

button {
  min-height: 44px;
  font: inherit;
  color: var(--paper);
  border: 1px solid #666477;
  border-radius: 9px;
  background: #30313d;
  padding: 8px 16px;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

button:hover {
  background: #403d49;
}

#sound,#pause {
  font-size: 14px;
}

#sound {
  background: transparent;
}

#sound[aria-pressed=true] {
  color: var(--gold);
  border-color: var(--gold);
}

main {
  padding-top: clamp(20px,4vw,48px);
}

.conversation {
  background: #262a37;
  border: 1px solid #52515e;
  border-radius: 18px;
  padding: clamp(16px,4vw,32px);
  box-shadow: 0 12px 38px #0e101c44;
}

h2 {
  margin: 13px 0 7px;
  font-size: clamp(21px,4.6vw,28px);
  line-height: 1.5;
  text-wrap: pretty;
}

h2:focus {
  outline: none;
}

#notice {
  color: #d8d6db;
  font-size: 16px;
  margin: 0;
}

.conversation #choices {
  display: grid;
  gap: 8px;
  margin-top: 19px;
}

#choices button {
  text-align: left;
  border-color: #857967;
  background: #37323a;
  color: #fff0d6;
  font-weight: 600;
  padding: 11px 15px;
  min-height: 48px;
}

#choices button:hover,#choices button:focus-visible {
  background: #52433f;
  border-color: var(--gold);
}

#performance {
  padding-top: 16px;
  background: #181a21;
  border: 1px solid #957654;
  border-radius: 12px;
  overflow: hidden;
}

.viewport {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.72;
  background: #472430;
}

.viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.apron {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
  padding: 2px 12px;
  gap: 8px;
}

#count {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

#pause {
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#result:not(:empty) {
  font-weight: 700;
  color: var(--gold);
  margin: 14px 0 7px;
}

#notice:not(:empty) {
  margin-top: 10px;
}

#notice:empty,#result:empty {
  margin: 0;
}

#replay {
  margin-top: 6px;
}

.text-stage::before {
  content: '✴';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 68px serif;
  color: var(--gold);
  background: linear-gradient(125deg,#3b2331,#7c4149,#332332);
}

#reply {
  margin-inline: 16px;
}

#reply {
  font-size: clamp(18px,3vw,23px);
  margin-bottom: 14px;
}

#receipt #result {
  font-variant-numeric: tabular-nums;
  font-size: clamp(18px,3vw,24px);
  margin: 16px 0;
}

@media(prefers-reduced-motion:no-preference) {
  .screen:not([hidden]) {
    animation: arrive .3s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: .35;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

#scene,.viewport canvas.stage-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.instrument {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
}

#choices button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 14px;
}

#ticket {display:block;width:100%;height:auto;border-radius:7px}
.accessible-only {position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.ticket-actions,.ticket-secondary {
  display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:14px;
}
.ticket-actions a,.ticket-actions #replay {
  display:inline-flex; gap:8px; align-items:center; justify-content:center;
  min-height:44px; padding:8px 18px; border-radius:999px;
  color:var(--paper); text-decoration:none; font-weight:700;
}
#compose-post {background:#000; color:white; border:1px solid #767676}
#compose-post:hover {background:#181818}
#replay {background:#efc58b; color:#28202a; border:0; margin:0}
#download-ticket {color:var(--muted); font-size:14px; padding:8px 4px}
.ticket-actions a:focus-visible {outline:3px solid var(--gold); outline-offset:3px}
.ticket-secondary {gap:14px; margin-top:4px}
.ticket-secondary button {margin:0; background:transparent; border:0; padding:4px; color:var(--muted); font-size:14px}
#share-feedback:empty {margin:0}

.house {min-height:100svh;display:grid;align-content:center;padding-block:16px}
main {padding:0}
.edge-controls {display:flex;gap:4px;align-items:center;justify-content:flex-end;margin-top:5px;padding-bottom:env(safe-area-inset-bottom)}
.edge-controls button {border:0;color:var(--muted);background:transparent;font-size:13px;text-decoration:none}
.viewport {display:block;width:100%;min-height:0;border:0;border-radius:0;padding:0;cursor:pointer;touch-action:none}
.viewport:focus-visible {outline-offset:-3px}
.viewport:disabled {cursor:default}
.apron {justify-content:center}
.gesture-sprite {display:block;pointer-events:none;z-index:3}
@media(prefers-reduced-motion:no-preference){
  #choices button:active .instrument {transform:scale(.88) rotate(-7deg)}
  .edge-controls button:active,.ticket-actions button:active {transform:scale(.95)}
}
