:root {
  color-scheme: light;
  --ink: #1f2633;
  --paper: #fff7df;
  --cream: #fff3c7;
  --leaf: #62b955;
  --petal: #ff7ea8;
  --water: #47b9d7;
  --sun: #ffd35a;
  --coral: #ff735f;
  --deep: #27244e;
  --sky-top: #79cfff;
  --sky-bottom: #ffe69a;
  --sun-x: 50%;
  --sun-y: 18%;
  --sun-color: #ffd35a;
  --cloud-opacity: 0.5;
  --rain-opacity: 0;
  --wind-opacity: 0.15;
  --light-opacity: 0;
  --scene-tint: rgba(255, 255, 255, 0);
  --mood-color: #ff735f;
  --progress: 50%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    "Comic Sans MS",
    "Trebuchet MS",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 126, 168, 0.22), transparent 26rem),
    radial-gradient(circle at 86% 6%, rgba(71, 185, 215, 0.26), transparent 24rem),
    linear-gradient(135deg, #fff8dc 0%, #fff0ba 52%, #d9f3da 100%);
}

button,
input {
  font: inherit;
}

.back-to-teaching {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 253, 242, 0.92);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(31, 38, 51, 0.72);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.back-to-teaching:hover,
.back-to-teaching:focus-visible {
  transform: translate(-1px, -2px);
  box-shadow: 5px 6px 0 rgba(31, 38, 51, 0.72);
}

.weather-page {
  min-height: 100vh;
  padding: clamp(14px, 2vw, 30px);
  display: grid;
  place-items: center;
}

.poster {
  width: min(1180px, 100%);
  min-height: calc(100vh - clamp(28px, 4vw, 60px));
  display: grid;
  grid-template-rows: auto auto minmax(360px, 1fr) auto;
  gap: clamp(12px, 1.6vw, 20px);
}

.masthead,
.calendar-shell,
.time-panel {
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(31, 38, 51, 0.92);
  background: rgba(255, 250, 224, 0.82);
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: clamp(14px, 2vw, 24px);
  border-radius: 8px 8px 22px 8px;
}

.kicker {
  margin: 0 0 4px;
  color: #d65472;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 96px);
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 4px 4px 0 #ffd35a, 7px 7px 0 rgba(31, 38, 51, 0.14);
}

.live-card {
  min-width: 190px;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--mood-color);
  display: grid;
  gap: 2px;
  text-align: right;
}

.live-card strong {
  font-size: 28px;
}

.calendar-shell {
  padding: 12px;
  border-radius: 8px;
}

.calendar-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 800;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(31, minmax(28px, 1fr));
  gap: 6px;
}

.day-button {
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf2;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(31, 38, 51, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.day-button:hover {
  transform: translate(-1px, -2px) rotate(-1deg);
  box-shadow: 4px 5px 0 rgba(31, 38, 51, 0.28);
}

.day-button.active {
  background: var(--mood-color);
  color: #fff;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(31, 38, 51, 0.42);
}

.city-stage {
  min-height: 0;
}

.scene {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 360px;
  border: 4px solid var(--ink);
  border-radius: 24px 8px 24px 8px;
  box-shadow: 10px 10px 0 rgba(31, 38, 51, 0.92);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 72%, #7ad765 72%, #69be5a 100%);
  isolation: isolate;
  transition: background 500ms ease;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 48px),
    linear-gradient(var(--scene-tint), var(--scene-tint));
  opacity: 0.9;
  pointer-events: none;
  z-index: 12;
}

.sky-glow {
  position: absolute;
  width: 38%;
  aspect-ratio: 1;
  left: calc(var(--sun-x) - 19%);
  top: calc(var(--sun-y) - 19%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 147, 0.54), transparent 66%);
  filter: blur(4px);
  transition: left 550ms ease, top 550ms ease, opacity 400ms ease;
}

