:root {
  color-scheme: dark;
  background: #08090c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #08090c;
}

body { min-height: 100vh; min-height: 100svh; }

.player-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: #08090c;
  isolation: isolate;
}

.player-mount {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.player-mount ruffle-player {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
}

.status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #d7d9df;
  background: #08090c;
  font-size: 14px;
  text-align: center;
  opacity: 1;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.status.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.status.is-error {
  color: #f0c7c7;
  background: #08090c;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgb(255 255 255 / 18%);
  border-top-color: #e6e8ed;
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.status.is-error .spinner { display: none; }

.fullscreen-button {
  position: absolute;
  z-index: 3;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 12px;
  color: #fff;
  background: rgb(10 11 15 / 58%);
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.player-shell:hover .fullscreen-button,
.fullscreen-button:focus-visible,
.player-shell:focus-within .fullscreen-button {
  opacity: 1;
}

.fullscreen-button:hover { background: rgb(35 37 44 / 88%); }
.fullscreen-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.fullscreen-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: none), (pointer: coarse) {
  .fullscreen-button { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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