:root {
  color-scheme: light;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
}

body { overscroll-behavior: none; }

#app {
  position: relative;
  isolation: isolate;
}

#landscapeVideo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  touch-action: manipulation;
}

#startFallback {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  z-index: 2;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  padding: 0.7rem 1.1rem;
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  #scene { cursor: pointer; }
}

/* ── 進場頁：純白極簡 ───────────────────────────────────── */
.landing {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  color: #111;
  background: #fff;
  opacity: 1;
  transition: opacity 1.1s ease;
}

.landing.hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

/* 文字輕微漂浮 */
.floaty {
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(-4px); }
  50%      { transform: translateY(4px); }
}

.landing-title {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #111;
}

.landing-langs {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: #444;
}

.landing-langs .sep {
  color: #bbb;
}

.lang-link {
  border: none;
  background: none;
  padding: 0.1rem 0.1rem;
  font: inherit;
  letter-spacing: 0.02em;
  color: #333;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.lang-link:hover,
.lang-link:focus-visible {
  color: #000;
  text-decoration-color: #000;
  outline: none;
}

.landing-credit {
  position: absolute;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #111;
}

@media (prefers-reduced-motion: reduce) {
  .floaty { animation: none; }
}

/* ── 返回進場頁的返回鍵（左上角） ───────────────────────── */
.back-btn {
  position: absolute;
  top: max(0.9rem, env(safe-area-inset-top));
  left: max(0.9rem, env(safe-area-inset-left));
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.25);
  color: #1c3a5e;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s ease, color 0.2s ease;
}

body.entered .back-btn { display: flex; }

.back-btn:hover,
.back-btn:focus-visible {
  background: rgba(20, 82, 140, 0.85);
  border-color: rgba(20, 82, 140, 0.85);
  color: #fff;
  outline: none;
}
