/* "מה פרשת השבוע": the site. Palette from the channel bible: sand and gold, olive, terracotta, sky, Jerusalem stone,
   and deep blue-violet for night. 20/10/2026. */

@font-face { font-family: "Rubik"; src: url("/fonts/Rubik.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Frank Ruhl Libre"; src: url("/fonts/FrankRuhlLibre.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FAF4E8; --bg2: #F2E7D1; --card: #FFFDF8; --ink: #2A2016; --ink2: #5A4A38; --muted: #857360;
  --line: #E7D8BD; --gold: #E3A82B; --gold2: #B67F17; --gold-soft: #FBEBC4; --olive: #5D7031; --olive-soft: #E6ECD3;
  --terra: #C05D34; --terra-soft: #F7E2D6; --sky: #2F7DB0; --sky-soft: #DCEBF5; --night: #262252;
  --ok: #3C8636; --ok-soft: #DFF0D9; --bad: #BF3F2B; --bad-soft: #F9DED8; --present: #D49A1C;
  --focus: #2F7DB0;
  --radius: 18px; --radius-s: 12px;
  --shadow: 0 1px 0 rgba(90, 60, 20, .06), 0 6px 20px rgba(90, 60, 20, .08);
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --verse: "Frank Ruhl Libre", "David", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16142C; --bg2: #1E1B3A; --card: #221F42; --ink: #F5EEDF; --ink2: #D8CDB8; --muted: #A99F8D;
    --line: #3A3562; --gold: #F0B93E; --gold2: #F4C962; --gold-soft: #3C3218; --olive: #A9BE73; --olive-soft: #2A3320;
    --terra: #E68A63; --terra-soft: #3D2620; --sky: #79B8E2; --sky-soft: #1C2D45; --ok: #74C26A; --ok-soft: #1F3A22;
    --bad: #F07C67; --bad-soft: #432220; --present: #E9B23C; --focus: #79B8E2;
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16142C; --bg2: #1E1B3A; --card: #221F42; --ink: #F5EEDF; --ink2: #D8CDB8; --muted: #A99F8D;
  --line: #3A3562; --gold: #F0B93E; --gold2: #F4C962; --gold-soft: #3C3218; --olive: #A9BE73; --olive-soft: #2A3320;
  --terra: #E68A63; --terra-soft: #3D2620; --sky: #79B8E2; --sky-soft: #1C2D45; --ok: #74C26A; --ok-soft: #1F3A22;
  --bad: #F07C67; --bad-soft: #432220; --present: #E9B23C; --focus: #79B8E2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent;
}
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 16px 32px; outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .7em; }
a { color: var(--sky); }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }
.hidden { display: none !important; }
.small { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* ---------- header / footer */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); }
.top nav { display: flex; align-items: center; gap: 6px; }
.navlink { text-decoration: none; font-size: 1.25rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.navlink:hover { background: var(--bg2); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 999px; min-height: 40px;
  background: var(--gold-soft); color: var(--ink); text-decoration: none; font-weight: 700; border: 1px solid var(--gold);
}
.pill.ghost { background: var(--card); border-color: var(--line); font-weight: 500; }
.foot { text-align: center; padding: 20px 16px 28px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }
.foot a { color: var(--ink2); }
.foot .ai { font-size: .78rem; }

/* ---------- coin */
.coin { display: inline-block; width: var(--s, 20px); height: var(--s, 20px); vertical-align: -0.2em; flex: none; }
.dinars { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
  border-radius: 999px; border: 0; background: var(--olive); color: #fff; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: transform .08s, filter .15s; touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.gold { background: var(--gold); color: #3B2604; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad-soft); }
.btn.google { background: #fff; color: #1F1F1F; box-shadow: inset 0 0 0 1.5px #DADCE0; font-weight: 500; }
.g-icon { display: inline-flex; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .92rem; }

/* ---------- cards and banners */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.kicker { color: var(--terra); font-weight: 600; font-size: .85rem; letter-spacing: .02em; margin-bottom: .2em; }
.banner { border-radius: var(--radius-s); padding: 12px 14px; margin: 12px 0; background: var(--sky-soft); }
.banner.preview { background: var(--terra-soft); font-weight: 600; }
.banner.ok { background: var(--ok-soft); }
.banner.guest { background: var(--gold-soft); }
.banner.closing { background: var(--night); color: #FFE7B0; }
.banner.guest p { margin-bottom: 10px; }
.banner.guest .small { margin: 8px 0 0; }
.me-strip { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 2px; color: var(--ink2); }
.streak { font-weight: 600; color: var(--terra); }

/* ---------- home */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-top: 4px; aspect-ratio: 16 / 10; background: var(--bg2); }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 44%; }
.hero-text {
  position: absolute; inset: auto 0 0 0; padding: 40px 18px 14px; color: #fff;
  background: linear-gradient(to top, rgba(28, 18, 8, .78), rgba(28, 18, 8, 0));
}
.hero-text .kicker { color: #FFD98A; }
.hero-text h1 { font-size: 2.1rem; margin: 0; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.hero-text .season { margin: 2px 0 0; font-size: .92rem; opacity: .92; }
.section-title { margin: 22px 2px 10px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s;
}
.game-card:active { transform: scale(.98); }
.game-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 30%; background: var(--bg2); }
.game-card.wide { grid-column: 1 / -1; flex-direction: row; }
.game-card.wide img { width: 40%; height: 150px; aspect-ratio: auto; object-position: center 35%; }
.gc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.gc-body h3 { margin: 0 0 2px; }
.gc-body p { font-size: .84rem; color: var(--muted); margin: 0 0 8px; line-height: 1.35; }
.gc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.gc-max { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.chip { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg2); color: var(--ink2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.fresh { background: var(--gold-soft); color: var(--gold2); }
.game-card.done img { filter: saturate(.75); }
.idea h2 { font-size: 1.35rem; }
.table-q { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--olive-soft); }

/* ---------- sources */
.src { margin: 12px 0 0; padding: 10px 14px; border-inline-start: 4px solid var(--gold); background: var(--bg); border-radius: 8px; }
.src blockquote { margin: 0; font-family: var(--verse); font-size: 1.22rem; line-height: 1.6; }
.src figcaption { font-size: .82rem; margin-top: 2px; }
.src a { text-decoration: none; }
.src.compact { padding: 6px 10px; margin-top: 8px; }
.src.compact blockquote { font-size: 1.05rem; }

/* ---------- board */
.board-rows { display: flex; flex-direction: column; gap: 6px; }
.brow { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.brow.me { background: var(--gold-soft); font-weight: 600; }
.brow .rank { text-align: center; font-weight: 700; color: var(--muted); }
.brow .nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine { margin-top: 14px; font-weight: 600; }

/* ---------- me */
.me-top { text-align: center; }
.big-dinars { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 2.6rem; }
.big-dinars span { font-size: 1rem; color: var(--muted); align-self: flex-end; margin-bottom: 10px; }
.me-stats { display: flex; justify-content: center; gap: 22px; color: var(--ink2); margin: 6px 0; }
#nick { flex: 1; min-width: 0; min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; cursor: pointer; min-height: 44px; }
.switch input { width: 22px; height: 22px; accent-color: var(--olive); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 8px; border-radius: 14px; background: var(--bg); opacity: .5; filter: grayscale(1); }
.badge.got { opacity: 1; filter: none; background: var(--gold-soft); }
.badge-icon { font-size: 1.8rem; line-height: 1.2; }
.badge b { font-size: .9rem; }
.badge small { font-size: .75rem; color: var(--muted); line-height: 1.3; }
.history { display: flex; flex-direction: column; }
.hrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.hrow:last-child { border-bottom: 0; }
.hdate { color: var(--muted); font-size: .82rem; }
.hname small { display: block; color: var(--muted); font-size: .8rem; }
.hamt { font-weight: 700; color: var(--gold2); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.host { margin: 0 auto 8px; border-radius: 20px; }

/* ---------- toasts and sheets */
.toasts { position: fixed; inset-inline: 0; top: calc(64px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; max-width: 520px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); transition: .25s; pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
.toast .src { background: transparent; border-color: var(--gold); margin-top: 6px; }
.toast .src a { color: inherit; }
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(20, 14, 6, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .25s; }
.sheet-wrap.in { background: rgba(20, 14, 6, .45); }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s ease-out; outline: none; }
.sheet-wrap.in .sheet { transform: none; }
.sheet .row { margin-top: 16px; }
.sheet .row .btn { flex: 1; }
.result { text-align: center; }
.result-coin { display: flex; justify-content: center; animation: pop .6s ease-out; }
.result-amount { font-size: 2.4rem; font-weight: 800; color: var(--gold2); display: flex; justify-content: center; align-items: center; gap: 6px; margin: 6px 0; }
.result-amount.guest { color: var(--muted); }
.result-detail { font-weight: 600; color: var(--ink2); }
.result-note { font-size: .9rem; color: var(--muted); }
.result-extra { font-weight: 600; color: var(--terra); margin: 2px 0; }
.badge-new { display: inline-flex; align-items: center; gap: 8px; background: var(--gold-soft); padding: 8px 14px; border-radius: 999px; margin: 6px auto; }
.result-sources { text-align: start; margin-top: 14px; }
.result-sources summary { cursor: pointer; font-weight: 600; color: var(--sky); min-height: 40px; display: flex; align-items: center; }
@keyframes pop { 0% { transform: scale(.3) rotate(-30deg); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: none; } }

/* ---------- loading / empty / closed */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 0; }
body.night { background: #12102A; color: #F5EEDF; }
body.night .foot { border-color: #2A2650; color: #A99F8D; }
body.night .foot a { color: #D8CDB8; }
.closed { position: relative; text-align: center; padding: 60px 8px 40px; min-height: 70vh; }
.closed h1 { font-family: var(--verse); font-size: 3rem; color: #FFD98A; margin-top: 18px; }
.closed .big { font-size: 1.35rem; }
.candles { display: flex; justify-content: center; }
.candles ellipse { animation: flicker 2.4s ease-in-out infinite; transform-origin: center bottom; transform-box: fill-box; }
@keyframes flicker { 50% { transform: scaleY(.9) scaleX(1.05); } }
.stars { position: absolute; inset: 0; z-index: -1; background-image:
  radial-gradient(1.5px 1.5px at 20% 15%, #fff, transparent), radial-gradient(1px 1px at 70% 25%, #fff, transparent),
  radial-gradient(1.5px 1.5px at 85% 60%, #fff, transparent), radial-gradient(1px 1px at 35% 70%, #fff, transparent),
  radial-gradient(1px 1px at 55% 10%, #fff, transparent), radial-gradient(1.5px 1.5px at 10% 45%, #fff, transparent),
  radial-gradient(1px 1px at 92% 20%, #fff, transparent), radial-gradient(1px 1px at 45% 40%, #fff, transparent); opacity: .7; }

/* ---------- game shell */
.game-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin: 2px 0 8px; }
.game-head h1 { text-align: center; font-size: 1.35rem; margin: 0; }
.back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; text-decoration: none; color: var(--ink); font-size: 1.4rem; background: var(--card); box-shadow: var(--shadow); }
.game-intro { color: var(--ink2); text-align: center; font-size: .93rem; margin: 0 0 10px; }
.practice-note { text-align: center; font-size: .85rem; background: var(--sky-soft); border-radius: 10px; padding: 6px 10px; margin-bottom: 10px; }
.progress { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 4px 0 14px; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .3s; }
.waiting { text-align: center; color: var(--muted); padding: 14px; }

/* ---------- quiz */
.q-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.q-card img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: center 44%; }
.q-in { padding: 16px; }
.q-num { color: var(--muted); font-size: .85rem; }
.q-text { font-size: 1.25rem; font-weight: 600; margin: 4px 0 14px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt { text-align: start; min-height: 54px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 500; transition: .15s; touch-action: manipulation; }
.opt:hover:not(:disabled) { border-color: var(--gold); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.dim { opacity: .55; }
.explain { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg2); animation: rise .25s; }
.explain .verdict { font-weight: 700; margin-bottom: 4px; }
.explain .verdict.ok { color: var(--ok); } .explain .verdict.bad { color: var(--bad); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.next-row { display: flex; justify-content: center; margin-top: 14px; }

/* ---------- crossword */
.cw { padding-bottom: 210px; }
.cw-grid { display: grid; direction: rtl; grid-template-columns: repeat(var(--w), var(--cell)); grid-template-rows: repeat(var(--h), var(--cell)); gap: 2px; justify-content: center; margin: 6px auto 10px; --cell: min(36px, calc((100vw - 40px) / var(--w) - 2px)); }
.cell { position: relative; background: var(--card); border: 1.5px solid var(--ink2); border-radius: 5px; display: grid; place-items: center; font-size: calc(var(--cell) * .58); font-weight: 600; cursor: pointer; user-select: none; touch-action: manipulation; }
.cell.void { background: transparent; border: 0; cursor: default; }
.cell .num { position: absolute; top: 0; inset-inline-start: 2px; font-size: calc(var(--cell) * .27); font-weight: 500; color: var(--muted); line-height: 1.1; }
.cell.sel { background: var(--sky-soft); }
.cell.cur { background: var(--gold-soft); border-color: var(--gold2); box-shadow: 0 0 0 2px var(--gold); z-index: 1; }
.cell.wrong { color: var(--bad); background: var(--bad-soft); }
.cell.hint { color: var(--sky); }
.cell.solved { background: var(--ok-soft); border-color: var(--ok); }
.clue-bar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 6px; background: var(--sky-soft); border-radius: 14px; padding: 6px; min-height: 56px; }
.clue-bar button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); cursor: pointer; font-size: 1.1rem; }
.clue-text { text-align: center; font-weight: 600; line-height: 1.3; }
.clue-text small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.cw-actions { display: flex; gap: 8px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.clues { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: .88rem; }
.clues h3 { font-size: .95rem; margin: 6px 0; }
.clue { display: block; width: 100%; text-align: start; background: none; border: 0; padding: 5px 6px; border-radius: 8px; cursor: pointer; line-height: 1.35; }
.clue.active { background: var(--gold-soft); }
.clue.solved { color: var(--muted); text-decoration: line-through; }
.kbd-dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 15; background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.kbd { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.kbd-row { display: flex; gap: 4px; justify-content: center; }
.key { flex: 1 1 0; max-width: 46px; min-width: 0; height: 50px; border: 0; border-radius: 8px; background: var(--card); color: var(--ink); font-size: 1.2rem; font-weight: 600; cursor: pointer; box-shadow: 0 1px 0 var(--line); touch-action: manipulation; padding: 0; }
.key.wide { flex: 1.5 1 0; max-width: 72px; font-size: .9rem; }
.key:active { transform: translateY(1px); background: var(--gold-soft); }
.key[data-state="correct"] { background: var(--ok); color: #fff; }
.key[data-state="present"] { background: var(--present); color: #fff; }
.key[data-state="absent"] { background: var(--line); color: var(--muted); }

/* ---------- puzzle */
.levels { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.lv { flex: 1; max-width: 140px; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; line-height: 1.15; }
.lv small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.lv.active { border-color: var(--gold); background: var(--gold-soft); }
.lv.done::after { content: " ✓"; color: var(--ok); }
.pz-board { position: relative; width: min(100%, 420px); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--bg2); touch-action: none; user-select: none; box-shadow: var(--shadow); }
.tile { position: absolute; left: 0; top: 0; width: calc(100% / var(--cols)); height: calc(100% / var(--rows)); background-image: var(--img); background-size: calc(var(--cols) * 100%) calc(var(--rows) * 100%); transition: transform .22s ease; cursor: grab; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.tile.sel { box-shadow: inset 0 0 0 3px var(--gold); z-index: 2; }
.tile.ok-easy { box-shadow: inset 0 0 0 2px rgba(80, 200, 80, .6); }
.tile.drag { transition: none; z-index: 5; cursor: grabbing; box-shadow: 0 8px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px var(--gold); }
.pz-board.solved .tile { box-shadow: none; }
.pz-peek { position: absolute; inset: 0; background-size: cover; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 6; }
.pz-peek.on { opacity: 1; }
.pz-meta { display: flex; justify-content: space-between; align-items: center; margin: 10px auto; width: min(100%, 420px); color: var(--muted); }
.pz-caption { text-align: center; margin-top: 10px; }

/* ---------- who said */
.ws-card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); text-align: center; }
.ws-quote { font-family: var(--verse); font-size: 1.6rem; line-height: 1.5; margin: 6px 0 16px; }
.speakers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.spk { min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 600; padding: 6px; touch-action: manipulation; }
.spk:hover:not(:disabled) { border-color: var(--gold); }
.spk.right { border-color: var(--ok); background: var(--ok-soft); }
.spk.wrong { border-color: var(--bad); background: var(--bad-soft); }
.spk.dim { opacity: .5; }
.ws-context { text-align: start; }

/* ---------- order */
.order-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.ocard { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 10px 8px 10px 10px; box-shadow: var(--shadow); border: 2px solid transparent; position: relative; touch-action: pan-y; }
.ocard.dragging { z-index: 5; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); border-color: var(--gold); transition: none; }
.ocard.ok { border-color: var(--ok); background: var(--ok-soft); }
.ocard.bad { border-color: var(--bad); }
.onum { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); font-weight: 700; font-size: .9rem; }
.otext { font-weight: 500; line-height: 1.35; }
.otext .src { margin-top: 6px; }
.oside { display: flex; align-items: center; gap: 2px; }
.ohandle { width: 36px; height: 44px; display: grid; place-items: center; cursor: grab; color: var(--muted); font-size: 1.3rem; touch-action: none; border-radius: 8px; }
.obtns { display: flex; flex-direction: column; }
.obtns button { width: 34px; height: 24px; border: 0; background: none; cursor: pointer; color: var(--ink2); font-size: .85rem; border-radius: 6px; }
.obtns button:hover { background: var(--bg2); }

/* ---------- word search */
.wsg { display: grid; direction: rtl; grid-template-columns: repeat(var(--n), var(--cell)); gap: 0; justify-content: center; margin: 4px auto 12px; touch-action: none; user-select: none; --cell: min(38px, calc((100vw - 36px) / var(--n))); }
.wcell { width: var(--cell); height: var(--cell); display: grid; place-items: center; font-size: calc(var(--cell) * .56); font-weight: 600; border-radius: 8px; position: relative; }
.wcell.sel { background: var(--gold); color: #3B2604; }
.wcell.found { background: var(--fc); }
.wlist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wchip { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-weight: 600; cursor: default; }
.ws-found { min-height: 74px; margin: 0 0 12px; }
.ws-found .src { margin-top: 0; }
.ws-found p { margin: 0 0 4px; font-weight: 600; }
.wchip.found { text-decoration: line-through; background: var(--fc); border-color: transparent; color: var(--ink2); cursor: pointer; }

/* ---------- word of the day */
.wd { padding-bottom: 200px; }
.wd-board { display: grid; gap: 6px; justify-content: center; margin: 8px auto 12px; }
.wd-row { display: grid; grid-template-columns: repeat(5, var(--t)); gap: 6px; direction: rtl; --t: min(58px, calc((100vw - 60px) / 5)); }
.wd-row.shake { animation: shake .4s; }
.wd-tile { width: var(--t); height: var(--t); display: grid; place-items: center; font-size: calc(var(--t) * .55); font-weight: 700; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.wd-tile.filled { border-color: var(--ink2); animation: tap .12s; }
.wd-tile.correct { background: var(--ok); border-color: var(--ok); color: #fff; }
.wd-tile.present { background: var(--present); border-color: var(--present); color: #fff; }
.wd-tile.absent { background: var(--muted); border-color: var(--muted); color: #fff; }
.wd-tile.flip { animation: flip .45s ease both; }
.wd-legend { display: flex; gap: 12px; justify-content: center; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.wd-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-inline-end: 4px; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes tap { 50% { transform: scale(1.08); } }

@media (min-width: 600px) {
  main { padding-top: 20px; }
  .hero-text h1 { font-size: 2.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- legal pages */
.legal h2 { margin-top: 1.4em; font-size: 1.15rem; }
.legal ul { padding-inline-start: 1.2em; margin: 0 0 .8em; }
.legal li { margin-bottom: .45em; }
