/* FLTIM.tv: Faith Life Ministries 24/7 replay channel */

:root {
  --night: #0b1327;
  --navy-deep: #0e1d40;
  --navy: #122f67;
  --navy-mid: #1a3c7e;
  --royal: #1d4fb5;
  --blue: #056fff;
  --gold: #ffc100;
  --gold-deep: #e6a900;
  --ink: #101828;
  --ink-soft: #3d4a63;
  --muted: #5f6b84;
  --line: #e2e7f1;
  --panel: #ffffff;
  --panel-soft: #f5f7fb;
  --radius: 14px;
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--gold);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: #fff;
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 70% 340px at 50% 230px, rgba(29, 79, 181, 0.55), transparent 70%),
    linear-gradient(180deg, #0c1838 0, #143276 220px, #102658 420px, var(--night) 760px);
  background-repeat: no-repeat;
  position: relative;
  overflow-x: hidden;
}

/* The supplied gradient strip, used for the top of the page only. */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 600px;
  background: url("background.jpg") repeat-x 0 0;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--gold);
  color: #000;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Masthead ---------- */

.masthead {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.topnav {
  max-width: 900px;
  margin: 0 auto;
  background: linear-gradient(180deg, #2457bd 0%, #173d8c 55%, #12306f 100%);
  border-radius: 0 0 46px 46px / 0 0 26px 26px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(255, 255, 255, 0.08);
  padding: 4px 28px 10px;
}
.topnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.topnav li + li { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.topnav a {
  display: block;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  transition: color 0.15s ease;
}
.topnav a:hover { color: var(--gold); }
.topnav .nav-give { color: var(--gold); }
.topnav .nav-give:hover { color: #ffe08a; }

.brand {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px 0 8px;
}
.brand-logo {
  grid-column: 2;
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}
.brand-text { grid-column: 3; }
.brand h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.tagline {
  margin: 4px 0 0;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 300;
  color: #dbe6ff;
}
.brand-phone {
  grid-column: 4;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9fc2ff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.brand-phone:hover { color: #fff; }
.phone-dot {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

/* ---------- White curved-top panel ---------- */

.panel {
  position: relative;
  max-width: 1240px;
  margin: 46px auto 0;
  background: var(--panel);
  color: var(--ink);
  border-radius: 0 0 14px 14px;
  padding: 6px clamp(14px, 2.6vw, 36px) 26px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}
.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -46px;
  height: 47px;
  background: var(--panel);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.panel-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  margin: -24px 0 18px;
  text-align: center;
}
.station-name {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.station-name span { color: var(--gold-deep); }
.replay-badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 11px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 193, 0, 0.25);
}
.panel-sub {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.panel-sub::before,
.panel-sub::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 48px;
  height: 1px;
  margin: 0 12px;
  background: var(--navy);
  opacity: 0.4;
}

/* ---------- Station layout ---------- */

.station {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}

/* ---------- The TV ---------- */

.tv {
  background: linear-gradient(180deg, #1b2335 0%, #0b0f1a 100%);
  border-radius: 20px;
  padding: 12px 12px 0;
  box-shadow:
    0 24px 48px rgba(11, 19, 39, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(0, 0, 0, 0.6);
}
.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
@supports not (aspect-ratio: 16 / 9) {
  .screen { height: 0; padding-top: 56.25%; }
}
.engine,
.engine iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#local-player { background: #000; object-fit: contain; }

.screen:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.screen:-webkit-full-screen { border-radius: 0; width: 100%; height: 100%; }

.screen-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(29, 79, 181, 0.55), transparent 65%),
    linear-gradient(180deg, #0f2150, #070c1a);
}
.screen-message img {
  width: clamp(56px, 11vw, 104px);
  height: auto;
  margin-bottom: 6px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}
.sm-title { margin: 0; font-size: clamp(1.05rem, 2.2vw, 1.5rem); font-weight: 700; }
.sm-text { margin: 0; max-width: 46ch; color: #c9d6f2; font-size: clamp(0.85rem, 1.5vw, 1rem); }
.sm-text a { color: var(--gold); }
.sm-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.screen-message[data-state="loading"] img { animation: tune 2.4s ease-in-out infinite; }
@keyframes tune { 50% { opacity: 0.55; transform: scale(0.96); } }

.tv-chin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 30px;
}
.chin-mark {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #8b97b3;
}
.chin-mark span { color: var(--gold); }
.chin-lamp {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a4560;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
body[data-phase="playing"] .chin-lamp { background: var(--gold); box-shadow: 0 0 8px rgba(255, 193, 0, 0.8); }

/* ---------- Buttons & controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn svg { flex: none; }

.btn-gold { background: var(--gold); color: #111; }
.btn-gold:hover:not(:disabled) { background: #ffd23f; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover:not(:disabled) { background: var(--navy-mid); }
.btn-quiet { background: var(--panel-soft); color: var(--navy); border-color: var(--line); }
.btn-quiet:hover:not(:disabled) { background: #e9eef8; border-color: #cdd6e8; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.1); }

.btn-sound { background: var(--gold); color: #111; }
.btn-sound:hover:not(:disabled) { background: #ffd23f; }
.btn-sound[aria-pressed="true"] { background: var(--panel-soft); color: var(--navy); border-color: var(--line); }
.btn-sound .ico-sound { display: none; }
.btn-sound[aria-pressed="true"] .ico-sound { display: block; }
.btn-sound[aria-pressed="true"] .ico-muted { display: none; }

#btn-play .ico-play { display: none; }
#btn-play[data-paused="true"] .ico-play { display: block; }
#btn-play[data-paused="true"] .ico-pause { display: none; }

.btn-start {
  min-height: 46px;
  padding: 10px 22px;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(230, 169, 0, 0.45);
  animation: invite 1.8s ease-in-out infinite;
}
@keyframes invite { 50% { box-shadow: 0 6px 26px rgba(230, 169, 0, 0.75); } }
.btn-return { color: var(--navy); border-color: var(--gold); background: #fff8e0; }
.btn-return:hover:not(:disabled) { background: #fff0bd; border-color: var(--gold-deep); }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.btn-fs { margin-left: auto; }

.status {
  margin: 10px 2px 0;
  min-height: 1.5em;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Side column ---------- */

.side { display: grid; gap: 16px; }

.card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card-heading {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}

.now {
  background: linear-gradient(160deg, var(--navy) 0%, #0d2253 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 28px rgba(18, 47, 103, 0.25);
}
.kicker {
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.mode-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #dfe8ff;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.75rem;
}
.now-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.now-speaker { margin: 4px 0 0; color: #c3d2f3; font-size: 0.92rem; min-height: 1.4em; }
.progress {
  position: relative;
  height: 6px;
  margin: 14px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width 0.9s linear;
}
.now-times {
  margin: 0;
  font-size: 0.82rem;
  color: #c3d2f3;
  font-variant-numeric: tabular-nums;
}
.now-times .sep { margin: 0 4px; }

.upnext-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.upnext-item {
  width: 100%;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.upnext-item:hover { border-color: #cdd6e8; box-shadow: 0 4px 14px rgba(18, 47, 103, 0.1); }
.upnext-item:focus-visible { outline: none; box-shadow: var(--focus); }
.upnext-thumb {
  position: relative;
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--navy), #0b1838);
  display: grid;
  place-items: center;
}
.upnext-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upnext-thumb img.thumb-logo { width: 34px; height: 34px; object-fit: contain; opacity: 0.9; }
.upnext-meta { display: grid; gap: 1px; min-width: 0; }
.upnext-when {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.upnext-title {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--navy);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upnext-sub { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext-hint { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }
.upnext-empty { font-size: 0.85rem; color: var(--muted); }

.pastor {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
}
.pastor img { width: 72px; height: 72px; flex: none; border-radius: 50%; }
.pastor p { margin: 0; }
.pastor-role { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-deep); }
.pastor-name { font-weight: 700; color: var(--navy); }
.pastor-links { font-size: 0.82rem; margin-top: 2px !important; }
.pastor-links a { color: var(--royal); }

.viewer-note {
  margin: 22px auto 0;
  max-width: 760px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px 30px;
  text-align: center;
  font-size: 0.82rem;
  color: #a9b8d8;
}
.site-footer p { margin: 0 0 4px; }
.site-footer strong { color: #fff; }
.site-footer address { font-style: normal; margin-bottom: 8px; }
.site-footer address span { margin: 0 6px; }
.site-footer a { color: #cfdcfa; text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .station { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side .pastor { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topnav { padding: 2px 8px 8px; border-radius: 0 0 22px 22px / 0 0 16px 16px; }
  .topnav li + li { border-left: 0; }
  .topnav a { padding: 7px 9px; font-size: 0.8rem; }
  .brand { grid-template-columns: auto 1fr; gap: 12px; padding: 14px 0 4px; }
  .brand-logo { grid-column: 1; width: 64px; height: 64px; }
  .brand-text { grid-column: 2; }
  .brand-phone { display: none; }
  .panel { margin-top: 30px; border-radius: 0; padding-left: 10px; padding-right: 10px; }
  .panel::before { top: -28px; height: 29px; }
  .panel-head { margin-top: -12px; margin-bottom: 12px; }
  .panel-sub::before, .panel-sub::after { width: 20px; margin: 0 8px; }
  .tv { padding: 6px 6px 0; border-radius: 12px; }
  .screen { border-radius: 6px; }
  .tv-chin { height: 22px; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .controls { gap: 6px; }
  .controls .btn { padding: 8px 12px; font-size: 0.85rem; }
  .btn-fs { margin-left: 0; }
}

@media (max-width: 420px) {
  .controls .btn-quiet { flex: 1 1 calc(50% - 6px); }
  .btn-start, .btn-sound, #btn-play, .btn-live { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  body::before, .topnav, .tv, .controls, .upnext, .skip-link { display: none; }
}

.site-footer .powered-by { margin-top: 16px; font-size: .82rem; }
.powered-by a { font-weight: 600; }

/* ---------- Live service ---------- */

#live-player { background: #000; object-fit: contain; }

.replay-badge[data-state="live"] { background: #b3121f; }
.replay-badge[data-state="live"] .badge-dot {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
  animation: live-pulse 1.4s ease-in-out infinite;
}
.replay-badge[data-state="connecting"] { background: var(--navy-mid); }
.replay-badge[data-state="connecting"] .badge-dot { animation: live-pulse 1s ease-in-out infinite; }
.replay-badge[data-state="live-paused"] { background: #5c1820; }
@keyframes live-pulse { 50% { opacity: 0.35; } }

.btn-live { background: #b3121f; color: #fff; }
.btn-live:hover:not(:disabled) { background: #d01826; }
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.4s ease-in-out infinite;
}

body[data-live="live"] .chin-lamp { background: #ff3b47; box-shadow: 0 0 8px rgba(255, 59, 71, 0.85); }
body[data-live="live"] .progress-fill { background: linear-gradient(90deg, #b3121f, #ff3b47); }
.screen-message[data-state="live"] { background: radial-gradient(ellipse at 50% 35%, rgba(179, 18, 31, 0.45), transparent 65%), linear-gradient(180deg, #0f2150, #070c1a); }
