/* tokens 由 tokens.css 统一提供 */
* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-primary);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--orange);
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.entry-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
}

.entry-stage-shell {
  overflow: hidden;
}

.entry-stage {
  position: relative;
  width: 1200px;
  height: 900px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  transform-origin: top left;
}

.brand-kicker {
  margin: 0 0 10px;
  color: var(--orange-deep);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.login-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px 26px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 224, 153, 0.35), transparent 50%),
    var(--panel-bg);
}

.login-brand {
  text-align: center;
  flex: 0 0 auto;
  animation: fadeInUp 0.55s ease both;
}

.login-brand h1 {
  margin: 0;
  color: var(--green);
  font-size: 72px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 0 rgba(255, 255, 255, 0.55),
    -1px 1px 0 rgba(255, 255, 255, 0.35),
    1px 1px 0 rgba(255, 255, 255, 0.3),
    0 3px 1px rgba(0, 0, 0, 0.06),
    0 5px 2px rgba(0, 0, 0, 0.05),
    0 8px 4px rgba(0, 0, 0, 0.04),
    0 14px 10px rgba(0, 0, 0, 0.03);
}

.login-brand h1 .highlight {
  color: var(--orange-deep);
}

/* 兼容旧版 .login-copy 选择器 */
.login-copy h1 {
  margin: 0;
  color: var(--green);
  font-size: 72px;
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7),
    0 3px 0 rgba(0, 0, 0, 0.08),
    0 6px 12px rgba(0, 0, 0, 0.06);
}

.login-copy h1 .highlight {
  color: var(--orange-deep);
}

.login-subtitle {
  margin: 40px 0 10px;
  color: #5a4030;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}

.login-hero {
  position: relative;
  display: grid;
  place-items: center;
  padding: 6px 20px;
  flex: 0 0 auto;
  overflow: hidden;
  animation: fadeInUp 0.55s ease 0.12s both;
}

.login-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  animation: hero-shimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}

.login-hero img {
  width: min(72%, 460px);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 18px 24px rgba(139, 92, 38, 0.16));
}

@keyframes hero-shimmer {
  0%   { left: -100%; }
  100% { left: 120%; }
}

.login-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 6px 0;
}

.fact-icon {
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
}

.fact-text {
  color: #594b40;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 396px;
  max-width: 100%;
  flex: 0 0 auto;
  animation: fadeInUp 0.55s ease 0.24s both;
}

.login-form h2 {
  margin: 0 0 7px;
  color: #5a4030;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.login-form .primary-button {
  position: relative;
  width: 100%;
  border-radius: 14px;
  min-height: 52px;
  font-size: 18px;
  overflow: hidden;
  box-shadow: 0 4px 0 var(--green-deep), 0 8px 20px rgba(47, 135, 87, 0.15);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.login-form .primary-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
}

.login-form .primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--green-deep), 0 12px 26px rgba(47, 135, 87, 0.22);
  filter: brightness(1.04);
}

.login-form .primary-button:hover::after {
  animation: btn-shimmer 1.6s ease-in-out infinite;
}

@keyframes btn-shimmer {
  0%   { left: -100%; }
  100% { left: 120%; }
}

.login-form .primary-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--green-deep), 0 4px 10px rgba(47, 135, 87, 0.12);
}

