﻿:root {
  color-scheme: dark;
  --app-height: 100vh;
  --toolbar-height: calc(env(safe-area-inset-top) + 64px);
  --toolbar-surface: rgba(0, 0, 0, 0.55);
  --toolbar-blur: blur(10px);
  --accent: rgba(255, 255, 255, 0.16);
  --accent-strong: rgba(255, 255, 255, 0.28);
  --text-color: #ffffff;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: var(--app-height);
  background: #000;
  color: var(--text-color);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

body {
  position: relative;
}

html.audio-disabled .media-controls {
  display: none !important;
}

button {
  font: inherit;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  background: var(--accent);
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 12px;
  background: var(--toolbar-surface);
  backdrop-filter: var(--toolbar-blur);
  -webkit-backdrop-filter: var(--toolbar-blur);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.session-controls,
.media-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-controls button,
.media-controls button {
  min-width: 64px;
}

.pairing-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  flex-wrap: wrap;
}

.pairing-hint__action {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  padding: 4px 12px;
  font-size: 13px;
}

.pairing-hint__action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.pairing-hint__action:disabled {
  opacity: 0.5;
}

.media-controls button {
  font-weight: 600;
}

.toolbar-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 18px;
  line-height: 1;
}

.toolbar-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.toolbar-toggle[aria-pressed="true"] {
  background: rgba(68, 191, 255, 0.18);
  border-color: rgba(68, 191, 255, 0.35);
}

body.toolbar-hidden .toolbar {
  transform: translateY(calc(-100% - env(safe-area-inset-top)));
  opacity: 0;
  pointer-events: none;
}
.container {
  position: relative;
  width: 100vw;
  height: var(--app-height);
  background: #000;
}

#remoteVideo {
  position: absolute;
  top: var(--toolbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--app-height) - var(--toolbar-height));
  object-fit: contain;
  object-position: center;
  background: #000;
  z-index: 1;
}

body.toolbar-hidden #remoteVideo {
  top: 0;
  height: var(--app-height);
}

#stage {
  position: absolute;
  top: var(--toolbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: auto;
}

body.toolbar-hidden #stage {
  top: 0;
}

.toolbar-reveal {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  right: 14px;
  z-index: 20;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.toolbar-reveal:focus-visible {
  outline: 2px solid rgba(68, 191, 255, 0.7);
  outline-offset: 2px;
}

.toolbar-reveal[hidden] {
  display: none;
}

body.video-active #remoteVideo {
  filter: none;
}

body:not(.video-active) #remoteVideo {
  filter: brightness(0.85);
}

.trial-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 30;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.trial-overlay[hidden] {
  display: none !important;
}

.trial-modal {
  max-width: 320px;
  width: 88%;
  padding: 24px 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.trial-modal h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.trial-modal p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
}

.trial-modal button {
  min-width: 120px;
  font-weight: 600;
  background: rgba(68, 191, 255, 0.28);
  border: 1px solid rgba(68, 191, 255, 0.45);
}

.trial-modal button:hover:not(:disabled) {
  background: rgba(68, 191, 255, 0.42);
}

.trial-modal button:focus-visible {
  outline: 2px solid rgba(68, 191, 255, 0.8);
  outline-offset: 2px;
}

.loading-overlay {
  position: absolute;
  top: var(--toolbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  color: var(--text-color);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.toolbar-hidden .loading-overlay {
  top: 0;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.loading-indicator span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: loading-pulse 1.2s ease-in-out infinite;
}

.loading-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}.loading-message {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.loading-hint {
  margin: 0;
  font-size: 14px;
  opacity: 0.75;
}

@keyframes loading-pulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}
}
@media (max-width: 720px) {
  .toolbar {
    gap: 8px;
    padding: calc(env(safe-area-inset-top) + 6px) 10px 10px;
  }

  .toolbar-controls {
    gap: 12px;
  }

  .session-controls,
  .media-controls {
    width: 100%;
    justify-content: center;
  }

  .session-controls button,
  .media-controls button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .toolbar-toggle,
  .toolbar-reveal {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  button {
    padding: 6px 10px;
  }
}





