@font-face { font-family: 'Frank Ruhl Libre'; src: url('fonts/FrankRuhlLibre.ttf') format('truetype'); font-weight: 300 900; font-display: block; }
@font-face { font-family: 'STaM Ashkenaz'; src: url('fonts/StamAshkenazCLM.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'Keter YG'; src: url('fonts/KeterYG-Medium.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'SBL Hebrew'; src: url('fonts/SBL_Hbrw.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Noto Serif Hebrew'; src: url('fonts/NotoSerifHebrew.ttf') format('truetype'); font-weight: 100 900; font-display: block; }

:root { --ink: #f3e6d0; --mute: #b39a7a; --glass: rgba(20, 12, 6, .62); --line: rgba(255, 190, 120, .22); --gold: #f0b45a; color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); overflow: hidden; overscroll-behavior: none;
  font: 15px/1.45 -apple-system, 'Segoe UI', Roboto, 'Noto Sans Hebrew', sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#fire { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; z-index: 0; }
#nogl { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--mute); }

#ui { position: fixed; inset: 0; z-index: 2; pointer-events: none; transition: opacity .8s; }
#ui.hide { opacity: 0; }
#ui.hide * { pointer-events: none !important; }
#cap { position: absolute; top: 0; inset-inline: 0; padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 0; text-align: center; pointer-events: auto; }
.cap { font-family: 'SBL Hebrew', 'Frank Ruhl Libre', serif; font-size: clamp(19px, 4.6vw, 30px); line-height: 1.6; color: rgba(243, 230, 208, .78);
  text-shadow: 0 0 12px #000, 0 0 3px #000; max-width: 760px; margin: 0 auto; }
.cap .on { color: #fff3c4; text-shadow: 0 0 14px #ffb347, 0 0 4px #ff8a00; }
.cap.plain { font-family: 'Frank Ruhl Libre', serif; }
.ref { color: var(--mute); font-size: 12.5px; margin-top: 2px; text-shadow: 0 0 6px #000; }
#bar { position: absolute; bottom: 0; inset-inline: 0; display: flex; justify-content: center; gap: 6px; padding: 10px 10px calc(env(safe-area-inset-bottom, 0px) + 12px); pointer-events: auto; direction: ltr; }
.ib { width: 46px; height: 46px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; position: relative; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ib.big { width: 56px; height: 56px; font-size: 18px; }
.ib small { position: absolute; bottom: -2px; font-size: 9px; color: var(--mute); }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.card { background: #160d07; border: 1px solid var(--line); border-bottom: 0; width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.head { display: flex; justify-content: space-between; align-items: center; }
.head h2 { margin: 0; font-size: 18px; color: var(--gold); font-weight: 600; }
.x { font-size: 18px; color: var(--mute); padding: 4px 8px; }
h3 { font-size: 14px; color: var(--mute); margin: 18px 0 6px; font-weight: 600; }
.ps { display: block; width: 100%; text-align: start; padding: 10px 6px; border-top: 1px solid var(--line); }
.ps .t { display: block; font-family: 'SBL Hebrew', 'Frank Ruhl Libre', serif; font-size: 19px; line-height: 1.5; direction: rtl; text-align: right; }
.ps .r { display: block; font-size: 12px; color: var(--mute); }
.ps.cur { background: rgba(240, 180, 90, .1); border-radius: 10px; }
textarea { width: 100%; font: 19px/1.5 'SBL Hebrew', 'Frank Ruhl Libre', serif; color: var(--ink); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.btn { margin-top: 8px; padding: 9px 16px; border-radius: 10px; background: #3a2410; border: 1px solid #6a4418; color: var(--gold); }
.lbl { display: block; color: var(--mute); font-size: 12.5px; margin: 16px 0 6px; }
.seg { display: flex; gap: 3px; background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 3px; }
.seg.wrap { flex-wrap: wrap; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; white-space: nowrap; }
.seg button.on { background: rgba(240, 180, 90, .22); color: #fff1d6; }
.fonts button b { display: block; font-size: 28px; font-weight: normal; line-height: 1.3; }
.fonts button small { display: block; font-size: 10.5px; color: var(--mute); }
.fine { color: var(--mute); font-size: 11.5px; margin-top: 18px; line-height: 1.6; }
#toast { position: fixed; top: 40%; left: 50%; transform: translateX(-50%); background: var(--glass); border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; z-index: 20; }