.celestial {
  position: absolute;
  left: var(--sun-x);
  top: var(--sun-y);
  width: clamp(54px, 8vw, 86px);
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--sun-color);
  box-shadow: 6px 6px 0 rgba(31, 38, 51, 0.28);
  transform: translate(-50%, -50%);
  transition: left 550ms ease, top 550ms ease, background 400ms ease;
  z-index: 2;
}

.scene.night .celestial::after {
  content: "";
  position: absolute;
  inset: -5px 11px 6px -4px;
  border-radius: 50%;
  background: var(--sky-top);
}

.cloud {
  position: absolute;
  width: 180px;
  height: 70px;
  opacity: var(--cloud-opacity);
  z-index: 4;
  animation: drift 8s ease-in-out infinite alternate;
}

.cloud span {
  position: absolute;
  bottom: 0;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 4px 4px 0 rgba(31, 38, 51, 0.18);
}

.cloud span:nth-child(1) {
  left: 0;
  width: 88px;
  height: 42px;
}

.cloud span:nth-child(2) {
  left: 44px;
  bottom: 14px;
  width: 78px;
  height: 55px;
}

.cloud span:nth-child(3) {
  left: 100px;
  width: 78px;
  height: 43px;
}

.cloud-one {
  left: 10%;
  top: 13%;
}

.cloud-two {
  right: 12%;
  top: 22%;
  transform: scale(0.72);
  animation-delay: -2s;
}

.cloud-three {
  left: 42%;
  top: 8%;
  transform: scale(0.54);
  animation-delay: -4s;
}

.rain-layer,
.wind-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.rain-layer {
  opacity: var(--rain-opacity);
  transition: opacity 260ms ease;
}

.raindrop {
  position: absolute;
  top: -12%;
  width: 3px;
  height: 32px;
  border-radius: 999px;
  background: #1884bc;
  border: 1px solid rgba(31, 38, 51, 0.5);
  transform: rotate(12deg);
  animation: rain-fall 900ms linear infinite;
}

.wind-layer {
  opacity: var(--wind-opacity);
}

.wind-line {
  position: absolute;
  left: -18%;
  width: 160px;
  height: 12px;
  border-top: 4px solid #fff9df;
  border-radius: 50%;
  filter: drop-shadow(2px 2px 0 rgba(31, 38, 51, 0.35));
  animation: wind-slide 3.5s linear infinite;
}

.mountains {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 28%;
  height: 28%;
  z-index: 1;
}

.mountain {
  position: absolute;
  bottom: 0;
  border: 4px solid var(--ink);
  background: #7bcf74;
  transform: rotate(45deg);
}

.ridge-one {
  left: 7%;
  width: 210px;
  height: 210px;
}

.ridge-two {
  left: 31%;
  width: 260px;
  height: 260px;
  background: #58b96e;
}

.ridge-three {
  right: 11%;
  width: 230px;
  height: 230px;
  background: #86d97d;
}

.city {
  position: absolute;
  left: 50%;
  bottom: 23%;
  width: min(640px, 76%);
  height: 38%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 18px;
}

.tower,
.gate .body {
  border: 4px solid var(--ink);
  background: #f5a65d;
  box-shadow: 7px 7px 0 rgba(31, 38, 51, 0.28);
}

.tower {
  width: 120px;
  height: 63%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 18px;
}

.tower-left {
  height: 52%;
  background: #7ebee8;
}

.tower-right {
  height: 74%;
  background: #ffcb67;
}

.tower i {
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 99px rgba(255, 229, 96, var(--light-opacity));
  transition: box-shadow 350ms ease;
}

.gate {
  width: min(260px, 42%);
  display: grid;
  justify-items: center;
}

.gate .roof {
  width: 112%;
  height: 54px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 8px 8px / 80% 80% 8px 8px;
  background: #e44944;
  box-shadow: 7px 7px 0 rgba(31, 38, 51, 0.28);
  margin-bottom: -8px;
  z-index: 2;
}

