:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-strong: #fffaf0;
  --ink: #1f2933;
  --muted: #69737c;
  --line: #ddd8ca;
  --teal: #0f766e;
  --teal-soft: #d8f3ef;
  --green: #237a4b;
  --green-soft: #dff3e7;
  --amber: #a15c07;
  --amber-soft: #ffedc2;
  --red: #b33b30;
  --red-soft: #f8d8d5;
  --blue: #2364aa;
  --blue-soft: #dcecff;
  --sky: #8fd3ff;
  --water: #56d4df;
  --water-deep: #11a6b8;
  --display-font: "Avenir Next Rounded", "Avenir Next", "Trebuchet MS", "Gill Sans", ui-rounded, system-ui, sans-serif;
  --shadow: 0 14px 0 rgba(14, 74, 85, 0.08), 0 18px 34px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 11%, rgba(255, 241, 153, 0.74) 0 34px, rgba(255, 241, 153, 0.24) 35px 78px, rgba(255, 241, 153, 0) 108px),
    linear-gradient(180deg, #99d9ff 0 112px, #6fd3ee 112px 168px, #1499be 168px 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(35, 100, 170, 0.35);
  outline-offset: 2px;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 10px;
}

.pool-water {
  position: fixed;
  inset: 118px 0 0;
  z-index: 0;
  min-height: 360px;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.03) 26%, rgba(0, 67, 99, 0.34) 100%),
    url("/assets/pool-water-texture.jpg") center top / cover no-repeat,
    linear-gradient(180deg, rgba(87, 214, 232, 0.96) 0%, rgba(17, 165, 195, 0.98) 40%, rgba(4, 106, 139, 0.98) 100%);
  box-shadow: inset 0 42px 70px rgba(255, 255, 255, 0.2), inset 0 -120px 160px rgba(2, 54, 86, 0.32);
}

.pool-water::before,
.pool-water::after {
  content: "";
  position: absolute;
  inset: -24%;
  pointer-events: none;
}

.pool-water::before {
  opacity: 0.34;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 24% 20%, rgba(255, 255, 255, 0.52) 0 4%, rgba(255, 255, 255, 0) 30%),
    linear-gradient(112deg, rgba(255, 255, 255, 0) 0 44%, rgba(255, 255, 255, 0.2) 47%, rgba(255, 255, 255, 0) 51% 100%),
    linear-gradient(28deg, rgba(255, 255, 255, 0) 0 50%, rgba(255, 255, 255, 0.15) 52%, rgba(255, 255, 255, 0) 55% 100%);
  background-size: 120% 80%, 230px 150px, 260px 170px;
  filter: blur(0.4px);
  transform: rotate(-7deg);
  animation: water-shimmer 24s linear infinite;
}

.pool-water::after {
  opacity: 0.22;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 22%, rgba(0, 59, 91, 0.28) 100%),
    repeating-linear-gradient(24deg, rgba(3, 78, 108, 0) 0 30px, rgba(3, 78, 108, 0.18) 31px 33px, rgba(3, 78, 108, 0) 34px 82px);
  background-size: auto, 240px 150px;
  filter: blur(0.8px);
  transform: rotate(3deg);
  animation: water-glimmer 33s linear infinite reverse;
}

.water-ripple {
  position: absolute;
  left: -18%;
  width: 136%;
  height: 54px;
  border-radius: 999px;
  opacity: 0.16;
  background:
    radial-gradient(ellipse at 12% 50%, rgba(255, 255, 255, 0.62) 0 8px, rgba(255, 255, 255, 0) 9px 42px),
    radial-gradient(ellipse at 42% 52%, rgba(255, 255, 255, 0.45) 0 7px, rgba(255, 255, 255, 0) 8px 38px),
    radial-gradient(ellipse at 78% 48%, rgba(255, 255, 255, 0.52) 0 9px, rgba(255, 255, 255, 0) 10px 46px);
  background-size: 240px 54px, 210px 54px, 270px 54px;
  mix-blend-mode: screen;
  animation: drift-wave 18s linear infinite;
}

.ripple-one {
  top: 15%;
}

.ripple-two {
  top: 45%;
  animation-duration: 25s;
  animation-direction: reverse;
}

.ripple-three {
  top: 74%;
  animation-duration: 31s;
}

