/*
 * TV dashboard — Samsung Q6F QLED 2018 (Tizen 4.0, Chromium M56).
 * Avoid CSS Grid (Chrome 57+) and flex gap (Chrome 84+).
 * Layout uses flexbox + margins only; colors use literal fallbacks.
 */

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

html {
  font-size: 16px;
}

.tv-body {
  background-color: #0b0f14;
  background-image: radial-gradient(circle at top, #152033 0%, #0b0f14 55%);
  color: #f4f7fb;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

.tv-shell {
  box-sizing: border-box;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  height: 100%;
  min-height: 720px;
  padding: 32px;
  width: 100%;
}

.tv-header {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-bottom: 28px;
}

.tv-brand {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}

.tv-brand-mark {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  background-color: #2dd4bf;
  background-image: -webkit-linear-gradient(315deg, #2dd4bf, #2563eb);
  background-image: linear-gradient(135deg, #2dd4bf, #2563eb);
  border-radius: 12px;
  color: #041018;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  font-size: 28px;
  font-weight: 800;
  height: 72px;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  letter-spacing: 0.08em;
  margin-right: 24px;
  width: 72px;
}

.tv-brand-text {
  min-width: 0;
}

.tv-brand-label {
  color: #9aa8bc;
  font-size: 18px;
  letter-spacing: 0.18em;
  margin: 0;
  text-transform: uppercase;
}

.tv-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin: 6px 0 0;
}

.tv-clock {
  text-align: right;
}

.tv-clock time {
  display: block;
  font-size: 28px;
  font-weight: 600;
}

.tv-clock-detail {
  color: #4fd1c5;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 8px 0 0;
}

.tv-grid {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  min-height: 0;
}

.tv-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-height: 0;
}

.tv-row + .tv-row {
  margin-top: 24px;
}

.tv-panel {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: 0;
}

.tv-panel + .tv-panel {
  margin-left: 24px;
}

.tv-panel-inner {
  background-color: #141b24;
  border: 1px solid #243041;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  height: 100%;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 40px;
}

.tv-panel-primary .tv-panel-inner {
  border-color: rgba(79, 209, 197, 0.45);
}

.tv-panel-title {
  color: #9aa8bc;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.tv-panel-value {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  word-wrap: break-word;
}

.tv-status-ok {
  color: #34d399;
}

.tv-panel-meta {
  color: #9aa8bc;
  font-size: 20px;
  line-height: 1.4;
  margin: 16px 0 0;
  word-wrap: break-word;
}

.tv-link {
  color: #4fd1c5;
  text-decoration: none;
}

.tv-link:focus,
.tv-link:hover {
  text-decoration: underline;
}

.tv-footer {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  border-top: 1px solid #243041;
  color: #9aa8bc;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  font-size: 18px;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
}

.tv-footer-main,
.tv-footer-sub {
  margin: 0;
}

.tv-updating {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  background-color: #0b0f14;
  background-image: radial-gradient(circle at top, #152033 0%, #0b0f14 55%);
  box-sizing: border-box;
  display: none;
  height: 100%;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  left: 0;
  padding: 48px;
  position: fixed;
  text-align: center;
  top: 0;
  width: 100%;
  z-index: 9999;
}

.tv-updating-visible {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.tv-updating-mark {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  background-color: #2dd4bf;
  background-image: -webkit-linear-gradient(315deg, #2dd4bf, #2563eb);
  background-image: linear-gradient(135deg, #2dd4bf, #2563eb);
  border-radius: 20px;
  color: #041018;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  font-size: 40px;
  font-weight: 800;
  height: 112px;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  letter-spacing: 0.08em;
  margin-bottom: 40px;
  width: 112px;
}

.tv-updating-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 20px;
}

.tv-updating-message {
  color: #4fd1c5;
  font-size: 32px;
  line-height: 1.4;
  margin: 0 0 16px;
  max-width: 960px;
}

.tv-updating-meta {
  color: #9aa8bc;
  font-size: 22px;
  margin: 0;
}

.tv-updating-spinner {
  border: 4px solid #243041;
  border-radius: 50%;
  border-top-color: #4fd1c5;
  height: 56px;
  margin-bottom: 36px;
  width: 56px;
  -webkit-animation: tv-spin 1s linear infinite;
  animation: tv-spin 1s linear infinite;
}

@-webkit-keyframes tv-spin {
  to {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes tv-spin {
  to {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

.tv-updating-synology .tv-updating-title {
  color: #fbbf24;
}

.tv-updating-badge {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  color: #fbbf24;
  display: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 24px;
  padding: 10px 18px;
  text-transform: uppercase;
}

.tv-updating-synology .tv-updating-badge {
  display: block;
}

@media screen and (min-width: 1600px) {
  .tv-updating-badge {
    font-size: 18px;
  }
}

.tv-content-hidden {
  visibility: hidden;
}

@media screen and (min-width: 1600px) {
  .tv-updating-title {
    font-size: 72px;
  }

  .tv-updating-message {
    font-size: 40px;
  }

  .tv-updating-meta {
    font-size: 28px;
  }
}

/* 4K / large living-room displays (TV browser often reports 1920 CSS px) */
@media screen and (min-width: 1600px) {
  html {
    font-size: 18px;
  }

  .tv-shell {
    padding: 48px;
  }

  .tv-brand-mark {
    font-size: 32px;
    height: 88px;
    width: 88px;
  }

  .tv-title {
    font-size: 52px;
  }

  .tv-clock time {
    font-size: 32px;
  }

  .tv-clock-detail {
    font-size: 72px;
  }

  .tv-panel-value {
    font-size: 56px;
  }

  .tv-panel-title {
    font-size: 26px;
  }

  .tv-panel-meta {
    font-size: 24px;
  }
}

@media screen and (min-width: 2560px) {
  html {
    font-size: 22px;
  }

  .tv-clock-detail {
    font-size: 88px;
  }

  .tv-panel-value {
    font-size: 64px;
  }
}

@media screen and (max-width: 960px) {
  .tv-body {
    overflow-y: auto;
  }

  .tv-shell {
    height: auto;
    min-height: 100%;
  }

  .tv-header {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
  }

  .tv-clock {
    margin-top: 20px;
    text-align: left;
  }

  .tv-grid {
    display: block;
  }

  .tv-row {
    display: block;
  }

  .tv-row + .tv-row {
    margin-top: 0;
  }

  .tv-panel {
    margin-bottom: 24px;
    margin-left: 0;
  }

  .tv-panel + .tv-panel {
    margin-left: 0;
  }

  .tv-panel-inner {
    height: auto;
    min-height: 160px;
  }

  .tv-footer {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
  }

  .tv-footer-sub {
    margin-top: 8px;
  }
}

/* ------------------------------------------------------------------ */
/* Full-screen art gallery + HUD                                      */
/* ------------------------------------------------------------------ */

.tv-body-gallery {
  background-color: #000;
  background-image: none;
  overflow: hidden;
}

.tv-gallery {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
}

.tv-slideshow {
  bottom: 0;
  height: 100%;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
}

.tv-slide {
  background-color: #000;
  bottom: 0;
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  -webkit-transition: opacity 2s ease-in-out;
  transition: opacity 2s ease-in-out;
  will-change: opacity;
  z-index: 1;
}

.tv-slide-active {
  opacity: 1;
  z-index: 2;
}

.tv-slide-img {
  border: 0;
  display: block;
  height: 100%;
  left: 0;
  object-fit: cover;
  object-position: center center;
  position: absolute;
  top: 0;
  width: 100%;
}

.tv-slide-caption {
  bottom: 180px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 22px;
  font-weight: 500;
  left: 48px;
  letter-spacing: 0.08em;
  margin: 0;
  position: absolute;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
  text-transform: uppercase;
  z-index: 4;
}

.tv-hud {
  bottom: 0;
  box-sizing: border-box;
  left: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 8;
}

.tv-hud-datetime {
  left: 48px;
  max-width: 45%;
  pointer-events: auto;
  position: absolute;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
  top: 36px;
}

.tv-hud-weekday {
  color: rgba(255, 255, 255, 0.78);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.tv-hud-date {
  color: #fff;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 10px;
}

.tv-hud-time {
  color: #fff;
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}

.tv-hud-ampm {
  color: rgba(255, 255, 255, 0.72);
  font-size: 28px;
  font-weight: 600;
  margin-left: 10px;
}

.tv-hud-widgets {
  bottom: 36px;
  left: 48px;
  pointer-events: none;
  position: absolute;
  right: 48px;
  text-align: right;
  z-index: 8;
}

.tv-hud-widget-stack {
  display: inline-block;
  max-width: 100%;
  pointer-events: auto;
  text-align: left;
  vertical-align: bottom;
}

.tv-hud-earthquake {
  margin-bottom: 16px;
}

.tv-hud-earthquake .tv-widget-card {
  margin-left: 0;
  width: 100%;
}

.tv-hud-weather {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  width: 100%;
}

.tv-hud-weather .tv-widget-card {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 220px;
  flex: 1 1 220px;
  margin-left: 16px;
  min-width: 220px;
}

.tv-hud-weather .tv-widget-card:first-child {
  margin-left: 0;
}

.tv-widget-card,
.tv-weather-card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(12, 18, 28, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-sizing: border-box;
  min-width: 220px;
  padding: 18px 20px 16px;
}

.tv-weather-city {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.tv-weather-current {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  margin-bottom: 14px;
}

.tv-weather-current-text {
  margin-left: 12px;
}

.tv-weather-icon {
  color: #fbbf24;
  display: block;
  font-size: 42px;
  line-height: 1;
  min-width: 42px;
  text-align: center;
}

.tv-weather-icon-sm {
  font-size: 22px;
  min-width: 22px;
}

.tv-weather-temp {
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 4px;
}

.tv-weather-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  margin: 0;
}

.tv-weather-hourly {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 12px;
}

.tv-weather-hour {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-width: 0;
  text-align: center;
}

.tv-weather-hour-time {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  text-transform: lowercase;
}

.tv-weather-hour-temp {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
  margin: 4px 0 0;
}

.tv-earthquake-card-recent {
  background: rgba(68, 24, 16, 0.42);
  border-color: rgba(251, 191, 36, 0.72);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}

.tv-earthquake-current {
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  margin-bottom: 4px;
}

.tv-earthquake-current-recent .tv-earthquake-mag {
  color: #fbbf24;
}

.tv-earthquake-mag {
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  margin: 0 14px 0 0;
  min-width: 72px;
  text-align: center;
}

.tv-earthquake-mag-calm {
  color: rgba(255, 255, 255, 0.42);
}

.tv-earthquake-current-text {
  min-width: 0;
}

.tv-earthquake-place {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 6px;
}

.tv-earthquake-list {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 12px;
  padding-top: 10px;
}

.tv-earthquake-item {
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  margin-top: 10px;
}

.tv-earthquake-item:first-child {
  margin-top: 0;
}

.tv-earthquake-item-recent {
  background: rgba(251, 191, 36, 0.1);
  border-radius: 12px;
  margin-left: -8px;
  margin-right: -8px;
  padding: 8px;
}

.tv-earthquake-item-mag {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 10px 0 0;
  min-width: 48px;
}

.tv-earthquake-item-recent .tv-earthquake-item-mag {
  color: #fbbf24;
}

.tv-earthquake-item-text {
  min-width: 0;
}

.tv-earthquake-item-place {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 4px;
}

.tv-earthquake-item-time {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}

.tv-info-panels {
  position: absolute;
  right: 32px;
  top: 32px;
  z-index: 8;
}

.tv-info-card {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 14px 18px;
}

.tv-info-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  letter-spacing: 0.14em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.tv-info-value {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

@media screen and (min-width: 1600px) {
  .tv-slide-caption {
    bottom: 210px;
    font-size: 26px;
    left: 56px;
  }

  .tv-hud-datetime {
    left: 56px;
    top: 42px;
  }

  .tv-hud-widgets {
    bottom: 42px;
    left: 56px;
    right: 56px;
  }

  .tv-hud-weekday {
    font-size: 26px;
  }

  .tv-hud-date {
    font-size: 42px;
  }

  .tv-hud-time {
    font-size: 96px;
  }

  .tv-hud-ampm {
    font-size: 34px;
  }

  .tv-widget-card,
  .tv-weather-card {
    min-width: 260px;
    padding: 22px 24px 18px;
  }

  .tv-hud-weather .tv-widget-card {
    -webkit-flex-basis: 260px;
    flex-basis: 260px;
    min-width: 260px;
  }

  .tv-weather-icon {
    font-size: 48px;
    min-width: 48px;
  }

  .tv-weather-temp {
    font-size: 46px;
  }

  .tv-weather-hour-time {
    font-size: 13px;
  }

  .tv-weather-hour-temp {
    font-size: 16px;
  }

  .tv-earthquake-mag {
    font-size: 46px;
    min-width: 82px;
  }

  .tv-earthquake-place {
    font-size: 20px;
  }
}

@media screen and (max-width: 960px) {
  .tv-hud-datetime {
    left: 24px;
    max-width: 100%;
    top: 24px;
  }

  .tv-hud-widgets {
    bottom: 24px;
    left: 24px;
    right: 24px;
  }

  .tv-hud-widget-stack {
    display: block;
    width: 100%;
  }

  .tv-hud-weather {
    -webkit-box-lines: multiple;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  .tv-hud-weather .tv-widget-card {
    margin-left: 0;
    margin-top: 16px;
    width: 100%;
  }

  .tv-hud-weather .tv-widget-card:first-child {
    margin-top: 0;
  }

  .tv-widget-card,
  .tv-weather-card {
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
    width: 100%;
  }

  .tv-slide-caption {
    bottom: 260px;
    left: 24px;
  }
}