.login-form .primary-button:disabled {
  cursor: not-allowed;
  background: linear-gradient(180deg, #b8d7c3, #99bea9);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 #8db59a, 0 6px 14px rgba(75, 96, 84, 0.08);
  filter: none;
  transform: none;
}

.invite-code-digits {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.digit-box {
  width: 56px;
  height: 68px;
  border: 2px solid rgba(232, 214, 188, 0.98);
  border-radius: 14px;
  padding: 0;
  background: #fffaf0;
  color: var(--ink);
  font-family: -apple-system, "SF Mono", "Helvetica Neue", "Arial", sans-serif;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  caret-color: transparent;
  font-variant-numeric: tabular-nums;
}

.digit-box:focus {
  border-color: rgba(70, 173, 115, 0.84);
  background: #fffdf6;
  box-shadow: 0 0 0 4px rgba(70, 173, 115, 0.13);
}

.digit-box:focus-visible {
  outline: none;
}

.digit-box.is-invalid {
  border-color: rgba(214, 107, 96, 0.58);
  background: #fff8f5;
}

.digit-box.is-filled {
  border-color: rgba(70, 173, 115, 0.55);
  background: #f3fff6;
}

.form-message {
  min-height: 0;
  color: #c9786e;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
}

.primary-button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 13px 28px;
  background: linear-gradient(180deg, #69c58b, var(--green));
  color: #fff;
  box-shadow: 0 8px 0 var(--green-deep), 0 14px 28px rgba(47, 135, 87, 0.18);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-button .button-spinner {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-top-color: #fff;
  border-radius: 999px;
  animation: button-spin 820ms linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 页面渐入动画 ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 邀请码验证失败震动 ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.invite-code-digits.is-shaking {
  animation: shake 0.4s ease;
}

.primary-button:hover,
.logout-button:hover,
.entry-theme-card:hover,
.entry-scene-type:hover,
.carousel-arrow:hover {
  transform: translateY(-2px);
  filter: brightness(1.02);
}

.primary-button:active,
.logout-button:active,
.entry-theme-card:active,
.entry-scene-type:active,
.carousel-arrow:active {
  transform: translateY(1px);
}

.primary-button:disabled,
.carousel-arrow:disabled {
  cursor: default;
  filter: saturate(0.7);
  opacity: 0.48;
  transform: none;
}

.primary-button:disabled {
  background: linear-gradient(180deg, #b8d7c3, #99bea9);
  box-shadow: 0 6px 0 #7da08c, 0 10px 22px rgba(75, 96, 84, 0.12);
}

.select-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 26px 46px 30px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 237, 204, 0.35), transparent 50%),
    var(--panel-bg);
}

.logout-button {
  position: absolute;
  top: 26px;
  right: 48px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 34px;
  padding: 4px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f9d56e, #f0b843);
  color: #5a3a1e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 0 #c48d2a, 0 9px 16px rgba(180, 130, 30, 0.16);
  transition: transform 150ms ease, filter 150ms ease;
}

.bgm-toggle-button {
  position: absolute;
  top: 26px;
  right: 136px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f9d56e, #f0b843);
  cursor: pointer;
  box-shadow: 0 4px 0 #c48d2a, 0 9px 16px rgba(180, 130, 30, 0.16);
  transition: transform 150ms ease, filter 150ms ease, background 200ms ease, box-shadow 200ms ease;
}

.bgm-toggle-button .bgm-icon {
  width: 100%;
  height: 100%;
  display: block;
  transition: filter 200ms ease;
}

.bgm-toggle-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.bgm-toggle-button:active {
  transform: translateY(1px);
}

.bgm-toggle-button.muted {
  background: linear-gradient(180deg, #d4d4d4, #bbb);
  box-shadow: 0 4px 0 #999, 0 8px 14px rgba(0, 0, 0, 0.06);
}

.bgm-toggle-button.muted .bgm-icon {
  filter: grayscale(1) brightness(0.7);
}

/* 红色斜杠 */
.bgm-toggle-button.muted::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 3px;
  background: #e8453c;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
  pointer-events: none;
}

.theme-section,
.scene-type-section {
  display: grid;
  gap: 14px;
}

.theme-section {
  gap: 18px;
}

.scene-type-section {
  gap: 10px;
  margin-top: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.step-badge {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb84d, #f28a22);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(242, 138, 34, 0.25);
}

.section-heading-text h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 900;
  color: #5a3a1e;
}

.entry-theme-grid {
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: center;
  gap: 20px;
}

.entry-theme-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  width: 170px;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid rgba(232, 214, 188, 0.86);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 253, 246, 0.72);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(116, 78, 34, 0.06);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.entry-theme-card.is-active {
  border-color: rgba(70, 173, 115, 0.86);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 2px rgba(70, 173, 115, 0.22), 0 10px 22px rgba(70, 173, 115, 0.12);
  transform: scale(1.07);
  z-index: 4;
}

.entry-theme-card.is-active:hover {
  transform: scale(1.07) translateY(-2px);
}

.entry-theme-card.is-active::after {
  content: "✓";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.entry-theme-card img {
  width: 114px;
  height: 114px;
  display: block;
  object-fit: contain;
}

.entry-theme-card strong {
  color: #4c4037;
  font-size: 22px;
  line-height: 1.15;
}

.entry-scene-types {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Flex gap 降级：老 Safari 不支持 gap，用 margin 补偿 */
.entry-scene-type + .entry-scene-type {
  margin-left: 16px;
}

@supports (gap: 16px) {
  .entry-scene-type + .entry-scene-type {
    margin-left: 0;
  }
}

.entry-scene-type {
  min-width: 156px;
  min-height: 50px;
  border: 1px solid rgba(232, 214, 188, 0.96);
  border-radius: 15px;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(116, 78, 34, 0.06);
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.entry-scene-type.is-active {
  border-color: transparent;
  background: linear-gradient(180deg, #68c58b, var(--green));
  color: #fff;
  box-shadow: 0 8px 16px rgba(70, 173, 115, 0.22);
}

.carousel-section {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding-top: 0;
}

.scene-carousel {
  position: relative;
  min-height: 390px;
}

.scene-track {
  position: absolute;
  inset: 0 70px 0;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.scene-track.is-dragging {
  cursor: grabbing;
}

.scene-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-width);
  height: var(--card-height);
  overflow: hidden;
  border: 1px solid rgba(232, 214, 188, 0.9);
  border-radius: 18px;
  background: #f8ead7;
  box-shadow: 0 14px 30px rgba(116, 78, 34, 0.14);
  opacity: var(--card-opacity);
  transform: translate(-50%, -50%) translateX(calc(var(--x) + var(--drag-x, 0px)));
  transition:
    transform 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    width 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    height 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 180ms ease;
  pointer-events: none;
  outline: none;
}

.scene-track.is-dragging .scene-card {
  transition-duration: 0ms;
}

.scene-card.is-current {
  box-shadow: 0 18px 36px rgba(116, 78, 34, 0.18);
}

.scene-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scene-card-title {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: calc(100% - 28px);
  min-width: 430px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  padding: 14px 30px 17px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(255, 242, 211, 0.86));
  box-shadow: 0 16px 34px rgba(95, 59, 24, 0.18), inset 0 -5px 0 rgba(244, 180, 67, 0.2);
  font-size: 62px;
  font-weight: 900;
  line-height: 1.02;
  text-align: center;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.96), 0 12px 18px rgba(80, 51, 21, 0.2);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
  outline: none;
}

.scene-card-title::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(223, 132, 46, 0.42);
  filter: blur(0.2px);
}

.scene-card:not(.is-current) .scene-card-title {
  min-width: 130px;
  max-width: calc(100% - 22px);
  padding: 7px 10px 8px;
  border-width: 2px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.92), rgba(255, 242, 211, 0.78));
  box-shadow: 0 8px 16px rgba(80, 51, 21, 0.12), inset 0 -3px 0 rgba(244, 180, 67, 0.16);
  font-size: 20px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.94), 0 7px 10px rgba(80, 51, 21, 0.14);
}