.beach-ball {
  position: fixed;
  z-index: 1;
  top: 24svh;
  left: -90px;
  width: 54px;
  height: 54px;
  border: 3px solid rgba(31, 41, 51, 0.2);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 10px, rgba(255, 255, 255, 0) 11px),
    conic-gradient(#ffffff 0 60deg, #f3534b 60deg 120deg, #ffffff 120deg 180deg, #2364aa 180deg 240deg, #ffffff 240deg 300deg, #f9d86e 300deg 360deg);
  box-shadow: 0 12px 0 rgba(31, 41, 51, 0.12);
  animation: ball-fly 95s linear 9s infinite;
}

.surprise-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.surprise-sprite {
  position: absolute;
  top: var(--surprise-top);
  width: var(--sprite-width);
  opacity: 0.82;
  filter: drop-shadow(0 10px 0 rgba(31, 41, 51, 0.08)) drop-shadow(0 10px 18px rgba(31, 41, 51, 0.12));
  animation-duration: var(--surprise-duration);
  animation-fill-mode: forwards;
  animation-timing-function: linear;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  will-change: transform;
}

.surprise-sprite.from-left {
  left: calc((var(--sprite-width) + 32px) * -1);
  animation-name: surprise-pass-left;
}

.surprise-sprite.from-right {
  right: calc((var(--sprite-width) + 32px) * -1);
  animation-name: surprise-pass-right;
}

.surprise-direction,
.surprise-bob,
.surprise-sprite svg {
  display: block;
}

.surprise-sprite.from-right .surprise-direction {
  transform: scaleX(-1);
}

.surprise-bob {
  animation: surprise-bob 2.8s ease-in-out infinite;
}

.surprise-sprite svg {
  width: 100%;
  height: auto;
}

.surprise-sprite.is-hurrying {
  z-index: 4;
  animation-duration: var(--hurry-duration, 2400ms);
  animation-timing-function: cubic-bezier(0.16, 0.92, 0.2, 1);
  pointer-events: none;
}

.surprise-sprite.hurry-to-right {
  animation-name: sprite-hurry-right;
}

.surprise-sprite.hurry-to-left {
  animation-name: sprite-hurry-left;
}

.surprise-sprite::after {
  content: "";
  position: absolute;
  top: 44%;
  width: 46%;
  height: 13px;
  border: 3px solid rgba(23, 33, 43, 0.86);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.86);
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0.35);
}

.surprise-sprite.hurry-to-right::after {
  right: 82%;
}

.surprise-sprite.hurry-to-left::after {
  left: 82%;
}

.surprise-sprite.is-hurrying::after {
  animation: hurry-trail var(--hurry-duration, 2400ms) ease-out forwards;
  opacity: 0.86;
}

.surprise-sprite.is-hurrying .surprise-bob {
  animation: hurry-wiggle 360ms ease-in-out infinite;
}

.surprise-sky {
  opacity: 0.95;
}

.surprise-water {
  opacity: 0.78;
  mix-blend-mode: multiply;
}

