/* The Aliens island's glass over the world (aliens/hud.js): the crank's button, the pilot's green screen, the round's strip. */

#al-crank,
#al-beam,
#al-pilot .leave,
#al-round {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  color: var(--ink);
}

#al-crank,
#al-beam {
  position: fixed;
  z-index: 3;
  width: 76px;
  height: 76px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#al-crank {
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
}

#al-crank > svg:not(.ring),
#al-beam > svg:not(.ring) {
  position: absolute;
  inset: 17px;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 1px 2px rgba(0, 40, 90, 0.35));
}

#al-crank kbd,
#al-beam kbd {
  position: absolute;
  right: -6px;
  bottom: -6px;
}

#al-crank.down {
  transform: translateX(-50%) scale(0.93);
  box-shadow: var(--rim), 0 0 20px 5px rgba(140, 255, 170, 0.8);
}

/* The ring round a button: how far its dish has come round, or how full the beam is. */
.ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke: #2fd65a;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: calc(var(--p, 0) * 100) 100;
  filter: drop-shadow(0 0 4px rgba(80, 255, 130, 0.9));
}

#al-pilot {
  position: fixed;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

#al-pilot .crt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vh, 80vw, 720px);
  aspect-ratio: 1;
  transform: translate(-50%, -52%);
  padding: 14px;
  border-radius: 34px;
  background: linear-gradient(180deg, #f6fbff, #c9d9e6 55%, #9fb6c8);
  box-shadow: inset 0 2px 0 #fff, inset 0 -3px 8px rgba(20, 50, 80, 0.35), 0 24px 60px rgba(0, 30, 70, 0.55);
}

#al-pilot canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 0 2px #24313d;
}

#al-pilot .leave {
  position: absolute;
  pointer-events: auto;
  left: 50%;
  top: calc(50% + min(39vh, 40vw, 360px) - 4px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px 10px 12px;
  border-radius: 999px;
  font: 600 17px var(--font);
  cursor: pointer;
}

#al-beam {
  pointer-events: auto;
  right: max(22px, calc(50% - min(39vh, 40vw, 360px) - 110px));
  bottom: 40px;
}

#al-beam.full {
  box-shadow: var(--rim), 0 0 22px 6px rgba(120, 255, 160, 0.75);
}

#al-round {
  position: fixed;
  z-index: 3;
  top: 18px;
  left: 50%;
  transform: translateX(calc(-50% + var(--shift, 0px) / 2));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-radius: 22px;
  pointer-events: none;
}

#al-round .dishes {
  display: flex;
  gap: 6px;
}

#al-round .dishes i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #6b8aa0;
  background: conic-gradient(rgba(47, 214, 90, 0.45) calc(var(--p, 0) * 360deg), transparent 0);
}

#al-round .dishes i.done {
  color: #fff;
  background: radial-gradient(circle at 40% 35%, #b8ffc8, #22c24e);
  box-shadow: 0 0 10px rgba(60, 255, 120, 0.8);
}

#al-round .dishes svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
}

#al-round b {
  display: block;
  width: 120px;
  height: 10px;
  border-radius: 5px;
  background: rgba(6, 48, 79, 0.22);
  overflow: hidden;
}

#al-round u {
  display: block;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(180deg, #a8ffbe, #22c24e);
}

/* Flying: the figure's own jump and gestures are put away, and the stick flies the saucer. */
:root[data-pilot] #jump,
:root[data-pilot] #gesture,
:root[data-pilot] #gestures {
  display: none !important;
}

:root[data-touch="true"] #al-crank {
  left: auto;
  right: 22px;
  bottom: calc(138px + env(safe-area-inset-bottom));
  transform: none;
}

:root[data-touch="true"] #al-crank.down {
  transform: scale(0.93);
}

/* On a phone the round's strip and the screen sit under the name, the tickets and Sound, over the stick and the beam's button. */
:root[data-touch="true"] #al-round {
  top: calc(112px + env(safe-area-inset-top));
}

:root[data-touch="true"] #al-pilot .crt {
  width: min(90vw, 52vh);
  top: calc(164px + env(safe-area-inset-top));
  transform: translateX(-50%);
}

:root[data-touch="true"] #al-pilot .leave {
  top: calc(174px + env(safe-area-inset-top) + min(90vw, 52vh));
}

:root[data-touch="true"] #al-beam {
  right: 22px;
  bottom: calc(40px + env(safe-area-inset-bottom));
  width: 96px;
  height: 96px;
}

:root[data-touch="true"] #al-beam > svg:not(.ring) {
  inset: 22px;
  width: 52px;
  height: 52px;
}
