:root {
  color-scheme: dark;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: #090b10;
  color: #f7f4ed;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -20%, rgba(103, 124, 156, 0.24), transparent 48rem),
    #090b10;
}

button,
iframe {
  font: inherit;
}

.play-page {
  width: min(100%, 120rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(0.75rem, 2vw, 1.75rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.15rem;
  color: #b3bfd0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.fullscreen-button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.fullscreen-button:hover {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.14);
}

.fullscreen-button:active {
  transform: scale(0.97);
}

.fullscreen-button:focus-visible {
  outline: 3px solid #93b7ea;
  outline-offset: 3px;
}

.fullscreen-button svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.game-stage {
  position: relative;
  width: 100%;
  max-height: calc(100dvh - 10rem);
  margin: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: clamp(0.35rem, 1vw, 0.8rem);
  background: #000;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.48);
}

.game-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.play-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #aeb5c0;
  font-size: 0.875rem;
}

.play-footer p {
  margin: 0;
}

.rotate-hint {
  display: none;
}

.local-warning {
  position: absolute;
  z-index: 5;
  inset: 0;
  padding: clamp(1.25rem, 5vw, 4rem);
  display: grid;
  place-content: center;
  gap: 0.8rem;
  background: #0d1119;
  color: #dce3ed;
  text-align: center;
  line-height: 1.8;
}

.local-warning[hidden] {
  display: none;
}

.local-warning p {
  max-width: 46rem;
  margin: 0;
}

.local-warning__title {
  color: #fff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.15rem, 3vw, 1.8rem);
}

.game-stage:fullscreen,
.game-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border: 0;
  border-radius: 0;
}

@media (max-width: 44rem) {
  .play-page {
    padding: 0.65rem;
  }

  .fullscreen-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .fullscreen-button {
    width: 2.75rem;
    padding: 0;
    justify-content: center;
  }

  .play-footer {
    display: block;
    line-height: 1.65;
  }

  .controls {
    display: none;
  }
}

@media (max-width: 56rem) and (orientation: landscape) {
  .play-page {
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .play-header {
    position: fixed;
    z-index: 10;
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
  }

  .play-header > div,
  .play-footer {
    display: none;
  }

  .fullscreen-button {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(0.4rem);
  }

  .game-stage {
    width: min(100vw, calc(100dvh * 16 / 9));
    max-height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 56rem) and (orientation: portrait) {
  .rotate-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(5, 7, 10, 0.84);
    color: #fff;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    animation: hint 4s 1.5s ease both;
  }

  .rotate-hint p {
    margin: 0;
    font-size: clamp(0.8rem, 3.8vw, 1rem);
    line-height: 1.6;
  }

  .phone-icon {
    width: 1.65rem;
    height: 2.75rem;
    border: 2px solid currentColor;
    border-radius: 0.3rem;
    transform: rotate(90deg);
  }
}

@keyframes hint {
  0%, 100% { opacity: 0; }
  15%, 75% { opacity: 1; }
}

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