:root {
  --red: #a3211c;
  --red-bright: #e8301f;
  --red-dark: #7a1814;
  --yellow: #ffcd02;
  --amber: #ffb317;
  --cream: #f7f4f1;
  --cream-line: #f0ece8;
  --ink: #1a1a1a;
  --white: #ffffff;
  --grad-red: linear-gradient(135deg, var(--red-bright) 0%, var(--red) 100%);
  --font-display: "Caprasimo", "Cooper Black", Georgia, serif;
  --font-body: "Poppins", system-ui, sans-serif;
  --app-width: 430px; /* lebar tampilan mobile, dipakai juga di desktop */
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--red-dark);
}

/* Kanvas mobile: di desktop tetap selebar HP, di tengah layar */
.poster {
  position: relative;
  width: 100%;
  max-width: var(--app-width);
  /* pas satu layar penuh, isi menyesuaikan tinggi layar */
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  margin: 0 auto;
  padding-bottom: clamp(12px, 2.4vh, 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--cream);
  /* motif titik halus */
  background-image: radial-gradient(var(--cream-line) 1.5px, transparent 1.6px);
  background-size: 18px 18px;
}

@media (min-width: 480px) {
  .poster { box-shadow: 0 10px 36px rgba(100, 20, 20, 0.45); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  flex: none;
  text-align: center;
  padding: clamp(18px, 3.4vh, 34px) 20px clamp(18px, 3vh, 28px);
  color: var(--white);
  background:
    radial-gradient(rgba(255, 255, 255, 0.07) 2px, transparent 2.2px) 0 0 / 22px 22px,
    linear-gradient(160deg, var(--red-bright) 0%, var(--red) 100%);
  border-radius: 0 0 28px 28px;
  box-shadow: 0 6px 0 var(--yellow), 0 10px 24px rgba(163, 33, 28, 0.25);
  margin-bottom: clamp(16px, 3vh, 30px);
}

.title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, min(6.2vh, 10vw), 3rem); /* 10vw: tidak menabrak tombol musik di HP sempit */
  line-height: 1.1;
  white-space: nowrap;
  color: var(--white);
  /* outline + bayangan tebal */
  text-shadow:
    3px 0 0 var(--red-dark), -3px 0 0 var(--red-dark),
    0 3px 0 var(--red-dark), 0 -3px 0 var(--red-dark),
    2px 2px 0 var(--red-dark), -2px 2px 0 var(--red-dark),
    2px -2px 0 var(--red-dark), -2px -2px 0 var(--red-dark),
    0 6px 0 var(--red-dark);
}

.badge {
  display: inline-block;
  margin: clamp(6px, 1.2vh, 12px) 0 0;
  padding: 5px 16px;
  font-weight: 800;
  font-size: clamp(0.7rem, 1.8vh, 0.85rem);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red-dark);
  background: var(--yellow);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(122, 24, 20, 0.35);
}

/* ---------- Tombol musik (pojok kanan atas) ---------- */
.music {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--red-dark);
  background: var(--yellow);
  border: 2px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(122, 24, 20, 0.35);
  cursor: pointer;
}
.music:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }
.music__icon { width: 16px; height: 16px; fill: currentColor; }
.music__icon--stop,
.music[aria-pressed="true"] .music__icon--play { display: none; }
.music[aria-pressed="true"] .music__icon--stop { display: block; }

/* denyut halus saat musik diputar */
.music[aria-pressed="true"] { animation: musik-denyut 1.6s ease-out infinite; }
@keyframes musik-denyut {
  0%   { box-shadow: 0 0 0 0 rgba(255, 205, 2, 0.7), 0 2px 8px rgba(122, 24, 20, 0.35); }
  100% { box-shadow: 0 0 0 12px rgba(255, 205, 2, 0), 0 2px 8px rgba(122, 24, 20, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .music[aria-pressed="true"] { animation: none; }
}

/* ---------- Dropdown jenis jadwal (details/summary, tanpa select bawaan) ---------- */
.hero { z-index: 5; } /* menu tampil di atas kartu */

.dd {
  position: relative;
  display: inline-block;
  margin-top: clamp(6px, 1.2vh, 12px);
}

.dd__btn {
  margin: 0;
  padding-right: 34px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.dd__btn::-webkit-details-marker { display: none; }
.dd__btn:focus-visible { box-shadow: 0 0 0 3px var(--white), 0 2px 8px rgba(122, 24, 20, 0.35); }

/* panah */
.dd__btn::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
}
.dd[open] .dd__btn::after { transform: translateY(-25%) rotate(-135deg); }

.dd__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(122, 24, 20, 0.3);
  text-align: left;
}
/* segitiga kecil penunjuk */
.dd__menu::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--white);
  transform: translateX(-50%) rotate(45deg);
}

