:root {
  color-scheme: dark;
  --night: #050a1a;
  --panel: rgba(12, 22, 48, .92);
  --line: rgba(183, 205, 255, .24);
  --text: #f6f8ff;
  --muted: #aab9d9;
  --yellow: #ffd85a;
  --blue: #6e9cff;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text);
  background: var(--night);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; }

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  overflow: auto;
  padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 16% 19%, rgba(121, 164, 255, .25) 0 1px, transparent 2px),
    radial-gradient(circle at 79% 24%, rgba(255, 255, 255, .8) 0 1px, transparent 2px),
    radial-gradient(circle at 61% 76%, rgba(255, 216, 90, .65) 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 25%, #172751 0%, #091329 48%, #040817 100%);
  background-size: 87px 97px, 121px 131px, 163px 149px, auto;
}
.overlay[hidden] { display: none; }
.screen {
  display: none;
  width: min(100%, 580px);
  min-height: calc(100vh - 48px);
  margin: auto;
  text-align: center;
  align-content: center;
  padding: 14px 0;
}
.screen.is-active { display: grid; justify-items: center; }
.screen.wide { width: min(100%, 860px); align-content: start; padding-top: 18px; }
.eyebrow, .step-number {
  width: max-content;
  padding: 7px 15px;
  border: 1px solid rgba(255,255,255,.27);
  border-radius: 999px;
  color: #dce7ff;
  background: rgba(255,255,255,.07);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}
