:root {
  --bg: #030303;
  --bg-soft: #111111;
  --ink: #f6f2ea;
  --ink-muted: rgba(246, 242, 234, 0.72);
  --paper: #141414;
  --toilet-main: #f8fbff;
  --toilet-edge: #d7e2f1;
  --water: #51b9ff;
  --water-deep: #0067b8;
  --water-foam: rgba(255, 255, 255, 0.82);
  --accent: #ffce00;
  --danger: #ff5b4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Pretendard Variable", "SUIT", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.video-section {
  padding: 0 1rem max(1rem, env(safe-area-inset-bottom)) 1rem;
}

.video-dock {
  width: min(100%, 26rem);
  margin: 0 auto;
}

.video-dock-inner {
  border-radius: 0.95rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.video-dock-label {
  margin: 0;
  padding: 0.36rem 0.55rem;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.countdown-wrap {
  position: relative;
  z-index: 4;
  padding:
    max(0.9rem, env(safe-area-inset-top))
    1rem
    0
    1rem;
}

.scene {
  min-height: calc(100vh - 110px);
  min-height: calc(100dvh - 110px);
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0 1rem max(1.25rem, env(safe-area-inset-bottom)) 1rem;
  overflow: hidden;
}

.hero {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.countdown-card {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.8rem 0.9rem 1rem;
  border-radius: 0;
  background: #d91f11;
  border: 4px solid #ffe100;
  box-shadow:
    0 0 0 3px #8d0000 inset,
    8px 8px 0 rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.countdown-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #ffe100 0 10px,
    #ff8a00 10px 20px
  );
  pointer-events: none;
}

.countdown-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0;
  background: #ffef66;
  color: #b10000;
  border: 2px solid #b10000;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  animation: salePop 1.15s ease-in-out infinite;
}

.countdown-label {
  margin: 0.6rem 0 0;
  color: #ffe100;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 2px 2px 0 rgba(120, 0, 0, 0.75);
}

.countdown-time {
  margin: 0.2rem 0 0;
  color: #fffdf8;
  text-shadow:
    3px 3px 0 #6d0000,
    6px 6px 0 rgba(0, 0, 0, 0.18);
  font-size: clamp(1.45rem, 8.4vw, 3.6rem);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.06em;
  white-space: nowrap;
  word-break: keep-all;
}

.countdown-meta {
  margin: 0.45rem 0 0;
  color: #fff3aa;
  font-size: 0.82rem;
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(120, 0, 0, 0.85);
}

h1 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.5rem, 12vw, 5.8rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 28rem;
  margin: 0.9rem 0 0;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-button,
.lever-button {
  width: 100%;
  min-height: 54px;
  padding: 0.9rem 1rem;
  border-radius: 1.2rem;
  font-size: 0.96rem;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(35, 23, 28, 0.14);
  white-space: nowrap;
}

.action-button {
  background: var(--ink);
  color: #080808;
}

.lever-button {
  background: var(--accent);
  color: #080808;
}

.toilet-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44svh;
  min-height: 44dvh;
  padding-top: 0.25rem;
}

.spark {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(18px);
  animation: floatBlob 7s ease-in-out infinite;
}

.spark-one {
  top: 4%;
  left: 12%;
  background: rgba(255, 255, 255, 0.12);
}

.spark-two {
  right: 10%;
  top: 18%;
  background: rgba(64, 197, 255, 0.18);
  animation-delay: -2s;
}

.spark-three {
  bottom: 10%;
  right: 22%;
  background: rgba(255, 210, 0, 0.12);
  animation-delay: -4s;
}

.toilet {
  position: relative;
  width: min(92vw, 420px);
  aspect-ratio: 0.82;
}

.toilet-lever {
  position: absolute;
  top: 10%;
  right: 2%;
  width: 82px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe59f, #d29c00);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.55), 0 10px 24px rgba(35, 23, 28, 0.18);
  transform-origin: 12px 50%;
  z-index: 5;
}

.toilet.flushing .toilet-lever,
.toilet.lever-pulled .toilet-lever {
  transform: rotate(34deg);
}

