:root {
  --ink: #0b0910;
  --ink-2: #15111c;
  --paper: #edf0ea;
  --mist: #a9b6b0;
  --dim: #7b8a84;
  --ember: #e8b04a;
  --ember-hi: #ffe2a6;
  --line: rgba(233, 231, 239, .15);
  --serif: 'Cormorant Garamond', 'Noto Serif TC', serif;
  --zh-serif: 'Noto Serif TC', serif;
  --sans: 'Noto Sans TC', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--sans); overflow: hidden; }
body { -webkit-font-smoothing: antialiased; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; }
kbd { font-family: var(--mono); font-size: .78em; padding: .05em .4em; border: 1px solid var(--line); border-radius: 3px; margin: 0 .08em; background: rgba(255, 255, 255, .04); }

/* ---------------- gate ---------------- */
#gate {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, 6vw) max(24px, env(safe-area-inset-bottom));
  background:
    linear-gradient(90deg, rgba(9, 7, 13, .92) 0%, rgba(9, 7, 13, .78) 36%, rgba(9, 7, 13, .18) 70%, rgba(9, 7, 13, 0) 100%),
    linear-gradient(0deg, rgba(9, 7, 13, .6), rgba(9, 7, 13, 0) 40%);
  transition: opacity .9s ease, visibility .9s;
}
body.entered #gate { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-inner { max-width: 34rem; }
.kicker { display: flex; align-items: center; gap: .7em; margin: 0 0 1.4rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mist); }
.kicker .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.mark { margin: 0; font-family: var(--sans); font-weight: 900; font-size: clamp(3.6rem, 12vw, 7.6rem); line-height: 1; letter-spacing: .08em; color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.mark-zh { margin: .6rem 0 0; font-family: var(--mono); font-weight: 400; font-size: clamp(.85rem, 2vw, 1rem); letter-spacing: .42em; color: #ffe2a6; }
.lede { margin: 1.6rem 0 0; font-size: 1rem; line-height: 1.95; color: #d9d3c7; }
.rule { margin: 1.8rem 0 1rem; height: 1px; background: var(--line); position: relative; overflow: hidden; max-width: 22rem; }
.rule i { position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, transparent, var(--ember), transparent); animation: sweep 2.8s ease-in-out infinite; }
body.ready .rule i { animation: none; opacity: 0; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
#status { margin: 0 0 1.1rem; font-family: var(--mono); font-size: .8rem; color: var(--mist); min-height: 1.2em; }
.enter {
  appearance: none; border: 0; cursor: pointer; padding: .95rem 2.1rem; border-radius: 999px;
  background: linear-gradient(180deg, var(--ember-hi), var(--ember)); color: #2a1a02; font-weight: 700; font-size: 1rem; letter-spacing: .12em;
  box-shadow: 0 0 0 1px rgba(255, 226, 166, .35), 0 10px 40px -10px rgba(232, 176, 74, .7);
  transition: transform .2s, box-shadow .2s, opacity .3s;
}
.enter:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 226, 166, .5), 0 14px 50px -10px rgba(232, 176, 74, .9); }
.enter:disabled { opacity: .35; cursor: wait; }
.enter:focus-visible, .ghost:focus-visible, .views button:focus-visible { outline: 2px solid var(--ember-hi); outline-offset: 3px; }
.keys { margin: 1.2rem 0 0; font-size: .82rem; color: var(--dim); line-height: 2; }
.about-link { display: inline-block; margin-top: 1.4rem; color: var(--mist); text-decoration: none; font-size: .88rem; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.about-link:hover { color: var(--paper); border-color: var(--ember); }
.gate-foot { position: absolute; left: max(16px, 6vw); bottom: max(18px, env(safe-area-inset-bottom)); margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: rgba(167, 179, 173, .7); }
.only-coarse { display: none; }
@media (pointer: coarse) { .only-coarse { display: block; } .only-fine { display: none; } }
.nojs { position: fixed; inset: auto 16px 16px; z-index: 30; color: var(--paper); }
.nojs a { color: var(--ember-hi); }

/* ---------------- HUD ---------------- */
.top {
  position: fixed; z-index: 10; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(9, 7, 13, .6), rgba(9, 7, 13, 0));
  opacity: 0; pointer-events: none; transition: opacity .6s .3s;
}
body.entered .top { opacity: 1; pointer-events: auto; }
body.locked .top { opacity: .35; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: inherit; margin-right: auto; }
.brand-mark { font-family: var(--sans); font-weight: 900; font-size: 1.3rem; letter-spacing: .12em; line-height: 1; }
.brand-sub { font-size: .68rem; letter-spacing: .2em; color: var(--mist); margin-top: 3px; }
.views { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 15, 13, .55); backdrop-filter: blur(8px); }
.views button { appearance: none; border: 0; background: none; cursor: pointer; padding: .38rem .8rem; border-radius: 999px; font-size: .82rem; color: var(--mist); }
.views button:hover { color: var(--paper); background: rgba(255, 255, 255, .06); }
.top-right { display: flex; gap: 6px; }
.ghost { appearance: none; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; padding: .42rem .85rem; border-radius: 999px; font-size: .82rem; border: 1px solid var(--line); background: rgba(12, 15, 13, .55); backdrop-filter: blur(8px); color: var(--paper); }
.ghost:hover { border-color: rgba(232, 176, 74, .6); }
.ghost[aria-pressed="true"] { border-color: var(--ember); color: var(--ember-hi); }
.help { position: fixed; z-index: 11; right: max(16px, env(safe-area-inset-right)); top: 70px; width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 100px); overflow: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 12, 11, .88); backdrop-filter: blur(14px); font-size: .88rem; line-height: 1.8; }
.help h2 { margin: 0 0 .4rem; font-family: var(--zh-serif); font-size: 1.05rem; }
.help ul { margin: 0; padding-left: 1.1rem; }
.help .fine { color: var(--mist); font-size: .8rem; margin: .8rem 0 0; }
#crosshair { position: fixed; z-index: 5; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(236, 230, 218, .55); opacity: 0; transition: opacity .3s; pointer-events: none; }
body.locked #crosshair { opacity: 1; }
.stick { display: none; position: fixed; z-index: 12; left: max(22px, env(safe-area-inset-left)); bottom: max(26px, env(safe-area-inset-bottom)); width: 112px; height: 112px; border-radius: 50%; border: 1px solid var(--line); background: rgba(12, 15, 13, .35); backdrop-filter: blur(6px); touch-action: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(236, 230, 218, .22); border: 1px solid rgba(236, 230, 218, .4); transition: transform .08s; }
@media (pointer: coarse) { body.entered .stick { display: block; } }

