/* Palette sampled from the Shevet Achim logo: black, cream-gold fill, gold rim, bronze, dark-brown ink. */
:root {
  --bg: #0a0806;
  --panel: #15110b;
  --panel-2: #1d170e;
  --text: #f4ead2;
  --muted: #b8a985;
  --gold: #d9b865;
  --gold-hi: #f9db9b;
  --gold-mid: #cdb783;
  --gold-lo: #967b53;
  --line: #3a2f1f;
  --card: #f9db9b;
  --card-text: #39291b;
  --card-muted: #6b5232;
  --btn-text: #1a1208;
  --warn: #e0a84a;
  --gold-grad: linear-gradient(135deg, var(--gold-hi), var(--gold-mid) 55%, var(--gold-lo));
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60rem 36rem at 50% -8%, rgb(217 184 101 / .17), transparent 62%); }
::selection { background: var(--gold); color: var(--btn-text); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .6em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 700; text-align: center; color: var(--gold-hi); }
p { margin: 0 0 1em; }
section { max-width: 62rem; margin: 0 auto; padding: 4.5rem 1rem; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }

/* pearl chain: the logo's beaded border, as a divider */
.pearls, h2::after {
  content: "";
  display: block;
  height: 12px;
  background: radial-gradient(circle at 35% 30%, #fff3cf 0 1.5px, var(--gold-mid) 3px, var(--gold-lo) 5px, transparent 5.6px) 0 0 / 16px 12px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
h2::after { width: 9rem; margin: .8rem auto 0; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1rem; background: rgb(10 8 6 / .82);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font: 700 1.3rem var(--serif); text-decoration: none; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lang { font: 500 .95rem var(--sans); border: 1px solid var(--gold-lo); background: transparent; color: var(--gold-hi); border-radius: 999px; padding: .35rem 1.1rem; min-height: 2.75rem; cursor: pointer; }
.lang:hover { background: rgb(249 219 155 / .1); }

.banner { position: sticky; top: 3.7rem; z-index: 4; display: flex; gap: .8rem; align-items: flex-start; max-width: 62rem; margin: 1rem 1rem 0; padding: .9rem 1.2rem; border-radius: .8rem; background: var(--panel); border: 1px solid var(--gold-lo); }
@media (min-width: 64rem) { .banner { margin-inline: auto; } }
.banner p { margin: 0; flex: 1; }
.banner.ok { border-color: var(--gold); border-inline-start: 6px solid var(--gold); }
.banner.bad { border-inline-start: 6px solid var(--warn); }
.banner .x { flex: none; min-width: 2.75rem; min-height: 2.75rem; margin: -.7rem -.9rem -.7rem 0; background: none; border: 0; color: var(--gold-hi); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.banner[hidden] { display: none; }

.hero { text-align: center; padding-top: 3.5rem; }

/* the plaque: cream oval with a gold rim, like the logo's cartouche */
.plaque {
  display: inline-block; padding: .45rem; margin-bottom: 2rem; border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 0 1px #000, 0 0 60px rgb(217 184 101 / .28), 0 24px 50px rgb(0 0 0 / .6);
  position: relative;
}
.plaque::before, .plaque::after {
  content: ""; position: absolute; top: 50%; width: 1.1rem; height: 1.1rem; margin-top: -.55rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3cf, var(--gold-mid) 45%, var(--gold-lo));
  box-shadow: 0 2px 6px rgb(0 0 0 / .6);
}
.plaque::before { inset-inline-start: -.55rem; }
.plaque::after { inset-inline-end: -.55rem; }
.plaque > div {
  display: grid; justify-items: center; gap: .35rem;
  padding: 1.7rem clamp(2rem, 9vw, 4.2rem); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #fde9b8, var(--card) 70%);
  color: var(--card-text); box-shadow: inset 0 0 0 2px rgb(57 41 27 / .25);
}
.plaque b { font: 900 clamp(1.5rem, 5vw, 2.1rem) var(--serif); line-height: 1.1; }
.plaque span { font: 700 clamp(1rem, 3.2vw, 1.3rem) var(--serif); color: var(--card-muted); }
.plaque .pearls { width: 7rem; opacity: .8; filter: brightness(.55) saturate(1.3); }

.eyebrow:lang(he) { letter-spacing: 0; text-transform: none; }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; }
h1 {
  font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 900; max-width: 16ch; margin-inline: auto; text-wrap: balance;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-mid) 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ns { padding: 1rem; text-align: center; }
.note { color: var(--muted); font-size: .92rem; max-width: 34rem; margin: 1.4rem auto 0; }
.rav { color: var(--gold-hi); font-weight: 500; }
.lead { max-width: 40rem; margin-inline: auto; color: var(--muted); font-size: 1.2rem; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--gold-grad); color: var(--btn-text); font: 700 1.05rem var(--sans);
  padding: .9rem 2.2rem; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 8px 28px rgb(217 184 101 / .3);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 12px 34px rgb(217 184 101 / .42); }
.btn.small { padding: .6rem 1.4rem; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn:disabled { opacity: .6; cursor: wait; }

.progress { max-width: 30rem; margin: 2.8rem auto 0; }
.bar { height: .65rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .6s; }
.progress p { margin: .6rem 0 0; color: var(--muted); font-size: .95rem; }

.steps ol { list-style: none; counter-reset: s; display: grid; gap: 1rem; padding: 0; margin-top: 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.6rem; transition: border-color .2s; }
.steps li:hover { border-color: var(--gold-lo); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--gold-grad); color: var(--btn-text); font: 900 1.15rem var(--serif); margin-bottom: .9rem; }
.steps b { display: block; font: 700 1.3rem var(--serif); color: var(--gold-hi); margin-bottom: .3rem; }
.steps span { color: var(--muted); }

.board { background: linear-gradient(var(--panel), var(--bg)); border-block: 1px solid var(--line); max-width: none; }
.board > * { max-width: 56rem; margin-inline: auto; }
.sub { text-align: center; color: var(--muted); margin: .2rem auto 0; }
.finder { margin-block: 2rem 1.5rem; text-align: center; }
.finder label { display: block; font-weight: 500; margin-bottom: .6rem; color: var(--muted); }
.row { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; align-items: center; }
input:not([type="checkbox"]) { font: 1.1rem var(--sans); padding: .65rem 1rem; border: 1px solid var(--gold-lo); border-radius: .7rem; background: #0f0c08; color: var(--text); width: 100%; }
input:not([type="checkbox"]):focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgb(217 184 101 / .25); }
.finder input { width: 10rem; text-align: center; }
::placeholder { color: var(--muted); }
input[aria-invalid="true"] { border-color: var(--warn); }
#found.bad { color: #ffb4a8; }
#found { margin: 1rem 0 0; min-height: 1.6em; }
.chip { font: 700 1rem var(--sans); border: 1px solid var(--gold-lo); background: transparent; color: var(--gold-hi); border-radius: 99px; padding: .25rem .95rem; cursor: pointer; margin-inline: .15rem; }
.chip:hover { background: rgb(249 219 155 / .12); }

.legend { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 1.1rem; height: 1.1rem; border-color: var(--gold-lo); }

.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; max-width: 36rem; margin: 0 auto 1.2rem; direction: ltr; }
.tab { font: 500 clamp(.68rem, 3.1vw, .8rem) var(--sans); border: 1px solid var(--gold-lo); background: var(--panel-2); color: var(--text); border-radius: .7rem; padding: .45rem .15rem; min-height: 2.75rem; white-space: nowrap; cursor: pointer; line-height: 1.25; }
.tab small { display: block; color: var(--muted); font-size: .72rem; }
.tab:hover { border-color: var(--gold-hi); }
.tab[aria-current="true"] { background: var(--gold-grad); color: var(--btn-text); border-color: transparent; font-weight: 700; }
.tab[aria-current="true"] small { color: var(--btn-text); }

.grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: .4rem; direction: ltr; }
.t { display: block; aspect-ratio: 1; border-radius: .55rem; border: 1px solid var(--line); }
button.t { font: 500 clamp(.7rem, 2.4vw, 1rem) var(--sans); padding: 0; position: relative; border-color: var(--gold-lo); cursor: pointer; background: var(--panel-2); color: var(--text); transition: transform .12s, border-color .12s, box-shadow .12s; }
@media (hover: hover) { button.t.a:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 16px rgb(217 184 101 / .25); } }
button.t.a[aria-pressed="true"] { background: var(--gold-grad); color: var(--btn-text); border-color: transparent; font-weight: 700; box-shadow: 0 4px 18px rgb(217 184 101 / .4); }
.t.s { text-decoration: line-through; background: repeating-linear-gradient(45deg, #0e0b07, #0e0b07 4px, #17120b 4px, #17120b 8px); color: #54472f; cursor: not-allowed; border-color: #1f1810; }
button.t[aria-pressed="true"]::after { content: "✓"; position: absolute; inset-block-start: 2px; inset-inline-end: 4px; font-size: .7em; }
.grid.full button.t.a:not([aria-pressed="true"]) { opacity: .45; }
.pickmsg { text-align: center; color: var(--warn); min-height: 1.4em; margin: 0 0 .6rem; }
.pickmsg:empty { display: none; }
.picks { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; padding: 0; margin: 0 0 1rem; }
.picks:empty { display: none; }
.t.r { background: #251c0c; border: 1px dashed var(--gold-lo); color: var(--warn); cursor: not-allowed; }
i.t.a { background: var(--panel-2); }
i.t.p { background: var(--gold-grad); border-color: transparent; }

.odds { text-align: center; }
.oddsgrid { direction: ltr; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 2rem 0 1.5rem; }
.oddsgrid div { background: var(--panel); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.3rem 1rem; }
.oddsgrid b { display: block; font: 900 2.4rem var(--serif); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.oddsgrid span { color: var(--muted); font-size: .95rem; }
.odds p { max-width: 40rem; margin-inline: auto; color: var(--muted); }

.about { text-align: center; max-width: 42rem; }
.about p { white-space: pre-line; color: var(--muted); font-size: 1.15rem; margin-top: 1.5rem; }
.link { color: var(--gold-hi); font-weight: 700; text-decoration-color: var(--gold-lo); text-underline-offset: .3em; }

.faq { max-width: 44rem; }
details { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: .95rem 1.25rem; margin-bottom: .6rem; }
details[open] { border-color: var(--gold-lo); }
summary { cursor: pointer; font-weight: 700; color: var(--gold-hi); }
details p { margin: .7rem 0 0; color: var(--muted); }

footer .contact { color: var(--gold-hi); font-weight: 700; text-underline-offset: .3em; display: inline-block; padding: .6rem 0; }
.hint a { color: var(--card-text); font-weight: 700; }
footer { text-align: center; padding: 2.5rem 1rem 7rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

.cart {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 6;
  display: flex; gap: .8rem; justify-content: space-between; align-items: center; flex-wrap: nowrap;
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: var(--gold-grad); color: var(--btn-text); font-weight: 700; box-shadow: 0 -10px 40px rgb(0 0 0 / .6);
}
.cart[hidden] { display: none; }
.cartinfo { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
#carttotal { font: 900 1.5rem var(--serif); }
#cartcount { font-size: .9rem; }
.cart :focus-visible { outline-color: var(--btn-text); }
.cart .btn { background: var(--btn-text); color: var(--gold-hi); box-shadow: none; padding: .6rem 1.2rem; white-space: nowrap; }

dialog { color-scheme: light; border: 0; border-radius: 1.4rem; padding: 1.8rem; width: min(30rem, calc(100vw - 2rem)); background: var(--card); color: var(--card-text); box-shadow: 0 0 0 3px var(--gold-lo), 0 30px 90px rgb(0 0 0 / .7); }
dialog::backdrop { background: rgb(0 0 0 / .75); backdrop-filter: blur(3px); }
dialog h3 { font-size: 1.6rem; }
dialog label { display: block; margin-bottom: .9rem; font-weight: 500; }
dialog input:not([type="checkbox"]) { margin-top: .25rem; background: #fff8e4; color: var(--card-text); border-color: var(--card-muted); }
dialog ::placeholder { color: var(--card-muted); }
dialog input:not([type="checkbox"]):focus { border-color: var(--card-text); box-shadow: 0 0 0 3px rgb(57 41 27 / .2); }
dialog .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .95rem; }
dialog .check input { margin-top: .2rem; width: 1.4rem; height: 1.4rem; accent-color: var(--card-text); }
dialog :focus-visible { outline-color: var(--card-text); }
dialog .btn { background: var(--btn-text); color: var(--gold-hi); box-shadow: none; }
dialog .btn.ghost { background: transparent; color: var(--card-text); box-shadow: none; text-decoration: underline; }
.dsum { background: rgb(57 41 27 / .09); border-radius: .7rem; padding: .7rem 1rem; font-weight: 700; }
.err { color: #9c1c1c; min-height: 1.4em; }
.err:empty { display: none; }
.hint { color: var(--card-muted); font-size: .88rem; margin: 1rem 0 0; text-align: center; }

/* The page stays hidden until app.js has filled the text (no empty flash, no layout jump); /noscript.css undoes this. */
html:not(.ready) main { visibility: hidden; }

/* Phones: 5 tickets per row, at least 44px tall, compact steps. */
@media (max-width: 36rem) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: .45rem; }
  .t { aspect-ratio: auto; height: 2.75rem; }
  button.t { font-size: 1.1rem; }
  section { padding-block: 3rem; }
  .steps ol { grid-template-columns: 1fr; }
  .steps li { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; padding: 1.1rem; }
  .steps li::before { grid-row: 1 / 3; margin: 0; }
  .steps b { margin: 0; }
}

/* Very short screens (zoom, landscape): the header and the cart scroll with the page. */
@media (max-height: 32rem) { .top { position: static; } .cart { position: static; } }

/* Short laptops: keep the call to action near the first screen. */
@media (max-height: 700px) and (min-width: 48rem) {
  .hero { padding-top: 1.5rem; }
  .plaque { margin-bottom: 1rem; }
  .plaque > div { padding-block: 1rem; }
  h1 { font-size: 3.2rem; }
}
