@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Symbols+2&display=swap');

:root{
  --bg: #000000;
  --panel: rgba(255,255,255,0.04);
  --panel2: rgba(255,255,255,0.03);
  --stroke: rgba(212,175,55,0.22);
  --stroke2: rgba(212,175,55,0.14);
  --gold: rgba(212,175,55,0.94);
  --gold2: rgba(212,175,55,0.78);
  --muted: rgba(212,175,55,0.62);
  --shadow: 0 14px 40px rgba(0,0,0,0.60);

  --font-display: "Cinzel", serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-symbol: "Noto Sans Symbols 2", "Segoe UI Symbol", "Apple Symbols", sans-serif;
}

*{
  box-sizing: border-box;
}

html,
body{
  height: 100%;
}

body{
  margin: 0;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  font-family: var(--font-body);
  color: rgba(255,255,255,0.90);
}

.card{
  width: min(720px, 100%);
  height: calc(
    100svh
    - (18px + env(safe-area-inset-top))
    - (18px + env(safe-area-inset-bottom))
  );
  max-height: calc(
    100svh
    - (18px + env(safe-area-inset-top))
    - (18px + env(safe-area-inset-bottom))
  );
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(1200px 700px at 50% -200px, rgba(212,175,55,0.12), rgba(0,0,0,0.0) 55%),
    rgba(255,255,255,0.02);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.topbar{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: clamp(18px, 4.8vw, 22px);
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}

.iconBtn{
  appearance: none;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.35);
  color: var(--gold);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.title{
  margin-top: 10px;
  text-align: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 8.5vw, 40px);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: none;
  font-variant: small-caps;
  flex: 0 0 auto;
}

.mainPanel{
  margin-top: 10px;
  padding: 12px 12px 10px;
  border-radius: 18px;
  border: 1px solid var(--stroke2);
  background: var(--panel);
  line-height: 1.35;
  font-size: clamp(20px, 5.2vw, 24px);
  text-align: center;
  flex: 0 0 auto;
  min-height: 0;
}

/* Zodiac glyph styling */
.zGlyph{
  font-family: var(--font-symbol);
  color: var(--gold);
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
  transform: translateY(0.03em);
}

/* Sun/Moon glyph styling */
.pGlyph{
  font-family: var(--font-symbol);
  color: var(--gold);
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
  transform: translateY(0.06em);
}

.anno{
  margin-top: 10px;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tarot{
  margin-top: 6px;
  color: rgba(255,255,255,0.92);
}

.ve{
  margin-top: 6px;
  color: rgba(255,255,255,0.80);
}

.moon{
  margin-top: 10px;
  color: rgba(255,255,255,0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.moonSub{
  margin-top: 2px;
  color: rgba(255,255,255,0.80);
  font-size: 13px;
}

.reshTitle{
  margin-top: 12px;
  text-align: center;
  color: var(--gold2);
  letter-spacing: 0.03em;
  font-size: 14px;
  font-family: var(--font-display);
  flex: 0 0 auto;
}

.reshGrid{
  margin-top: 10px;
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.reshItem{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: var(--panel2);
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}

.reshItem:active{
  transform: translateY(1px);
}

.reshLeft{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold2);
}

.reshItem.next{
  border-color: rgba(212,175,55,0.38);
  box-shadow: 0 0 0 1px rgba(212,175,55,0.10), 0 0 22px rgba(212,175,55,0.08);
}

.countdown{
  margin-top: 12px;
  text-align: center;
  color: var(--gold2);
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  flex: 0 0 auto;
}

.footer{
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 4px;
  flex: 0 0 auto;
}

/* subtle gold shimmer */
.card.shimmer::after{
  content:"";
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    120deg,
    rgba(0,0,0,0) 35%,
    rgba(212,175,55,0.10) 48%,
    rgba(212,175,55,0.18) 50%,
    rgba(212,175,55,0.10) 52%,
    rgba(0,0,0,0) 65%
  );
  transform: translateX(-40%);
  animation: goldShimmer 1.15s ease-out forwards;
  pointer-events: none;
}

@keyframes goldShimmer{
  to { transform: translateX(40%); }
}

/* iOS readability bump */
@supports (-webkit-touch-callout: none) {
  body { -webkit-text-size-adjust: 100%; }
  .card { color: rgba(212,175,55,0.96); }
}

/* =========================
   Resh modal
   ========================= */
.modal{
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

.modal.isOpen{
  display: block;
}

.modalBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.68);
}

.modalSheet{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  width: min(720px, calc(100vw - 24px));
  height: min(94svh, calc(100svh - 24px));
  max-height: min(94svh, calc(100svh - 24px));
  border: 1px solid var(--stroke);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  background: rgba(0,0,0,0.94);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modalClose{
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.55);
  color: var(--gold);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modalMedia{
  position: relative;
  flex: 0 0 auto;
  height: min(30svh, 260px);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
  background-color: #000;
}

.modalMedia::after{
  content:"";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.10),
    rgba(0,0,0,0.50),
    rgba(0,0,0,0.92)
  );
}

.modalContent{
  padding: 14px 16px 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modalKicker{
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.modalTitle{
  margin: 6px 0 10px;
  font-size: clamp(22px, 6vw, 28px);
  color: var(--gold);
  font-family: var(--font-display);
  flex: 0 0 auto;
}

.modalText{
  color: rgba(255,255,255,0.90);
  font-size: clamp(16px, 4.6vw, 18px);
  line-height: 1.5;
  white-space: normal;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  padding-right: 10px;
  -webkit-overflow-scrolling: touch;
}

/* Desktop/tablet: image beside text */
@media (min-width: 560px){
  .modalSheet{
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border-radius: 20px;
    height: min(88svh, 760px);
    max-height: min(88svh, 760px);
    display: grid;
    grid-template-columns: 42% 58%;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .modalMedia{
    height: 100%;
    min-height: 0;
  }

  .modalContent{
    height: 100%;
    min-height: 0;
  }

  .modalText{
    min-height: 0;
    height: 0;
    max-height: none;
  }
}
.weekdayGlyph{
  color: inherit;
  font-family: var(--font-symbol), var(--font-display), serif;
  font-size: 1em;
  font-weight: inherit;
  line-height: 1;
  vertical-align: baseline;
  display: inline-block;
  transform: translateY(-0.02em);
  margin-right: 0.18em;
}