:root {
  color-scheme: dark;
  --panel-bg: rgba(14, 10, 8, 0.76);
  --panel-line: rgba(255, 174, 91, 0.35);
  --panel-line-soft: rgba(255, 174, 91, 0.2);
  --weather-text: #ffc06f;
  --weather-soft: #ffd9a4;
  --clock-glow: #ffb071;
  --clock-hot: #ffd4ac;
  --button-bg: rgba(10, 15, 22, 0.72);
  --button-border: rgba(255, 176, 113, 0.42);
  --button-text: #ffe2c7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 70%, rgba(185, 99, 34, 0.18), transparent 34%),
    #05080d;
  color: #fff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
}

.scene {
  position: relative;
  width: min(100vw, calc(100vh * 1672 / 941));
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  background-image: url("sozai/background-image.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: saturate(1.02) contrast(1.02);
}

.weather-panel {
  position: absolute;
  left: 2.1%;
  top: 6.8%;
  width: 18.4%;
  min-width: 18rem;
  color: var(--weather-text);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(31, 23, 18, 0.68), rgba(10, 8, 7, 0.82)),
    var(--panel-bg);
  box-shadow:
    inset 0 1px rgba(255, 219, 172, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.34),
    0 1rem 2.5rem rgba(0, 0, 0, 0.48),
    0 0 1.8rem rgba(255, 117, 45, 0.14);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.weather-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem 1rem 0.8rem;
  border-bottom: 1px solid rgba(255, 174, 91, 0.15);
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 0 0.7rem rgba(255, 150, 68, 0.72);
}

.location-pin {
  position: relative;
  width: 0.78rem;
  height: 0.78rem;
  flex: 0 0 auto;
  border-radius: 50% 50% 50% 0;
  background: var(--weather-text);
  transform: rotate(-45deg);
  box-shadow: 0 0 0.75rem rgba(255, 150, 68, 0.72);
}

.location-pin::after {
  content: "";
  position: absolute;
  inset: 0.25rem;
  border-radius: 50%;
  background: #20120a;
}

.weather-menu {
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  gap: 0.13rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--weather-text);
  cursor: pointer;
  padding: 0.34rem 0;
}

.weather-menu span {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.45rem rgba(255, 150, 68, 0.7);
}

.weather-menu:hover,
.weather-menu:focus-visible {
  outline: none;
  background: rgba(255, 174, 91, 0.12);
}

.weather-body {
  padding: 1.1rem 0.9rem 1rem;
}

.weather-current {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.8rem;
}

.weather-symbol {
  position: relative;
  width: 2.6rem;
  height: 2.1rem;
  flex: 0 0 auto;
  filter: drop-shadow(0 0.42rem 0.42rem rgba(0, 0, 0, 0.62));
}

.weather-symbol::before,
.weather-symbol::after {
  content: "";
  position: absolute;
  display: block;
}

