* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
}
.player {
  --bg: #082d27;
  --panel: #0d4337;
  --surface: #115342;
  --accent: #d9ac50;
  --text: #fff;
  --muted: #b9d5cc;
  --ticker: #071f1b;
  background: var(--bg);
  color: var(--text);
}
.theme-midnight {
  --bg: #07132d;
  --panel: #0d1d40;
  --surface: #142957;
  --accent: #71a7ff;
  --muted: #b9c9eb;
  --ticker: #040b1b;
}
.theme-sand {
  --bg: #efe2c3;
  --panel: #5e4727;
  --surface: #d7bb7f;
  --accent: #f5d47b;
  --text: #352712;
  --muted: #e3d3af;
  --ticker: #46341d;
}
.theme-royal {
  --bg: #211238;
  --panel: #341d50;
  --surface: #56346e;
  --accent: #e1b85e;
  --muted: #d8cae5;
  --ticker: #160b25;
}
.theme-minimal {
  --bg: #e8eeeb;
  --panel: #fff;
  --surface: #f7faf8;
  --accent: #0e4b3d;
  --text: #143b31;
  --muted: #69827a;
  --ticker: #0e4b3d;
}
.tv-layout {
  width: 100vw;
  height: 100vh;
  display: grid;
  background: var(--bg);
}
.layout-1 {
  grid-template-columns: clamp(240px, 21vw, 400px) 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "prayer header" "prayer slide" "prayer ticker";
}
.layout-2 {
  grid-template-columns: 1fr clamp(240px, 21vw, 400px);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "header prayer" "slide prayer" "ticker prayer";
}
.layout-3 {
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: "header" "slide" "prayer" "ticker";
}
.layout-4 {
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "header" "prayer" "slide" "ticker";
}
.layout-5 {
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "header" "slide" "ticker";
}
.mosque-header {
  grid-area: header;
  min-height: clamp(86px, 12vh, 145px);
  padding: clamp(16px, 2vw, 32px) clamp(24px, 3vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.mosque-identity {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 24px);
  min-width: 0;
}
.mosque-identity img,
.mosque-logo {
  width: clamp(50px, 5vw, 78px);
  height: clamp(50px, 5vw, 78px);
  border-radius: 16px;
  object-fit: cover;
}
.mosque-logo {
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
  font-size: 1.6rem;
}
.mosque-identity small {
  display: block;
  color: var(--muted);
  font-size: clamp(0.55rem, 0.75vw, 0.8rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mosque-identity h1 {
  font-size: clamp(1.2rem, 2.2vw, 2.6rem);
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.date-block {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 32px);
  text-align: right;
}
.date-block > span {
  height: 40px;
  width: 1px;
  background: color-mix(in srgb, var(--text) 15%, transparent);
}
.date-block small,
.date-block strong {
  display: block;
}
.date-block small {
  color: var(--muted);
  font-size: clamp(0.5rem, 0.65vw, 0.72rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.date-block strong {
  font-size: clamp(0.7rem, 1vw, 1.05rem);
  margin-top: 4px;
}
.header-clock {
  display: flex;
  align-items: center;
}
.header-clock strong {
  font-size: clamp(2.3rem, 4vw, 5rem);
  letter-spacing: -0.07em;
}
.header-clock small {
  color: var(--accent);
  font-size: 1.1rem;
  margin: 15px 0 0 8px;
}
.prayer-panel {
  grid-area: prayer;
  background: var(--panel);
  padding: clamp(18px, 2.2vw, 42px);
  display: flex;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.12);
  z-index: 3;
}
.layout-1 .prayer-panel,
.layout-2 .prayer-panel {
  flex-direction: column;
}
.prayer-list {
  display: flex;
  flex: 1;
}
.layout-1 .prayer-list,
.layout-2 .prayer-list {
  flex-direction: column;
  justify-content: space-evenly;
}
.prayer-time {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
}
.layout-1 .prayer-time,
.layout-2 .prayer-time {
  padding: clamp(8px, 1.2vh, 15px) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
}
.prayer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.6;
}
.prayer-time > div {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.prayer-time small {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: clamp(0.6rem, 0.75vw, 0.85rem);
  color: var(--muted);
  font-weight: 700;
}
.prayer-time strong {
  font-size: clamp(1.25rem, 1.8vw, 2.2rem);
  letter-spacing: -0.04em;
}
.next-prayer {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  padding: clamp(10px, 1.1vw, 18px);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
}
.next-prayer small {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.next-prayer strong {
  font-size: clamp(0.75rem, 0.95vw, 1rem);
  margin-top: 4px;
}
.next-prayer span {
  font-size: clamp(0.8rem, 1.1vw, 1.15rem);
  font-weight: 800;
  color: var(--accent);
  margin-top: 4px;
}
.layout-3 .prayer-panel,
.layout-4 .prayer-panel {
  align-items: center;
  padding: clamp(10px, 1.1vw, 18px) clamp(20px, 2.5vw, 45px);
  gap: clamp(20px, 3vw, 55px);
}
.layout-3 .prayer-list,
.layout-4 .prayer-list {
  justify-content: space-between;
  gap: clamp(10px, 2vw, 35px);
}
.layout-3 .prayer-time,
.layout-4 .prayer-time {
  flex: 1;
}
.layout-3 .prayer-time > div,
.layout-4 .prayer-time > div {
  display: block;
  text-align: center;
}
.layout-3 .prayer-time small,
.layout-4 .prayer-time small,
.layout-3 .prayer-time strong,
.layout-4 .prayer-time strong {
  display: block;
}
.layout-3 .prayer-time strong,
.layout-4 .prayer-time strong {
  font-size: clamp(1.1rem, 1.9vw, 2.3rem);
}
.layout-3 .next-prayer,
.layout-4 .next-prayer {
  min-width: 190px;
}
.slide-stage {
  grid-area: slide;
  position: relative;
  min-height: 0;
  background: var(--surface);
  overflow: hidden;
}
.tv-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease;
  display: grid;
  place-items: center;
}
.tv-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.welcome-slide {
  background-size: cover;
  background-position: center;
  padding: 8%;
  text-align: center;
}
.welcome-slide small,
.countdown-card > small,
.lecture-card > small {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.2em;
}
.welcome-slide h2 {
  font-size: clamp(2.2rem, 5vw, 5.8rem);
  margin: 12px 0;
}
.countdown-card,
.lecture-card {
  text-align: center;
  padding: 4%;
}
.countdown-card h2,
.lecture-card h2 {
  font-size: clamp(1.8rem, 3.8vw, 4.7rem);
  margin: 10px 0 3vh;
}
.countdown-card p,
.lecture-card p {
  color: var(--muted);
}
.lecture-card > i {
  display: block;
  font-size: clamp(2.2rem, 3.8vw, 4.7rem);
  color: var(--accent);
  margin-bottom: 15px;
}
.lecture-card p {
  font-size: clamp(0.75rem, 1.3vw, 1.4rem);
  line-height: 1.7;
  max-width: 900px;
  margin: auto;
}
.slide-progress {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 18px;
  display: flex;
  gap: 7px;
}
.slide-progress span {
  width: 24px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}
.slide-progress span.active {
  background: var(--accent);
  width: 42px;
}
.ticker-bar {
  grid-area: ticker;
  height: clamp(68px, 8.5vh, 100px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  background: var(--ticker);
  color: #fff;
}
.ticker-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(16px, 2vw, 32px);
  background: var(--accent);
  color: #10251f;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ticker-window {
  overflow: hidden;
  display: flex;
  align-items: center;
}
.ticker-track {
  white-space: nowrap;
  font-size: clamp(0.8rem, 1.15vw, 1.3rem);
  font-weight: 600;
  animation: ticker 28s linear infinite;
  padding-left: 100%;
}
.clock-box {
  min-width: clamp(145px, 13vw, 240px);
  padding: 0 clamp(16px, 2vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}
.clock-box strong {
  font-size: clamp(1.9rem, 3vw, 4rem);
  letter-spacing: -0.06em;
}
.clock-box small {
  color: var(--accent);
  font-size: clamp(0.75rem, 1.1vw, 1.25rem);
  margin: 12px 0 0 7px;
}
@keyframes ticker {
  to {
    transform: translateX(-100%);
  }
}
@media (max-width: 900px) {
  .layout-1 {
    grid-template-columns: 190px 1fr;
  }
  .layout-2 {
    grid-template-columns: 1fr 190px;
  }
  .date-block > div:first-child,
  .date-block > span {
    display: none;
  }
  .layout-3 .next-prayer,
  .layout-4 .next-prayer {
    display: none;
  }
  .ticker-label span {
    display: none;
  }
  .clock-box {
    min-width: 140px;
  }
}
