:root { color-scheme: light; font-family: Inter, "Segoe UI", Arial, sans-serif; color: #263029; background: #f3f4f0; font-synthesis: none; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
#viewer { position: relative; width: 100%; height: 100%; height: 100dvh; background: radial-gradient(ellipse at 50% 42%, #fcfcf8 0%, #eef0eb 75%); }
#canvas-host { position: absolute; inset: 80px 0 146px; touch-action: none; }
canvas { display: block; width: 100%; height: 100%; outline: none; }
.topbar { position: absolute; inset: 0 0 auto; height: 80px; display: flex; align-items: center; padding: 0 34px 0 154px; gap: 24px; pointer-events: none; }
.brand { color: #263029; text-decoration: none; font-size: 25px; letter-spacing: -1.8px; font-weight: 800; pointer-events: auto; }
.brand span { color: #b76830; }
.heading { padding-left: 0; }
h1 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.2px; }
h1 span { color: #b76830; font-variant-numeric: tabular-nums; }
.heading p { margin: 1px 0 0; color: #738075; font-size: 11px; letter-spacing: .2px; }
.state { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #657065; }
.status-dot { width: 6px; height: 6px; background: #9da79b; border-radius: 50%; }
[data-state="playing"] .status-dot { background: #388357; box-shadow: 0 0 0 4px #38835712; }
[data-state="error"] .status-dot { background: #bc4c35; }
.loading { position: absolute; inset: 80px 0 146px; display: flex; align-items: center; justify-content: center; flex-direction: column; background: #f3f4f0e8; z-index: 2; }
.loading[hidden], button[hidden] { display: none; }
.loading-mark { font-size: 72px; font-weight: 300; letter-spacing: -5px; color: #abb4a8; }
.loading p { font-size: 13px; color: #657065; text-align: center; max-width: 320px; line-height: 1.6; padding: 0 20px; }
progress { appearance: none; -webkit-appearance: none; border: none; overflow: hidden; background: #dfe4dc; border-radius: 5px; }
progress::-webkit-progress-bar { background: #dfe4dc; }
progress::-webkit-progress-value { background: #a36032; border-radius: 5px; }
progress::-moz-progress-bar { background: #a36032; border-radius: 5px; }
#load-progress { width: 180px; height: 3px; }
#retry { margin-top: 12px; }
.player { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 34px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid #26302913; background: #f6f7f2e6; backdrop-filter: blur(12px); }
.timeline-row { display: flex; align-items: center; gap: 14px; max-width: 620px; margin: 0 auto 4px; font-size: 11px; font-variant-numeric: tabular-nums; color: #737d73; }
#timeline { --timeline-progress: 0%; appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
#timeline::-webkit-slider-runnable-track { height: 4px; border-radius: 5px; background: linear-gradient(to right, #a36032 var(--timeline-progress), #dfe4dc var(--timeline-progress)); }
#timeline::-moz-range-track { height: 4px; border-radius: 5px; background: #dfe4dc; }
#timeline::-moz-range-progress { height: 4px; border-radius: 5px; background: #a36032; }
#timeline::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 2px solid #f6f7f2; border-radius: 50%; background: #a36032; box-shadow: 0 0 0 1px #a36032; }
#timeline::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #f6f7f2; border-radius: 50%; background: #a36032; box-shadow: 0 0 0 1px #a36032; }
#timeline:disabled { opacity: .4; cursor: default; }
#timeline:focus-visible { outline: 2px solid #a36032; outline-offset: 2px; border-radius: 5px; }
.player-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.controls { display: flex; gap: 8px; }
button { border: 1px solid #cbd2c8; background: transparent; color: #38443b; border-radius: 7px; padding: 11px 17px; cursor: pointer; font-size: 12px; line-height: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, border-color .15s; min-height: 42px; }
button:hover:not(:disabled) { background: #e3e8df; border-color: #a8b5a4; }
button:disabled { opacity: .36; cursor: default; }
button.primary { background: #2c4033; border-color: #2c4033; color: #f9fbf5; }
button.primary:hover:not(:disabled) { background: #3f5848; }
button:focus-visible, a:focus-visible { outline: 2px solid #a36032; outline-offset: 4px; }
button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hint, .loop-note { font-size: 11px; color: #7b857b; }
.loop-note { justify-self: end; display: flex; gap: 6px; align-items: center; }
.loop-note span { font-size: 18px; }
@media (max-width: 850px) { .hint { display: none; } .player-row { grid-template-columns: 1fr; justify-items: center; gap: 0; } .loop-note { display: none; } }
@media (max-width: 520px) { .topbar { padding: 0 18px; height: 72px; gap: 16px; } .heading { padding-left: 16px; } .heading p { font-size: 10px; } .state { font-size: 10px; gap: 5px; } .brand { font-size: 23px; } .player { padding: 8px 18px max(18px, env(safe-area-inset-bottom)); } .timeline-row { margin-bottom: 4px; } #canvas-host { inset: 118px 0 138px; } button { padding: 11px 14px; min-height: 44px; } .controls { gap: 7px; width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

#language { pointer-events: auto; font: inherit; font-size: 11px; color: #657065; background: transparent; border: 1px solid #cbd2c8; border-radius: 5px; padding: 7px 5px; min-height: 34px; cursor: pointer; }
#language:focus-visible { outline: 2px solid #a36032; outline-offset: 3px; }
@media (max-width: 520px) { .topbar { gap: 12px; } .heading { padding-left: 12px; } h1 { font-size: 14px; } .state #status { display: none; } .heading p { max-width: 135px; } #language { margin-left: 0; } }
@media (max-width: 370px) { .topbar { gap: 10px; padding: 0 14px; } .heading p { max-width: 110px; font-size: 9px; } .state { display: none; } #language { margin-left: auto; } button { padding: 10px 9px; font-size: 11px; } }

/* Reserve separate space for the shared demo return control on narrow screens. */
@media (max-width: 520px) {
  .topbar { height: 118px; padding: 68px 18px 0; align-items: flex-start; }
  .heading { padding-left: 0; }
  .heading p { max-width: none; }
  .state { display: none; }
  #language { position: absolute; top: 18px; right: 18px; }
  .loading { inset: 118px 0 138px; }
}
