:root {
  --navy-950: #020a16;
  --navy-900: #06172c;
  --navy-800: #0b2443;
  --gold-100: #fff0b7;
  --gold-300: #f6d374;
  --gold-500: #d7a437;
  --gold-700: #9d6a18;
  --text: #fffdf6;
  --muted: #b8c6de;
  --panel: rgba(4, 19, 41, 0.88);
  --line: rgba(243, 202, 105, 0.42);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--navy-950);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(241, 195, 84, 0.28), transparent 29rem),
    radial-gradient(circle at 18% 76%, rgba(32, 83, 139, 0.26), transparent 22rem),
    linear-gradient(180deg, #12345e 0%, #06172c 38%, #020a16 100%);
}

button, a, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
}

.brand-header {
  position: relative;
  overflow: hidden;
  height: clamp(178px, 28svh, 250px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  background: #081b34;
}

.brand-link, .brand-image {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-image {
  object-fit: cover;
  object-position: center 43%;
  transform: scale(1.02);
}

.brand-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(2, 10, 22, 0.82));
}

.live-badge {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(3, 14, 31, 0.78);
  color: var(--gold-100);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  backdrop-filter: blur(8px);
}

.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e63c3c;
  box-shadow: 0 0 12px rgba(230, 60, 60, .9);
}

.player-panel,
.prayer-card,
.announcement-card,
.link-grid {
  margin-top: 12px;
}

.player-panel,
.prayer-card,
.announcement-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .25);
  backdrop-filter: blur(12px);
}

.player-panel { padding: 15px 16px 14px; }

.player-controls {
  display: grid;
  grid-template-columns: 1fr 112px 1fr;
  align-items: center;
  gap: 10px;
}

.control-button,
.play-button,
.action-button,
.gold-button,
.outline-button,
.link-button,
.install-button,
.timer-grid button,
.dialog-secondary {
  border: 0;
  cursor: pointer;
}

.control-button {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--gold-300);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.pause-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: block;
}
.pause-icon::before,
.pause-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 7px;
  border-radius: 3px;
  background: currentColor;
}
.pause-icon::before { left: 3px; }
.pause-icon::after { right: 3px; }

.clock-icon { font-size: 28px; line-height: 1; }

.play-button {
  width: 92px;
  height: 92px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #07162a;
  background: radial-gradient(circle at 36% 27%, #fff5c6 0%, #f5ce69 42%, #c88b22 100%);
  box-shadow: 0 0 0 5px rgba(241, 199, 98, .18), 0 0 28px rgba(241, 199, 98, .42), inset 0 2px 3px rgba(255,255,255,.7);
  transition: transform .16s ease;
}
.play-button:active { transform: scale(.96); }

.play-triangle {
  width: 0;
  height: 0;
  margin-left: 7px;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 27px solid #07162a;
}

.player-status {
  min-height: 18px;
  margin: 8px 0 11px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(244, 206, 112, .32);
  border-radius: 14px;
  color: var(--gold-100);
  background: rgba(255, 255, 255, .035);
  font-weight: 700;
}
.action-button span:first-child { font-size: 19px; }

.prayer-card { padding: 18px 17px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; }
.section-icon { font-size: 29px; line-height: 1; }
.section-heading h1 {
  margin: 0 0 4px;
  color: var(--gold-300);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 500;
}
.section-heading p { margin: 0; color: var(--muted); line-height: 1.4; font-size: 14px; }

.prayer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.gold-button,
.outline-button,
.link-button,
.install-button,
.dialog-secondary {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 800;
}
.gold-button {
  color: #06172c;
  background: linear-gradient(135deg, #fff0ad, #d7a437);
  box-shadow: 0 8px 20px rgba(215, 164, 55, .18);
}
.outline-button,
.dialog-secondary {
  color: var(--gold-100);
  border: 1px solid rgba(244, 206, 112, .48);
  background: rgba(255, 255, 255, .025);
}

.announcement-card {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  border-left: 4px solid var(--gold-500);
}
.announcement-icon { font-size: 27px; }
.announcement-card p { margin: 0; color: #f1f4fa; font-size: 14px; line-height: 1.45; }

.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.055);
  font-size: 13px;
}
.link-button span:first-child { font-size: 18px; }

.install-button {
  width: 100%;
  margin-top: 10px;
  color: var(--gold-100);
  border: 1px dashed rgba(244, 206, 112, .35);
  background: transparent;
}
.install-hidden { display: none !important; }

.app-dialog {
  width: min(calc(100% - 28px), 480px);
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 20px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #071a33;
  box-shadow: 0 28px 90px rgba(0,0,0,.65);
}
.app-dialog::backdrop { background: rgba(0, 5, 14, .78); backdrop-filter: blur(5px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-header h2 { margin: 0; color: var(--gold-300); font-family: Georgia, serif; font-weight: 500; }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.08); font-size: 25px; cursor: pointer; }
.app-dialog > form > p, .app-dialog > p { color: var(--muted); }
.timer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 16px 0 11px; }
.timer-grid button { min-height: 47px; border-radius: 12px; color: #07162a; background: linear-gradient(135deg, #fff0ad, #d7a437); font-weight: 800; }
.dialog-secondary { width: 100%; }

.app-dialog label { display: block; margin: 14px 0; color: var(--gold-100); font-size: 14px; font-weight: 700; }
.app-dialog input[type="text"], .app-dialog textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  outline: none;
  background: rgba(255,255,255,.06);
}
.app-dialog textarea { resize: vertical; }
.check-row { display: flex !important; align-items: flex-start; gap: 9px; color: #e7edf8 !important; font-weight: 400 !important; }
.check-row input { margin-top: 2px; accent-color: var(--gold-500); }
.full-width { width: 100%; }
.form-message { min-height: 18px; margin: 10px 0 0; color: var(--gold-300) !important; font-size: 13px; }
.motives-list { margin-top: 14px; color: var(--muted); line-height: 1.5; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(255, 222, 133, .82);
  outline-offset: 3px;
}

@media (min-width: 720px) {
  .app-shell { padding-top: 24px; padding-bottom: 34px; }
}

@media (max-width: 380px) {
  .app-shell { padding-left: 9px; padding-right: 9px; }
  .brand-header { height: 164px; }
  .player-controls { grid-template-columns: 1fr 96px 1fr; }
  .play-button { width: 82px; height: 82px; }
  .prayer-actions, .link-grid { grid-template-columns: 1fr; }
}

@media (display-mode: standalone) {
  #installButton { display: none !important; }
}


.motive-item {
  padding: 13px 14px;
  border: 1px solid rgba(244, 206, 112, .26);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  line-height: 1.5;
}
.motive-item + .motive-item { margin-top: 10px; }
