:root {
  --bg: #071410;
  --sheet: #0f221c;
  --card: #163028;
  --line: #2a4a40;
  --gold: #d4b56a;
  --gold-2: #f0d78c;
  --teal: #1f6b58;
  --text: #f4efe4;
  --muted: #b7c4be;
  --danger: #e07a6a;
  --ok: #6ec89a;
  --radius: 16px;
  --tap: 52px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  background: #040a08;
  color: var(--text);
  min-height: 100dvh;
}

.app {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 640px) {
  .app { max-width: 560px; }
}

.hero {
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(212, 181, 106, 0.22), transparent 50%),
    linear-gradient(165deg, #14352c 0%, #0b1f1a 70%, #071410 100%);
  padding: 22px 16px 26px;
  padding-top: calc(16px + env(safe-area-inset-top));
}
.hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-top img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.hero h1 {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.next-label {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.next-name {
  margin: 4px 0 0;
  font-family: Amiri, serif;
  font-size: 2.2rem;
  line-height: 1.1;
  color: var(--gold-2);
}
.next-time {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.countdown {
  margin: 6px 0 0;
  color: var(--gold);
  font-weight: 600;
}

.sheet {
  width: 100%;
  padding: 14px 12px 36px;
  display: grid;
  gap: 12px;
}

.note {
  background: #3a2a12;
  border: 1px solid #7a6230;
  color: #f6e7b8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.credits, .credits-list { font-size: 0.8rem; color: var(--muted); }
.credits-list { padding-left: 18px; }
.credits a, .credits-list a { color: var(--gold-2); }
.credits code, .credits-list code {
  color: var(--gold-2);
  font-size: 0.78rem;
}

.install-card { border-color: #4a6a3a; }
.offline-card { border-color: var(--gold); }
.icon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.icon-preview img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.icon-preview strong { display: block; font-size: 1.15rem; }
.icon-preview span { color: var(--muted); font-size: 0.85rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.btn {
  min-height: var(--tap);
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--gold); color: #1a1406; }
.btn-ghost {
  background: transparent;
  color: var(--gold-2);
  border: 1.5px solid var(--gold);
}
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

.ios-steps {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--sheet);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.tab {
  min-height: var(--tap);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  background: var(--teal);
  color: #fff;
}

.row { display: flex; flex-wrap: wrap; gap: 8px; }
.field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.field input, .field select {
  min-height: 48px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1f1a;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.city-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.city-results li button {
  width: 100%;
  text-align: left;
  background: #0d1f1a;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  min-height: var(--tap);
  font: inherit;
  cursor: pointer;
}
.city-results li:last-child button { border-bottom: 0; }

.prayer-list, .azan-picker {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.prayer-row, .azan-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  background: #10241e;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.prayer-row.next {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.prayer-row .name {
  font-family: Amiri, serif;
  font-size: 1.2rem;
}
.prayer-row .time { font-weight: 700; }
.prayer-row .sub, .azan-row .sub {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: "Source Sans 3", sans-serif;
}
.toggle {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: #355248;
  position: relative;
  cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--ok); }
.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.toggle[aria-pressed="true"]::after { transform: translateX(20px); }

.azan-row { grid-template-columns: 1fr auto auto; }
.azan-row.selected { border-color: var(--gold); }
.mini {
  min-height: var(--tap);
  min-width: 72px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1f1a;
  color: var(--gold-2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ring {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 8, 0.94);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  z-index: 20;
}
.ring[hidden] { display: none; }
.ring-kicker { color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.ring-name { font-family: Amiri, serif; font-size: 3rem; margin: 8px 0; color: var(--gold-2); }
.ring-sub { color: var(--muted); }
.ring .actions { justify-content: center; }

.upload input { margin-top: 6px; color: var(--text); width: 100%; }

@media (max-width: 639px) {
  .actions { flex-direction: column; }
  .actions .btn,
  .row .btn,
  .btn-block { width: 100%; }
  .row { flex-direction: column; }
  .azan-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label label"
      "play use";
  }
  .azan-row > div:first-child { grid-area: label; }
  .azan-row .mini { grid-area: play; width: 100%; }
  .azan-row .btn { grid-area: use; width: 100%; }
  .prayer-row { grid-template-columns: 1fr auto auto; }
  .tab { min-height: var(--tap); font-size: 1rem; }
}