.gate .body {
  width: 100%;
  height: 142px;
  display: grid;
  place-items: center;
}

.gate span {
  display: grid;
  place-items: center;
  width: 88px;
  height: 56px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 10px 10px;
  background: rgba(82, 49, 35, 0.9);
  color: #ffe1a1;
  font-weight: 900;
}

.lake {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 13%;
  height: 18%;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 42% 46%;
  background: linear-gradient(180deg, rgba(83, 213, 235, 0.9), rgba(39, 150, 204, 0.95));
  z-index: 4;
  overflow: hidden;
}

.lake span {
  position: absolute;
  width: 28%;
  height: 14px;
  border-top: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: ripple 2.8s ease-in-out infinite;
}

.lake span:nth-child(1) {
  left: 12%;
  top: 34%;
}

.lake span:nth-child(2) {
  left: 42%;
  top: 56%;
  animation-delay: -1s;
}

.lake span:nth-child(3) {
  right: 10%;
  top: 28%;
  animation-delay: -1.7s;
}

.park {
  position: absolute;
  inset: auto 0 9% 0;
  height: 18%;
  z-index: 6;
}

.tree {
  position: absolute;
  bottom: 0;
  width: 76px;
  height: 116px;
}

.tree-left {
  left: 12%;
}

.tree-right {
  right: 13%;
  transform: scale(0.88);
}

.tree i {
  position: absolute;
  left: 30px;
  bottom: 0;
  width: 18px;
  height: 62px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #9a633f;
}

.tree b {
  position: absolute;
  left: 0;
  top: 0;
  width: 78px;
  height: 78px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ff9bbb 0 12%, transparent 13%), #61c75c;
  box-shadow: 5px 5px 0 rgba(31, 38, 51, 0.22);
}

.flower-bed {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: min(410px, 46%);
  height: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: end;
  justify-content: space-around;
}

.flower-bed i {
  width: 24px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 45% 45%;
  background: var(--petal);
  box-shadow: 0 13px 0 -7px var(--leaf);
  animation: flower-wiggle 1.8s ease-in-out infinite;
}

.flower-bed i:nth-child(even) {
  background: #ffd35a;
  animation-delay: -0.7s;
}

.street {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 12%;
  border-top: 4px solid var(--ink);
  background: #4a4d57;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-around;
  overflow: hidden;
}

.street span {
  width: 28%;
  height: 6px;
  border-radius: 999px;
  background: #ffe77d;
}

.time-panel {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 8px 8px 8px 22px;
}

.time-readout {
  display: grid;
  gap: 2px;
}

#hour-label {
  font-size: 34px;
  font-weight: 900;
}

#period-label {
  color: #d65472;
}

.slider-wrap {
  min-width: 0;
}

.time-marks {
  display: flex;
  justify-content: space-between;
  padding: 0 5px 5px;
  font-size: 13px;
  font-weight: 900;
}

.time-slider {
  width: 100%;
  accent-color: var(--mood-color);
  cursor: pointer;
}

.time-slider::-webkit-slider-runnable-track {
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--mood-color) 0 var(--progress), #fff 0),
    linear-gradient(90deg, #2b2d62, #ffdf84 28%, #62cdf7 52%, #ff9b75 76%, #2b2d62);
  box-shadow: 4px 4px 0 rgba(31, 38, 51, 0.24);
}

.time-slider::-webkit-slider-thumb {
  appearance: none;
  width: 34px;
  height: 34px;
  margin-top: -12px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #fff9df;
  box-shadow: 4px 4px 0 var(--mood-color);
}

.time-slider::-moz-range-track {
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
}

.time-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #fff9df;
  box-shadow: 4px 4px 0 var(--mood-color);
}

.play-button {
  min-height: 48px;
  padding: 0 18px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--mood-color);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(31, 38, 51, 0.72);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.play-button:hover {
  transform: translate(-1px, -2px);
  box-shadow: 5px 6px 0 rgba(31, 38, 51, 0.72);
}

