@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800;900&display=swap");

:root {
  --bg: #02110b;
  --panel: rgba(8, 53, 35, 0.92);
  --panel-soft: rgba(3, 22, 14, 0.88);
  --line: rgba(170, 255, 211, 0.18);
  --text: #f4fff8;
  --muted: #b8d8c7;
  --accent: #8dffbd;
  --accent-strong: #2ee67f;
  --warning: #f6d86b;
  --ticker-height: clamp(74px, 8vh, 98px);
  --top-height: clamp(116px, 14.5vh, 158px);
  --side-padding: clamp(22px, 3vw, 54px);
  --font-display: "Montserrat", "Avenir Next", "Century Gothic", Arial, sans-serif;
  --font-ui: "Montserrat", "Avenir Next", "Century Gothic", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body {
  background:
    radial-gradient(circle at 8% 10%, rgba(46, 230, 127, 0.26), transparent 34%),
    radial-gradient(circle at 86% 84%, rgba(141, 255, 189, 0.20), transparent 42%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.025), transparent 48%),
    linear-gradient(135deg, #010905 0%, #052719 50%, #020b07 100%);
}

.dashboard {
  display: grid;
  grid-template-rows: var(--top-height) 1fr var(--ticker-height);
  width: 100vw;
  height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(360px, 1.25fr) minmax(280px, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 0;
  padding: clamp(14px, 1.8vh, 22px) var(--side-padding);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5, 34, 22, 0.86), rgba(2, 16, 10, 0.68));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.clock-card,
.weather {
  min-width: 0;
  border: 1px solid rgba(170, 255, 211, 0.22);
  border-radius: clamp(20px, 1.8vw, 30px);
  background: linear-gradient(145deg, rgba(8, 53, 35, 0.92), rgba(3, 24, 16, 0.82));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.clock-card {
  justify-self: start;
  width: min(100%, 372px);
  padding: clamp(10px, 1.2vh, 16px) clamp(16px, 2vw, 28px);
}

.clock {
  display: flex;
  align-items: flex-end;
  gap: 0.02em;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(40px, 4.4vw, 86px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -1px;
}

.clock .colon {
  opacity: 1;
}

.clock .seconds {
  margin-left: 0.18em;
  margin-bottom: 0.08em;
  color: var(--muted);
  font-size: 0.38em;
  font-weight: 800;
}

.date {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(12px, 1vw, 18px);
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.logo-wrap {
  display: grid;
  min-width: 0;
  height: 100%;
  place-items: center;
}

.logo-wrap img {
  width: auto;
  max-width: min(100%, 520px);
  height: auto;
  max-height: calc(var(--top-height) - 16px);
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
}

.weather {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-self: end;
  align-items: center;
  width: min(100%, 470px);
  gap: clamp(10px, 1.2vw, 18px);
  padding: clamp(10px, 1.4vh, 18px) clamp(14px, 1.8vw, 24px);
}

.weather-icon {
  min-width: clamp(54px, 4.8vw, 82px);
  width: clamp(54px, 4.8vw, 82px);
  height: clamp(54px, 4.8vw, 82px);
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: clamp(32px, 3vw, 56px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.weather-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  text-align: right;
}

.weather-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  min-width: 0;
  gap: 12px;
}

.weather-info strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(28px, 2.55vw, 50px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.weather-desc,
.weather-city {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-desc {
  color: var(--text);
  font-size: clamp(12px, 1vw, 17px);
  font-weight: 800;
}

.weather-city {
  color: var(--muted);
  font-size: clamp(10px, 0.82vw, 14px);
  font-weight: 700;
}

.weather-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.weather-pill {
  border: 1px solid rgba(141, 255, 189, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  padding: 5px 9px;
  font-size: clamp(10px, 0.82vw, 13px);
  font-weight: 800;
  white-space: nowrap;
}

.main {
  position: relative;
  display: grid;
  min-height: 0;
  padding: clamp(16px, 2.4vh, 32px) var(--side-padding);
}

.main::before {
  position: absolute;
  inset: clamp(14px, 2vh, 24px) var(--side-padding);
  border: 1px solid rgba(141, 255, 189, 0.055);
  border-radius: clamp(26px, 3vw, 44px);
  background: linear-gradient(135deg, rgba(46, 230, 127, 0.03), rgba(255, 255, 255, 0.012));
  content: "";
  pointer-events: none;
}

.media-frame {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(100%, 1620px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(141, 255, 189, 0.22);
  border-radius: clamp(26px, 3vw, 42px);
  background: rgba(3, 22, 14, 0.88);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.media-frame.has-caption::after {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.62));
  content: "";
  pointer-events: none;
}

.slide-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #03170f;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 2;
}

.slide-media.active {
  opacity: 1;
  z-index: 4;
}

.slide-media.leaving {
  opacity: 0;
  z-index: 2;
}

.slide-media.cover {
  object-fit: cover;
}

.slide-media.contain {
  object-fit: contain;
  padding: clamp(12px, 2vw, 28px);
}

.slide-media.image-media {
  background-position: center;
  background-repeat: no-repeat;
}

.slide-media.image-media.cover {
  background-size: cover;
}

.slide-media.image-media.contain {
  background-size: contain;
  padding: 0;
}

.placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  padding: clamp(24px, 4vw, 58px);
  place-items: center;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.placeholder h1 {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 72px);
  font-weight: 900;
  line-height: 1.02;
}

.placeholder p {
  margin: 0;
  font-size: clamp(15px, 1.3vw, 24px);
  font-weight: 600;
  line-height: 1.35;
}

.slide-caption {
  position: absolute;
  z-index: 5;
  bottom: clamp(18px, 2vw, 34px);
  left: clamp(18px, 2.2vw, 38px);
  display: none;
  max-width: min(72%, 960px);
  border: 1px solid rgba(141, 255, 189, 0.28);
  border-radius: 22px;
  background: rgba(2, 16, 10, 0.72);
  color: var(--text);
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.5vw, 30px);
  font-weight: 850;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 0;
  height: var(--ticker-height);
  overflow: hidden;
  border-top: 1px solid rgba(141, 255, 189, 0.18);
  background: linear-gradient(90deg, #020b07, #03170e 48%, #020b07);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.30);
}

.ticker-label {
  display: grid;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, #9dffbd, #2ee67f 52%, #0c6b3d);
  color: #02100a;
  min-width: clamp(160px, 14vw, 200px);
  padding: 0 clamp(20px, 2.6vw, 36px);
  font-family: var(--font-display);
  font-size: clamp(16px, 1.25vw, 26px);
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 14px 0 40px rgba(46, 230, 127, 0.18);
}

.ticker-window {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: clamp(42px, 5vw, 72px);
  padding-left: clamp(24px, 3vw, 42px);
  white-space: nowrap;
  animation: tickerMove var(--ticker-speed, 115s) linear infinite;
  will-change: transform;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: clamp(18px, 2vw, 30px);
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(19px, 1.85vw, 36px);
  font-weight: 800;
}

.ticker-item::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  content: "";
}

@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.offline {
  position: absolute;
  z-index: 30;
  top: 16px;
  right: 16px;
  display: none;
  border: 1px solid rgba(246, 216, 107, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff1b5;
  padding: 10px 15px;
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 900;
}

.offline.show {
  display: block;
}

.progress-dots,
.media-index-badge {
  position: absolute;
  z-index: 6;
  right: clamp(18px, 2vw, 32px);
  border: 1px solid rgba(141, 255, 189, 0.18);
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  transition: opacity 180ms linear;
}

.progress-dots {
  bottom: clamp(18px, 2vw, 32px);
  display: flex;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 11px;
}

.progress-dots.show,
.media-index-badge.show {
  opacity: 1;
}

.progress-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(244, 255, 248, 0.36);
}

.progress-dots .dot.active {
  background: var(--accent);
}

.media-index-badge {
  bottom: calc(clamp(18px, 2vw, 32px) + 39px);
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(190px, 1fr) minmax(230px, 1.2fr) minmax(210px, 1fr);
  }

  .weather-city {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --top-height: 176px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr);
    grid-template-rows: 1fr 1fr;
  }

  .logo-wrap {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .weather {
    justify-self: stretch;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }

  .slide-media,
  .progress-dots,
  .media-index-badge {
    transition: none;
  }
}
