:root {
  --bg: #b9c2ad;
  --paper: #e5ddcf;
  --ink: #141410;
  --acid: #ddff18;
  --muted: #7a7f70;
  --line: rgba(20, 20, 16, 0.28);
  --soft-line: rgba(255, 255, 255, 0.16);
  --danger: #ec4f32;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 52% 32%, rgba(221, 255, 24, 0.16), transparent 24rem),
    linear-gradient(180deg, #b9c2ad 0%, #aeb8a3 100%);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  width: min(100%, 430px);
  min-height: calc(100svh - 36px);
  overflow: hidden;
  border: 1px solid rgba(20, 20, 16, 0.22);
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(20, 20, 16, 0.2);
}

.hero-panel {
  position: relative;
  min-height: 300px;
  padding: 24px 24px 18px;
  color: #f5f3eb;
  background: var(--ink);
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, transparent 0 45%, rgba(221, 255, 24, 0.95) 46%, rgba(221, 255, 24, 0.72) 58%, transparent 68%),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.16), transparent 8rem);
  opacity: 0.9;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: screen;
}

.brand-row,
.month-stamp,
.hero-panel h1,
.hero-panel p {
  position: relative;
  z-index: 1;
}

.brand-row {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.brand-logo {
  display: block;
  width: 148px;
  height: auto;
}

.month-stamp {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 56px;
  line-height: 1;
  font-weight: 800;
}

.month-stamp strong {
  color: var(--acid);
  font-size: 74px;
  font-weight: 820;
}

.hero-panel h1 {
  margin: 18px 0 0;
  font-size: clamp(42px, 12vw, 62px);
  line-height: 0.92;
  font-weight: 760;
}

.hero-panel p {
  width: min(320px, 94%);
  margin: 20px 0 0;
  color: rgba(245, 243, 235, 0.78);
  font-size: 14px;
  line-height: 1.55;
}

.month-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px;
  background: var(--acid);
  border-bottom: 1px solid var(--ink);
  scrollbar-width: none;
}

.month-strip::-webkit-scrollbar {
  display: none;
}

.month-button {
  height: 42px;
  border: 1px solid rgba(20, 20, 16, 0.45);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
}

.month-button.is-active {
  color: var(--acid);
  background: var(--ink);
  border-color: var(--ink);
}

.entry-panel,
.visual-panel,
.list-panel {
  padding: 20px 18px;
}

.entry-panel {
  border-bottom: 1px solid var(--line);
}

.visual-panel {
  border-bottom: 1px solid var(--line);
  background: #ded6c8;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 780;
}

#movieCount {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #f2eadc;
  font-size: 12px;
  font-weight: 780;
}

.poster-note {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.poster-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  border: 1px solid var(--ink);
  background: #f4eee3;
}

.poster-mode-button {
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
}

.poster-mode-button + .poster-mode-button {
  border-left: 1px solid var(--ink);
}

.poster-mode-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

.poster-mode-button.is-active {
  color: var(--acid);
  background: var(--ink);
}

.movie-form {
  display: grid;
  gap: 10px;
}

.movie-form label {
  font-size: 12px;
  font-weight: 780;
  color: var(--muted);
}

.movie-form textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 14px;
  color: var(--ink);
  background: #f4eee3;
  outline: none;
  font-size: 17px;
  line-height: 1.55;
}

.movie-form textarea:focus {
  box-shadow: 0 0 0 3px rgba(221, 255, 24, 0.75);
}

.primary-action,
.ghost-action,
.delete-action {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-weight: 820;
}

.primary-action {
  color: var(--acid);
  background: var(--ink);
}

.ghost-action {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
}

.share-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.share-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.share-copy strong {
  font-size: 15px;
  line-height: 1.35;
}

.share-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-action {
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
}

.share-action svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

.share-action-primary {
  color: var(--acid);
  background: var(--ink);
}

.share-action-secondary {
  color: var(--ink);
  background: #f4eee3;
}

.share-action:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.share-status {
  min-height: 19px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.collage-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: var(--stage-height, 360px);
  overflow: hidden;
  border: 1px solid var(--ink);
  background:
    radial-gradient(circle at 50% 88%, rgba(17, 17, 17, 0.06), transparent 11rem),
    #e0ded6;
  transition: min-height 520ms ease;
}