.auth-view {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-mark {
  width: 56px;
  height: 56px;
}

.auth-panel h1,
.app-header h1,
.today-band h2,
.pool-tool h2,
.calendar-tool h2 {
  margin: 0;
  font-family: var(--display-font);
  line-height: 1.05;
}

.auth-panel h1 {
  margin-top: 18px;
  font-size: 1.8rem;
}

.auth-panel p,
.brand-lockup p,
.today-band p,
.pool-tool p,
.save-status {
  margin: 0;
}

.token-form {
  margin-top: 24px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.token-row,
.pool-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.token-row button,
.pool-input-row button,
.refresh-button {
  background: var(--teal);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
}

.form-error,
.save-status {
  min-height: 22px;
  margin-top: 10px;
  color: var(--red);
  font-size: 0.9rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0 8px;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.brand-lockup h1 {
  font-size: 1.32rem;
}

.brand-lockup p {
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  font-weight: 800;
}

main {
  display: grid;
  gap: 9px;
  padding-bottom: 28px;
}

.current-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(31, 41, 51, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 6px 18px rgba(31, 41, 51, 0.06);
}

.current-strip span:last-child {
  text-align: right;
}

.today-band,
.pool-tool,
.calendar-tool,
.details-panel {
  border: 2px solid rgba(31, 41, 51, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.today-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
}

.today-band h2 {
  margin-top: 2px;
  font-size: 1.08rem;
}

.today-band p:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.refresh-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.today-band.anytime {
  background: linear-gradient(110deg, #dff3e7, #fff 72%);
}

.today-band.peak {
  background: linear-gradient(110deg, #ffedc2, #fff 72%);
}

.today-band.no {
  background: linear-gradient(110deg, #f8d8d5, #fff 72%);
}

.today-band.needs-water {
  background: linear-gradient(90deg, var(--blue-soft), #fff);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pool-tool {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98)),
    repeating-linear-gradient(135deg, rgba(86, 212, 223, 0.22) 0 10px, rgba(255, 255, 255, 0) 10px 24px);
}

.tool-heading,
.calendar-heading,
.details-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pool-tool h2,
.calendar-tool h2,
.details-panel h2 {
  margin-top: 4px;
  font-size: 1.22rem;
}

.muted-text {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.pool-form {
  margin-top: 14px;
}

.learning-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.calendar-tool {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.98)),
    repeating-linear-gradient(90deg, rgba(17, 166, 184, 0.08) 0 14px, rgba(255, 255, 255, 0) 14px 32px);
}

.calendar-heading {
  align-items: center;
  padding: 10px 10px 7px;
}

.calendar-actions {
  display: grid;
  justify-items: end;
  gap: 0;
}

.calendar-nav-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.updated-at {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.week-nav {
  display: flex;
  gap: 4px;
}

.week-nav button {
  display: grid;
  width: 27px;
  min-height: 27px;
  place-items: center;
  border: 1px solid rgba(31, 41, 51, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--teal);
  font-family: var(--display-font);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.week-nav button:disabled {
  opacity: 0.32;
  cursor: default;
}

.history-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.history-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
}

.dot.anytime {
  background: var(--green);
}

.dot.peak {
  background: var(--amber);
}

.dot.no {
  background: var(--red);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  padding: 0 6px 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  gap: 4px;
  padding: 0 6px 0;
}

.calendar-pad {
  min-height: 66px;
}

.day-tile {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 78px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 11px;
  background: #f2f0e8;
  color: var(--ink);
  padding: 0;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 51, 0.08), 0 4px 0 rgba(14, 74, 85, 0.09);
}

.day-tile.is-selected,
.day-tile[aria-pressed="true"] {
  border-color: rgba(31, 41, 51, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 8px 18px rgba(31, 41, 51, 0.12);
}

.day-tile.is-selected,
.day-tile.is-flipped {
  z-index: 2;
}

.day-tile.anytime {
  background: #9fdfb5;
}

.day-tile.peak {
  background: #ffd36b;
}

.day-tile.no {
  background: #f3a19b;
}

.day-tile.needs-water {
  background: #9ecbff;
}

.day-tile.quality-outlook.anytime {
  background: #c7e8d1;
}

.day-tile.quality-outlook.peak {
  background: #f8e0a6;
}

.day-tile.quality-outlook.no {
  background: #e7bbb7;
}

.day-tile.quality-outlook.needs-water {
  background: #c7ddf5;
}

.day-tile.is-past {
  background: #dce2e5;
  border-color: rgba(31, 41, 51, 0.08);
  color: rgba(31, 41, 51, 0.58);
}

.day-tile.is-past .tile-temp,
.day-tile.is-past .tile-status {
  color: rgba(31, 41, 51, 0.56);
}

.day-tile.is-today {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18), 0 8px 18px rgba(31, 41, 51, 0.12);
}

.day-card-inner {
  position: absolute;
  inset: 0;
  border-radius: 9px;
}

.day-tile.is-flipped .day-card-inner {
  animation: card-turnover 230ms ease;
}

.day-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  border-radius: 9px;
  overflow: hidden;
  transition: opacity 90ms ease, visibility 90ms ease;
}

.day-card-front {
  grid-template-rows: auto 1fr auto;
  align-items: center;
  padding: 6px 4px 7px;
}

.day-card-back {
  grid-template-rows: 0.62fr 1fr 0.62fr 1fr 0.9fr;
  align-items: center;
  gap: 0;
  padding: 7px 3px 6px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
}

.day-tile.is-flipped .day-card-front {
  opacity: 0;
  visibility: hidden;
}

.day-tile.is-flipped .day-card-back {
  opacity: 1;
  visibility: visible;
}

.day-card-back span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-label {
  justify-self: center;
  color: rgba(31, 41, 51, 0.58);
  max-width: 100%;
  font-size: 0.4rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.back-value {
  justify-self: center;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  line-height: 0.95;
}

.back-condition {
  justify-self: center;
  color: rgba(31, 41, 51, 0.72);
  font-size: 0.52rem;
}

.day-number {
  position: relative;
  z-index: 1;
  justify-self: start;
  font-size: 0.82rem;
  font-weight: 900;
}

.tile-status {
  position: relative;
  z-index: 1;
  justify-self: center;
  align-self: center;
  overflow: hidden;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-temp {
  position: relative;
  z-index: 1;
  justify-self: center;
  color: rgba(31, 41, 51, 0.72);
  font-size: 0.82rem;
  font-weight: 900;
}

.details-panel {
  padding: 16px;
}

.details-panel:empty {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.status-pill.anytime {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.peak {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.no {
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.needs-water {
  background: var(--blue-soft);
  color: var(--blue);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.metric {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  line-height: 1.05;
}

.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.reason-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.source-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-note a {
  color: var(--blue);
  font-weight: 900;
}

.is-hidden {
  display: none !important;
}

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

  .day-tile {
    min-height: 92px;
  }

  .tile-temp {
    font-size: 0.9rem;
  }

  .tile-status {
    font-size: 1.48rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .page-shell {
    padding: 10px;
  }

  .today-band,
  .pool-tool,
  .details-panel {
    padding: 13px;
  }

  .today-band {
    padding: 8px 9px;
  }

  .calendar-heading {
    padding: 9px 8px 6px;
  }

  .calendar-grid {
    gap: 3px;
    padding-inline: 5px;
  }

  .day-tile {
    min-height: 74px;
  }

  .tile-temp {
    font-size: 0.74rem;
  }

  .tile-status {
    font-size: 1.12rem;
  }

}

@keyframes drift-wave {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(120px);
  }
}

@keyframes water-shimmer {
  from {
    transform: translate3d(0, 0, 0) rotate(-7deg);
  }

  to {
    transform: translate3d(168px, 74px, 0) rotate(-7deg);
  }
}

@keyframes water-glimmer {
  from {
    transform: translate3d(0, 0, 0) rotate(3deg);
  }

  to {
    transform: translate3d(-140px, 86px, 0) rotate(3deg);
  }
}

@keyframes ball-fly {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }

  7% {
    transform: translateX(calc(100vw + 140px)) translateY(70px) rotate(700deg);
  }

  100% {
    transform: translateX(calc(100vw + 140px)) translateY(70px) rotate(700deg);
  }
}

@keyframes surprise-pass-left {
  from {
    transform: translateX(0) translateY(0);
  }

  to {
    transform: translateX(calc(100vw + var(--sprite-width) + 64px)) translateY(var(--travel-y));
  }
}

@keyframes surprise-pass-right {
  from {
    transform: translateX(0) translateY(0);
  }

  to {
    transform: translateX(calc((100vw + var(--sprite-width) + 64px) * -1)) translateY(var(--travel-y));
  }
}

@keyframes surprise-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }

  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
}

@keyframes sprite-hurry-right {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }

  18% {
    transform: translateX(24px) translateY(-12px) rotate(-5deg) scale(1.06);
  }

  100% {
    transform: translateX(calc(100vw + var(--sprite-width) + 120px)) translateY(var(--hurry-y, -12px)) rotate(15deg) scale(0.88);
  }
}

@keyframes sprite-hurry-left {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
  }

  18% {
    transform: translateX(-24px) translateY(-12px) rotate(5deg) scale(1.06);
  }

  100% {
    transform: translateX(calc((100vw + var(--sprite-width) + 120px) * -1)) translateY(var(--hurry-y, -12px)) rotate(-15deg) scale(0.88);
  }
}

@keyframes hurry-wiggle {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-9px) rotate(4deg);
  }
}

@keyframes hurry-trail {
  0% {
    opacity: 0;
    transform: scaleX(0.22);
  }

  18% {
    opacity: 0.86;
    transform: scaleX(0.85);
  }

  100% {
    opacity: 0;
    transform: scaleX(1.35);
  }
}

@keyframes card-turnover {
  0% {
    transform: scaleX(1);
  }

  48% {
    transform: scaleX(0.08);
  }

  52% {
    transform: scaleX(0.08);
  }

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

@media (prefers-reduced-motion: reduce) {
  .pool-water::before,
  .pool-water::after,
  .water-ripple,
  .beach-ball,
  .surprise-sprite,
  .surprise-bob,
  .day-card-inner {
    animation: none;
    transition: none;
  }
}

/* Sunday Funnies visual pass. */
:root {
  --comic-line: #17212b;
  --comic-paper: #fffaf0;
  --comic-yellow: #ffd95e;
  --comic-water: #44c7cf;
  --comic-good: #99d891;
  --comic-peak: #ffd95e;
  --comic-bad: #f49485;
  --comic-muted-bad: #dfb9b4;
  --comic-muted-peak: #efd792;
  --comic-muted-good: #bfdaba;
  --display-font: "Trebuchet MS", "Avenir Next Rounded", "Avenir Next", ui-rounded, system-ui, sans-serif;
  --line: rgba(23, 33, 43, 0.2);
  --shadow: 4px 5px 0 rgba(23, 33, 43, 0.82);
}

body {
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.14) 0 1.1px, transparent 1.5px) 0 0 / 9px 9px,
    radial-gradient(circle at 15% 10%, rgba(255, 217, 94, 0.96) 0 35px, rgba(255, 217, 94, 0.28) 36px 63px, transparent 64px),
    linear-gradient(180deg, #ffe27a 0 116px, #8ed7ff 116px 235px, #43bfd0 235px 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 13%, #fffaf0 0 18px, transparent 19px),
    radial-gradient(circle at 83% 12%, #fffaf0 0 22px, transparent 23px),
    radial-gradient(circle at 93% 12%, #fffaf0 0 20px, transparent 21px);
  opacity: 0.72;
}

.pool-water {
  inset: 132px 0 0;
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.12) 0 1.2px, transparent 1.6px) 0 0 / 8px 8px,
    linear-gradient(180deg, rgba(255, 250, 240, 0.26), rgba(255, 250, 240, 0) 20%),
    linear-gradient(180deg, #65d9df 0%, #33becb 43%, #168fa9 100%);
  border-top: 4px solid var(--comic-line);
  box-shadow: inset 0 18px 0 rgba(255, 250, 240, 0.28), inset 0 -80px 0 rgba(23, 33, 43, 0.1);
}

.pool-water::before {
  opacity: 0.44;
  mix-blend-mode: screen;
  background:
    repeating-radial-gradient(ellipse at 28% 45%, rgba(255, 250, 240, 0.8) 0 2px, transparent 3px 18px),
    repeating-linear-gradient(18deg, transparent 0 34px, rgba(255, 250, 240, 0.26) 35px 38px, transparent 39px 78px);
  background-size: 210px 120px, 260px 150px;
  filter: none;
}

.pool-water::after {
  opacity: 0.25;
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.18) 0 1.5px, transparent 1.9px) 0 0 / 11px 11px,
    repeating-linear-gradient(24deg, transparent 0 42px, rgba(23, 33, 43, 0.18) 43px 46px, transparent 47px 90px);
  filter: none;
}

.water-ripple {
  height: 46px;
  opacity: 0.32;
  background:
    radial-gradient(ellipse at 13% 50%, rgba(255, 250, 240, 0.9) 0 7px, transparent 8px 43px),
    radial-gradient(ellipse at 49% 52%, rgba(255, 250, 240, 0.82) 0 6px, transparent 7px 38px),
    radial-gradient(ellipse at 82% 48%, rgba(255, 250, 240, 0.86) 0 8px, transparent 9px 46px);
}

.beach-ball {
  border: 4px solid var(--comic-line);
  box-shadow: 5px 6px 0 rgba(23, 33, 43, 0.82);
}

.auth-panel,
.current-strip,
.today-band,
.pool-tool,
.calendar-tool,
.details-panel {
  border: 3px solid var(--comic-line);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.app-header {
  padding-top: 8px;
}

.brand-lockup img,
.auth-mark {
  border: 3px solid var(--comic-line);
  border-radius: 12px;
  box-shadow: 3px 4px 0 rgba(23, 33, 43, 0.82);
}

.brand-lockup h1,
.auth-panel h1,
.calendar-tool h2,
.today-band h2,
.pool-tool h2,
.details-panel h2 {
  color: var(--comic-line);
  font-family: var(--display-font);
  font-weight: 900;
}

.ghost-button,
.refresh-button,
.token-row button,
.pool-input-row button,
.week-nav button {
  border: 2px solid var(--comic-line);
  background: var(--comic-paper);
  color: var(--comic-line);
  box-shadow: 3px 3px 0 var(--comic-line);
}

.refresh-button,
.token-row button,
.pool-input-row button {
  background: #2f837b;
  color: #fffaf0;
}

.ghost-button:active,
.refresh-button:active,
.token-row button:active,
.pool-input-row button:active,
.week-nav button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--comic-line);
}

input {
  border: 2px solid var(--comic-line);
  background: #fffdf8;
}

.current-strip {
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.1) 0 1px, transparent 1.4px) 0 0 / 8px 8px,
    rgba(255, 250, 240, 0.9);
}

.calendar-tool {
  overflow: visible;
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.08) 0 1px, transparent 1.4px) 0 0 / 10px 10px,
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 253, 248, 0.98));
}

