@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-serif: "Playfair Display", Georgia, "Times New Roman", Times, serif;
  --bg-primary: #000000;
  --text-primary: #FFFFFF;
  --text-secondary: #E4E6EB;
  --text-muted: #B0B3B8;
  --accent: #7DD3FC;
  --accent-warm: #FACC15;
  --danger: #FB7185;
  --danger-strong: #FF304D;
  --danger-bg: #170305;
  --radius: 8px;
}

body.bad-mode {
  --accent: #FACC15;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg-primary);
}

body {
  color: var(--text-primary);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
}

#app {
  width: 600px;
  height: 600px;
  padding: 8px;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 584px;
  height: 584px;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 22px;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-title-row {
  position: relative;
  min-width: 0;
  width: 88px;
}

.app-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  max-width: 84px;
  font-size: 16px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: 0;
  white-space: normal;
}

.app-version {
  position: absolute;
  top: 20px;
  left: 66px;
  color: var(--text-muted);
  font-size: 8px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 0.72;
}

.view-label {
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 41px;
  line-height: 1;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  white-space: nowrap;
}

.screen-arrow {
  position: absolute;
  top: 292px;
  z-index: 2;
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.screen-arrow.visible {
  opacity: 0.66;
}

.screen-arrow-left {
  left: 20px;
  transform: translateY(-50%) rotate(-90deg);
}

.screen-arrow-right {
  right: 20px;
  transform: translateY(-50%) rotate(90deg);
}

.stage {
  flex: 1;
  display: flex;
  min-height: 0;
  padding-top: 2px;
}

.forecast-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: transparent;
  cursor: pointer;
}

.forecast-card:focus {
  outline: none;
}

.card-state,
.forecast-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.forecast-content {
  padding-top: 8px;
  padding-bottom: 60px;
}

.forecast-content .model-viewer,
.forecast-content .forecast-sentence {
  transition:
    transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 150ms ease;
  will-change: transform, opacity;
}

.forecast-content.page-no-transition .model-viewer,
.forecast-content.page-no-transition .forecast-sentence {
  transition: none;
}

.weather-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 118px;
  background: transparent;
  color: var(--accent-warm);
  font-size: 72px;
  line-height: 1;
}

.hero-icon {
  margin-bottom: 20px;
}

.model-viewer {
  position: relative;
  width: 148px;
  height: 148px;
  background: transparent;
  overflow: hidden;
}

.model-viewer canvas,
.loading-model-viewer canvas {
  display: block;
}

.model-viewer canvas {
  width: 148px;
  height: 148px;
}

.loading-model-viewer {
  position: relative;
  width: 74px;
  height: 74px;
  margin-bottom: 26px;
  background: transparent;
  overflow: hidden;
}

.loading-model-viewer canvas {
  width: 74px;
  height: 74px;
}

.fallback-icon {
  position: absolute;
  inset: 24px;
  width: auto;
  height: auto;
  background: transparent;
  display: none;
}

.model-viewer.model-fallback .fallback-icon {
  display: flex;
}

.loading-model-viewer.model-fallback .loading-fallback-icon {
  inset: 0;
  display: flex;
  font-size: 46px;
}

.error-icon {
  color: var(--danger);
}

.loading-icon {
  color: var(--accent-warm);
}

.card-state p {
  max-width: 440px;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
}

.forecast-sentence {
  max-width: 500px;
  color: var(--text-primary);
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}

.forecast-content.page-exit-left .model-viewer {
  transform: translateX(-24px) scale(0.78);
}

.forecast-content.page-exit-right .model-viewer {
  transform: translateX(24px) scale(0.78);
}

.forecast-content.page-exit-left .forecast-sentence {
  opacity: 0;
  transform: translateX(-24px);
}

.forecast-content.page-exit-right .forecast-sentence {
  opacity: 0;
  transform: translateX(24px);
}

.forecast-content.page-enter-left .model-viewer {
  transform: translateX(-24px) scale(0.78);
}

.forecast-content.page-enter-right .model-viewer {
  transform: translateX(24px) scale(0.78);
}

.forecast-content.page-enter-left .forecast-sentence,
.forecast-content.page-enter-right .forecast-sentence {
  opacity: 0;
}

.forecast-content.page-enter-left .forecast-sentence {
  transform: translateX(-24px);
}

.forecast-content.page-enter-right .forecast-sentence {
  transform: translateX(24px);
}

.forecast-content.page-enter-left.page-enter-active .model-viewer,
.forecast-content.page-enter-right.page-enter-active .model-viewer {
  transform: translateX(0) scale(1);
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.2, 1.18, 0.34, 1);
}

.forecast-content.page-enter-left.page-enter-active .forecast-sentence,
.forecast-content.page-enter-right.page-enter-active .forecast-sentence {
  opacity: 1;
  transform: translateX(0);
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.2, 0.86, 0.32, 1);
}

.refresh-note {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  margin-top: 0;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.2;
  font-style: normal;
  font-weight: 400;
  opacity: 0.68;
}

.mode-modal {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(35, 0, 4, 0.9);
}

.mode-panel {
  width: 480px;
  max-width: calc(100% - 48px);
  padding: 26px;
  border: 3px solid var(--danger-strong);
  border-radius: var(--radius);
  background: var(--danger-bg);
  text-align: center;
  animation: danger-popup-pop 2.8s ease-in-out infinite, danger-frame-blink 1.45s ease-in-out infinite;
  transform-origin: center;
}

.mode-kicker {
  color: var(--danger-strong);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
}

.mode-panel h1 {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 34px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.mode-panel p {
  margin: 14px auto 0;
  max-width: 420px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 600;
}

.mode-panel .mode-action {
  color: #FFE66D;
  font-family: var(--font-serif);
  font-size: 19px;
  font-style: normal;
  font-weight: 400;
  opacity: 0.82;
}

@keyframes danger-popup-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}

@keyframes danger-frame-blink {
  0%, 100% {
    border-color: var(--danger-strong);
    box-shadow: 0 0 0 rgba(255, 48, 77, 0);
  }
  50% {
    border-color: #FF6B7D;
    box-shadow: 0 0 18px rgba(255, 48, 77, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .forecast-card,
  .loading-icon,
  .forecast-content .model-viewer,
  .forecast-content .forecast-sentence,
  .mode-panel {
    animation: none;
    transition: none;
  }
}
