@font-face {
  font-family: RVTitle;
  src: url(assets/title.ttf);
  font-weight: 900;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: RVDisplay;
  src: url(assets/display.ttf);
  font-weight: 700;
  font-display: block;
}
@font-face {
  font-family: RVMono;
  src: url(assets/mono.ttf);
  font-weight: 500;
  font-display: block;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  font-family: RVDisplay, system-ui, sans-serif;
}
#frame {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
canvas {
  display: block;
  background: #04060e;
  opacity: 0;
  transition: opacity 0.25s;
}
body.ready canvas {
  opacity: 1;
}

/* touch controls: hidden until a finger touches the screen */
#pad {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
body.touch #pad {
  display: block;
}
#pad > *,
#buttons > * {
  pointer-events: auto;
}
#stick {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(38vmin, 170px);
  height: min(38vmin, 170px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 170, 230, 0.1) 0 55%, rgba(140, 170, 230, 0.2) 56% 100%);
  border: 1.5px solid rgba(160, 190, 255, 0.35);
  touch-action: none;
}
#knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 40%;
  margin: -20% 0 0 -20%;
  border-radius: 50%;
  background: rgba(200, 220, 255, 0.4);
  border: 1.5px solid rgba(230, 240, 255, 0.6);
  pointer-events: none;
}
#buttons {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(46vmin, 210px);
  height: min(40vmin, 180px);
  pointer-events: none;
}
#pad button {
  position: absolute;
  border: 1.5px solid rgba(160, 190, 255, 0.4);
  background: rgba(20, 30, 60, 0.45);
  color: #eaf1ff;
  font: 700 15px RVDisplay, system-ui, sans-serif;
  letter-spacing: 0.04em;
  border-radius: 50%;
  touch-action: none;
  padding: 0;
}
#pad button.on {
  background: rgba(95, 243, 255, 0.45);
  border-color: #5ff3ff;
}
#pad .big {
  width: 44%;
  aspect-ratio: 1;
  font-size: 24px;
  line-height: 1;
}
#pad .big span {
  display: block;
  font-size: 9px;
  opacity: 0.75;
  margin-top: 2px;
}
#pad .a {
  right: 0;
  bottom: 6%;
  border-color: rgba(255, 138, 58, 0.7);
}
#pad .b {
  right: 48%;
  bottom: 0;
}
#pad .small {
  width: 25%;
  aspect-ratio: 1;
  font-size: 9px;
}
#buttons .small:nth-child(1) {
  right: 62%;
  top: 0;
}
#buttons .small:nth-child(2) {
  right: 30%;
  top: -4%;
}
#bPause {
  right: max(12px, env(safe-area-inset-right));
  top: max(10px, env(safe-area-inset-top));
  width: 38px !important;
  height: 38px;
  aspect-ratio: auto !important;
  font-size: 13px !important;
}
/* held upright: picture on top, controls underneath */
body.portrait #frame {
  align-items: flex-start;
}
body.portrait #bPause {
  top: auto;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + min(40vmin, 180px) + 34px);
}
#turn {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(56.25vw + env(safe-area-inset-top) + 18px);
  margin: 0;
  text-align: center;
  color: rgba(198, 210, 238, 0.5);
  font: 700 12px RVDisplay, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
body.portrait #turn {
  display: block;
}
