:root {
  --bg-1: #1c2233;
  --bg-2: #05060a;
  --fg: #ffffff;
  --muted: #9aa3b5;
  --soft: #cfd3dc;
  --cyan: #22d3ee;
  --gold: #f5d67b;
  --line: rgba(255, 255, 255, .25);
  --chip: rgba(255, 255, 255, .08);
  --chip-hover: rgba(255, 255, 255, .18);
  --menu: #1a1f2c;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(circle at center, var(--bg-1) 0%, var(--bg-2) 100%) fixed;
  background-color: var(--bg-2);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 12px;
  text-align: center;
}
.icon { font-size: 140px; line-height: 1; margin-bottom: 20px; min-height: 60px; animation: bounce 1.1s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.08) rotate(-3deg); } }
.icon.pic, .icon.name { font-size: 16px; display: flex; flex-direction: column; align-items: center; animation: none; }
.icon.pic img { display: block; max-height: 34vh; max-width: min(60vw, 420px); border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .18); object-fit: contain; }
.caption { margin-top: 10px; font-size: 18px; color: var(--soft); }
.name-he { font-family: "David", "Frank Ruhl Libre", "Times New Roman", serif; font-size: clamp(56px, 12vw, 110px); line-height: 1.15; font-weight: 700; color: var(--gold); text-shadow: 0 0 30px rgba(245, 214, 123, .45); max-width: 90vw; }
.name-he.long { font-size: clamp(40px, 8vw, 72px); }
.name-he.pasuk { font-size: clamp(28px, 5vw, 48px); }
.wave { display: flex; align-items: flex-end; gap: 5px; height: 40px; margin-bottom: 20px; opacity: 0; transition: opacity .2s; }
.wave.playing { opacity: 1; }
.wave span { display: inline-block; width: 7px; background: var(--cyan); border-radius: 4px; animation: wave .85s ease-in-out infinite; }
.wave span:nth-child(1) { height: 10px; }
.wave span:nth-child(2) { height: 22px; animation-delay: .1s; }
.wave span:nth-child(3) { height: 36px; animation-delay: .2s; }
.wave span:nth-child(4) { height: 22px; animation-delay: .1s; }
.wave span:nth-child(5) { height: 10px; }
@keyframes wave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.text { font-size: clamp(26px, 4.6vw, 44px); font-weight: 700; line-height: 1.35; max-width: 920px; margin: 0; padding: 0 8px; min-height: 1.35em; }
.cite { margin-top: 10px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.controls { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; max-width: 100%; direction: ltr; }
.btn, .sel { background: var(--chip); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; font-size: 16px; line-height: 1; cursor: pointer; }
.btn { padding: 8px 12px; min-width: 42px; min-height: 36px; }
.sel { padding: 8px 12px; font-size: 14px; min-height: 36px; }
.btn:hover, .sel:hover { background: var(--chip-hover); }
.sel option { color: #000; }
#langSel { direction: rtl; }
.themes { position: relative; }
.menu { display: none; position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 250px; background: var(--menu); border: 1px solid var(--line); border-radius: 8px; padding: 6px; z-index: 20; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); text-align: left; }
.menu.open { display: block; }
.menu label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.menu label:hover { background: rgba(255, 255, 255, .1); }
.credit { margin-top: 18px; font-size: 11px; color: var(--muted); max-width: 90vw; min-height: 1em; direction: ltr; }
.credit a, .foot a { color: var(--muted); }
.foot { padding: 12px 16px 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); direction: ltr; }
.start { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5, 6, 10, .82); z-index: 50; }
.start.hidden { display: none; }
.start button { display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0; color: var(--fg); cursor: pointer; font: inherit; }
.start-icon { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--cyan); display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--cyan); padding-left: 6px; }
.start-he { font-size: 26px; font-weight: 700; }
.start-en { font-size: 15px; color: var(--soft); }
@media (max-width: 520px) {
  .icon { font-size: 96px; }
  .icon.pic img { max-height: 28vh; max-width: 80vw; }
  .controls { gap: 8px; }
  .menu { right: auto; left: 50%; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .icon, .wave span { animation: none; }
}
