:root {
  color-scheme: light;
  font-family: 'Atkinson Hyperlegible Next', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #263632;
  background: #f4efe7;
  font-synthesis: none;
  --ink: #253832;
  --quiet: #53625a;
  --line: #cfcac0;
  --accent: #334c42;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 77% 7%, #fbf5e9 0%, #f4efe7 48%, #ede8df 100%);
}
[hidden] { display: none !important; }
.page {
  width: min(1240px, calc(100% - clamp(28px, 8vw, 114px)));
  padding: 28px 0 22px;
  min-width: 0;
}
.masthead {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 16px;
}
.masthead h1 {
  margin: 0;
  font: 650 clamp(1.65rem, 4.2vw, 3.3rem)/1.15 'Instrument Serif', 'Noto Serif CJK SC', 'Songti SC', SimSun, serif;
  letter-spacing: 0.025em;
  color: var(--ink);
}
.shot {
  margin: 0;
  border: 1px solid #a9a89a;
  border-radius: 12px;
  overflow: hidden;
  background: #e8e2d8;
  box-shadow: 0 24px 52px -31px #35473885, 0 2px 7px #35473810;
}
.viewport {
  position: relative;
  isolation: isolate;
  height: min(680px, 70vh);
  height: min(680px, 70svh);
  background: radial-gradient(ellipse at 31% 28%, #687064 0%, #344a43 48%, #222f2c 100%);
}
.viewport canvas { display: block; width: 100%; height: 100%; }
.viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 88px 0 #192a2e42;
  pointer-events: none;
  z-index: 1;
}
.scene-message {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #fbf6e8;
  background: radial-gradient(ellipse at 46% 40%, #4f5d51 0%, #344a43 59%, #222f2c 100%);
  text-align: center;
  padding: 16px;
}
.scene-message h2 { font-size: clamp(1.04rem, 3vw, 1.32rem); font-weight: 650; margin: 0; }
.scene-message p { max-width: 28em; margin: 10px 0 0; color: #efeadf; font-size: .9rem; line-height: 1.6; }
.scene-message button { margin-top: 18px; color: #253832; background: #f1e9d8; border-color: #f1e9d8; }
.player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px 9px 18px;
  gap: 12px;
  min-height: 62px;
  border-top: 1px solid var(--line);
  background: #f7f1e7;
}
.player-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--quiet);
  font-size: 0.875rem;
  line-height: 1.45;
}
.status-dot {
  flex: 0 0 7px;
  height: 7px;
  border-radius: 50%;
  background: #786345;
  box-shadow: 0 0 0 3px #78634521;
}
[data-state='playing'] .status-dot { background: #48735b; box-shadow: 0 0 0 3px #48735b25; }
[data-state='error'] .status-dot { background: #9a4b38; box-shadow: 0 0 0 3px #9a4b3829; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 44px;
  padding: 5px 12px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff8ec;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover { filter: brightness(1.13); }
button:focus-visible { outline: 2px solid #aa6a25; outline-offset: 3px; }
.scene-message button:focus-visible { outline-color: #ffc380; }
button:disabled { visibility: hidden; }
.icon { position: relative; width: 11px; height: 12px; }
[data-state='playing'] .icon::before { content: ''; position: absolute; inset: 1px 1px; border-inline: 3px solid currentColor; }
[data-state='paused'] .icon::before { content: ''; position: absolute; left: 2px; top: 1px; border-block: 5px solid transparent; border-left: 8px solid currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) and (orientation: portrait) {
  .page { width: calc(100% - 26px); padding: 18px 0; }
  .masthead { margin-bottom: 11px; }
  .viewport { height: min(62vh, 117vw); height: min(62svh, 117vw); }
  .viewport::after { box-shadow: inset 0 0 48px 0 #192a2e39; }
  .player { padding-inline: 11px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .page {
    width: min(1100px, calc(100% - 44px));
    width: min(1100px, calc(100% - max(22px, env(safe-area-inset-left)) - max(22px, env(safe-area-inset-right))));
    padding: 9px 0;
  }
  .masthead { margin-bottom: 7px; }
  .masthead h1 { font-size: clamp(1.25rem, 4.6vh, 1.7rem); }
  .viewport { height: max(135px, calc(100vh - 110px)); height: max(135px, calc(100svh - 110px)); }
  .player { min-height: 50px; padding-block: 3px; }
}