.today-band.anytime,
.today-band.peak,
.today-band.no,
.today-band.needs-water {
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.1) 0 1px, transparent 1.5px) 0 0 / 8px 8px,
    linear-gradient(110deg, var(--today-tone, #fffaf0), rgba(255, 250, 240, 0.96) 72%);
}

.today-band.anytime {
  --today-tone: #d9f0d2;
}

.today-band.peak {
  --today-tone: #ffefb1;
}

.today-band.no {
  --today-tone: #ffd5ce;
}

.today-band.needs-water {
  --today-tone: #d7eff5;
}

.week-nav button {
  background: #fffdf8;
  color: #2f837b;
}

.day-tile {
  border: 2px solid var(--comic-line);
  border-radius: 9px;
  background: #ece7dc;
  box-shadow: 3px 4px 0 rgba(23, 33, 43, 0.72);
  color: var(--comic-line);
}

.day-card-inner,
.day-card-face {
  border-radius: 7px;
}

.day-card-face {
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.1) 0 1px, transparent 1.5px) 0 0 / 9px 9px,
    transparent;
}

.day-tile.anytime {
  background: var(--comic-good);
}

.day-tile.peak {
  background: var(--comic-peak);
}

.day-tile.no {
  background: var(--comic-bad);
}

.day-tile.needs-water {
  background: #9bd8ff;
}

