:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;

  background: #050914;
  color: #f5f8ff;

  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

#field {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: manipulation;
}

.top {
  position: fixed;
  z-index: 10;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  pointer-events: none;
}

.top > div,
.top button {
  pointer-events: auto;
}

.top > div {
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;

  background: rgba(5, 9, 20, .6);
  backdrop-filter: blur(14px);
}

.top strong {
  display: block;
  font-size: 13px;
  letter-spacing: .3em;
}

.top small {
  display: block;
  margin-top: 4px;
  opacity: .62;
}

.secondary,
.moods button {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;

  background: rgba(255,255,255,.08);
  color: white;

  padding: 9px 12px;

  backdrop-filter: blur(12px);
}

.secondary.enabled {
  border-color: rgba(123,220,255,.55);
  background: rgba(123,220,255,.15);
}

.moods {
  position: fixed;
  z-index: 9;
  top: 92px;
  right: 12px;

  display: flex;
  flex-direction: column;
  gap: 7px;
}

.moods button {
  cursor: pointer;
}

.moods button.selected {
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.16);
}

footer {
  position: fixed;
  z-index: 9;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;

  transform: translateX(-50%);

  padding: 9px 15px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;

  background: rgba(0,0,0,.35);
  backdrop-filter: blur(12px);

  white-space: nowrap;
  font-size: 13px;
}

.presence-card {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(65px + env(safe-area-inset-bottom));

  width: min(88vw, 330px);

  transform: translateX(-50%);

  display: grid;
  justify-items: center;
  gap: 8px;

  padding: 20px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;

  background: rgba(4,8,18,.86);
  backdrop-filter: blur(18px);

  text-align: center;
}

.presence-card.hidden {
  display: none;
}

.close-card {
  position: absolute;
  top: 7px;
  right: 10px;

  border: 0;
  background: transparent;
  color: white;

  font-size: 24px;
}

.presence-light {
  width: 30px;
  height: 30px;
  border-radius: 50%;

  background: #fff;
  box-shadow: 0 0 28px currentColor;
}

#presence-distance,
#presence-mood {
  font-size: 13px;
  opacity: .7;
}

@media (max-width: 560px) {
  .top {
    align-items: flex-start;
  }

  .top small {
    max-width: 140px;
  }

  .moods {
    top: 112px;
  }

  .moods button {
    padding: 8px 10px;
    font-size: 12px;
  }
}
