@font-face {
  font-family: Relay;
  src: local("Georgia");
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #101716;
  color: #eee8d6;
  font-family: Arial, sans-serif;
}
body {
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid #aeb6a23b;
  border-radius: 3px;
  padding: 10px 14px;
  min-height: 40px;
  transition:
    background 0.18s,
    border-color 0.18s;
}
button:hover {
  background: #e8d7ae12;
  border-color: #dcca8a8a;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid #f7cb75;
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button[aria-pressed="true"] {
  background: #dac091;
  color: #1e2925;
  border-color: #dac091;
}
button.action {
  background: #d9bb82;
  color: #1b2420;
  border-color: #e8ca94;
  font-weight: 600;
  min-height: 46px;
  display: flex;
  gap: 25px;
  align-items: center;
  justify-content: space-between;
}
button.action:hover {
  background: #eed19b;
}
button.text-button {
  border: 0;
  color: #c5c8b9;
  padding: 7px 8px;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 12px;
}
#app {
  width: 100%;
  height: 100svh;
  position: relative;
  isolation: isolate;
}
#scene {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 40%,
    transparent 45%,
    #080e0e80 100%
  );
}
header {
  position: absolute;
  top: 27px;
  left: 36px;
  right: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  z-index: 4;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 1.5;
  font-weight: 600;
  color: #b9beac;
}
h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 27px;
  letter-spacing: -0.6px;
  margin: 7px 0;
}
h1 span {
  color: #d4ae6f;
}
nav {
  display: flex;
  gap: 7px;
}
nav button {
  font-size: 11px;
  background: #111b18a8;
}
#stage-line {
  position: absolute;
  top: 114px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#stage-number {
  color: #dabc83;
  border: 1px solid #c3b79050;
  padding: 6px 8px;
}
#stage-title {
  color: #dddcc9;
}
.live-dot {
  width: 5px;
  height: 5px;
  background: #deb56f;
  border-radius: 50%;
  box-shadow: 0 0 10px #d4a355;
}
#dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 48px));
  padding: 17px 22px 10px;
  background: linear-gradient(125deg, #1b2825ee, #101b18f5);
  border: 1px solid #a5ad9530;
  box-shadow: 0 16px 60px #0006;
  backdrop-filter: blur(16px);
  border-radius: 5px;
}
.dock-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.dock-heading p {
  font-size: 13px;
  margin: 5px 0;
  color: #e0e2d3;
}
.dock-heading button {
  font-size: 12px;
  white-space: nowrap;
  border-color: #c2b08265;
}
.controls {
  display: flex;
  gap: 20px;
  align-items: end;
}
.control {
  min-width: 100px;
}
.control.wide {
  flex: 1;
  min-width: 0;
}
label,
.routing label {
  font-size: 11px;
  color: #c2c8b5;
  display: block;
  margin-bottom: 7px;
}
label output {
  float: right;
  color: #edd4a1;
  font-variant-numeric: tabular-nums;
}
.segmented {
  display: flex;
  gap: 5px;
}
.segmented button {
  font-size: 12px;
  min-width: 40px;
}
.range-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-line button {
  padding: 0;
  min-width: 32px;
  min-height: 36px;
  font-size: 18px;
}
.range-line input {
  width: 100%;
  min-width: 30px;
}
input[type="range"] {
  accent-color: #d7b881;
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: #d7b881;
  width: 18px;
  height: 18px;
}
.dock-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #bfc1a91a;
  margin-top: 13px;
  padding-top: 7px;
}
.dock-footer p {
  font-size: 11px;
  line-height: 1.45;
  color: #bbc5b6;
  margin: 0;
  max-width: 80%;
}
.dock-footer button {
  white-space: nowrap;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 50px;
  background: linear-gradient(90deg, #091210e8, #0912107a 43%, transparent 80%);
  z-index: 3;
}
.intro-card {
  max-width: 470px;
  margin-left: 3vw;
}
.intro-card h2,
.ending-card h2 {
  font:
    400 clamp(48px, 5.5vw, 78px)/0.99 Georgia,
    serif;
  letter-spacing: -2px;
  margin: 26px 0;
}
.intro-card p,
.ending-card p {
  font-size: 14px;
  line-height: 1.8;
  color: #d1d6c7;
}
.muted {
  color: #a5b3a5 !important;
}
.intro-card .action {
  margin-top: 30px;
  width: 280px;
}
.intro-note {
  font-size: 10px;
  line-height: 1.8;
  color: #8e9f92;
  margin-top: 18px;
}
.ending-card {
  max-width: 430px;
  margin-left: 3vw;
}
.receipt {
  font: 10px/1.9 monospace;
  color: #ceb680;
  letter-spacing: 1px;
  border-top: 1px solid #baa77960;
  border-bottom: 1px solid #baa77960;
  padding: 15px 0;
  margin: 24px 0;
}
.ending-card .text-button {
  display: block;
  margin-top: 12px;
}
dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid #c9bd9550;
  border-radius: 5px;
  padding: 34px;
  background: #182520;
  color: #e6e1cb;
  box-shadow: 0 20px 120px #000a;
  max-height: 90svh;
  overflow-y: auto;
}
dialog::backdrop {
  background: #06100dab;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font:
    normal 31px Georgia,
    serif;
  margin: 13px 0 24px;
}
dialog p {
  font-size: 13px;
  line-height: 1.8;
}
dialog small {
  font-size: 11px;
  color: #b5c0ac;
  line-height: 1.7;
}
dialog .close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 0;
  font-size: 24px;
  padding: 0;
  width: 35px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 25px 0;
}
th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #aaa989;
}
td,
th {
  padding: 12px 4px;
  border-bottom: 1px solid #b5ba9a30;
}
td:last-child {
  letter-spacing: 3px;
  font-weight: bold;
}
.signature {
  color: #e8c286;
  font-size: 23px;
  letter-spacing: 7px;
}
.handwritten {
  font-family: Georgia, serif;
  font-style: italic;
  color: #d3c298 !important;
}
.slip-label {
  color: #d0b47c;
  font-size: 10px !important;
  letter-spacing: 1px;
}
blockquote {
  margin: 15px 0;
  font:
    20px/1.8 Georgia,
    serif;
  border-left: 2px solid #b69a68;
  padding-left: 17px;
}
.route-key {
  font: 10px/2 monospace;
  color: #bdbb9d;
  background: #0e1b17;
  padding: 13px;
}
ol {
  padding-left: 22px;
  font-size: 14px;
  line-height: 2.2;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 13px;
}
#hover {
  position: absolute;
  pointer-events: none;
  background: #0e1816e8;
  border: 1px solid #ab9e7650;
  padding: 7px 11px;
  font-size: 11px;
  opacity: 0;
  z-index: 2;
}
#fallback {
  position: absolute;
  inset: 20%;
  background: #182520;
  padding: 40px;
  z-index: 8;
}
#send-controls {
  align-items: center;
  justify-content: space-between;
}
#send-controls p {
  font-family: Georgia, serif;
  font-style: italic;
}
.routing {
  gap: 12px;
}
.routing .segmented button {
  padding: 10px;
  font-size: 11px;
}
.routing .action {
  font-size: 12px;
  white-space: nowrap;
}
.routing > .text-button {
  font-size: 10px;
}
#reset-confirm {
  border-top: 1px solid #9a977a44;
  margin-top: 20px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  header {
    top: 18px;
    left: 20px;
    right: 20px;
  }
  .identity h1 {
    font-size: 21px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  nav {
    gap: 4px;
  }
  nav button {
    font-size: 10px;
    padding: 7px;
    min-height: 35px;
  }
  nav #sound {
    width: 43px;
    overflow: hidden;
    font-size: 0;
  }
  nav #sound:after {
    content: "♫";
    font-size: 16px;
  }
  #stage-line {
    left: 20px;
    top: 94px;
    font-size: 9px;
    gap: 9px;
  }
  #dock {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 14px 15px 9px;
  }
  .dock-heading {
    gap: 8px;
    margin-bottom: 12px;
  }
  .dock-heading p {
    font-size: 11px;
    line-height: 1.5;
    max-width: 220px;
  }
  .dock-heading button {
    font-size: 10px;
    padding: 8px;
    min-height: 36px;
  }
  .controls {
    flex-wrap: wrap;
    gap: 12px;
  }
  .control {
    min-width: 95px;
  }
  .control.wide {
    min-width: 140px;
  }
  .controls > .action {
    width: 100%;
    min-height: 42px;
    font-size: 12px;
  }
  .controls > .control.wide {
    flex-basis: 45%;
  }
  #tune-controls > .control.wide {
    flex-basis: 55%;
  }
  .segmented button {
    padding: 7px;
    min-width: 29px;
    min-height: 36px;
  }
  .range-line {
    gap: 5px;
  }
  .range-line button {
    min-width: 26px;
  }
  .dock-footer {
    margin-top: 10px;
    align-items: flex-start;
  }
  .dock-footer p {
    font-size: 10px;
    max-width: 77%;
    line-height: 1.5;
  }
  .dock-footer button {
    font-size: 10px;
    white-space: normal;
    text-align: right;
    padding: 0;
    max-width: 65px;
  }
  .overlay {
    padding: 24px;
    background: linear-gradient(90deg, #0b1612d9, #0b161266);
  }
  .intro-card,
  .ending-card {
    margin: 0;
    max-width: 350px;
  }
  .intro-card h2,
  .ending-card h2 {
    font-size: 54px;
  }
  .intro-card p,
  .ending-card p {
    font-size: 12px;
  }
  .intro-card .action {
    width: 100%;
    max-width: 280px;
  }
  .routing {
    gap: 10px;
  }
  .routing > div {
    width: 100%;
  }
  .routing .segmented button {
    flex: 1;
    font-size: 11px;
  }
  .routing > .text-button {
    position: absolute;
    right: 15px;
    top: 12px;
    font-size: 9px;
    min-height: 20px;
  }
  .routing > .action {
    width: 100%;
  }
  #dock:has(.routing:not([hidden])) .dock-heading {
    padding-top: 12px;
  }
  dialog {
    padding: 30px 24px;
  }
  #send-controls p {
    font-size: 12px;
  }
  #stage-title {
    max-width: 200px;
  }
  #fallback {
    inset: 10%;
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (max-height: 650px) {
  body {
    overflow-y: auto;
  }
  #app {
    height: 760px;
    min-height: 100svh;
  }
  .overlay {
    align-items: flex-start;
    padding-top: 155px;
  }
}
#ending {
  background: linear-gradient(
    90deg,
    #08110fee 0%,
    #08110fd9 29%,
    #08110f60 55%,
    transparent 80%
  );
}
/* Touch layout: the instrument has its own viewport; the control tray never covers it. */
@media (max-width: 700px) and (min-height: 651px) {
  body {
    overflow-y: auto;
  }
  #app {
    display: flow-root;
    height: auto;
    min-height: 100svh;
    padding-bottom: 12px;
  }
  header {
    display: block;
    top: 16px;
    left: 18px;
    right: 18px;
  }
  header nav {
    position: absolute;
    right: 0;
    top: 51px;
    gap: 8px;
  }
  nav button {
    font-size: 14px;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
  }
  nav #sound {
    width: 44px;
  }
  .identity h1 {
    font-size: 24px;
    margin-top: 6px;
  }
  .identity .eyebrow {
    font-size: 10px;
  }
  #stage-line {
    top: 113px;
    left: 18px;
    font-size: 12px;
    gap: 8px;
  }
  #stage-number {
    padding: 5px 7px;
  }
  #app:has(#dock:not([hidden])) #scene {
    top: 145px;
    height: 330px;
  }
  #scene {
    height: 100svh;
  }
  #dock {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: calc(100% - 24px);
    margin: 475px auto 0;
    padding: 16px;
    border-radius: 8px;
  }
  .dock-heading {
    margin-bottom: 14px;
    min-height: 44px;
  }
  .dock-heading .eyebrow {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .dock-heading p {
    display: none;
  }
  .dock-heading button {
    font-size: 14px;
    min-height: 44px;
    padding: 10px 12px;
  }
  .controls {
    gap: 12px;
  }
  .control.wide,
  .controls > .control.wide,
  #tune-controls > .control.wide {
    flex-basis: 100%;
  }
  #tune-controls > .control:first-child {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  #tune-controls > .control:first-child label {
    margin: 0;
  }
  label,
  .routing label {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
  }
  .segmented button {
    min-height: 44px;
    min-width: 44px;
    font-size: 14px;
    padding: 8px 12px;
  }
  .range-line {
    gap: 10px;
  }
  .range-line button {
    min-width: 44px;
    min-height: 44px;
    font-size: 22px;
  }
  .range-line input {
    height: 44px;
    margin: 0;
  }
  .controls > .action {
    font-size: 15px;
    min-height: 48px;
  }
  .dock-footer {
    align-items: center;
    margin-top: 14px;
    padding-top: 10px;
  }
  .dock-footer p {
    font-size: 14px;
    max-width: none;
    flex: 1;
    line-height: 1.45;
  }
  .dock-footer button {
    font-size: 14px;
    max-width: 92px;
    min-width: 76px;
    min-height: 44px;
    padding: 6px;
  }
  .routing {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .routing > div {
    grid-column: 1 / -1;
  }
  .routing .segmented {
    gap: 6px;
  }
  .routing .segmented button {
    font-size: 14px;
    padding: 8px 5px;
    min-width: 0;
  }
  #destinations button {
    min-height: 64px;
  }
  #destinations button span,
  #destinations button small {
    display: block;
    font-size: 14px;
    line-height: 1.5;
  }
  .routing > .text-button {
    position: static;
    min-height: 48px;
    font-size: 14px;
    padding: 8px;
  }
  #dock:has(.routing:not([hidden])) .dock-heading {
    padding-top: 0;
  }
  dialog p,
  dialog small,
  dialog label,
  dialog li,
  .intro-card p,
  .ending-card p {
    font-size: 14px;
  }
  dialog button {
    min-width: 44px;
    min-height: 44px;
    font-size: 14px;
  }
  dialog .close {
    min-width: 44px;
    min-height: 44px;
  }
  .overlay {
    position: fixed;
  }
  .intro-note {
    font-size: 12px;
  }
}
@media (max-width: 700px) and (min-height: 651px) {
  nav #sound {
    width: auto;
    font-size: 14px;
  }
  nav #sound:after {
    content: none;
  }
  #ending {
    background: linear-gradient(
      180deg,
      #08110f30 0%,
      #08110f10 36%,
      #08110fd9 54%,
      #08110ff5 72%
    );
  }
  #ending .ending-card {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    max-width: none;
  }
  #ending .ending-card h2 {
    font-size: 44px;
    margin: 14px 0;
  }
  #ending .ending-card p {
    margin: 10px 0;
    line-height: 1.6;
  }
  #ending .receipt {
    margin: 16px 0;
    padding: 10px 0;
  }
  #ending .action,
  #ending .text-button {
    min-height: 44px;
    font-size: 14px;
  }
  #ending .ending-card .text-button {
    margin-top: 4px;
  }
}

@media (pointer: coarse) {
  .setting {
    min-height: 44px;
  }
  .setting input[type="range"] {
    min-height: 44px;
  }
  button {
    min-height: 44px;
  }
}
@media (max-width: 700px) and (min-height: 651px) {
  dialog table,
  dialog th {
    font-size: 14px;
  }
  dialog .route-key,
  dialog .slip-label {
    font-size: 14px !important;
  }
}
