@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Noto+Serif+TC:wght@500;700&display=swap");

:root {
  --ink: #1f1c1a;
  --paper: #f7f0e6;
  --gold: #d9a441;
  --crimson: #c24c3a;
  --teal: #3a6b6f;
  --mist: rgba(247, 240, 230, 0.6);
  --shadow: rgba(25, 20, 17, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  font-family: "Noto Serif TC", "Cormorant Garamond", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 238, 210, 0.7), transparent 60%),
    linear-gradient(180deg, #f7efe2 0%, #d8c7b3 45%, #8c7b6b 100%);
  display: block;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.4), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.25), transparent 40%),
    repeating-linear-gradient(90deg, rgba(122, 94, 68, 0.08) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(0deg, rgba(173, 147, 118, 0.08) 0 1px, transparent 1px 5px);
}

.bg::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -5vw;
  right: -5vw;
  height: 180px;
  background:
    linear-gradient(180deg, rgba(33, 23, 18, 0.95), rgba(33, 23, 18, 0.7)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 10px);
  clip-path: polygon(0 60%, 8% 45%, 16% 60%, 24% 42%, 32% 58%, 40% 38%, 48% 58%, 56% 40%, 64% 58%, 72% 44%, 80% 60%, 88% 42%, 96% 58%, 100% 45%, 100% 0, 0 0);
  box-shadow: 0 20px 40px rgba(18, 12, 9, 0.5);
  z-index: 0;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(30, 22, 18, 0.2) 0 10px, transparent 10px 60px),
    repeating-linear-gradient(0deg, rgba(30, 22, 18, 0.15) 0 6px, transparent 6px 48px);
  opacity: 0.25;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.mist {
  position: absolute;
  width: 140vw;
  height: 50vh;
  left: -20vw;
  background: linear-gradient(90deg, transparent, var(--mist), transparent);
  filter: blur(18px);
  opacity: 0.6;
  animation: drift 22s linear infinite;
}

.mist-a {
  top: 10vh;
}

.mist-b {
  top: 45vh;
  animation-duration: 28s;
  animation-direction: reverse;
}

@keyframes drift {
  0% {
    transform: translateX(-10%);
  }
  100% {
    transform: translateX(10%);
  }
}

.lantern {
  position: absolute;
  width: 70px;
  height: 90px;
  background: radial-gradient(circle at 40% 30%, #ffd38a, #c75b38 60%, #7b2d24 100%);
  border-radius: 36px 36px 30px 30px;
  box-shadow: 0 12px 30px rgba(70, 28, 20, 0.35);
  animation: sway 6s ease-in-out infinite;
}

.lantern::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 16px;
  background: #51221a;
  left: calc(50% - 7px);
  top: -12px;
  border-radius: 8px 8px 4px 4px;
}

.lantern::before {
  content: "";
  position: absolute;
  inset: -18px;
  background: radial-gradient(circle, rgba(255, 199, 120, 0.55), transparent 70%);
  filter: blur(6px);
  opacity: 0.8;
  z-index: -1;
}

.lantern-a {
  top: 8vh;
  left: 12vw;
}

.lantern-b {
  top: 18vh;
  right: 10vw;
  animation-delay: 1.2s;
}