.cistern {
  position: absolute;
  top: 4%;
  left: 50%;
  width: 54%;
  height: 29%;
  transform: translateX(-50%);
  border-radius: 1.8rem;
  background: linear-gradient(180deg, white, #edf4fb 58%, #d9e5f2 100%);
  box-shadow:
    inset 0 -12px 20px rgba(184, 201, 219, 0.75),
    0 26px 40px rgba(71, 72, 89, 0.18);
  z-index: 2;
}

.cistern-shine {
  position: absolute;
  inset: 12px auto 18px 16px;
  width: 34%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  filter: blur(4px);
}

.seat-ring {
  position: absolute;
  left: 50%;
  top: 24%;
  width: 82%;
  height: 54%;
  transform: translateX(-50%);
  border-radius: 48% 48% 42% 42%;
  background: linear-gradient(180deg, white, #eff5fb 72%, #dae5ef);
  box-shadow:
    inset 0 -18px 24px rgba(198, 211, 226, 0.88),
    0 35px 48px rgba(71, 72, 89, 0.14);
  z-index: 3;
}

.seat-hole {
  position: absolute;
  inset: 10% 12%;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 50% 35%, #7ad4ff 0 16%, #51b9ff 18%, #0d8cdb 48%, #005084 72%, #002947 100%);
  box-shadow: inset 0 18px 30px rgba(255, 255, 255, 0.28);
  z-index: 1;
}

.water-surface,
.drain-glow,
.swirl-ring {
  position: absolute;
  border-radius: 50%;
  inset: 0;
  pointer-events: none;
}

.water-surface {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.88), transparent 24%),
    radial-gradient(circle at 35% 50%, rgba(255, 255, 255, 0.3), transparent 14%);
  animation: waterIdle 4.5s ease-in-out infinite;
}

.drain-glow {
  inset: 30% 32%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), rgba(0, 40, 75, 0.75) 70%, transparent 72%);
  opacity: 0.82;
}

.swirl-ring {
  border: 6px solid transparent;
  opacity: 0;
  mix-blend-mode: screen;
}

.swirl-ring-a {
  inset: 14%;
  border-top-color: rgba(255, 255, 255, 0.76);
  border-left-color: rgba(255, 255, 255, 0.5);
}

.swirl-ring-b {
  inset: 24%;
  border-bottom-color: rgba(255, 255, 255, 0.78);
  border-right-color: rgba(255, 255, 255, 0.42);
}

.person-frame {
  position: absolute;
  left: 50%;
  top: 17%;
  width: 42%;
  aspect-ratio: 0.76;
  transform: translateX(-50%) translateY(-160%);
  border-radius: 1.1rem;
  overflow: hidden;
  border: 0;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  z-index: 3;
  will-change: transform, opacity, filter;
}

.person-frame img,
.photo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.person-frame img {
  object-fit: cover;
  object-position: center 24%;
  display: block;
  transform: scale(1.08);
  transform-origin: center;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
  will-change: transform;
}

.photo-fallback {
  display: none;
  place-items: center;
  align-content: center;
  gap: 0.25rem;
  background:
    linear-gradient(135deg, rgba(255, 210, 0, 0.92), rgba(255, 121, 51, 0.95)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.6), transparent 32%);
  color: white;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  text-align: center;
  letter-spacing: 0.04em;
}

.photo-fallback span:last-child {
  font-size: 1.35rem;
}

.person-frame.inserted {
  animation: dropIn 950ms cubic-bezier(0.2, 1, 0.34, 1) forwards;
}

.person-frame.flushing-cycle {
  animation: flushSpin 1.28s cubic-bezier(0.12, 0.78, 0.18, 1) forwards;
}

.toilet.flushing .seat-hole {
  animation: bowlPulse 1s cubic-bezier(0.15, 0.8, 0.2, 1) forwards;
}

.toilet.flushing .water-surface {
  animation: waterFlush 0.96s linear forwards;
}

.toilet.flushing .swirl-ring-a {
  animation: swirlA 0.5s linear infinite;
  opacity: 1;
}

.toilet.flushing .swirl-ring-b {
  animation: swirlB 0.36s linear infinite;
  opacity: 1;
}

