body.play-screen :is(#onboarding.entry-interface[data-onboarding], #level-up.entry-interface)[open] {
  --entry-paper: var(--interface-surface);
  --entry-rail: var(--interface-rail);
  --entry-top: var(--interface-top);
  --entry-left: max(16px, env(safe-area-inset-left));
  --entry-right: max(16px, env(safe-area-inset-right));
  --css-frame-bg: none !important;
  --css-frame-border: none !important;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0 var(--entry-right) max(24px, env(safe-area-inset-bottom)) var(--entry-left);
  border: 0;
  border-radius: 0;
  background: var(--entry-paper);
  box-shadow: none;
  color: var(--ui-ink);
  font: 16px/1.4 "Meadow UI", sans-serif;
  transform: none;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: calc(var(--entry-top) + 64px) 16px;
}

body.play-screen :is(#onboarding.entry-interface[data-onboarding], #level-up.entry-interface)[open]::before,
body.play-screen :is(#onboarding.entry-interface[data-onboarding], #level-up.entry-interface)[open]::after {
  content: none;
}

body.play-screen :is(#onboarding.entry-interface[data-onboarding], #level-up.entry-interface)[open]::backdrop {
  background: #fff7ec;
  backdrop-filter: none;
  animation: none;
}

.entry-interface :is(.entry-header, .entry-content) {
  width: min(100%, var(--entry-rail));
  margin-inline: auto;
}

.entry-interface .entry-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--entry-top) 0 12px;
  border: 0;
  background: var(--entry-paper);
}

body.play-screen :is(#onboarding, #level-up).entry-interface .entry-header :is(h1, h2) {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 44px;
  max-width: none;
  margin: 0;
  color: inherit;
  font: 900 var(--interface-title-size)/1.15 "Meadow UI", sans-serif;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}

body.play-screen #onboarding.entry-interface .entry-header h2::before,
body.play-screen #onboarding.entry-interface .entry-header h2::after {
  content: none;
}

.entry-interface .entry-content p,
.entry-interface .entry-content h3 {
  margin: 0;
}

.entry-interface .entry-content p {
  color: #5f455e;
  font-size: inherit;
  line-height: inherit;
}

body.play-screen :is(#onboarding, #level-up).entry-interface button.entry-button {
  --css-frame-bg: none !important;
  --css-frame-border: none !important;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--control-line, #ad8ec4);
  border-radius: 8px;
  background: var(--control-face, #fff4e3);
  color: inherit;
  box-shadow: 0 2px var(--control-edge, #a682bf);
  font: 800 16px/1.2 "Meadow UI", sans-serif;
  overflow-wrap: anywhere;
  text-shadow: none;
}

.entry-interface .entry-header .entry-button {
  flex: 0 0 auto;
  max-width: 45%;
}

.entry-interface .entry-button.entry-primary {
  --control-face: #ff9684;
  --control-line: #ba6574;
  --control-edge: #b76378;
}

.entry-interface .entry-button[aria-pressed="true"] {
  --control-face: #eadcf5;
  --control-line: #8663a4;
  --control-edge: #8663a4;
}

body.play-screen .entry-interface :is(button, input):focus-visible {
  outline: 2px solid #65428b;
  outline-offset: 2px;
}

body.play-screen #onboarding.entry-interface [data-play-now]:focus-visible {
  outline: 2px solid #65428b;
  outline-offset: 2px;
}

.entry-interface :is(.entry-welcome, .entry-flow, .entry-rewards) {
  display: grid;
  gap: 12px;
  text-align: center;
}

body.play-screen #onboarding.entry-interface[data-onboarding="welcome"][open] {
  background: #bbacf0 url("ui/raster/v2/title-scene-landscape.webp") center / cover no-repeat;
}

@media (max-aspect-ratio: 1/1) {
  body.play-screen #onboarding.entry-interface[data-onboarding="welcome"][open] {
    background-image: url("ui/raster/v2/title-scene-portrait.webp");
  }
}

.entry-interface .entry-welcome {
  width: min(100%, 360px);
  margin-inline: auto;
  padding-top: min(64dvh, max(48dvh, calc(100dvh - 160px)));
  justify-items: center;
  transition: opacity 420ms ease;
}