.poster-orbit {
  position: relative;
  width: 100%;
  height: var(--stage-height, 360px);
  display: grid;
  place-items: center;
  opacity: 1;
  transition: height 520ms ease;
}

.collage-stage.is-empty .poster-orbit {
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.poster-shape {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  background: transparent;
  border: 0;
  transform: none;
  box-shadow: none;
}

.poster-shape.is-animating {
  animation: none;
}

.shape-sheen {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, transparent 0 50%, rgba(20, 20, 16, 0.07) 100%);
}

.poster-rings {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.poster-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  opacity: 0;
  overflow: visible;
  transform: translate(-50%, -50%) rotate(var(--ring-rotate, -6deg)) scale(var(--ring-scale, 1));
  transform-origin: center;
  animation: ring-stretch 720ms cubic-bezier(0.18, 1.05, 0.22, 1) both;
  animation-delay: var(--ring-delay, 0ms);
}

.poster-ring polygon {
  fill: transparent;
  stroke: var(--ring-color, var(--ink));
  stroke-width: var(--ring-width, 2);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.poster-labels,
.poster-dots {
  position: absolute;
  inset: 0;
}

.poster-dots {
  z-index: 1;
}

.poster-labels {
  z-index: 2;
  overflow: hidden;
  touch-action: manipulation;
}

.growth-cluster {
  position: absolute;
  left: calc(50% + var(--growth-offset-x, 0px));
  top: calc(50% + var(--growth-offset-y, 0px));
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) rotate(-6deg) scale(var(--growth-fit-scale, 1));
  transform-origin: center;
}

.growth-blob,
.growth-items,
.growth-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.growth-blob {
  overflow: visible;
  filter: drop-shadow(0 2px 0 rgba(20, 20, 16, 0.14));
  opacity: 1;
  transition: opacity 180ms ease;
}

.growth-cluster.is-awaiting-first-pill .growth-blob {
  opacity: 0;
}

.growth-blob.is-pushing {
  animation: growth-frame-push 620ms cubic-bezier(0.2, 0.9, 0.24, 1) both;
}

.growth-items,
.growth-dots {
  overflow: visible;
}

.growth-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--pill-border, rgba(17, 17, 17, 0.5));
  border-radius: 9px;
  color: var(--pill-ink, #141410);
  background: var(--pill-color);
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(var(--growth-angle, 0deg));
  transform-origin: center;
  transition:
    left 620ms cubic-bezier(0.2, 0.9, 0.24, 1),
    top 620ms cubic-bezier(0.2, 0.9, 0.24, 1),
    transform 620ms cubic-bezier(0.2, 0.9, 0.24, 1);
  box-shadow: 0 1px 0 rgba(20, 20, 16, 0.16);
  z-index: 2;
}

.growth-pill.is-entering {
  animation: growth-pill-enter 540ms cubic-bezier(0.2, 1.32, 0.3, 1) both;
}

.growth-pill.is-preparing {
  opacity: 0;
  transform:
    translate(-50%, -50%)
    translate(var(--growth-spawn-x, 0px), var(--growth-spawn-y, 0px))
    rotate(var(--growth-angle, 0deg))
    scale(0.12);
}

.growth-pill.is-reanchoring {
  transition: none;
}

.growth-pill.is-push-preparing {
  transition: none;
  transform:
    translate(-50%, -50%)
    translate(var(--growth-push-x, 0px), var(--growth-push-y, 0px))
    rotate(var(--growth-angle, 0deg));
}

.growth-pill.is-pushing-out {
  animation: growth-pill-push-out 800ms cubic-bezier(0.22, 0.72, 0.22, 1) both;
}

