:root {
  --ui-fg: #f8f3e8;
}

@font-face {
  font-family: "LXGW WenKai Subset";
  src: url("fonts/lxgw-wenkai-subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  background: #050505;
  font-family: "LXGW WenKai Subset", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Serif SC", sans-serif;
  color: var(--ui-fg);
}

.scene-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(24px);
  transition: opacity 2.6s ease, filter 2.8s ease, transform 2.8s ease;
  pointer-events: none;
  will-change: opacity, filter, transform;
}

.cover1 {
  z-index: 1;
  opacity: 0;
  background-image: url("cover.webp");
}

.cover1.is-loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.cover2 {
  z-index: 2;
  opacity: 0;
  background-image: url("cover2.webp");
}

.cover2.is-loaded {
  filter: blur(0);
  transform: scale(1);
}

.cover2.is-visible {
  opacity: 1;
}

.ui-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.action-btn {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  pointer-events: auto;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(25, 18, 14, 0.25);
  color: var(--ui-fg);
  padding: 12px 30px;
  border-radius: 999px;
  font-size: 17px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.6s ease, transform 0.6s ease, background 0.3s ease;
  cursor: pointer;
}

.action-btn:hover {
  background: rgba(45, 30, 22, 0.4);
}

.action-btn:active {
  transform: translate(-50%, 2px);
}

body.reveal-ui .action-btn {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.mask-open .action-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 14px);
}

.text-mask {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  pointer-events: none;
}

.text-mask.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mask-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(30, 22, 18, 0.45);
  color: rgba(255, 255, 255, 0.95);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.text-card {
  width: min(88vw, 560px);
  padding: 28px 24px;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(14, 10, 8, 0.5);
  color: rgba(255, 248, 238, 0.95);
  text-align: left;
  line-height: 1.8;
  font-size: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.text-card p {
  margin: 0;
  text-align: justify;
}

.text-divider {
  width: 72px;
  height: 1px;
  margin: 16px auto;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0)
  );
}