@media (max-width: 720px) {
  #gate { align-items: flex-end; background: linear-gradient(0deg, rgba(9, 7, 12, .95) 0%, rgba(9, 7, 12, .8) 55%, rgba(9, 7, 12, .1) 100%); padding-bottom: max(56px, env(safe-area-inset-bottom)); }
  .lede { font-size: .92rem; line-height: 1.85; }
  .lede br { display: none; }
  .gate-foot { display: none; }
  .top { flex-wrap: wrap; row-gap: 8px; }
  .brand-sub { display: none; }
  .views { order: 3; width: 100%; justify-content: space-between; }
  .views button { flex: 1; padding: .42rem .2rem; }
  .top-right .ghost { padding: .38rem .6rem; font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) { .kicker .dot, .rule i { animation: none; } }
body.clean .top, body.clean #crosshair, body.clean .stick, body.clean #gate { display: none !important; }

/* ---------------- 聲音 panel (js/mixer.js?v=73ea98033e) ---------------- */
.ghost.is-on { border-color: var(--ember); color: var(--ember-hi); }
.mixer { width: min(340px, calc(100vw - 32px)); padding: 16px 18px 14px; line-height: 1.5; }
.mx-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .45rem; }
.mx-head h2 { margin: 0; }
.mx-switch { appearance: none; cursor: pointer; position: relative; width: 60px; height: 28px; padding: 0 11px 0 0; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-size: .76rem; color: var(--mist); text-align: right; transition: background .2s, border-color .2s; }
.mx-switch::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--mist); transition: transform .2s, background .2s; }
.mx-switch[aria-checked="true"] { padding: 0 0 0 11px; text-align: left; border-color: var(--ember); color: var(--ember-hi); background: rgba(255, 255, 255, .1); }
.mx-switch[aria-checked="true"]::before { transform: translateX(32px); background: var(--ember-hi); }
.mx-row { display: grid; grid-template-columns: 7.2em 1fr 2.2em; align-items: center; gap: 10px; padding: .2rem 0; font-size: .84rem; color: var(--paper); transition: opacity .2s; }
.mx-row output { font-family: var(--mono); font-size: .76rem; color: var(--mist); text-align: right; }
.mx-sub { margin: .5rem 0 .1rem; padding-top: .55rem; border-top: 1px solid var(--line); font-size: .72rem; letter-spacing: .14em; color: var(--dim); }
.mixer.is-off .mx-row { opacity: .45; }
.mixer input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: none; cursor: pointer; }
.mixer input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ember) var(--p, 50%), rgba(255, 255, 255, .14) var(--p, 50%)); }
.mixer input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 3px rgba(0, 0, 0, .35); }
.mixer input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); }
.mixer input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ember); }
.mixer input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--paper); }
.mixer input[type=range]:focus-visible, .mx-switch:focus-visible, .mx-reset:focus-visible { outline: 2px solid var(--ember-hi); outline-offset: 3px; border-radius: 6px; }
.mx-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: .7rem; font-size: .72rem; color: var(--dim); }
.mx-reset { appearance: none; cursor: pointer; border: 1px solid var(--line); background: none; border-radius: 999px; padding: .3rem .8rem; font-size: .76rem; color: var(--mist); }
.mx-reset:hover { color: var(--paper); border-color: var(--ember); }
@media (pointer: coarse) {
  .mx-foot span { display: none; }
  .mx-row { padding: .35rem 0; }
  .mixer input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
  .mixer input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }
}