.entry-interface[data-leaving="true"] .entry-welcome {
  opacity: 0;
  pointer-events: none;
}

body.play-screen .entry-interface .welcome-readiness {
  display: flex;
  position: static;
  width: 100%;
  max-width: none;
  transform: none;
}

body.play-screen #onboarding.entry-interface .welcome-readiness [data-play-now] {
  width: 100%;
  min-height: clamp(52px, 9dvh, 76px);
  font-size: clamp(22px, 4vw, 32px);
}

.entry-interface .welcome-readiness [hidden] {
  display: none;
}

body.play-screen #onboarding.entry-interface .welcome-readiness [data-art-status] {
  --css-frame-bg: none !important;
  --css-frame-border: none !important;
  padding: 8px 12px;
  border: 1px solid #e3c8b9;
  border-radius: 8px;
  background: #fff5e6;
  color: #5f455e;
  font-size: 14px;
}

body.play-screen #onboarding.entry-interface .welcome-readiness [data-art-progress] {
  --css-frame-bg: none !important;
  --css-frame-border: none !important;
  appearance: auto;
  height: 12px;
  padding: 0;
  border: 0;
  background: none;
}

.entry-interface .entry-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.entry-interface progress {
  width: 100%;
  height: 8px;
  accent-color: #9662b8;
}

body.play-screen #onboarding.entry-interface .entry-step progress {
  position: static;
  flex: 1;
  min-width: 0;
  height: 8px;
  margin: 0;
}

.entry-interface .entry-step span {
  flex: none;
}

body.play-screen #onboarding.entry-interface .entry-guide {
  position: static;
  display: block;
  width: clamp(82px, 16dvh, 132px);
  height: auto;
  margin: 0 auto;
  transform: none;
  image-rendering: pixelated;
}

.entry-interface .entry-content .entry-prompt {
  font-size: 18px;
  font-weight: 800;
}

.entry-interface .entry-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.entry-interface .entry-options small {
  display: block;
  margin-top: 3px;
}

.entry-interface[data-onboarding="profile"] .entry-options {
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: start;
}

.entry-interface .entry-options label {
  display: grid;
  gap: 4px;
  font-weight: 800;
}

.entry-interface .entry-options input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #ad8ec4;
  border-radius: 8px;
  background: #fffdf6;
  color: inherit;
  font: inherit;
  font-weight: 400;
}

.entry-interface .entry-options input[aria-invalid="true"] {
  border-color: #b34a3e;
}

.entry-interface .entry-content [data-onboarding-status] {
  min-height: 2.8em;
  font-size: 14px;
}

.entry-interface .entry-content [data-onboarding-status="available"] { color: #3c733e; }
.entry-interface .entry-content [data-onboarding-status]:is([data-onboarding-status="invalid"], [data-onboarding-status="taken"], [data-onboarding-status="error"]) { color: #96392f; }

body.play-screen #level-up.entry-interface .level-up-badge {
  position: relative;
  inset: auto;
  width: clamp(96px, 24dvh, 166px);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
}

body.play-screen #level-up.entry-interface .level-up-badge span {
  font-size: min(clamp(44px, 12dvh, 74px), calc(120px / var(--level-digits)));
}

body.play-screen #level-up.entry-interface .level-up-rays {
  inset: 0 auto;
  left: 50%;
  width: min(320px, calc(100vw - var(--entry-left) - var(--entry-right)));
  translate: -50% 0;
}

body.play-screen #level-up.entry-interface .level-up-badge :is(img, span) {
  translate: none;
}

body.play-screen #level-up.entry-interface .level-up-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0 2px 3px;
  border: 0;
  overflow: visible;
}

body.play-screen #level-up.entry-interface .level-up-grid article {
  width: clamp(90px, 24vw, 116px);
  min-height: 0;
  padding: 6px 4px;
}

body.play-screen #level-up.entry-interface .level-up-grid canvas {
  width: 64px;
  height: 64px;
}

@media (min-width: 580px) {
  .entry-interface .entry-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-interface .entry-welcome {
    transition: none;
  }
}
