/* Logan's phone camera. Fixed on the page so it stays up on every tab. */

.phone-cam {
  position: fixed;
  right: max(0.8rem, env(safe-area-inset-right));
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  z-index: 10072;
  width: 12.5rem;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.94);
  border: 2px solid #c9a227;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: #f0e2c0;
  overflow: hidden;
  touch-action: none;
}

.phone-cam.is-placed {
  bottom: auto;
}

.phone-cam-toggle,
.phone-cam-bar button {
  margin: 0;
  border: 0;
  background: transparent;
  color: #f0d78a;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.phone-cam-toggle {
  padding: 0.55rem 0.7rem;
  min-height: 2.6rem;
  text-align: left;
}

.phone-cam-toggle:hover,
.phone-cam-bar button:hover {
  background: rgba(201, 162, 39, 0.16);
}

.phone-cam.is-on .phone-cam-toggle,
.phone-cam.is-live .phone-cam-toggle,
.phone-cam.is-live .phone-cam-bar {
  display: none;
}

.phone-cam.is-remote video.phone-cam-view {
  display: none;
}

.phone-cam.is-on::after,
.phone-cam.is-live::after {
  content: "Live";
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 1;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(20, 16, 8, 0.8);
  color: #f0d78a;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.phone-cam:not(.is-on):not(.is-live) .phone-cam-view,
.phone-cam:not(.is-on):not(.is-live) .phone-cam-bar,
.phone-cam:not(.is-on):not(.is-live) .phone-cam-note {
  display: none;
}

.phone-cam-view {
  width: 100%;
  height: min(18rem, 52vh);
  object-fit: cover;
  display: block;
  background: #12151e;
  cursor: grab;
}

.phone-cam-note {
  margin: 0;
  padding: 0.35rem 0.5rem 0;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #f0e2c0;
}

.phone-cam-note:empty {
  display: none;
}

.phone-cam-bar {
  display: flex;
}

.phone-cam-bar button {
  flex: 1;
  min-height: 2.4rem;
  border-top: 1px solid rgba(201, 162, 39, 0.35);
}

.phone-cam-bar button + button {
  border-left: 1px solid rgba(201, 162, 39, 0.35);
}

/* Phones: a small button above the money bar, then a short picture. */
@media (max-width: 640px) {
  .phone-cam {
    left: auto;
    right: max(0.5rem, env(safe-area-inset-right));
    bottom: calc(5.8rem + env(safe-area-inset-bottom));
    width: auto;
    z-index: 10055;
  }

  .phone-cam:not(.is-on):not(.is-live) {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
  }

  .phone-cam:not(.is-on):not(.is-live) .phone-cam-toggle {
    width: 2.75rem;
    height: 2.75rem;
    min-height: 0;
    padding: 0;
    font-size: 0;
    text-align: center;
  }

  .phone-cam:not(.is-on) .phone-cam-toggle::before {
    content: "📷";
    font-size: 1.15rem;
    line-height: 2.75rem;
  }

  .phone-cam.is-on,
  .phone-cam.is-live {
    width: 6.25rem;
  }

  .phone-cam.is-on .phone-cam-view,
  .phone-cam.is-live .phone-cam-view {
    height: 7.6rem;
  }

  .phone-cam-bar button {
    min-height: 2rem;
    font-size: 0.68rem;
  }
}
