:root {
  color-scheme: dark;
  --background: #07131c;
  --panel: #0d202c;
  --panel-strong: #102936;
  --text: #f7fbfd;
  --muted: #b8c9d1;
  --accent: #55d6be;
  --accent-warm: #ffd166;
  --line: rgba(255, 255, 255, 0.14);
  --safe-x: clamp(20px, 3vw, 64px);
  --safe-y: clamp(12px, 2vh, 32px);
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
}

body {
  color: var(--text);
}

.screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: clamp(72px, 12vh, 136px) minmax(0, 1fr) clamp(48px, 8vh, 82px);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(85, 214, 190, 0.08), transparent 38%),
    linear-gradient(135deg, #07131c 0%, #0a1923 100%);
}

.screen__header,
.screen__footer {
  display: flex;
  align-items: center;
  padding-inline: var(--safe-x);
}

.screen__header {
  border-bottom: 1px solid var(--line);
}

.screen__header h1 {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0;
  font-size: clamp(32px, 4vw, 68px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.screen__welcome {
  color: var(--accent);
  font-size: 0.82em;
  letter-spacing: -0.02em;
}

.screen__content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(270px, 3fr) minmax(0, 7fr);
  gap: clamp(14px, 1.5vw, 30px);
  padding: var(--safe-y) var(--safe-x);
}

.info-panel,
.ads-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: clamp(16px, 1.5vw, 28px);
  background: rgba(13, 32, 44, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.info-panel {
  display: grid;
  grid-template-rows: minmax(0, 0.9fr) 1px minmax(0, 1.1fr);
  padding: clamp(14px, 2vw, 34px);
  text-align: center;
}

.clock,
.weather {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.clock__time {
  display: block;
  margin: 0;
  font-size: clamp(64px, 8.2vw, 140px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.clock__date {
  max-width: 100%;
  margin: clamp(10px, 1.7vh, 20px) 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 34px);
  font-weight: 600;
  line-height: 1.15;
}

.info-panel__divider {
  width: 76%;
  justify-self: center;
  background: var(--line);
}

.weather__place,
.weather__description,
.weather__updated,
.weather__source {
  margin: 0;
}

.weather__place {
  color: var(--accent);
  font-size: clamp(18px, 1.6vw, 28px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weather__current {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 18px);
  margin-block: clamp(3px, 0.6vh, 9px);
}

.weather__icon {
  width: clamp(58px, 6vw, 96px);
  height: clamp(58px, 6vw, 96px);
  overflow: visible;
  color: var(--accent-warm);
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-icon__fill {
  fill: var(--panel-strong);
}

.weather-icon__bolt {
  fill: var(--accent-warm);
  stroke-width: 3;
}

.weather__temperature {
  font-size: clamp(48px, 5.4vw, 92px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
}

.weather__description {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(18px, 1.7vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather__updated,
.weather__source {
  color: var(--muted);
  font-size: clamp(11px, 0.9vw, 16px);
  line-height: 1.25;
}

.weather__updated {
  min-height: 1.25em;
  margin-top: clamp(5px, 0.8vh, 10px);
}

.weather__updated--warning {
  color: var(--accent-warm);
}

.svg-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ads-panel,
.ads {
  position: relative;
}

.ads {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(125deg, rgba(85, 214, 190, 0.08), transparent 52%),
    var(--panel-strong);
}

.ad-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  gap: clamp(18px, 2.5vw, 48px);
  padding: clamp(28px, 4vw, 76px);
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 700ms ease, transform 900ms ease;
  pointer-events: none;
}

.ad-slide--active {
  z-index: 2;
  opacity: 1;
  transform: scale(1);
}

.ad-slide--text {
  grid-template-columns: minmax(0, 1fr);
}

.ad-slide--mixed {
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.1fr);
}

.ad-slide--image {
  padding: clamp(14px, 2vw, 32px);
}

.ad-slide__media {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: clamp(12px, 1.2vw, 22px);
}

.ad-slide__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.ad-slide__image--cover {
  object-fit: cover;
}

.ad-slide__content {
  min-width: 0;
  max-height: 100%;
  overflow: hidden;
}

.ad-slide--text .ad-slide__content {
  max-width: 90%;
}

.ad-slide__eyebrow {
  margin: 0 0 clamp(12px, 1.8vh, 24px);
  color: var(--accent);
  font-size: clamp(16px, 1.5vw, 27px);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ad-slide__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(48px, 6.1vw, 112px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ad-slide--mixed .ad-slide__title {
  font-size: clamp(38px, 4.5vw, 82px);
}

.ad-slide__text {
  display: -webkit-box;
  margin: clamp(20px, 3vh, 42px) 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(24px, 2.5vw, 46px);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ad-slide__image-error {
  max-width: 22ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.screen__footer {
  justify-content: center;
  border-top: 1px solid var(--line);
}

.screen__footer p {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 40px);
  font-weight: 800;
  letter-spacing: 0.035em;
}

@media (max-aspect-ratio: 3 / 2) {
  .screen__content {
    grid-template-columns: minmax(250px, 34fr) minmax(0, 66fr);
  }

  .ad-slide--mixed {
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-height: 620px) {
  .weather__source {
    display: none;
  }

  .ad-slide__text {
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-slide {
    transition-duration: 1ms;
  }
}
