:root {
  --fade-ms: 600ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  background: #000;
}

#player, #preload {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#preload {
  visibility: hidden;
  pointer-events: none;
}

#controls {
  position: fixed;
  right: max(env(safe-area-inset-right), 18px);
  bottom: max(env(safe-area-inset-bottom), 18px);
  display: flex;
  gap: 6px;
  transition: opacity var(--fade-ms);
}

#controls button {
  appearance: none;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 200ms, background 200ms;
}

#controls button:hover { opacity: 1; background: rgba(0, 0, 0, 0.55); }

#footer-links {
  position: fixed;
  left: max(env(safe-area-inset-left), 18px);
  bottom: max(env(safe-area-inset-bottom), 22px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  transition: opacity var(--fade-ms);
}

#footer-links a,
#footer-links button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  cursor: pointer;
  transition: color 200ms;
}

#footer-links a:hover,
#footer-links button:hover { color: rgba(255, 255, 255, 0.9); }

#footer-links .sep { color: rgba(255, 255, 255, 0.3); }

body.idle #controls,
body.idle #footer-links {
  opacity: 0;
}

body.muted #mute { opacity: 0.55; }

#empty {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: italic;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.55);
}
#empty[hidden] { display: none; }
#empty a { color: inherit; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 36px 32px 28px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  line-height: 1.55;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-card h2 {
  margin: 0 0 16px;
  font-weight: 400;
  font-size: 26px;
  font-style: italic;
}

.modal-card p { margin: 0 0 14px; }
.modal-card p:last-child { margin-bottom: 0; }

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  appearance: none;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover { color: #fff; }