.growth-dot {
  position: absolute;
  left: var(--dot-x);
  top: var(--dot-y);
  width: var(--dot-size, 14px);
  height: var(--dot-size, 14px);
  border: 1px solid rgba(20, 20, 16, 0.35);
  border-radius: 50%;
  background: var(--dot-color, #111111);
  transform: translate(-50%, -50%);
  animation: growth-dot-enter 420ms cubic-bezier(0.2, 1.32, 0.3, 1) both;
  z-index: 1;
}

.movie-pill {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: none;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--pill-border, rgba(17, 17, 17, 0.5));
  border-radius: 10px;
  color: var(--pill-ink, #141410);
  background: var(--pill-color);
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  display: grid;
  place-items: center;
  transform-origin: center;
  box-shadow: 0 2px 0 rgba(20, 20, 16, 0.2);
  will-change: transform;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.movie-pill.is-waiting {
  visibility: hidden;
}

.movie-pill.is-falling {
  visibility: visible;
  opacity: 1;
}

.poster-dot,
.poster-dash {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) rotate(var(--r));
  animation: pill-pop 520ms cubic-bezier(0.2, 1.4, 0.34, 1) both;
  animation-delay: var(--delay);
}

.poster-dot {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--dot-color);
  border: 1px solid rgba(20, 20, 16, 0.34);
}

.poster-dash {
  width: 22px;
  height: 6px;
  border-radius: 999px;
  background: var(--ink);
}

.poster-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(210px, 72%);
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 760;
  text-align: center;
  transform: translate(-50%, -50%) rotate(6deg);
}

.poster-empty[hidden] {
  display: none;
}

.movie-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.movie-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--ink);
  background: #171713;
  color: #f5f3eb;
}

.movie-index {
  color: var(--acid);
  font-size: 18px;
  line-height: 1;
  font-weight: 830;
}

.movie-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 720;
}

.delete-action {
  width: 34px;
  min-height: 34px;
  color: #f5f3eb;
  background: transparent;
  border-color: var(--soft-line);
  font-size: 20px;
  line-height: 1;
}

.empty-state {
  margin: 0;
  padding: 28px 18px;
  border: 1px dashed rgba(20, 20, 16, 0.45);
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}

@keyframes pill-pop {
  0% {
    opacity: 0;
    transform: rotate(var(--r)) scale(0.1);
  }

  72% {
    opacity: 1;
    transform: rotate(var(--r)) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: rotate(var(--r)) scale(1);
  }
}

@keyframes growth-pill-enter {
  0% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      translate(var(--growth-spawn-x, 0px), var(--growth-spawn-y, 0px))
      rotate(var(--growth-angle, 0deg))
      scale(0.12);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--growth-angle, 0deg)) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--growth-angle, 0deg)) scale(1);
  }
}

@keyframes growth-dot-enter {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes growth-pill-push-out {
  0% {
    transform:
      translate(-50%, -50%)
      translate(var(--growth-push-x, 0px), var(--growth-push-y, 0px))
      rotate(var(--growth-angle, 0deg));
  }

  100% {
    transform: translate(-50%, -50%) rotate(var(--growth-angle, 0deg));
  }
}

@keyframes growth-frame-push {
  0% {
    transform: scale(0.82);
  }

  68% {
    transform: scale(1.025);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shape-grow {
  0% {
    opacity: 0;
    transform: rotate(-14deg) scale(0.16);
  }

  38% {
    opacity: 1;
  }

  76% {
    transform: rotate(-5deg) scale(1.05);
  }

  100% {
    opacity: 1;
    transform: rotate(-6deg) scale(1);
  }
}

@keyframes halo-stretch {
  0% {
    opacity: 0;
    transform: rotate(-14deg) scale(0.1);
  }

  50% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
    transform: rotate(-6deg) scale(1);
  }
}

@keyframes ring-stretch {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(calc(var(--ring-rotate, -6deg) - 5deg)) scale(0.14);
  }

  56% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--ring-rotate, -6deg)) scale(calc(var(--ring-scale, 1) + 0.035));
  }

  100% {
    opacity: var(--ring-opacity, 1);
    transform: translate(-50%, -50%) rotate(var(--ring-rotate, -6deg)) scale(var(--ring-scale, 1));
  }
}

@keyframes poster-float {
  0%,
  100% {
    transform: rotate(-1deg) scale(0.98);
  }

  50% {
    transform: rotate(2deg) scale(1.02);
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding: 36px;
  }

  .phone-frame {
    min-height: 820px;
  }
}
