html, body {
  height: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}

/* Sized in JS to the object-fit: cover rectangle of the photo,
   so hotspot percentages stay glued to the image when the viewport crops it. */
.frame {
  position: absolute;
}

.buf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.buf.off {
  opacity: 0;
}

.hotspot {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

body.debug .hotspot {
  outline: 2px solid #ff2a2a;
  background: rgba(255, 42, 42, 0.28);
}

body.debug .hotspot span {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-100%);
  background: #ff2a2a;
  color: #fff;
  font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif;
  padding: 2px 4px;
  white-space: nowrap;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.overlay[hidden] {
  display: none !important;
}

.mac {
  width: min(520px, calc(100vw - 28px));
  background: #d9d9d9;
  color: #000;
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #808080,
    2px 2px 0 #000;
  padding: 2px;
  font-family: Geneva, "Lucida Grande", "Trebuchet MS", sans-serif;
  user-select: none;
}

.mac-titlebar {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  background: repeating-linear-gradient(
    to bottom,
    #111 0 1px,
    #f2f2f2 1px 2px
  );
  border: 1px solid #000;
}

.mac-close {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  padding: 0;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #888;
  cursor: pointer;
  flex: 0 0 auto;
}

.mac-close:active {
  background: #ccc;
}

.mac-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  max-width: 68%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #000;
  padding: 0 10px;
  font: bold 12px/16px Geneva, "Lucida Grande", "Trebuchet MS", sans-serif;
}

.mac-well {
  margin: 6px 6px 4px;
  background: #000;
  aspect-ratio: 4 / 3;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #555, inset -1px -1px 0 #fff;
  position: relative;
  overflow: hidden;
}

.mac-well video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.mac-bar {
  margin: 0 6px 6px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  background: #d4d4d4;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.mac-play {
  width: 22px;
  height: 16px;
  padding: 0;
  background: #ddd;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #666;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.mac-play::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #000;
}

.mac-play.is-playing::before {
  left: 6px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 0;
  background:
    linear-gradient(#000, #000) left / 2px 100% no-repeat,
    linear-gradient(#000, #000) right / 2px 100% no-repeat;
}

.mac-scrub {
  position: relative;
  flex: 1;
  height: 10px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #888;
}

.mac-thumb {
  position: absolute;
  top: -3px;
  left: 0;
  width: 12px;
  height: 14px;
  background: #e8e8e8;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #777;
  pointer-events: none;
}

.mac-scrub input {
  position: absolute;
  inset: -4px 0;
  width: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mac-time {
  font: 11px/1 ui-monospace, ui-monospace, monospace;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #bbb;
  padding: 2px 4px;
  min-width: 78px;
  text-align: center;
}

.extras {
  position: relative;
  min-width: 200px;
  background: #fff6b8;
  color: #1a1a1a;
  border: 1px solid #222;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  padding: 22px 28px 18px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.extras h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 650;
}

.extras p {
  margin: 0;
  font-size: 14px;
}

.extras-close {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #222;
}

.load-error {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eee;
  font: 14px/1.4 ui-sans-serif, system-ui, sans-serif;
}
