:root {
  --blue-950: #032d55;
  --blue-900: #00477d;
  --blue-800: #075f9f;
  --gold: #b5aa72;
  --ink: #111820;
  --muted: #4f6474;
  --paper: #ffffff;
  --line: #d6e7ef;
  --shadow: rgba(0, 47, 84, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 83, 140, 0.12), transparent 22rem),
    radial-gradient(circle at 90% 15%, rgba(181, 170, 114, 0.16), transparent 24rem),
    linear-gradient(180deg, #eef8fb 0%, #f7fbfd 100%);
  font-family: Arial, Helvetica, sans-serif;
}

.toolbar {
  width: min(1050px, calc(100% - 32px));
  margin: 24px auto 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(3, 45, 85, 0.12);
}

.toolbar-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.toolbar-heading p,
.toolbar-heading h1 {
  margin: 0;
}

.toolbar-heading p {
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.toolbar-heading h1 {
  color: var(--blue-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.controls {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr auto auto;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--blue-950);
  font-size: 0.86rem;
  font-weight: 800;
}

select,
input,
button {
  min-height: 43px;
  border-radius: 12px;
  font: inherit;
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

button {
  border: 0;
  padding: 0 18px;
  background: var(--blue-900);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:last-child {
  background: var(--gold);
}

button:hover {
  filter: brightness(1.05);
}

.rule-summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.poster {
  position: relative;
  container-type: inline-size;
  width: min(1050px, calc(100% - 32px));
  aspect-ratio: 851 / 1203;
  margin: 0 auto 44px;
  background: url("assets/background.png") center / contain no-repeat;
  filter: drop-shadow(0 24px 48px rgba(3, 45, 85, 0.20));
}

.poster-layer {
  position: absolute;
  inset: 0;
}

.poster-logo {
  position: absolute;
  top: 8.85%;
  left: 50%;
  width: 10.9%;
  transform: translateX(-50%);
  border-radius: 50%;
}

.poster-title-block {
  position: absolute;
  top: 19.05%;
  left: 13%;
  width: 74%;
  text-align: center;
}

.poster-main-title {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-size: 5.65cqw;
  font-weight: 800;
  line-height: 0.97;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.poster-city-title {
  margin-top: 1.1%;
  color: var(--gold);
  font-size: 24px;
  font-size: 2.85cqw;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.poster-meta {
  position: absolute;
  top: 30.4%;
  left: 12.2%;
  width: 75.6%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #111;
  font-size: 12px;
  font-size: 1.42cqw;
  line-height: 1.15;
}

.poster-meta > :last-child {
  text-align: right;
}

.table-area {
  position: absolute;
  top: 32.55%;
  left: 12.15%;
  width: 75.7%;
}

#prayerTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  border: 2px solid var(--blue-950);
  color: #0b1118;
  font-size: 10.2px;
  font-size: 1.2cqw;
  line-height: 1.05;
}

#prayerTable th,
#prayerTable td {
  border: 1px solid var(--blue-950);
  text-align: center;
  white-space: nowrap;
  padding: 2.35px 2px;
  padding: 0.276cqw 0.235cqw;
}

#prayerTable thead th,
#prayerTable .month-break th {
  background: var(--blue-950);
  color: #fff;
  font-weight: 800;
}

#prayerTable thead th:nth-child(1),
#prayerTable tbody td:nth-child(1),
#prayerTable .month-break th:nth-child(1) { width: 7.3%; }
#prayerTable thead th:nth-child(2),
#prayerTable tbody td:nth-child(2),
#prayerTable .month-break th:nth-child(2) { width: 13.2%; }
#prayerTable thead th:nth-child(3),
#prayerTable tbody td:nth-child(3),
#prayerTable .month-break th:nth-child(3) { width: 6.3%; }

#prayerTable .month-break td {
  background: #fff;
  border-left-color: var(--blue-950);
  border-right-color: var(--blue-950);
}

#prayerTable td.extreme-time {
  font-weight: 800;
}

.duas {
  position: absolute;
  top: 79.3%;
  left: 12.9%;
  width: 63.8%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  color: #0b0e11;
}

.duas article {
  min-width: 0;
  padding: 0 12px 0 0;
  padding-right: 1.42cqw;
}

.duas article + article {
  border-left: 2px solid var(--blue-900);
  padding: 0 0 0 12px;
  padding-left: 1.42cqw;
}

.duas h2 {
  margin: 0 0 5px;
  color: #111;
  font-size: 15px;
  font-size: 1.76cqw;
  line-height: 1.1;
  font-weight: 900;
}

.duas p {
  margin: 2px 0;
  font-size: 12.3px;
  font-size: 1.44cqw;
  line-height: 1.15;
}

.duas .arabic {
  margin-top: 5px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 19px;
  font-size: 2.23cqw;
  line-height: 1.22;
}

@media (max-width: 760px) {
  .toolbar {
    width: min(100% - 18px, 1050px);
    margin-top: 12px;
    padding: 14px;
  }

  .toolbar-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .controls button {
    min-height: 40px;
  }

  .poster {
    width: min(100% - 10px, 1050px);
    margin-bottom: 22px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 100%;
    min-height: 100%;
    background: #fff;
  }

  .toolbar {
    display: none;
  }

  .poster {
    width: 100vw;
    max-width: none;
    margin: 0;
    filter: none;
    box-shadow: none;
  }
}