.lantern-c {
  top: 60vh;
  right: 18vw;
  animation-delay: 2.4s;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

.cloud {
  position: absolute;
  width: 220px;
  height: 120px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 60px;
  filter: blur(1px);
  animation: float 20s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.cloud::before {
  width: 100px;
  height: 100px;
  top: -40px;
  left: 30px;
}

.cloud::after {
  width: 120px;
  height: 120px;
  top: -50px;
  right: 20px;
}

.cloud-a {
  top: 10vh;
  left: 25vw;
}

.cloud-b {
  top: 70vh;
  left: 5vw;
  animation-duration: 28s;
  animation-direction: reverse;
}

@keyframes float {
  0% {
    transform: translateX(0px);
  }
  50% {
    transform: translateX(30px);
  }
  100% {
    transform: translateX(0px);
  }
}

.panel {
  position: relative;
  width: min(900px, 92vw);
  margin: 48px auto 64px;
  padding: 36px 40px 28px;
  background:
    radial-gradient(120% 120% at 50% -20%, rgba(255, 248, 236, 0.7), transparent 60%),
    rgba(247, 240, 230, 0.92);
  border: 1px solid rgba(93, 74, 60, 0.3);
  box-shadow: 0 20px 50px var(--shadow);
  backdrop-filter: blur(4px);
  border-radius: 24px;
  overflow: visible;
  z-index: 1;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.signboard {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  margin-bottom: 14px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #7a4e2a, #5b3a22),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 6px);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.2), 0 10px 20px rgba(55, 33, 20, 0.35);
  color: #f6e7c8;
  letter-spacing: 0.2em;
  font-size: 12px;
  text-transform: uppercase;
}

.sign-nail {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d4b16b;
  box-shadow: inset -1px -1px 2px rgba(95, 64, 32, 0.6);
}

.sign-text {
  font-weight: 700;
}

.gold-seal {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #ffe7a1, #d3a347 55%, #8a5b1d 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), 0 10px 20px rgba(70, 43, 16, 0.4);
  display: grid;
  place-items: center;
  position: relative;
}

.gold-seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px dashed rgba(90, 55, 20, 0.6);
}

.seal-text {
  font-size: 22px;
  font-weight: 700;
  color: #5b3a14;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 10px;
}

.sub {
  color: #5b5146;
  font-size: 16px;
}

.moods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: -20% -20% auto -20%;
  height: 260px;
  background: radial-gradient(circle at 50% 100%, rgba(255, 238, 210, 0.35), transparent 70%);
  filter: blur(8px);
  opacity: 0.9;
}

.mood {
  background: linear-gradient(180deg, #f4e6d4, #d8c1aa);
  border: 1px solid rgba(93, 74, 60, 0.4);
  border-radius: 18px;
  padding: 16px 12px;
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mood:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(69, 50, 38, 0.25);
}

.mood:active {
  transform: translateY(0px) scale(0.98);
}

.icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
}

.icon svg {
  width: 78px;
  height: 78px;
  stroke: #4c3f34;
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.noface rect {
  fill: #f2efe9;
  stroke: #3a2c23;
}

.mask-line {
  stroke: #9c7b5e;
}

.mask-eye {
  fill: #2a1f18;
  stroke: none;
}

.mask-mouth {
  stroke: #7a5044;
}

.yubaba path {
  fill: #e6d2b6;
  stroke: #4a382c;
}

.yubaba .hair {
  fill: #3d2f2a;
  stroke: #2b201c;
}

.yubaba .face-detail {
  stroke: #7a5044;
}

.haku .dragon {
  stroke: #4a6f7a;
}

.haku .dragon-eye {
  fill: #4a6f7a;
  stroke: none;
}

.haku .dragon-horn {
  stroke: #b7994a;
}

.boh circle {
  fill: #f2d0c8;
  stroke: #7a5044;
}

.boh .cheek {
  fill: #c56c6c;
  stroke: none;
}

.boh .mouth {
  stroke: #7a5044;
}

.boh .cap {
  fill: #e8e0d4;
  stroke: #7a5044;
}

.soot circle {
  fill: #2a1f18;
  stroke: #1a1411;
}

.soot-eye {
  fill: #f2efe9;
  stroke: none;
}

.soot-mouth {
  stroke: #3a2b25;
}

.soot .spark circle {
  fill: #f0c43d;
  stroke: none;
}

.kamaji circle {
  fill: #d8c2a7;
  stroke: #5a4336;
}

.kamaji .arm {
  stroke: #5a4336;
}

.kamaji .brow {
  stroke: #6a4b3c;
}

.chihiro circle {
  fill: #f0d7c5;
  stroke: #6a4b3c;
}

.chihiro .hair {
  stroke: #3a2b25;
}

.chihiro .collar {
  stroke: #9c7b5e;
}

.dadpig circle {
  fill: #f0c6b6;
  stroke: #7a5044;
}

.dadpig .pig-eye {
  fill: #3a2b25;
  stroke: none;
}

.dadpig .pig-snout {
  fill: #e2a99e;
  stroke: #7a5044;
}

.dadpig .pig-nostril {
  fill: #7a5044;
  stroke: none;
}

.dadpig .pig-ear {
  stroke: #7a5044;
}

.label {
  font-weight: 600;
}

.status {
  min-height: 24px;
  text-align: center;
  font-size: 15px;
  color: var(--teal);
}

.status.error {
  color: var(--crimson);
}

.footnote {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: #675a4a;
}

@media (max-width: 640px) {
  .panel {
    padding: 28px 20px 22px;
  }

  .signboard {
    padding: 8px 14px;
    letter-spacing: 0.12em;
  }

  .lantern {
    width: 54px;
    height: 70px;
  }

  .moods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mood {
    min-height: 132px;
    font-size: 15px;
  }

  .icon,
  .icon svg {
    width: 68px;
    height: 68px;
  }
}
