:root {
  --viewport-height: 100vh;
  --page-background: #000;
  --text-color: #f5f5f5;
  --muted-surface: rgba(255, 255, 255, 0.12);
  --control-surface: rgba(20, 20, 20, 0.58);
  --control-surface-hover: rgba(20, 20, 20, 0.82);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--page-background);
}

body {
  color: var(--text-color);
  font-family: Arial, Helvetica, sans-serif;
}

.experience {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--viewport-height);
  min-height: 100vh;
  min-height: 100svh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--page-background);
}

.stream-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--page-background);
}

.loading-screen {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page-background);
  opacity: 1;
  visibility: visible;
  transition: opacity 350ms ease, visibility 350ms ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

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

.status-panel {
  max-width: 560px;
  text-align: center;
  line-height: 1.55;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 18px;
  border: 3px solid var(--muted-surface);
  border-top-color: var(--text-color);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.error-state[hidden] {
  display: none;
}

.refresh-button {
  margin-top: 14px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 6px;
  color: var(--text-color);
  background: var(--muted-surface);
  font: inherit;
  cursor: pointer;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.fullscreen-button {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #fff;
  background: var(--control-surface);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 250ms ease, background-color 250ms ease;
  touch-action: manipulation;
}

.fullscreen-button:hover,
.fullscreen-button:focus-visible {
  opacity: 1;
  background: var(--control-surface-hover);
  outline: none;
}

.fullscreen-button.is-idle {
  opacity: 0;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1600ms; }
  .loading-screen,
  .fullscreen-button { transition: none; }
}
