:root {
  --bg-top: #13243f;
  --bg-mid: #214b68;
  --bg-bottom: #f2b76e;
  --panel: rgba(10, 20, 36, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f7f2e8;
  --text-soft: rgba(247, 242, 232, 0.76);
  --accent: #ffd27a;
  --accent-strong: #ff9d57;
  --track: rgba(255, 246, 221, 0.18);
  --fill: linear-gradient(90deg, #ffb56b 0%, #ffd27a 100%);
  --shadow: 0 24px 80px rgba(5, 12, 24, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --font-body: "Aptos", "Trebuchet MS", sans-serif;
  --font-display: "Georgia", "Times New Roman", serif;
  --font-mono: "Consolas", "Courier New", monospace;
  --timeline-gradient: linear-gradient(
    90deg,
    rgba(40, 29, 62, 0.95) 0%,
    rgba(20, 32, 64, 0.95) 22%,
    rgba(80, 121, 172, 0.95) 42%,
    rgba(244, 194, 116, 0.95) 56%,
    rgba(255, 237, 182, 0.95) 72%,
    rgba(224, 159, 98, 0.95) 88%,
    rgba(98, 63, 56, 0.95) 100%
  );
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  overscroll-behavior-y: none;
  background-color: var(--bg-top);
}

body {
  position: relative;
  color: var(--text-main);
  font-family: var(--font-body);
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  background: transparent;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 210, 122, 0.2), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(255, 157, 87, 0.14), transparent 22%),
    radial-gradient(circle at 50% 82%, rgba(255, 207, 133, 0.38), transparent 30%),
    linear-gradient(180deg, #10233d 0%, #1c4564 40%, #3e6880 64%, #e7b56f 100%);
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(transparent 0%, rgba(255, 255, 255, 0.03) 100%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 8px,
      transparent 8px,
      transparent 18px
    );
  pointer-events: none;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 48px;
}

.hero {
  padding: 18px 8px 2px;
  animation: rise-in 700ms ease-out both;
}

.eyebrow,
.card-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.summary-card h2,
.timeline-head h2,
.empty-state h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  max-width: none;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 0.98;
  white-space: nowrap;
}

.hero-copy {
  width: min(100%, 980px);
  max-width: none;
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: nowrap;
}

.hero-source {
  margin: 14px 0 0;
  color: rgba(247, 242, 232, 0.7);
  font-size: 0.98rem;
  line-height: 1.5;
}

.hero-source a {
  color: #fff0c1;
  text-decoration-color: rgba(255, 240, 193, 0.45);
  text-underline-offset: 0.18em;
}

.hero-source a:hover {
  text-decoration-color: rgba(255, 240, 193, 0.9);
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.summary-card p,
.timeline-note,
.empty-state p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.view-switcher {
  margin-top: 18px;
  animation: rise-in 820ms ease-out both;
}

.view-tablist {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(8, 18, 30, 0.42);
  box-shadow: 0 14px 34px rgba(5, 12, 24, 0.16);
  backdrop-filter: blur(14px);
}

.view-tab {
  min-width: 132px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(247, 242, 232, 0.68);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.view-tab:hover {
  color: rgba(255, 248, 234, 0.92);
}

.view-tab:focus-visible {
  outline: 2px solid rgba(255, 210, 122, 0.8);
  outline-offset: 2px;
}

.view-tab.is-active {
  background:
    linear-gradient(180deg, rgba(255, 214, 139, 0.3), rgba(255, 177, 95, 0.16)),
    rgba(255, 248, 234, 0.06);
  color: #fff4d8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 212, 0.18),
    0 10px 22px rgba(255, 176, 89, 0.16);
}

.display-view[hidden] {
  display: none;
}

.summary-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(250px, 0.72fr);
  margin-top: 16px;
}

.circular-info-grid {
  margin: 14px 0 16px;
}

.summary-card {
  min-height: 138px;
  padding: 20px 22px;
  background: rgba(10, 20, 36, 0.48);
  box-shadow: 0 10px 28px rgba(5, 12, 24, 0.14);
  border-color: rgba(255, 255, 255, 0.06);
  animation: rise-in 900ms ease-out both;
}

.summary-card h2 {
  font-size: clamp(1.2rem, 1.9vw, 1.75rem);
  margin-bottom: 10px;
}

.window-card {
  background: rgba(10, 20, 36, 0.54);
  box-shadow: 0 14px 34px rgba(5, 12, 24, 0.18);
  border-color: rgba(255, 255, 255, 0.075);
}

.window-card h2 {
  font-size: clamp(1.12rem, 1.65vw, 1.62rem);
  white-space: nowrap;
}

.window-event {
  margin: -2px 0 6px;
  color: rgba(255, 226, 154, 0.82);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.segment-card {
  background: rgba(10, 20, 36, 0.68);
  box-shadow: 0 18px 42px rgba(5, 12, 24, 0.24);
  border-color: rgba(255, 255, 255, 0.1);
}

.segment-card h2 {
  font-size: clamp(1.38rem, 2.15vw, 2.08rem);
}

.segment-card .card-hint {
  color: rgba(247, 242, 232, 0.82);
}

.optional-card {
  min-height: 138px;
  padding: 18px 20px;
  background: rgba(11, 18, 30, 0.28);
  box-shadow: 0 6px 18px rgba(5, 12, 24, 0.08);
  border-color: rgba(255, 255, 255, 0.035);
}

.optional-card .card-label {
  color: rgba(247, 242, 232, 0.54);
  margin-bottom: 12px;
}

.circular-info-card {
  min-height: 0;
  margin-inline: auto;
}

.circular-info-card .circular-copy-text {
  max-width: none;
  white-space: nowrap;
}

.circular-legend {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-label {
  margin: 0 0 10px;
  color: rgba(247, 242, 232, 0.56);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legend-grid {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(3, minmax(0, max-content));
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(247, 242, 232, 0.8);
  font-size: 0.86rem;
  line-height: 1.2;
  white-space: nowrap;
}

.legend-swatch {
  display: inline-block;
  flex: 0 0 auto;
}

.legend-swatch.is-maghrib {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 244, 212, 0.84);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 245, 220, 0.95), rgba(255, 183, 107, 0.78));
  transform: rotate(45deg);
}

.legend-swatch.is-isyak {
  width: 12px;
  height: 10px;
  border: 1px solid rgba(232, 226, 255, 0.9);
  background: #473a78;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.legend-swatch.is-subuh {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(235, 244, 255, 0.98);
  border-radius: 50%;
  background: #406390;
}

.legend-swatch.is-syuruk {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 244, 212, 0.76);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 240, 198, 0.95) 0 34%, rgba(255, 196, 109, 0.88) 35% 54%, rgba(255, 196, 109, 0) 55% 100%);
  clip-path: polygon(50% 0%, 62% 24%, 86% 14%, 76% 38%, 100% 50%, 76% 62%, 86% 86%, 62% 76%, 50% 100%, 38% 76%, 14% 86%, 24% 62%, 0% 50%, 24% 38%, 14% 14%, 38% 24%);
}

