:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
}

* { box-sizing: border-box; }

html, body, #viewer {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

#viewer {
  position: relative;
  display: grid;
  place-items: center;
}

#sop-image {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  display: none;
  background: #000;
}

#sop-image.visible { display: block; }

.message {
  display: grid;
  place-items: center;
  gap: 1rem;
  max-width: 36rem;
  padding: 2rem;
  color: #f8fafc;
  text-align: center;
}

.message.hidden { display: none; }

.message p {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 700;
}

.message small {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.5;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid #1e293b;
  border-top-color: #38bdf8;
  border-radius: 999px;
  animation: spin .85s linear infinite;
}

.message.error .spinner { display: none; }

.connection {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: .45rem .7rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .45rem;
  color: #cbd5e1;
  background: rgba(15,23,42,.82);
  font-size: .85rem;
  opacity: 0;
  transition: opacity .2s ease;
}

#viewer:hover .connection,
.connection.problem { opacity: 1; }

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

.fullscreen-controls{position:fixed;left:4px;bottom:4px;z-index:10;color:#fff}
.fullscreen-controls button{display:flex;align-items:center;justify-content:center;width:24px;height:24px;min-height:0;padding:4px;border:0;border-radius:3px;background:rgba(15,23,42,.45);color:#fff;cursor:pointer;opacity:.55}
.fullscreen-controls button:hover,.fullscreen-controls button:focus{opacity:1}
.fullscreen-controls button:focus{outline:1px solid #f6a800;outline-offset:1px}
.fullscreen-controls button svg{display:block;flex:none}
.fullscreen-controls p{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.fullscreen-controls.is-hidden{opacity:0;pointer-events:none}
html.sop-fullscreen #connection{display:none}
