:root {
  --ink: #554d70;
  --ink-soft: #8d82a1;
  --lavender: #9a8bd0;
  --lavender-deep: #7c6ab7;
  --pink: #f2b7d4;
  --border: rgba(138, 117, 183, 0.14);
  --shadow: 0 22px 60px rgba(96, 73, 138, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.88), transparent 20%),
    radial-gradient(circle at 85% 16%, rgba(255, 236, 198, 0.78), transparent 24%),
    radial-gradient(circle at 18% 84%, rgba(199, 231, 255, 0.76), transparent 26%),
    radial-gradient(circle at 52% 58%, rgba(255, 224, 241, 0.36), transparent 34%),
    linear-gradient(155deg, #d8d1ff 0%, #e7dcfa 36%, #f6e4ef 63%, #d8edf9 100%);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(124, 106, 183, 0.28);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.dream-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.cloud {
  position: absolute;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 56px;
  height: 56px;
  left: 18px;
  bottom: 10px;
}

.cloud::after {
  width: 70px;
  height: 70px;
  right: 14px;
  bottom: 6px;
}

.cloud-a {
  width: 122px;
  top: 8.5%;
  left: -18px;
  opacity: 0.55;
}

.cloud-b {
  width: 110px;
  right: -10px;
  bottom: 19%;
  opacity: 0.42;
  transform: scale(0.95);
}

.cloud-c {
  width: 88px;
  top: 58%;
  left: 7%;
  opacity: 0.18;
  transform: scale(0.82);
}

.sprinkle {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1;
  text-shadow: 0 3px 12px rgba(135, 107, 182, 0.14);
}

.star.lilac {
  color: rgba(175, 153, 224, 0.78);
}

.star.pink {
  color: rgba(255, 207, 228, 0.88);
}

.star.soft {
  opacity: 0.5;
  filter: blur(0.2px);
}

.star.tiny {
  font-size: 0.62rem;
}

.star.small {
  font-size: 0.8rem;
}

.star.medium {
  font-size: 1rem;
}

.star.large {
  font-size: 1.16rem;
}

.star-a1 { top: 16%; left: 13.5%; }
.star-a2 { top: 18.8%; left: 17.5%; }
.star-a3 { top: 22.5%; left: 21.5%; }
.star-a4 { top: 26.8%; left: 25.8%; }
.star-a5 { top: 31.8%; left: 29.2%; }

.star-b1 { top: 12.5%; right: 15%; }
.star-b2 { top: 16.5%; right: 18%; }
.star-b3 { top: 20.5%; right: 21.8%; }
.star-b4 { top: 25.5%; right: 24.8%; }
.star-b5 { top: 30.5%; right: 28.6%; }

.star-c1 { top: 68.5%; right: 18%; }
.star-c2 { top: 73%; right: 22.5%; }
.star-c3 { top: 77%; right: 26%; }

.star-d1 { bottom: 17%; left: 23%; }
.star-d2 { bottom: 13%; left: 27%; }

.app-shell {
  width: min(760px, calc(100% - 32px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 36px 0;
}

.hero {
  width: 100%;
  text-align: center;
}

h1 {
  margin: 0;
  color: #5c507c;
  font-size: clamp(2.15rem, 4vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.042em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.28);
}

.patch-card {
  width: min(690px, 100%);
  min-height: 328px;
  display: grid;
  place-items: center;
  padding: 42px 38px 38px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}

.view {
  width: min(100%, 520px);
  text-align: center;
}

.view h2 {
  margin: 0;
  color: #5a4f76;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.view > p {
  max-width: 450px;
  margin: 12px auto 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.dream-mark {
  position: relative;
  width: 64px;
  height: 54px;
  margin: 0 auto 22px;
}

.moon {
  position: absolute;
  width: 44px;
  height: 44px;
  top: 5px;
  left: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff1c9 2%, #ffdce9 68%, #efc8ec 100%);
  box-shadow: 0 7px 18px rgba(153, 119, 170, 0.12);
}

.moon::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  top: -4px;
  right: -13px;
  border-radius: 50%;
  background: #fff;
}

.mark-star {
  position: absolute;
  right: 3px;
  bottom: 6px;
  color: #a98ad2;
  font-size: 0.92rem;
  line-height: 1;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: 999px;
  padding: 11px 26px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.primary-button {
  margin-top: 22px;
  min-width: 188px;
  border: 1px solid rgba(117, 96, 170, 0.16);
  color: #fff;
  background: linear-gradient(135deg, #9d8ad5, #d995bf);
  box-shadow: 0 10px 22px rgba(129, 96, 166, 0.2);
}

.secondary-button {
  border: 1px solid rgba(126, 110, 164, 0.2);
  color: #6a5c86;
  background: #fff;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  box-shadow: 0 13px 26px rgba(129, 96, 166, 0.26);
}

.local-note {
  margin-top: 18px !important;
  color: #9185a4 !important;
  font-size: 0.78rem !important;
}

.star-loader {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 24px;
  color: #b59bd2;
}

.star-loader span {
  font-size: 0.82rem;
  animation: loader-pulse 1.2s ease-in-out infinite;
}

.star-loader span:nth-child(2) {
  animation-delay: 0.16s;
}

.star-loader span:nth-child(3) {
  animation-delay: 0.32s;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.info-item {
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(96, 73, 138, 0.055);
}

.info-item span {
  display: block;
  margin-bottom: 7px;
  color: #8a7ca0;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.info-item strong {
  color: #5d5278;
  font-size: 0.96rem;
}

.button-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.button-row .primary-button,
.button-row .secondary-button {
  margin-top: 0;
}

.error-view .secondary-button {
  margin-top: 24px;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(108, 87, 155, 0.16);
  backdrop-filter: blur(12px);
}

.drop-overlay-card {
  width: min(520px, 100%);
  padding: 46px 28px;
  border: 2px dashed rgba(125, 102, 181, 0.32);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 30px 90px rgba(82, 62, 123, 0.2);
  text-align: center;
}

.drop-overlay-card strong,
.drop-overlay-card span {
  display: block;
}

.drop-overlay-card strong {
  margin-top: 12px;
  color: #5d507b;
  font-size: 1.5rem;
}

.overlay-star {
  color: #ad91d2;
  font-size: 1.1rem;
}

@keyframes loader-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0) scale(0.86);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) scale(1.06);
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 760px);
    gap: 22px;
    padding: 28px 0;
  }

  .patch-card {
    min-height: 340px;
    padding: 34px 20px 32px;
    border-radius: 28px;
  }

  .view {
    width: min(100%, 100%);
  }

  .dream-mark {
    margin-bottom: 22px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    text-align: left;
  }

  .info-item span {
    margin-bottom: 0;
  }

  .button-row {
    flex-direction: column;
  }

  .button-row button {
    width: 100%;
  }
}