.legend-swatch.is-zohor {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 244, 212, 0.92);
  border-radius: 2px;
  background: #31557b;
}

.legend-swatch.is-asar {
  width: 12px;
  height: 11px;
  background: linear-gradient(180deg, rgba(255, 240, 198, 0.98), rgba(255, 171, 96, 0.82));
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

@media (min-width: 721px) {
  .legend-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
  }
}

.optional-prayer-list {
  display: grid;
  gap: 8px;
  justify-content: start;
}

.optional-prayer-row {
  display: grid;
  grid-template-columns: 84px auto;
  align-items: baseline;
  gap: 10px;
}

.optional-prayer-name {
  color: rgba(247, 242, 232, 0.66);
  font-size: 0.85rem;
  font-weight: 600;
}

.optional-prayer-range {
  color: rgba(247, 242, 232, 0.52);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.card-hint {
  font-size: 0.9rem;
}

.empty-state {
  margin-top: 18px;
  padding: 22px 24px;
  animation: rise-in 1050ms ease-out both;
}

code {
  font-family: var(--font-mono);
}

strong {
  color: #fff0c1;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .summary-grid {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(200px, 0.92fr);
  }

  .hero h1 {
    white-space: normal;
  }

  .hero-copy {
    white-space: normal;
  }

  .circular-info-card .circular-copy-text {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 24px;
  }

  .view-tablist {
    display: grid;
    width: 100%;
  }

  .view-tab {
    min-width: 0;
  }

  .summary-grid {
    justify-items: center;
    grid-template-columns: 1fr;
  }

  .summary-grid > .summary-card,
  .circular-info-grid > .summary-card {
    width: min(100%, 430px);
    max-width: 430px;
  }

  .optional-card {
    justify-self: center;
  }

  .circular-info-grid {
    display: grid;
    justify-items: center;
  }

  .circular-info-card {
    justify-self: center;
  }

  .circular-info-card .circular-copy-text {
    white-space: normal;
  }

  .legend-grid {
    grid-template-columns: repeat(3, minmax(0, max-content));
    gap: 8px 16px;
  }

  .panel {
    border-radius: 24px;
  }
}
