* { box-sizing: border-box }
body { margin: 0; font-family: system-ui, sans-serif; background: #13212b; color: white }
main { height: 100vh; height: 100dvh; position: relative; overflow: hidden; isolation: isolate }
#view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; background: #283841 url('images/schody_o_0.jpg') center/cover }
#view:active { cursor: grabbing }
#cube { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d }
.face { position: absolute; width: 1000px; height: 1000px; left: -500px; top: -500px; backface-visibility: hidden; pointer-events: none }

.badge { position: absolute; pointer-events: none; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); padding: 4px 9px; border-radius: 14px; background: #102532dc; color: #bcecff; font-weight: 700; font-size: 14px }
.controls { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 4px }
.controls button { cursor: pointer; display: grid; place-items: center; color: white; background: #102532dc; border: 1px solid #ffffff80; border-radius: 50%; width: 44px; height: 44px; padding: 0 }
.controls button:hover { background: #234957 }
.ready #rotation { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: clamp(54px, 9vw, 72px); height: clamp(54px, 9vw, 72px); background: #102532ed; box-shadow: 0 3px 16px #08152250 }
.icon { width: 13px; height: 16px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%) }
.ready .icon { width: 18px; height: 22px; margin-left: 3px }
#rotation.playing .icon { clip-path: none; background: linear-gradient(to right, currentColor 35%, transparent 35% 65%, currentColor 65%) }
button:focus-visible, #view:focus-visible { outline: 3px solid #9befff; outline-offset: -3px }

#wheel-hint {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid; place-items: center; padding: 16px;
  background: rgb(8 18 27 / 78%); color: white; text-align: center;
  font-size: clamp(16px, 3vw, 22px); line-height: 1.5;
  opacity: 0; transition: opacity 160ms ease;
}
#wheel-hint.visible { opacity: 1 }
#wheel-hint kbd { font: inherit; font-weight: 700 }
@media (prefers-reduced-motion: reduce) {
  #wheel-hint { transition: none }
}