.weather-symbol::before {
  left: 10%;
  bottom: 14%;
  width: 76%;
  height: 44%;
  border-radius: 999px;
  background: linear-gradient(180deg, #d7d9dd, #59616b 68%, #2b3139);
  box-shadow:
    inset 0 0.14rem 0.18rem rgba(255, 255, 255, 0.45),
    inset 0 -0.28rem 0.45rem rgba(12, 16, 21, 0.52);
}

.weather-symbol::after {
  left: 21%;
  bottom: 35%;
  width: 42%;
  height: 44%;
  border-radius: 50%;
  background: linear-gradient(180deg, #eef0f3, #6b727d 72%, #303641);
  box-shadow:
    1.05rem 0.2rem 0 -0.14rem #858c96,
    inset 0 0.15rem 0.18rem rgba(255, 255, 255, 0.4);
}

.weather-symbol-lg {
  width: 4.1rem;
  height: 3.25rem;
}

.weather-symbol[data-kind="clear"]::before {
  left: 18%;
  top: 12%;
  width: 64%;
  height: 64%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff6c8 0 12%, #ffd875 38%, #f49a37 72%);
  box-shadow:
    0 0 0.8rem rgba(255, 172, 65, 0.68),
    0 0 1.7rem rgba(255, 128, 37, 0.38);
}

.weather-symbol[data-kind="clear"]::after {
  display: none;
}

.weather-symbol[data-kind="partly"]::before {
  left: 39%;
  top: 4%;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff1b1 0 14%, #ffc857 45%, #ec8f2f 75%);
  box-shadow: 0 0 1rem rgba(255, 151, 45, 0.5);
}

.weather-symbol[data-kind="partly"]::after {
  left: 8%;
  bottom: 13%;
  width: 74%;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9ebef, #69717b 70%, #303641);
  box-shadow:
    0.9rem -0.18rem 0 -0.1rem #c2c6ce,
    inset 0 0.14rem 0.18rem rgba(255, 255, 255, 0.42);
}

.weather-symbol[data-kind="rain"]::before {
  background: linear-gradient(180deg, #bfc7d1, #49515d 70%, #222a34);
}

.weather-symbol[data-kind="rain"]::after {
  box-shadow:
    1.05rem 0.2rem 0 -0.14rem #69727f,
    -0.1rem 1.15rem 0 -0.2rem #9ec8ff,
    0.72rem 1.24rem 0 -0.2rem #9ec8ff,
    1.48rem 1.15rem 0 -0.2rem #9ec8ff;
}

.weather-symbol[data-kind="snow"]::before {
  background: linear-gradient(180deg, #f2f6fb, #8e98a4 70%, #4c5560);
}

.weather-symbol[data-kind="snow"]::after {
  box-shadow:
    1.05rem 0.2rem 0 -0.14rem #b5bdc7,
    -0.1rem 1.15rem 0 -0.17rem #eaf6ff,
    0.72rem 1.24rem 0 -0.17rem #eaf6ff,
    1.48rem 1.15rem 0 -0.17rem #eaf6ff;
}

.weather-reading {
  min-width: 0;
}

.weather-description {
  margin: 0 0 0.15rem;
  color: var(--weather-soft);
  font-size: 0.92rem;
  font-weight: 800;
}

.weather-temperature {
  margin: 0;
  color: var(--weather-text);
  font-size: 3.85rem;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow:
    0 0 0.08em #ffe9cb,
    0 0 0.28em rgba(255, 147, 55, 0.62);
}

.weather-temperature span:last-child {
  font-size: 1.5rem;
  vertical-align: 0.55em;
}

.weather-range {
  margin: 0.25rem 0 1rem;
  text-align: center;
  color: var(--weather-text);
  font-size: 0.98rem;
  font-weight: 800;
  text-shadow: 0 0 0.55rem rgba(255, 150, 68, 0.52);
}

.range-separator {
  margin: 0 0.45rem;
  color: rgba(255, 216, 168, 0.68);
}

.weather-metrics {
  margin: 0 0 0.75rem;
  border: 1px solid var(--panel-line-soft);
  border-radius: 7px;
  overflow: hidden;
}

.weather-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.62rem 0.7rem;
  background: rgba(12, 9, 7, 0.42);
}

.weather-metrics div + div {
  border-top: 1px solid rgba(255, 174, 91, 0.18);
}

.weather-metrics dt,
.weather-metrics dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--weather-soft);
}

.weather-metrics dd {
  color: var(--weather-text);
}

.hourly-forecast {
  border: 1px solid var(--panel-line-soft);
  border-radius: 7px;
  background: rgba(12, 9, 7, 0.42);
  padding: 0.75rem 0.62rem 0.7rem;
}

.hourly-forecast h2 {
  margin: 0 0 0.55rem;
  color: var(--weather-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.hourly-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.28rem;
}

.hourly-item {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0.32rem;
  color: var(--weather-soft);
  font-size: 0.74rem;
  font-weight: 800;
}

.hourly-item .weather-symbol {
  transform: scale(0.68);
  transform-origin: center;
}

.hourly-temp {
  color: var(--weather-text);
  font-size: 0.78rem;
}

.weather-status {
  min-height: 1rem;
  margin: 0.65rem 0 0;
  color: rgba(255, 217, 164, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

.timer-face {
  position: absolute;
  left: 54.5%;
  top: 44.8%;
  width: 15.2%;
  height: 8.8%;
  display: grid;
  place-items: center;
  padding-top: 0.45%;
  border-radius: 0.7vw;
  background: radial-gradient(circle at 50% 50%, rgba(41, 16, 7, 0.33), transparent 68%);
  transform: perspective(900px) rotateX(1deg) rotateY(1deg) rotateZ(4deg);
}

.mode-label {
  align-self: end;
  margin: 0 0 -0.45em;
  color: rgba(255, 195, 145, 0.78);
  font-size: clamp(0.28rem, 0.62vw, 0.64rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-shadow:
    0 0 0.55em rgba(255, 143, 78, 0.8),
    0 0 1.1em rgba(255, 96, 36, 0.45);
}

.timer-display {
  align-self: center;
  color: var(--clock-hot);
  font-family:
    "Courier New", "Roboto Mono", Consolas, ui-monospace, SFMono-Regular, monospace;
  font-size: clamp(1rem, 4.1vw, 4.4rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 0.08em #fff1df,
    0 0 0.18em var(--clock-glow),
    0 0 0.45em rgba(255, 119, 43, 0.86),
    0 0 0.9em rgba(255, 97, 31, 0.6);
}

.controls {
  position: absolute;
  left: 53.8%;
  top: 55.3%;
  width: 16.3%;
  display: flex;
  justify-content: center;
  gap: clamp(0.18rem, 0.42vw, 0.42rem);
  transform: rotateZ(5deg);
}

.control-button {
  min-width: 0;
  min-height: clamp(1.45rem, 2.45vw, 2.5rem);
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32em;
  border: 1px solid rgba(255, 210, 172, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(26, 22, 20, 0.88), rgba(7, 10, 15, 0.82)),
    var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  font-size: clamp(0.48rem, 0.82vw, 0.82rem);
  font-weight: 700;
  line-height: 1;
  padding: 0.35em 0.2em;
  text-align: center;
  text-shadow: 0 0 0.6em rgba(255, 144, 76, 0.72);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 0.35em 1.1em rgba(0, 0, 0, 0.42);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.control-button span:first-child {
  color: #ffc06f;
  font-size: 1.05em;
  line-height: 1;
}

.control-button:hover,
.control-button:focus-visible {
  border-color: var(--button-border);
  color: #fff3e8;
  outline: none;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 2px rgba(255, 148, 81, 0.16),
    0 0.45em 1.2em rgba(0, 0, 0, 0.48);
}

.control-button:active {
  transform: translateY(1px);
}

.control-button.primary {
  border-color: rgba(255, 181, 119, 0.52);
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
  }

  .scene {
    width: 100vw;
    min-width: 760px;
  }
}