.brand-mark { position: relative; width: 108px; height: 90px; margin: 22px auto 4px; }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; top: 26px; width: 43px; height: 43px;
  border: 5px solid var(--yellow); border-radius: 50%; box-shadow: 0 0 26px rgba(255,216,90,.35);
}
.brand-mark::before { left: 7px; }
.brand-mark::after { right: 7px; }
.brand-mark span { position: absolute; left: 46px; top: 42px; width: 16px; height: 5px; background: var(--yellow); }
.brand-mark i { position: absolute; left: 48px; top: 4px; width: 12px; height: 22px; border-radius: 8px; background: #8fb0ff; transform: rotate(22deg); }
h1 { margin: 0; font-size: clamp(43px, 13vw, 72px); line-height: 1; letter-spacing: .06em; text-shadow: 0 4px 30px rgba(104,150,255,.38); }
h1 span { color: var(--yellow); }
h2 { margin: 18px 0 12px; font-size: clamp(25px, 7vw, 38px); line-height: 1.35; }
.lead { color: #dce6ff; font-size: clamp(17px, 4vw, 21px); font-weight: 700; line-height: 1.75; }
.primary-button, .secondary-button {
  width: min(100%, 390px); min-height: 57px; margin-top: 18px; padding: 13px 20px;
  border: 0; border-radius: 18px; font-weight: 900; cursor: pointer;
}
.primary-button { color: #15213d; background: linear-gradient(135deg, #ffe879, #ffc947); box-shadow: 0 8px 28px rgba(255,205,65,.22); }
.secondary-button { color: #eaf0ff; background: rgba(128,162,237,.16); border: 1px solid rgba(157,185,248,.35); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.primary-button:focus-visible, .secondary-button:focus-visible, .course-card:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.note { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.safety { margin-top: 24px; max-width: 470px; padding: 12px 16px; color: #c9d5ef; background: rgba(4,9,22,.42); border-radius: 13px; font-size: 12px; line-height: 1.7; }
.reticle-demo { position: relative; width: 106px; height: 106px; margin: 20px auto; }
.reticle-demo span { position: absolute; inset: 10px; border: 5px solid rgba(255,255,255,.22); border-top-color: var(--yellow); border-radius: 50%; animation: demo-lock 2.2s infinite ease-in-out; }
.reticle-demo i { position: absolute; inset: 48px; border-radius: 50%; background: white; }
.reticle-demo b { position: absolute; left: 0; right: 0; top: 112px; font-size: 12px; color: var(--muted); }
@keyframes demo-lock { 0%,20% { transform: scale(1); } 78%,100% { transform: scale(.55); border-color: #63e99b; } }
.howto-list { width: min(100%, 460px); list-style: none; padding: 20px 0 0; margin: 18px 0 0; text-align: left; }
.howto-list li { display: grid; grid-template-columns: 8em 1fr; gap: 10px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.howto-list strong { color: var(--yellow); }
.howto-list span { color: #c7d3ed; }
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin-top: 13px; }
.course-card {
  min-height: 132px; padding: 16px 11px; color: var(--text); text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 17px; background: var(--panel);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.course-card:hover { transform: translateY(-2px); border-color: rgba(255,216,90,.58); }
.course-card.is-selected { border-color: var(--yellow); background: rgba(39, 51, 84, .96); box-shadow: 0 0 0 2px rgba(255,216,90,.13); }
.course-icon { display: block; color: var(--yellow); font-size: 25px; }
.course-card strong { display: block; margin-top: 9px; font-size: 17px; }
.course-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.difficulty { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 15px; color: var(--muted); font-size: 13px; }
.difficulty span { margin-right: 5px; font-weight: 700; }
.difficulty button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #dbe6ff; background: rgba(255,255,255,.05); }
.difficulty button.is-selected { color: #19223b; border-color: var(--yellow); background: var(--yellow); font-weight: 900; }
.difficulty-description { min-height: 1.5em; margin: 9px 0 0; color: #c6d5f2; font-size: 13px; font-weight: 700; }
.play-actions { width: 100%; margin-top: 14px; }
.play-actions p { margin: 0 0 -6px; color: #dbe6ff; }
.play-actions .primary-button, .play-actions .secondary-button { margin-left: 5px; margin-right: 5px; width: min(100%, 285px); }
.explore-season-picker { margin: 15px auto 3px; }
.explore-season-picker[hidden] { display: none; }
.explore-picker-group + .explore-picker-group { margin-top: 13px; }
.explore-picker-group > span { display: block; margin-bottom: 8px; color: #c6d5f2; font-size: 13px; font-weight: 800; }
.explore-options { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.explore-options button {
  min-width: 76px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px;
  color: #dbe6ff; background: rgba(255,255,255,.05); font-weight: 800; cursor: pointer;
}
.explore-options button.is-selected { color: #19223b; border-color: var(--yellow); background: var(--yellow); }
.play-actions button:disabled { opacity: .42; cursor: not-allowed; }
.phone-rotate { position: relative; width: 126px; height: 92px; margin: 24px auto 2px; }
.phone-rotate span {
  position: absolute; left: 30px; top: 8px; width: 68px; height: 40px;
  border: 4px solid #dbe6ff; border-radius: 9px; transform: rotate(-8deg);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), 0 0 24px rgba(110,156,255,.2);
}
.phone-rotate span::after { content: ""; position: absolute; right: 4px; top: 15px; width: 4px; height: 4px; border-radius: 50%; background: var(--yellow); }
.phone-rotate i { position: absolute; right: 2px; bottom: 2px; color: var(--yellow); font-size: 42px; font-style: normal; }
.cardboard-checks { width: min(100%, 470px); margin: 14px auto; padding: 0; list-style-position: inside; color: #cfdbf2; line-height: 2; text-align: left; }
.orientation-state { min-height: 26px; margin: 12px 0 0; color: var(--yellow); font-weight: 900; }
.orientation-state.is-ready { color: #71f0a3; }
.text-button { margin-top: 17px; padding: 10px 16px; border: 0; color: #c8d5ee; background: transparent; cursor: pointer; }
.game-controls { position: fixed; z-index: 12; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; }
.game-controls[hidden] { display: none; }
.game-controls button { padding: 8px 10px; color: #f5f7ff; border: 1px solid rgba(255,255,255,.23); border-radius: 10px; background: rgba(5,10,26,.72); font-size: 11px; backdrop-filter: blur(8px); }
.rotate-notice { position: fixed; z-index: 30; inset: 0; place-items: center; padding: 20px; background: #050a1a; color: white; font-size: 20px; font-weight: 900; text-align: center; }
.rotate-notice[hidden] { display: none; }
a-scene, .a-canvas { background: #030714 !important; }
a-scene { position: fixed !important; inset: 0; z-index: 1; }

/* A-Frame標準の白いCardboard案内は独自の横向き画面と重複し、iOSで端に残像が出るため使わない。 */
.a-orientation-modal, .a-enter-vr, .a-enter-ar { display: none !important; }
.webvr-polyfill-fullscreen-wrapper { background: #030714 !important; overflow: hidden !important; }
/* iPhone横向きではWebVR polyfillのscreen寸法とSafariのsafe-area寸法が混在しやすい。
   Cardboard中だけラッパーとcanvasを物理画面のviewportへ固定し、両眼の中心ずれを防ぐ。 */
body.is-ios-device.is-vr-playing .webvr-polyfill-fullscreen-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.is-ios-device.is-vr-playing .webvr-polyfill-fullscreen-wrapper > .a-canvas,
body.is-ios-device.is-vr-playing .a-canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
body.is-vr-playing .game-controls,
body.is-vr-playing .rotate-notice { display: none !important; }

@media (max-width: 650px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .course-card { min-height: 115px; }
  .screen.wide { padding-bottom: 28px; }
}
@media (orientation: portrait) and (max-width: 850px) {
  body.is-playing .rotate-notice { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
