:root {
  --royal: #0b3b8f;
  --royal2: #062654;

  --muted: rgba(247, 251, 255, 0.78);
  --stroke: rgba(255, 255, 255, 0.18);
  --text: #f7fbff;

  --flame: #ffd27d;
  --flameHot: #fff7cc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1100px 700px at 15% 0%, rgba(69, 155, 255, 0.45) 0%, transparent 62%),
    radial-gradient(900px 600px at 85% 15%, rgba(200, 230, 255, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, var(--royal), var(--royal2));
  overflow-x: hidden;
}

/* Twinkle stars overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 18%, rgba(255,255,255,.55) 55%, transparent 58%),
    radial-gradient(1px 1px at 31% 12%, rgba(255,255,255,.45) 55%, transparent 58%),
    radial-gradient(2px 2px at 67% 20%, rgba(255,255,255,.50) 55%, transparent 58%),
    radial-gradient(1px 1px at 86% 40%, rgba(255,255,255,.35) 55%, transparent 58%),
    radial-gradient(2px 2px at 22% 62%, rgba(255,255,255,.40) 55%, transparent 58%),
    radial-gradient(1px 1px at 54% 72%, rgba(255,255,255,.30) 55%, transparent 58%),
    radial-gradient(2px 2px at 79% 80%, rgba(255,255,255,.35) 55%, transparent 58%);
  opacity: 0.65;
  animation: twinkle 4.5s ease-in-out infinite;
  filter: blur(0.2px);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 0.80; transform: translateY(-2px); }
}

/* Premium composed pattern overlay */
body::after{
  content:"";
  position:fixed;
  inset:-60px;
  pointer-events:none;
  opacity:0.16;
  mix-blend-mode:screen;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700' viewBox='0 0 700 700'%3E%3Cdefs%3E%3CradialGradient id='coin' cx='35%25' cy='30%25'%3E%3Cstop offset='0' stop-color='%23fff4c6'/%3E%3Cstop offset='0.55' stop-color='%23ffd277'/%3E%3Cstop offset='1' stop-color='%23b77a1f'/%3E%3C/radialGradient%3E%3ClinearGradient id='silver' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23f2f6ff'/%3E%3Cstop offset='1' stop-color='%23aeb8c8'/%3E%3C/linearGradient%3E%3Cfilter id='soft' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeGaussianBlur stdDeviation='0.2'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23soft)'%3E%3Cg fill='%23ffffff' fill-opacity='0.55'%3E%3Ccircle cx='78' cy='88' r='2'/%3E%3Ccircle cx='612' cy='126' r='1.8'/%3E%3Ccircle cx='540' cy='604' r='2.2'/%3E%3Ccircle cx='132' cy='584' r='1.7'/%3E%3Cpath d='M340 64 L350 96 L384 96 L356 114 L366 146 L340 126 L314 146 L324 114 L296 96 L330 96 Z'/%3E%3Cpath d='M640 370 L648 394 L674 394 L652 408 L660 432 L640 416 L620 432 L628 408 L606 394 L632 394 Z'/%3E%3Cpath d='M110 360 L118 384 L144 384 L122 398 L130 422 L110 406 L90 422 L98 398 L76 384 L102 384 Z'/%3E%3C/g%3E%3Cg transform='translate(120 160)'%3E%3Ccircle cx='0' cy='0' r='38' fill='url(%23coin)'/%3E%3Ccircle cx='0' cy='0' r='33' fill='none' stroke='%23fff7d9' stroke-opacity='0.85' stroke-width='3'/%3E%3Ccircle cx='0' cy='0' r='38' fill='none' stroke='%23835a12' stroke-opacity='0.5' stroke-width='2'/%3E%3Ctext x='0' y='12' font-family='Arial' font-size='34' text-anchor='middle' fill='%238a5d13' fill-opacity='0.82'%3E%E2%82%AA%3C/text%3E%3C/g%3E%3Cg transform='translate(560 520) scale(0.95)'%3E%3Ccircle cx='0' cy='0' r='38' fill='url(%23coin)'/%3E%3Ccircle cx='0' cy='0' r='33' fill='none' stroke='%23fff7d9' stroke-opacity='0.85' stroke-width='3'/%3E%3Ccircle cx='0' cy='0' r='38' fill='none' stroke='%23835a12' stroke-opacity='0.5' stroke-width='2'/%3E%3Ctext x='0' y='12' font-family='Arial' font-size='34' text-anchor='middle' fill='%238a5d13' fill-opacity='0.82'%3E%E2%82%AA%3C/text%3E%3C/g%3E%3Cg transform='translate(520 280) rotate(-10)'%3E%3Cpath d='M0 -44 L16 -18 L0 0 L-16 -18 Z' fill='url(%23silver)' stroke='%23ffffff' stroke-opacity='0.55'/%3E%3Cpath d='M-34 10 L0 -8 L34 10 L18 62 L-18 62 Z' fill='url(%23silver)' stroke='%23ffffff' stroke-opacity='0.5'/%3E%3Cpath d='M0 62 L7 86 L0 96 L-7 86 Z' fill='%2393a0b3'/%3E%3Ctext x='0' y='44' font-family='Arial' font-size='22' text-anchor='middle' fill='%232a3340' fill-opacity='0.72'%3E%D7%92%3C/text%3E%3C/g%3E%3Cg transform='translate(190 430) rotate(14) scale(0.78)'%3E%3Cpath d='M0 -44 L16 -18 L0 0 L-16 -18 Z' fill='url(%23silver)' stroke='%23ffffff' stroke-opacity='0.55'/%3E%3Cpath d='M-34 10 L0 -8 L34 10 L18 62 L-18 62 Z' fill='url(%23silver)' stroke='%23ffffff' stroke-opacity='0.5'/%3E%3Cpath d='M0 62 L7 86 L0 96 L-7 86 Z' fill='%2393a0b3'/%3E%3Ctext x='0' y='44' font-family='Arial' font-size='22' text-anchor='middle' fill='%232a3340' fill-opacity='0.72'%3E%D7%A0%3C/text%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-repeat:repeat;
  background-size: 760px 760px;
  animation: floaty 26s ease-in-out infinite;
  transform: translateZ(0);
}