/* ---------------- 波 panel ---------------- */
.wavebox .mx-row { grid-template-columns: 5.6em 1fr 2.2em; }
.wavebox .wv-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: .32rem 0; font-size: .84rem; }
.wavebox .wv-line small { display: block; color: var(--dim); font-size: .72rem; line-height: 1.5; margin-top: 1px; }
.wavebox .wv-note { margin: .6rem 0 0; padding-top: .55rem; border-top: 1px solid var(--line); color: var(--mist); font-size: .76rem; line-height: 1.7; }
.wavebox .mx-switch { flex: none; }
.wavebox .wv-seg { display: flex; gap: 4px; flex: none; }
.wavebox .wv-fine { margin: 0 0 .3rem; color: var(--dim); font-size: .72rem; line-height: 1.6; }
.wavebox .wv-seg button { appearance: none; cursor: pointer; min-height: 28px; padding: .2rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--paper); font-size: .74rem; font-variant-numeric: tabular-nums; }
.wavebox .wv-seg button:hover { border-color: rgba(232, 176, 74, .6); }
.wavebox .wv-seg button[aria-pressed="true"] { border-color: var(--ember); color: var(--ember-hi); background: rgba(232, 176, 74, .14); }
.wavebox .wv-seg button:focus-visible { outline: 2px solid var(--ember-hi); outline-offset: 2px; }
#hint { position: fixed; z-index: 6; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(11, 9, 16, .6); backdrop-filter: blur(8px); font-size: .8rem; color: var(--paper); opacity: 0; transition: opacity .8s; pointer-events: none; white-space: normal; max-width: min(44rem, calc(100vw - 32px)); text-align: center; line-height: 1.6; border-radius: 16px; }
body.entered #hint.show { opacity: 1; }
body.clean #hint { display: none !important; }
@media (pointer: coarse) { #hint { bottom: auto; top: 118px; } }
.views button[aria-pressed="true"] { color: var(--ember-hi); background: rgba(255, 255, 255, .08); }
#gate { background: linear-gradient(90deg, rgba(9, 7, 13, .9) 0%, rgba(9, 7, 13, .72) 34%, rgba(9, 7, 13, .1) 66%, rgba(9, 7, 13, 0) 100%), linear-gradient(0deg, rgba(9, 7, 13, .55), rgba(9, 7, 13, 0) 40%); }

/* 造物: draw an outline, grow a thing */
.makebox #pad { display: block; width: 100%; aspect-ratio: 1; margin: .2rem 0 .5rem; border: 1px solid var(--line); border-radius: 10px; background: radial-gradient(circle at 50% 45%, rgba(232, 176, 74, .10), rgba(0, 0, 0, .25)); touch-action: none; cursor: crosshair; }
.makebox .mk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: .22rem 0; font-size: .8rem; color: var(--mist); }
.makebox .mk-row > span { width: 3.6em; flex: none; }
.makebox .mk-row button { appearance: none; cursor: pointer; padding: .34rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--paper); font-size: .8rem; }
.makebox .mk-row button:hover { border-color: rgba(232, 176, 74, .6); }
.makebox .mk-row button[aria-pressed="true"] { border-color: var(--ember); color: var(--ember-hi); background: rgba(232, 176, 74, .14); }
.makebox .mk-row .mk-go { flex: 1; padding: .5rem 1rem; border: 0; background: linear-gradient(180deg, var(--ember-hi), var(--ember)); color: #2a1a02; font-weight: 700; font-size: .88rem; }
.makebox .mk-row button:focus-visible { outline: 2px solid var(--ember-hi); outline-offset: 2px; }
.makebox { z-index: 13; }
.makebox .mk-tabs { padding-top: 0; }
.makebox .mk-row button:disabled { opacity: .35; cursor: default; }
.makebox .mk-row .mk-note { flex-basis: 100%; padding-left: calc(3.6em + 6px); color: var(--dim); font-size: .72rem; line-height: 1.5; }
.makebox #padPhoto { margin-left: auto; }