.day-tile.quality-outlook.anytime {
  background: var(--comic-muted-good);
}

.day-tile.quality-outlook.peak {
  background: var(--comic-muted-peak);
}

.day-tile.quality-outlook.no {
  background: var(--comic-muted-bad);
}

.day-tile.quality-outlook.needs-water {
  background: #bfd9ea;
}

.day-tile.is-past {
  background:
    radial-gradient(circle at 0 0, rgba(23, 33, 43, 0.12) 0 1px, transparent 1.4px) 0 0 / 8px 8px,
    #d6d8d6;
  border-color: rgba(23, 33, 43, 0.38);
  color: rgba(23, 33, 43, 0.62);
  box-shadow: 3px 4px 0 rgba(23, 33, 43, 0.22);
}

.day-tile.is-selected,
.day-tile[aria-pressed="true"] {
  border-color: var(--comic-line);
  box-shadow: 0 0 0 3px var(--comic-paper), 4px 5px 0 rgba(23, 33, 43, 0.82);
}

.day-tile.is-today {
  border-color: #2f837b;
  box-shadow: 0 0 0 3px rgba(255, 250, 240, 0.96), 4px 5px 0 #2f837b;
}

.day-number,
.tile-status,
.tile-temp,
.back-value {
  color: var(--comic-line);
  font-family: var(--display-font);
}

.back-label,
.back-condition,
.tile-temp {
  color: rgba(23, 33, 43, 0.72);
}

.history-toggle input {
  accent-color: #2f837b;
}

.metric,
.reason-list li,
.status-pill {
  border: 2px solid var(--comic-line);
  box-shadow: 2px 2px 0 rgba(23, 33, 43, 0.72);
}

.surprise-sprite {
  opacity: 0.96;
  filter: drop-shadow(5px 6px 0 rgba(23, 33, 43, 0.82));
}

.surprise-water {
  opacity: 0.98;
  mix-blend-mode: normal;
}

.surprise-sky,
.surprise-ground {
  opacity: 0.98;
}

@media (max-width: 380px) {
  .auth-panel,
  .current-strip,
  .today-band,
  .pool-tool,
  .calendar-tool,
  .details-panel {
    border-width: 2px;
    box-shadow: 3px 4px 0 rgba(23, 33, 43, 0.78);
  }

  .day-tile {
    min-height: 76px;
    box-shadow: 2px 3px 0 rgba(23, 33, 43, 0.68);
  }
}
