:root {
  color: #27231e;
  background: #fff;
  font: 16px system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
header {
  background: #000;
  border-bottom: 1px solid #96794b;
  min-height: 71px;
  display: grid;
  place-items: center;
  padding: 10px;
}

header img { display: block; width: 141px; height: 43px; object-fit: contain; }
main { max-width: 1040px; margin-inline: auto; padding: 22px 24px 32px; }
.intro { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 13px; }
h1 { font: 400 clamp(28px, 4.1vw, 45px)/1.12 Georgia, serif; margin: 0; letter-spacing: -.035em; }
.intro p, .help { margin: 0; color: #5d5549; font-size: .82rem; }
.intro p { white-space: nowrap; }

.stage {
  min-height: 270px;
  height: min(57vh, 570px);
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d4cbbd;
  border-radius: 3px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline-offset: -3px;
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
}

canvas:active { cursor: grabbing; }
.overlay {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background: #fff;
  font-size: .88rem;
  text-align: center;
  pointer-events: none;
}

.disclaimer {
  position: absolute;
  z-index: 2;
  inset: 9px 9px auto auto;
  max-inline-size: min(78%, 275px);
  margin: 0;
  border-radius: 3px;
  padding: 5px 8px;
  color: #483d2d;
  background: #fffaf0ee;
  font-size: .72rem;
  line-height: 1.35;
  text-align: right;
  pointer-events: none;
}

.controls { margin: 13px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 14px; }
.group { display: flex; flex-wrap: wrap; gap: 5px; }
button {
  color: #352e24;
  background: #fcfaf5;
  border: 1px solid #d7cdbe;
  border-radius: 3px;
  padding: 8px 13px;
  min-height: 44px;
  min-width: 44px;
  font: 600 .82rem/1.1 system-ui, sans-serif;
  cursor: pointer;
}

button:hover:not(:disabled) { border-color: #7e694b; }
button[aria-pressed="true"] { color: #fffaf0; background: #30271d; border-color: #30271d; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid #825b23; outline-offset: 2px; }
.help { line-height: 1.45; }
.fallback-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; pointer-events: none; }
.fallback-angle { margin-top: 12px; }
.fallback-angle summary { cursor: pointer; padding-block: 8px; }
.fallback-angle img { max-width: 100%; height: auto; display: block; }
.overlay:empty, .overlay[hidden], #status[hidden] + .fallback-poster { display: none; }
.stage:not(:has(#status[hidden])) ~ :is(.controls, .help) { display: none; }
.stage:has(#status[hidden]) ~ .fallback-angle { display: none; }

.embedded header, .embedded .intro { display: none; }
.embedded main { max-width: none; padding: 0 0 5px; }
.embedded .stage { min-height: 220px; height: clamp(220px, calc(100svh - 98px), 570px); }
.embedded .controls { margin-block: 9px 7px; }

@media (max-width: 560px) {
  header { min-height: 60px; }
  header img { width: 125px; height: 37px; }
  main { padding: 16px 12px 24px; }
  .intro { margin-bottom: 9px; gap: 4px 12px; flex-wrap: wrap; }
  .intro p { font-size: .76rem; }
  .stage { height: 50svh; }
  .controls { gap: 8px; }
  .group { gap: 4px; }
  button { padding-inline: 10px; }
  .embedded .stage { height: clamp(220px, calc(100svh - 154px), 520px); }
}
