:root {
  --bg: #000;
  --fg: #fff;
  --ui-bg: rgba(0, 0, 0, .58);
  --line: rgba(255, 255, 255, .78);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--fg);
}

body {
  position: fixed;
  inset: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
  color: inherit;
}

.viewer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
}

.art-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  touch-action: none;
}

.navigator {
  position: absolute;
  z-index: 20;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  height: min(162px, 24vh);
  width: auto;
  aspect-ratio: var(--nav-aspect, 3 / 4);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .82);
  background: transparent;
  pointer-events: none;
}

.navigator img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  background: transparent;
}

.navigator__window {
  position: absolute;
  border: 1px solid #fff;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.controls {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.controls button {
  width: max-content;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .34);
  background: var(--ui-bg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.controls button:first-child {
  justify-self: start;
}

.controls button:last-child {
  justify-self: end;
}

.controls button:hover,
.controls button:focus-visible {
  border-color: #fff;
  outline: 0;
}

.controls button:disabled {
  opacity: .26;
  cursor: default;
}

.controls__counter {
  padding: 5px 8px;
  background: var(--ui-bg);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.status {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 40;
  width: min(520px, calc(100vw - 44px));
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .12em;
  text-align: center;
  pointer-events: none;
}

@media (hover: none), (pointer: coarse) {
  .navigator {
    height: min(132px, 22vh);
    width: auto;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }

  .controls {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .controls button {
    min-height: 38px;
    font-size: 8px;
  }
}

/* RENAISSANCE NAVIGATOR V3.1 */
.navigator {
  height: min(162px, 24vh);
  width: auto;
  aspect-ratio: var(--nav-aspect, 3 / 4);
  overflow: hidden;
  background: transparent;
}

.navigator img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  background: transparent;
}

@media (hover: none), (pointer: coarse) {
  .navigator {
    height: min(132px, 22vh);
    width: auto;
  }
}