.scene-card.is-current .scene-card-title.is-title-long {
  font-size: 56px;
}

.scene-card.is-current .scene-card-title.is-title-extra-long {
  font-size: 52px;
}

.scene-card:not(.is-current) .scene-card-title.is-title-long {
  font-size: 16px;
}

.scene-card:not(.is-current) .scene-card-title.is-title-extra-long {
  font-size: 14px;
}

.scene-card:not(.is-current) .scene-card-title::after {
  bottom: -5px;
  height: 5px;
}

.scene-title-char {
  display: inline-block;
  outline: none;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.92));
}

.scene-title-char.color-0 {
  color: #d65332;
}

.scene-title-char.color-1 {
  color: #f0892c;
}

.scene-title-char.color-2 {
  color: #e7a620;
}

.scene-title-char.color-3 {
  color: #4d9c59;
}

.carousel-arrow {
  position: absolute;
  top: 44%;
  z-index: 8;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fffdf6;
  color: #d86b1f;
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(116, 78, 34, 0.12);
  transition: transform 150ms ease, filter 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.carousel-arrow:hover {
  background: #fff6e8;
  box-shadow: 0 10px 20px rgba(116, 78, 34, 0.14);
}

.carousel-arrow:active {
  background: #ffefd8;
}

.carousel-arrow-left {
  left: 2px;
}

.carousel-arrow-right {
  right: 2px;
}

.empty-carousel {
  align-self: center;
  justify-self: center;
  margin: 0;
  padding: 18px 24px;
  border: 1px dashed rgba(244, 155, 53, 0.55);
  border-radius: 16px;
  background: #fff9ee;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
}

.start-button {
  justify-self: center;
  min-width: 210px;
}

/* Scene card access labels */
.scene-access-label {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.6;
  z-index: 10;
  pointer-events: none;
}

.scene-access-label.access-locked {
  background: rgba(158, 158, 158, 0.82);
  color: #fff;
}

@media (max-width: 760px), (max-height: 520px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overscroll-behavior: none;
  }

  .entry-page {
    min-height: 100vh;
    min-height: var(--app-height, 100svh);
    display: block;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .entry-stage-shell {
    width: 100%;
    min-height: calc(var(--app-height, 100svh) - 24px);
    height: auto;
    overflow: visible;
  }

  .entry-stage {
    width: 100%;
    height: auto;
    overflow: visible;
    border-radius: 18px;
    transform: none;
  }

  .login-stage {
    padding: 20px 14px 18px;
    gap: 4px;
  }

  .login-hero {
    padding: 6px 14px;
  }

  .login-hero img {
    width: min(48vw, 200px);
  }

  .login-copy h1,
  .login-brand h1 {
    font-size: 40px;
  }

  .login-subtitle {
    margin-top: 6px;
    font-size: 18px;
  }

  .login-form {
    width: 100%;
    gap: 10px;
  }

  .login-form h2 {
    font-size: 16px;
  }

  .digit-box {
    width: 46px;
    height: 56px;
    font-size: 26px;
    border-radius: 12px;
  }

  .invite-code-digits {
    gap: 8px;
  }

  .select-stage {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 14px 22px;
  }

  .logout-button {
    top: 14px;
    right: 14px;
  }

  .bgm-toggle-button {
    top: 14px;
    right: 96px;
  }

  .theme-section,
  .scene-type-section {
    gap: 10px;
  }

  .section-heading {
    padding-right: 88px;
  }

  .step-badge {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }

  .section-heading-text h2 {
    font-size: 22px;
  }

  .entry-theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .entry-theme-card {
    min-height: 118px;
    aspect-ratio: auto;
    gap: 8px;
    border-radius: 14px;
    padding: 12px;
  }

  .entry-theme-card.is-active,
  .entry-theme-card.is-active:hover {
    transform: none;
  }

  .entry-theme-card img {
    width: 50px;
    height: 50px;
  }

  .entry-theme-card strong {
    font-size: 17px;
  }

  .entry-scene-types {
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .entry-scene-type {
    min-width: 112px;
    min-height: 44px;
    flex: 0 0 auto;
    font-size: 16px;
    scroll-snap-align: start;
  }

  .carousel-section {
    grid-template-rows: auto auto auto;
    gap: 12px;
  }

  .scene-carousel {
    min-height: 270px;
  }

  .scene-track {
    inset: 0 36px;
    touch-action: pan-y;
  }

  .scene-card {
    border-radius: 14px;
  }

  .scene-card-title {
    min-width: min(250px, calc(100% - 26px));
    padding: 8px 16px 10px;
    border-width: 2px;
    border-radius: 20px;
    font-size: 34px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.96), 0 8px 12px rgba(80, 51, 21, 0.18);
  }

  .scene-card.is-current .scene-card-title.is-title-long,
  .scene-card.is-current .scene-card-title.is-title-extra-long {
    font-size: 29px;
  }

  .scene-card:not(.is-current) .scene-card-title {
    min-width: 76px;
    padding: 5px 7px 6px;
    border-radius: 12px;
    font-size: 13px;
  }

  .scene-card:not(.is-current) .scene-card-title.is-title-long,
  .scene-card:not(.is-current) .scene-card-title.is-title-extra-long {
    font-size: 11px;
  }

  .carousel-arrow {
    top: 42%;
    width: 44px;
    height: 44px;
    font-size: 26px;
  }

  .start-button {
    width: min(100%, 240px);
    min-width: 0;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .entry-page {
    padding: 8px;
  }

  .entry-stage-shell {
    min-height: calc(var(--app-height, 100svh) - 16px);
  }

  .login-stage {
    gap: 2px;
    padding: 12px 14px 10px;
  }

  .login-hero {
    padding: 2px 12px;
  }

  .login-hero img {
    width: min(24vw, 140px);
  }

  .login-copy h1,
  .login-brand h1 {
    font-size: 30px;
  }

  .login-subtitle {
    font-size: 14px;
  }

  .login-form {
    gap: 6px;
  }

  .login-form h2 {
    font-size: 18px;
  }

  .digit-box {
    width: 36px;
    height: 48px;
    font-size: 22px;
    border-radius: 10px;
  }

  .invite-code-digits {
    gap: 6px;
  }

  .select-stage {
    min-height: auto;
    gap: 6px;
    padding: 8px 12px 10px;
  }

  .entry-theme-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .entry-theme-card {
    min-height: 56px;
    gap: 2px;
    padding: 6px;
    border-radius: 12px;
  }

  .entry-theme-card img {
    width: 28px;
    height: 28px;
  }

  .entry-theme-card strong {
    font-size: 12px;
  }

  .entry-scene-type {
    min-width: 86px;
    min-height: 32px;
    font-size: 13px;
  }

  .scene-carousel {
    min-height: 116px;
  }

  .scene-card-title {
    min-width: min(190px, calc(100% - 20px));
    padding: 5px 10px 6px;
    font-size: 19px;
  }

  .scene-card.is-current .scene-card-title.is-title-long,
  .scene-card.is-current .scene-card-title.is-title-extra-long {
    font-size: 17px;
  }

  .section-heading {
    gap: 8px;
  }

  .step-badge {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .section-heading-text h2 {
    font-size: 18px;
  }

  .carousel-section {
    gap: 4px;
  }

  .start-button {
    min-height: 36px;
    padding: 8px 20px;
  }
}

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

/* ===== 统一焦点指示器 ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

.entry-theme-card:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 18px;
}

.entry-scene-type:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 15px;
}

.carousel-arrow:focus-visible,
.logout-button:focus-visible,
.bgm-toggle-button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 999px;
}

/* ===== 触摸目标最小 44px ===== */
.entry-scene-type {
  min-height: var(--touch-min);  /* 44px（原 50px，保持更大） */
}

.carousel-arrow {
  width: 56px;
  height: 56px;  /* ≥ 44px ✓ */
}
