:root {
  color-scheme: light;
  --ink: #2d2438;
  --muted: #6f6477;
  --paper: #fff9f0;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(45, 36, 56, 0.14);
  --rose: #ff8fa3;
  --peach: #ffb36b;
  --lemon: #ffe08a;
  --mint: #a4d7c8;
  --shadow: 0 22px 60px rgba(65, 38, 79, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 224, 138, 0.7), transparent 34rem),
    linear-gradient(150deg, #ffd4ae 0%, #f7a6a6 43%, #a4d7c8 100%);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100svh;
  min-height: 100dvh;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  place-items: center;
}

.sky-card {
  --sky-a: #f7a6a6;
  --sky-b: #ffb36b;
  --sky-c: #ffe08a;
  --sun-glow: rgba(255, 242, 168, 0.2);
  --sun-bright: rgba(255, 242, 168, 0.7);
  --hill-front: #5aa99a;
  --hill-back: rgba(164, 215, 200, 0.76);
  display: flex;
  flex-direction: column;
  width: min(100%, 430px);
  height: min(100%, calc(100svh - 20px));
  height: min(100%, calc(100dvh - 20px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sky-card[data-forecast="quiet"] {
  --sky-a: #c7b6c9;
  --sky-b: #e3b6a1;
  --sky-c: #f2d9a4;
  --sun-glow: rgba(255, 242, 168, 0.12);
  --sun-bright: rgba(255, 242, 168, 0.45);
  --hill-front: #6a9f94;
  --hill-back: rgba(186, 210, 199, 0.72);
}

.sky-card[data-forecast="good"] {
  --sky-a: #f8a1ad;
  --sky-b: #ffb36b;
  --sky-c: #ffe08a;
  --sun-glow: rgba(255, 242, 168, 0.2);
  --sun-bright: rgba(255, 242, 168, 0.72);
}

.sky-card[data-forecast="great"] {
  --sky-a: #ff7897;
  --sky-b: #ff9d5f;
  --sky-c: #ffe36e;
  --sun-glow: rgba(255, 232, 118, 0.28);
  --sun-bright: rgba(255, 244, 154, 0.9);
  --hill-front: #45a68e;
}

.sky-card[data-forecast="epic"] {
  --sky-a: #ff4f8b;
  --sky-b: #ff7a3d;
  --sky-c: #ffe54d;
  --sun-glow: rgba(255, 225, 87, 0.36);
  --sun-bright: rgba(255, 247, 148, 1);
  --hill-front: #2fa68f;
  --hill-back: rgba(174, 229, 194, 0.82);
}

.sky-art {
  position: relative;
  height: clamp(108px, 22dvh, 170px);
  flex: 0 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 45%),
    linear-gradient(160deg, var(--sky-a) 0%, var(--sky-b) 50%, var(--sky-c) 100%);
}

.sun {
  position: absolute;
  right: 38px;
  bottom: 30px;
  width: clamp(58px, 14dvh, 82px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff2a8;
  box-shadow: 0 0 0 18px var(--sun-glow), 0 0 44px var(--sun-bright);
}

.cloud {
  position: absolute;
  z-index: 1;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(1px);
  opacity: 0;
}

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

.cloud::before {
  top: -10px;
  left: 18%;
  width: 34px;
  height: 34px;
}

.cloud::after {
  top: -15px;
  right: 16%;
  width: 42px;
  height: 42px;
}

.cloud-one {
  top: 26%;
  left: 8%;
  width: 120px;
}

.cloud-two {
  top: 18%;
  right: 20%;
  width: 96px;
}

.cloud-three {
  top: 44%;
  right: 5%;
  width: 150px;
  background: rgba(255, 239, 190, 0.48);
}

.sky-card[data-clouds="some"] .cloud-one,
.sky-card[data-clouds="some"] .cloud-three {
  opacity: 0.55;
}

.sky-card[data-clouds="heavy"] .cloud {
  opacity: 0.68;
}

.sky-card[data-forecast="great"][data-clouds="some"] .cloud,
.sky-card[data-forecast="great"][data-clouds="heavy"] .cloud,
.sky-card[data-forecast="epic"][data-clouds="some"] .cloud,
.sky-card[data-forecast="epic"][data-clouds="heavy"] .cloud {
  background: rgba(255, 151, 180, 0.58);
}

.sky-card[data-forecast="epic"][data-clouds="some"] .cloud-three,
.sky-card[data-forecast="epic"][data-clouds="heavy"] .cloud-three {
  background: rgba(255, 209, 112, 0.54);
}

.hill {
  position: absolute;
  right: -12%;
  bottom: -60px;
  width: 120%;
  height: 112px;
  border-radius: 50% 50% 0 0;
}

.hill-back {
  bottom: -74px;
  background: var(--hill-back);
  transform: rotate(-3deg);
}

.hill-front {
  left: -18%;
  background: var(--hill-front);
  transform: rotate(4deg);
}

.title-row,
.day-stepper,
.result {
  margin: 0 16px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 10vw, 2.55rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.2rem;
}

.day-stepper {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  margin-top: auto;
  margin-bottom: 8px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.step-button {
  display: grid;
  width: 40px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.step-button.is-hidden {
  pointer-events: none;
  visibility: hidden;
}

.day-label {
  margin: 0;
  min-height: 34px;
  align-content: center;
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 900;
}

button:focus-visible {
  border-color: rgba(255, 143, 163, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 143, 163, 0.18);
}

.result {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  place-items: center;
  background: var(--panel);
}

.empty-state,
.error {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  text-align: center;
}

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

.retry-button {
  min-height: 44px;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: #33202f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--lemon), var(--peach) 54%, var(--rose));
}

.score {
  font-size: clamp(3.8rem, 18dvh, 6.4rem);
  font-weight: 950;
  line-height: 0.82;
}

.quality {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 900;
}

.result-time {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.verdict {
  max-width: 28ch;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}

.meta-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-item strong {
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 430px) and (max-height: 760px) {
  .app-shell {
    padding: 0;
  }

  .sky-card {
    width: 100%;
    height: 100dvh;
    border-width: 0;
    border-radius: 0;
  }

  .sky-art {
    height: clamp(92px, 19dvh, 132px);
  }

  .title-row,
  .day-stepper,
  .result {
    margin-right: 12px;
    margin-left: 12px;
  }

  .title-row {
    padding-top: 12px;
  }

  .eyebrow {
    font-size: 0.66rem;
  }

  h1 {
    font-size: clamp(1.65rem, 9vw, 2.1rem);
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .result {
    margin-top: 10px;
    padding: 12px;
  }

  .quality {
    margin-bottom: 6px;
  }

  .score {
    font-size: clamp(3.7rem, 16dvh, 5.3rem);
  }

  .result-time {
    margin-top: 8px;
    font-size: 0.96rem;
  }

  .meta-list {
    gap: 5px;
    margin-top: 10px;
  }

  .meta-item {
    gap: 8px;
    padding-top: 6px;
    font-size: 0.78rem;
  }

  .day-label {
    min-height: 28px;
    font-size: 0.76rem;
  }

  .step-button {
    height: 28px;
  }
}

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

  .sky-card {
    height: min(760px, calc(100svh - 48px));
    height: min(760px, calc(100dvh - 48px));
  }
}