.dd__menu a {
  position: relative;
  display: block;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: var(--red-dark);
  border-radius: 10px;
  outline: none;
}
.dd__menu a:focus-visible { box-shadow: inset 0 0 0 2px var(--red); }
.dd__menu a[aria-current="page"] {
  color: var(--white);
  background: var(--grad-red);
}

/* Keterangan bulan (Piket Sabtu) */
.periode {
  margin: clamp(6px, 1vh, 10px) 0 0;
  font-size: clamp(0.72rem, 1.8vh, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- Halaman 404 ---------- */
.notfound {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 24px;
  text-align: center;
  font-weight: 500;
}
.notfound p { margin: 0; color: #4a3a35; }
.notfound__btn {
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--white);
  background: var(--grad-red);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(163, 33, 28, 0.35);
}

/* ---------- Grid hari ---------- */
.grid {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-inline: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(0, 1fr); /* jumlah baris mengikuti jumlah kartu */
  column-gap: 14px;
  row-gap: clamp(10px, 2.2vh, 22px);
}

.day {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.day__name {
  position: relative;
  z-index: 2;
  flex: none;
  margin: 0 0 -13px;
  padding: 4px 18px;
  font-weight: 800;
  font-size: clamp(0.75rem, 2vh, 0.9rem);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white);
  background: var(--grad-red);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(163, 33, 28, 0.35);
}

.day__card {
  list-style: none;
  margin: 0;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: clamp(18px, 2.8vh, 24px) 10px clamp(8px, 1.4vh, 12px);
  background: var(--white);
  border: 1px solid var(--cream-line);
  border-top: 4px solid var(--yellow);
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 0.8vh, 7px);
  counter-reset: slot;
}

/* Kartu yang sedang berjalan (hari ini / Sabtu ini) */
.day--now .day__card {
  border-color: var(--red);
  border-top-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 205, 2, 0.6), 0 6px 20px rgba(163, 33, 28, 0.2);
}
.day__now {
  position: absolute;
  z-index: 3;
  top: -6px;
  right: -4px;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--red-dark);
  background: var(--yellow);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(122, 24, 20, 0.3);
}

.day__card li {
  flex: 1 1 0;
  min-height: 18px;
  max-height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 4px;
  background: var(--cream);
  border-radius: 8px;
  font-size: clamp(0.72rem, 1.8vh, 0.85rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  counter-increment: slot;
}

/* Piket Sabtu: kartu lebih tinggi (2 baris), isi diperbesar */
.grid[data-jenis="sabtu"] .day__card { gap: clamp(6px, 1.2vh, 10px); }
.grid[data-jenis="sabtu"] .day__card li {
  max-height: 44px;
  font-size: clamp(0.8rem, 2.1vh, 0.95rem);
}

.day__card .day__date {
  flex: none;
  min-height: 0;
  justify-content: center;
  padding: 0;
  background: none;
  font-size: clamp(0.68rem, 1.7vh, 0.78rem);
  font-weight: 600;
  color: var(--red);
  counter-increment: none;
}
.day__card .day__date::before { content: none; }

/* nomor urut kecil di tiap baris */
.day__card li::before {
  content: counter(slot);
  flex: none;
  display: grid;
  place-items: center;
  height: min(1.6em, calc(100% - 4px));
  aspect-ratio: 1;
  font-size: 0.7em;
  line-height: 1;
  font-weight: 700;
  color: var(--red);
  background: var(--white);
  border: 1px solid var(--cream-line);
  border-radius: 50%;
}

/* ---------- Quote ---------- */
.quote {
  flex: none;
  margin: clamp(12px, 2.6vh, 28px) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(7px, 1.4vh, 12px) 12px;
  background: var(--grad-red);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(163, 33, 28, 0.35);
}

.quote p {
  margin: 0;
  flex: 1;
  text-align: center;
  font-weight: 500;
  font-size: clamp(0.72rem, 1.8vh, 0.85rem);
  line-height: 1.4;
  white-space: pre-line; /* baris baru dari data quote */
  color: var(--white);
}

.quote__pin {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--white);
}

