:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f5f5f5;
  background: #050505;
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #050505; overscroll-behavior: none; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
#app { width: 100vw; height: 100dvh; position: relative; overflow: hidden; }
.gate {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left));
  background: radial-gradient(circle at 50% 25%, #202020 0, #0d0d0d 34%, #050505 72%);
}
.gate-card { width: min(92vw, 390px); text-align: center; display: grid; gap: 14px; }
.mark { width: 74px; height: 74px; margin: 0 auto 4px; display: grid; place-items: center; border: 1px solid #4d4d4d; border-radius: 50%; font-size: 22px; font-weight: 800; letter-spacing: .04em; background: #101010; }
h1 { margin: 0; font-size: clamp(42px, 13vw, 72px); letter-spacing: -.06em; line-height: .95; }
p { margin: 0 0 8px; color: #b8b8b8; line-height: 1.45; }
small { color: #777; line-height: 1.4; }
.primary, .secondary { width: 100%; min-height: 54px; border-radius: 15px; cursor: pointer; }
.primary { border: 0; background: #f3f3f3; color: #080808; font-weight: 800; }
.secondary { border: 1px solid #383838; background: #111; color: #dedede; font-weight: 700; }
.player-shell { position: absolute; inset: 0; background: #000; overflow: hidden; touch-action: none; }
.player-host { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
/* The source movie is 4:3. Keep the actual Ruffle viewport 4:3 as well,
   so portrait Safari cannot hand Flash a tall stage that crops the movie. */
ruffle-player {
  width: min(100vw, calc(100dvh * 4 / 3)) !important;
  height: min(100dvh, calc(100vw * 3 / 4)) !important;
  aspect-ratio: 4 / 3;
  max-width: 100vw;
  max-height: 100dvh;
  display: block;
  touch-action: none;
  outline: 0;
}
@supports not (height: 100dvh) {
  ruffle-player {
    width: min(100vw, calc(100vh * 4 / 3)) !important;
    height: min(100vh, calc(100vw * 3 / 4)) !important;
    max-height: 100vh;
  }
}
.floating {
  position: absolute; z-index: 20; top: calc(10px + var(--safe-top)); right: calc(10px + var(--safe-right));
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,.18); color: white;
  background: rgba(15,15,15,.68); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 24px;
  opacity: .72; transition: opacity .2s ease;
}
.floating:active { opacity: 1; transform: scale(.96); }
.rotate-hint {
  position: absolute; z-index: 15; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%);
  display: none; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 999px;
  background: rgba(12,12,12,.75); border: 1px solid rgba(255,255,255,.15); color: #ddd; font-size: 13px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none;
}
.rotate-hint span { font-size: 18px; }
.error { position: absolute; z-index: 50; inset: 16px; display: grid; place-items: center; padding: 24px; background: rgba(20,0,0,.94); border: 1px solid #6e2525; border-radius: 18px; text-align: center; }
@media (orientation: portrait) and (max-width: 800px) { .rotate-hint { display: flex; } }
@media (display-mode: fullscreen), (display-mode: standalone) { .floating { top: calc(6px + var(--safe-top)); right: calc(6px + var(--safe-right)); } }
