:root {
  --paper: #f8faf9;
  --mist: #dce9ea;
  --glass: #edf4f3;
  --steel: #687b7f;
  --ink: #182225;
  --accent: #2f7881;
  --shadow: rgba(23, 39, 43, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(248, 250, 249, 0.96) 0%, rgba(229, 240, 240, 0.88) 62%, rgba(202, 217, 219, 0.94) 100%),
    repeating-linear-gradient(90deg, rgba(47, 120, 129, 0.08) 0 1px, transparent 1px 120px);
  font-family: "Times New Roman", "Songti SC", serif;
}

.scene {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(16px, 3vw, 36px);
}

.scene::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, 0.66) 48% 51%, transparent 51% 100%),
    linear-gradient(245deg, transparent 0 56%, rgba(104, 123, 127, 0.11) 56% 57%, transparent 57% 100%);
}

.scene::after {
  position: absolute;
  inset: auto 12vw 5vh;
  z-index: -1;
  height: min(18vh, 150px);
  content: "";
  background: radial-gradient(ellipse at center, rgba(47, 120, 129, 0.2), rgba(47, 120, 129, 0) 68%);
  transform: perspective(700px) rotateX(62deg);
}

.stage {
  position: relative;
  display: grid;
  width: min(76vw, 620px);
  height: min(94svh, 900px);
  place-items: end center;
}

.stage::before {
  position: absolute;
  inset: auto 4% 0;
  height: 18%;
  content: "";
  background: radial-gradient(ellipse at center, var(--shadow), rgba(23, 39, 43, 0) 72%);
  filter: blur(8px);
}

.character-button {
  position: relative;
  display: grid;
  width: min(76vw, 620px);
  max-height: 94svh;
  aspect-ratio: 1086 / 1448;
  padding: 0;
  border: 0;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  outline: none;
  place-items: center;
  transform-origin: 50% 92%;
}

.character-button::before {
  position: absolute;
  inset: 4%;
  z-index: -1;
  content: "";
  border: 1px solid rgba(104, 123, 127, 0.22);
  opacity: 0.55;
  transform: skewX(-3deg);
}

.character-button:focus-visible::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 120, 129, 0.16);
  opacity: 1;
}

.character {
  display: block;
  width: 100%;
  height: auto;
  max-height: 94svh;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 26px 34px rgba(23, 39, 43, 0.18));
  transform: translateY(0) scale(1);
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.character-button:hover .character,
.character-button.is-dancing .character {
  filter: drop-shadow(0 32px 38px rgba(23, 39, 43, 0.22));
  transform: translateY(-4px) scale(1.01);
}

.character-button.is-nodding .character {
  filter: drop-shadow(0 22px 28px rgba(23, 39, 43, 0.18));
  transform: translateY(2px) scale(0.997);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .scene {
    align-items: end;
    padding: 12px;
  }

  .stage,
  .character-button {
    width: min(94vw, 500px);
  }
}

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