.pedestal {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 34%;
  height: 26%;
  transform: translateX(-50%);
  border-radius: 36% 36% 24% 24%;
  background: linear-gradient(180deg, #eff5fb, #d7e1ec 84%);
  box-shadow: inset 0 -16px 20px rgba(181, 195, 210, 0.85);
  z-index: 1;
}

.base-shadow {
  position: absolute;
  left: 50%;
  bottom: 3%;
  width: 52%;
  height: 4%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(8px);
  z-index: 0;
}

@media (max-width: 420px) {
  .scene {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .countdown-wrap {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .video-section {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .video-dock {
    width: 100%;
  }

  .countdown-card {
    padding: 0.75rem 0.75rem 0.9rem;
  }

  .countdown-kicker {
    font-size: 0.66rem;
  }

  h1 {
    font-size: clamp(1.95rem, 10.8vw, 2.9rem);
    line-height: 0.98;
  }

  .controls {
    gap: 0.62rem;
    margin-top: 0.85rem;
  }

  .action-button,
  .lever-button {
    min-height: 50px;
    padding: 0.82rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 1rem;
  }

  .subtitle {
    font-size: 0.91rem;
  }

  .countdown-label {
    font-size: 0.9rem;
  }

  .countdown-time {
    font-size: clamp(1.22rem, 7vw, 2.5rem);
    letter-spacing: -0.07em;
  }

  .countdown-meta {
    font-size: 0.76rem;
  }

  .toilet-stage {
    min-height: 38svh;
    min-height: 38dvh;
  }

  .toilet {
    width: min(87vw, 330px);
  }

  .person-frame {
    width: 44%;
    top: 16.5%;
  }

  .spark-two {
    right: 0;
  }

  .spark-three {
    right: 8%;
  }
}

@keyframes dropIn {
  0% {
    transform: translateX(-50%) translateY(-160%) scale(0.84);
    opacity: 0;
  }
  72% {
    transform: translateX(-50%) translateY(8%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes flushSpin {
  0% {
    transform: translate3d(-50%, 0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  18% {
    transform: translate3d(-46%, 7%, 0) rotate(95deg) scale(0.97);
    opacity: 1;
  }
  38% {
    transform: translate3d(-54%, 18%, 0) rotate(220deg) scale(0.84);
    opacity: 0.95;
  }
  58% {
    transform: translate3d(-52%, 33%, 0) rotate(360deg) scale(0.62);
    opacity: 0.78;
  }
  78% {
    transform: translate3d(-50%, 51%, 0) rotate(520deg) scale(0.34);
    opacity: 0.42;
  }
  100% {
    transform: translate3d(-50%, 72%, 0) rotate(660deg) scale(0.07);
    opacity: 0.02;
  }
}

@keyframes waterIdle {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes bowlPulse {
  0% {
    transform: scale(1);
  }
  28% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(0.975);
  }
}

@keyframes waterFlush {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(300deg) scale(1.08);
  }
  100% {
    transform: rotate(720deg) scale(0.92);
  }
}

@keyframes swirlA {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(0.72);
  }
}

@keyframes swirlB {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(-360deg) scale(0.55);
  }
}

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

@keyframes salePop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (min-width: 921px) {
  .scene {
    display: grid;
    grid-template-columns: minmax(280px, 460px) 1fr;
    gap: 2rem;
    align-items: center;
    justify-content: unset;
    min-height: auto;
    padding: 1rem 3rem 3rem;
  }

  .hero {
    margin: 0;
    text-align: left;
  }

  .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
  }

  .action-button,
  .lever-button {
    width: auto;
  }

  .toilet {
    width: min(70vw, 470px);
  }

  .toilet-stage {
    min-height: 720px;
    padding-top: 0;
  }

  .spark {
    width: 180px;
    height: 180px;
  }

  .subtitle {
    margin-top: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .countdown-wrap {
    padding: max(1rem, env(safe-area-inset-top)) 3rem 0;
  }

  .video-section {
    padding: 0 3rem 1.6rem;
  }

  .video-dock {
    width: min(100%, 18rem);
    margin: 0 0 0 auto;
  }

  .countdown-card {
    max-width: 31rem;
    margin: 0 0 0 auto;
  }

}