.play-button[aria-pressed="true"] {
  background: var(--deep);
}

@keyframes drift {
  from {
    translate: -12px 0;
  }
  to {
    translate: 18px 7px;
  }
}

@keyframes rain-fall {
  to {
    transform: translateY(128vh) rotate(12deg);
  }
}

@keyframes wind-slide {
  to {
    transform: translateX(145vw);
  }
}

@keyframes ripple {
  50% {
    transform: translateX(16px) scaleX(1.1);
    opacity: 0.55;
  }
}

@keyframes flower-wiggle {
  50% {
    transform: rotate(7deg) translateY(-3px);
  }
}

@media (max-width: 860px) {
  .poster {
    grid-template-rows: auto auto 420px auto;
  }

  .masthead {
    align-items: stretch;
  }

  .calendar-grid {
    grid-template-columns: repeat(8, minmax(34px, 1fr));
  }

  .time-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

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

@media (max-width: 620px) {
  .back-to-teaching {
    position: static;
    width: fit-content;
    margin: 8px 10px 0;
    min-height: 30px;
    padding: 0 9px;
    border-width: 2px;
    font-size: 11px;
    box-shadow: 3px 3px 0 rgba(31, 38, 51, 0.72);
  }

  .weather-page {
    padding: 6px 10px 12px;
  }

  .poster {
    min-height: auto;
    grid-template-rows: auto auto 400px auto;
    gap: 8px;
  }

  .masthead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 34%);
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    box-shadow: 6px 6px 0 rgba(31, 38, 51, 0.92);
    border-radius: 8px 8px 16px 8px;
  }

  .kicker {
    margin-bottom: 2px;
    font-size: 12px;
  }

  h1 {
    font-size: clamp(34px, 11vw, 42px);
    text-shadow: 3px 3px 0 #ffd35a, 5px 5px 0 rgba(31, 38, 51, 0.14);
  }

  .live-card {
    width: auto;
    min-width: 0;
    padding: 7px 9px;
    gap: 0;
    text-align: right;
    box-shadow: 4px 4px 0 var(--mood-color);
  }

  .live-card span {
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .live-card strong {
    font-size: 24px;
    line-height: 1.05;
  }

  .calendar-shell {
    padding: 10px;
  }

  .calendar-title {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 15px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 5px;
  }

  .day-button {
    height: 38px;
  }

  .scene {
    min-height: 400px;
    border-radius: 18px 8px 18px 8px;
  }

  .time-panel {
    gap: 10px;
    padding: 10px 12px 12px;
    box-shadow: 6px 6px 0 rgba(31, 38, 51, 0.92);
  }

  .time-readout {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
  }

  #hour-label {
    font-size: 28px;
    line-height: 1;
  }

  #period-label,
  #wind-label {
    min-width: 0;
    font-size: 14px;
    line-height: 1.2;
  }

  .time-marks {
    padding-bottom: 4px;
  }

  .time-slider::-webkit-slider-runnable-track {
    height: 12px;
  }

  .time-slider::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
    margin-top: -12px;
  }

  .play-button {
    min-height: 42px;
  }

  .city {
    width: 90%;
    gap: 8px;
  }

  .tower {
    width: 76px;
    padding: 10px;
    gap: 7px;
  }

  .gate {
    width: 170px;
  }

  .gate .body {
    height: 116px;
  }

  .cloud {
    width: 150px;
  }

  .flower-bed {
    width: 54%;
  }
}

@media (max-width: 360px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr) 104px;
    padding: 9px 10px;
  }

  .kicker {
    font-size: 11px;
  }

  h1 {
    font-size: 33px;
  }

  .live-card {
    padding: 6px 8px;
  }

  .live-card strong {
    font-size: 22px;
  }

  .live-card span,
  #period-label,
  #wind-label {
    font-size: 12px;
  }

  #hour-label {
    font-size: 25px;
  }
}