@keyframes floaty{
  0%,100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(-26px, 18px, 0); }
}

/* -----------------------------
   Music Player
------------------------------ */
.music-player{
  position: fixed;
  top: 14px;
  right: 14px;
  width: 320px;
  max-width: calc(100vw - 28px);
  z-index: 1000;

  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(5, 16, 35, 0.45);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.35);
  overflow: hidden;
  transition: transform 180ms ease, width 180ms ease;
}

.player-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px 10px;
}

.player-title{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.player-badge{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.player-meta{ min-width:0; }
.player-now{
  font-size: 11px;
  letter-spacing: 0.3px;
  color: rgba(247,251,255,0.70);
}
.player-track{
  font-size: 13px;
  font-weight: 750;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls{
  display:flex;
  gap: 8px;
}

.pbtn{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  border-radius: 999px;
  height: 34px;
  width: 34px;
  cursor:pointer;
  display:grid;
  place-items:center;
}

.pbtn:hover{ background: rgba(255,255,255,0.12); }

.pbtn-primary{
  width: 46px;
  font-weight: 800;
  background: rgba(255,255,255,0.14);
}

.pbtn-min{
  width: 34px;
  font-weight: 900;
}

.player-bottom{
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: grid;
  gap: 10px;
}

.player-label{
  font-size: 11px;
  color: rgba(247,251,255,0.70);
}

.player-select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  outline: none;
}

.player-volume{
  display:flex;
  align-items:center;
  gap: 10px;
}

.player-slider{
  width: 100%;
}

.player-hint{
  font-size: 12px;
  color: rgba(247,251,255,0.72);
  min-height: 16px;
}

/* tiny EQ animation */
.player-eq{
  display:flex;
  gap: 3px;
  align-items:flex-end;
  width: 22px;
  height: 14px;
  opacity: 0.8;
}
.player-eq span{
  width: 4px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  transform-origin: bottom;
}
.music-player.is-playing .player-eq span{
  animation: eq 650ms ease-in-out infinite;
}
.music-player.is-playing .player-eq span:nth-child(2){ animation-delay: 120ms; }
.music-player.is-playing .player-eq span:nth-child(3){ animation-delay: 240ms; }

@keyframes eq{
  0%,100% { transform: scaleY(0.55); opacity: 0.65; }
  50% { transform: scaleY(1.35); opacity: 0.95; }
}

/* Minimized state */
.music-player.is-min{
  width: 210px;
}
.music-player.is-min .player-bottom{
  display: none;
}
.music-player.is-min .player-now{
  display: none;
}
.music-player.is-min .player-track{
  max-width: 120px;
}
.music-player.is-min .pbtn:not(.pbtn-primary):not(.pbtn-min){
  display: none; /* hide prev/next in minimized */
}
.music-player.is-min .pbtn-min{
  content: "+";
}

/* Mobile: place player at bottom as a pill */
@media (max-width: 520px){
  .music-player{
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    border-radius: 18px;
  }

  .music-player.is-min{
    width: auto;
  }

  .music-player.is-min .player-title{
    flex: 1;
  }

  .music-player.is-min .player-track{
    max-width: 180px;
  }
}

/* -----------------------------
   Main page layout
------------------------------ */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 18px 54px;
}

.header {
  text-align: center;
  padding: 10px 0 10px;
}

.mark {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.magen {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: rgba(255,255,255,0.75);
  stroke-width: 4.5;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.30));
}

.header h1 {
  margin: 0;
  letter-spacing: 1.2px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 800;
}

.subhead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.explainer {
  margin: 10px auto 0;
  max-width: 720px;
  color: rgba(247,251,255,0.88);
  font-size: 14px;
  line-height: 1.4;
}

