html:not([data-view]) body,
html[data-game-chooser="true"][data-view="home"] body {
  margin: 0;
  background: #fffaf2;
}
html[data-game-chooser="true"][data-view="home"] #app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
html[data-game-chooser="true"][data-view="home"] .header {
  width: 100%;
  z-index: 1;
}
html[data-game-chooser="true"][data-view="home"] #app > #main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  min-height: 0;
  max-width: none;
  padding: 0;
}
html[data-game-chooser="true"][data-view="home"] #app > #main > hanooki-landing { display: flex; }
hanooki-landing {
  display: flex;
  isolation: isolate;
  background: #fffaf2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 0 max(16px, env(safe-area-inset-right)) max(clamp(20px, 5vh, 65px), env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: #392354;
  text-align: center;
}
.landing-scene {
  position: relative;
  width: min(62vw, 81vh, 900px);
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 4 / 3;
  flex: 0 1 auto;
}
.landing-scene video, .landing-scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: darken;
  -webkit-mask-image: linear-gradient(to right, transparent, black 2.4%, black 97.6%, transparent), linear-gradient(to bottom, transparent, black 3%, black 97%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, black 2.4%, black 97.6%, transparent), linear-gradient(to bottom, transparent, black 3%, black 97%, transparent);
  mask-composite: intersect;
}
.landing-scene video { opacity: 0; }
.landing-scene img[hidden] { display: none; }
hanooki-landing:is([data-phase="playing"],[data-phase="held"]) video { opacity: 1; }
.landing-choices { width: min(100%, 600px); flex: none; }
.landing-choices h1 { font: 800 clamp(28px, 3.1vw, 46px)/1.25 Baloo, sans-serif; margin: 8px 0 clamp(12px, 2vh, 22px); color: #392354; }
.landing-choices nav { display: flex; gap: clamp(12px, 1.5vw, 24px); justify-content: center; }
.landing-choices .landing-game {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: min(19vw, 270px); min-height: 52px; padding: 10px 15px;
  border: 0; border-radius: 13px; font: 700 clamp(18px, 1.6vw, 24px)/1.15 Baloo, sans-serif;
  text-decoration: none; cursor: pointer;
}
.landing-game.challenge { background: #7853ca; color: white; box-shadow: 0 5px #50398c; }
.landing-game.saha { background: #d8f546; color: #392354; box-shadow: 0 5px #a3b936; }
hanooki-landing:defined:not([data-choices="visible"]) .landing-choices { pointer-events: none; }
hanooki-landing:not([data-choices="visible"]) :is(.landing-choices h1,.landing-game) { opacity: 0; }
hanooki-landing:not(:defined) :is(.landing-choices h1,.landing-game) { animation: landing-reveal 240ms ease 4s both; }
hanooki-landing[data-choices="visible"] .landing-choices h1 { animation: landing-reveal 560ms cubic-bezier(.18,.82,.22,1) both; }
hanooki-landing[data-choices="visible"] .landing-game {
  animation: landing-reveal 600ms cubic-bezier(.18,.82,.22,1) 100ms both;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
hanooki-landing[data-choices="visible"] .landing-game.saha { animation-delay: 180ms; }
@keyframes landing-reveal { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@media (hover:hover) { .landing-choices .landing-game:hover { transform: translateY(-2px); } }
.landing-choices .landing-game:active { transform: translateY(3px); box-shadow: none; }
.landing-choices .landing-game:focus-visible { outline: 3px solid #392354; outline-offset: 6px; }
@media (max-width:740px) {
  hanooki-landing { padding-inline: 12px; padding-bottom: max(5vh, env(safe-area-inset-bottom)); }
  .landing-scene { width: min(100%, 72vh, 620px); }
  .landing-choices .landing-game { width: min(42vw, 230px); min-height: 48px; border-radius: 11px; }
}
@media (max-height:540px) and (orientation:landscape) {
  html[data-game-chooser="true"][data-view="home"] .header { height: clamp(42px, 13dvh, 60px); padding-block: 0; }
  html[data-game-chooser="true"][data-view="home"] .brand-logo { height: clamp(32px, 10dvh, 46px); width: auto; }
  hanooki-landing { padding-block: 0 max(9px, env(safe-area-inset-bottom)); }
  .landing-scene { width: min(72vh, 49vw); }
  .landing-choices h1 { font-size: 22px; margin: 2px 0 5px; }
  .landing-choices .landing-game { min-height: 40px; padding-block: 6px; }
}
@media (prefers-reduced-motion:reduce) {
  hanooki-landing[data-choices] :is(.landing-choices h1,.landing-game) { animation: none; transition: none; }
  hanooki-landing:not(:defined) :is(.landing-choices h1,.landing-game) { opacity: 1; animation: none; }
}