.tagline {
  margin: 12px 0 0;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  letter-spacing: 0.3px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
}

/* card */
.card {
  margin-top: 18px;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: 0 26px 85px rgba(0,0,0,0.33);
  backdrop-filter: blur(14px);
  position: relative;
}

.card::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: 22px;
  pointer-events:none;
  background: radial-gradient(120% 140% at 50% 35%, transparent 35%, rgba(0,0,0,0.18) 100%);
  opacity: 0.35;
}

/* status */
.status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.status-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.status-sub {
  color: var(--muted);
  font-size: 14px;
}

/* Night indicator dots */
.night-indicator{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-top: 4px;
}

.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.dot.is-on{
  background: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.70);
  box-shadow:
    0 0 16px rgba(140, 190, 255, 0.25),
    0 0 28px rgba(255,255,255,0.12);
}

.dot.is-active{
  background: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.90);
  box-shadow:
    0 0 18px rgba(140, 190, 255, 0.35),
    0 0 44px rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

/* controls */
.controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
  color: var(--muted);
  font-size: 14px;
}

.toggle input { transform: translateY(1px); }

.row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 10px 12px;
  align-items: center;
}

label { color: rgba(247,251,255,0.86); font-size: 13px; }

select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(5, 16, 35, 0.40);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

select:disabled { opacity: 0.55; }

/* Share row */
.share-row{
  margin-top: 12px;
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  position: relative;
  z-index: 1;
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 650;
  cursor:pointer;
  box-shadow: 0 14px 40px rgba(0,0,0,0.20);
}

.btn:hover{ background: rgba(255,255,255,0.14); }

.btn-ghost{
  background: rgba(5,16,35,0.30);
}

.copy-toast{
  color: rgba(247,251,255,0.85);
  font-size: 13px;
  min-width: 120px;
  text-align: left;
}

/* menorah */
.menorah {
  position: relative;
  margin: 24px auto 6px;
  padding: 26px 18px 74px;
  display: grid;
  grid-template-columns: repeat(9, minmax(20px, 1fr));
  gap: 12px;
  align-items: end;
  max-width: 860px;
  z-index: 1;
}

/* base */
.base {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 18px;
  height: 20px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.48), rgba(215,221,231,0.18));
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    0 18px 55px rgba(0,0,0,0.35),
    0 0 60px rgba(140, 190, 255, 0.18);
}

.base::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -10px;
  height: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.0));
  border: 1px solid rgba(255,255,255,0.18);
}

/* candle */
.candle {
  position: relative;
  height: 118px;
  display: grid;
  place-items: end center;
}

.candle .wax {
  width: 24px;
  height: 90px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.78));
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

.candle .wax::after {
  content: "";
  display: block;
  width: 32px;
  height: 8px;
  margin: 0 auto;
  transform: translateY(8px);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(215,221,231,0.18));
  border: 1px solid rgba(255,255,255,0.18);
}

.candle .flame {
  width: 18px;
  height: 26px;
  margin-bottom: 6px;
  border-radius: 50%;
  transform: rotate(10deg);
  background: radial-gradient(circle at 40% 35%, var(--flameHot), var(--flame) 55%, rgba(255, 160, 60, 0.2) 76%);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow:
    0 0 18px rgba(255, 210, 120, 0.30),
    0 0 55px rgba(255, 210, 120, 0.18);
}

.candle.lit::before {
  content: "";
  position: absolute;
  width: 70px;
  height: 120px;
  border-radius: 999px;
  transform: translateY(-20px);
  background: radial-gradient(circle at 50% 25%, rgba(255, 210, 120, 0.22), transparent 65%);
  filter: blur(0.5px);
}

.candle.lit .flame {
  opacity: 1;
  transform: rotate(10deg) translateY(-1px);
}

.candle.dim .wax {
  background: linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0.12));
  border-color: rgba(255,255,255,0.18);
}

/* Shamash */
.shamash {
  height: 152px;
  transform: translateY(-14px);
}

.shamash .wax {
  width: 26px;
  height: 104px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(215,221,231,0.55));
}

/* Micro light-up animation */
@media (prefers-reduced-motion: no-preference) {
  .candle.just-lit .flame { animation: flamePop 650ms ease-out both; }
  .candle.just-lit::before { animation: glowPulse 800ms ease-out both; }
}

@keyframes flamePop {
  0%   { opacity: 0; transform: rotate(10deg) translateY(6px) scale(0.86); }
  60%  { opacity: 1; transform: rotate(10deg) translateY(-2px) scale(1.06); }
  100% { opacity: 1; transform: rotate(10deg) translateY(-1px) scale(1); }
}

@keyframes glowPulse {
  0%   { opacity: 0; transform: translateY(-20px) scale(0.92); }
  55%  { opacity: 1; transform: translateY(-20px) scale(1.06); }
  100% { opacity: 1; transform: translateY(-20px) scale(1); }
}

.footnote {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  position: relative;
  z-index: 1;
}
