:root {
  --bg: #fbf6ea;
  --card: #f5ecd9;
  --line: #e6d6b4;
  --gold: #b08a3c;
  --gold-dark: #8a6a2a;
  --gold-light: #e9d29a;
  --ink: #3a2e1f;
  --muted: #7a6a52;
  --rose: #d9825b;
  --fs: 26px; /* psalm text size, user adjustable */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Nunito Sans", system-ui, sans-serif; font-size: 18px; line-height: 1.45;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.frame {
  max-width: 640px; margin: 10px auto; min-height: calc(100vh - 20px);
  border: 1.5px solid var(--gold); border-radius: 14px;
  outline: 1px solid var(--gold-light); outline-offset: -7px;
  padding: 22px 16px 18px; position: relative;
}
.top { text-align: center; }
h1 {
  font-family: "Cormorant Garamond", serif; font-weight: 600; color: var(--gold);
  font-size: 40px; letter-spacing: .04em; text-transform: uppercase; margin: 4px 0 6px; line-height: 1.05;
}
.dedication {
  margin: 0 auto 18px; padding: 12px 16px; max-width: 420px; font-size: 15px; color: var(--ink);
  background: linear-gradient(#fffaf0, #f3e7cc); border: 1px solid var(--gold-light); border-radius: 10px;
}
.loading { text-align: center; color: var(--muted); }

/* ---------- name picker ---------- */
.pick h2, .section-title {
  font-family: "Cormorant Garamond", serif; color: var(--gold-dark); font-size: 30px; text-align: center; margin: 8px 0 12px;
}
.search {
  width: 100%; font-size: 20px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  margin-bottom: 10px;
}
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.names button {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px;
  font-weight: 700; font-size: 18px; text-align: center;
}
.names button:active { background: var(--gold-light); }

/* ---------- personal ---------- */
.hello { text-align: center; margin: 4px 0 10px; }
.hello h2 { font-family: "Cormorant Garamond", serif; font-size: 34px; margin: 0; color: var(--ink); }
.progress { margin: 6px 0 4px; }
.bar { height: 12px; background: #efe3c8; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #d7b25e); border-radius: 99px; transition: width .6s; }
.progress p { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 16px; }

.notice {
  background: #fff7ea; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; text-align: center;
}
.help-banner { background: #fff1e6; border-color: #f0c9a8; }

.psalm {
  background: #fffdf8; border: 1px solid var(--line); border-radius: 16px; margin: 16px 0; overflow: hidden;
  box-shadow: 0 2px 10px rgba(138, 106, 42, .06);
}
.psalm-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--gold); color: #fff; padding: 10px 16px; font-weight: 800; letter-spacing: .03em;
}
.psalm-head .heb { font-family: "Frank Ruhl Libre", serif; font-size: 22px; font-weight: 700; }
.psalm-head small { font-weight: 600; opacity: .9; }
.psalm-text {
  direction: rtl; text-align: right; font-family: "Frank Ruhl Libre", "David", serif;
  font-size: var(--fs); line-height: 1.9; padding: 16px 18px 6px;
}
.psalm-text .v { color: var(--gold); font-size: .62em; font-weight: 700; margin-inline-end: .25em; }
.amen-wrap { padding: 8px 16px 18px; text-align: center; }
.amen {
  width: 100%; max-width: 360px; border: 0; border-radius: 14px; padding: 18px 10px; font-size: 24px; font-weight: 800;
  background: linear-gradient(#c49a46, var(--gold-dark)); color: #fff; box-shadow: 0 4px 0 #6f5420;
}
.amen:active { transform: translateY(2px); box-shadow: 0 2px 0 #6f5420; }
.psalm.done .psalm-head { background: #8fa37a; }
.done-line { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font-weight: 700; gap: 10px; }
.done-line .links { display: flex; gap: 14px; }
.link { background: none; border: 0; color: var(--gold-dark); text-decoration: underline; font-size: 15px; padding: 4px; }

.skip-btn {
  display: block; margin: 6px auto 0; background: none; border: 1px solid var(--line); border-radius: 99px;
  padding: 8px 16px; font-size: 16px; color: var(--muted);
}

/* ---------- offer ---------- */
.offer { text-align: center; background: #fff; border: 2px solid var(--gold-light); border-radius: 16px; padding: 18px 14px; margin: 18px 0; }
.offer h3 { font-family: "Cormorant Garamond", serif; font-size: 28px; margin: 0 0 6px; color: var(--gold-dark); }
.offer p { margin: 0 0 14px; font-size: 19px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 12px; padding: 14px 20px; font-size: 19px; font-weight: 800; background: var(--gold); color: #fff;
}
.btn.ghost { background: transparent; color: var(--gold-dark); border: 1.5px solid var(--gold-light); }

/* ---------- board ---------- */
.board { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; direction: rtl; }
.cell {
  aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--line); background: #fffdf8; padding: 0;
  font-size: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center;
}
.cell.read { background: linear-gradient(135deg, #d9b45f, var(--gold)); border-color: var(--gold); color: #fff; }
.cell.skip { background: #f6d5c2; border-color: var(--rose); color: #9a4b2a; }
.cell.taken { background: #f3e2b5; border-color: var(--gold); color: var(--gold-dark); }
.cell.mine { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 10px 0; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; border: 1px solid var(--line); background: #fffdf8; }
.legend .l-read::before { background: var(--gold); border-color: var(--gold); }
.legend .l-skip::before { background: #f6d5c2; border-color: var(--rose); }
.legend .l-taken::before { background: #f3e2b5; border-color: var(--gold); }
.streak { text-align: center; font-size: 20px; font-weight: 800; margin: 12px 0 4px; }
.cell-info { text-align: center; min-height: 1.5em; font-size: 16px; color: var(--ink); margin: 6px 0; }
.who-list { background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 16px; }
.who-list h4 { margin: 6px 0; color: var(--gold-dark); }
.who-list ul { margin: 0 0 8px; padding-inline-start: 18px; }
.share { display: block; width: 100%; margin-top: 12px; background: #25d366; }

.parcours { margin-top: 22px; text-align: center; background: linear-gradient(#fffaf0, #f3e7cc); border: 1px solid var(--gold-light); border-radius: 16px; padding: 16px 12px; }
.parcours .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.parcours b { display: block; font-variant-numeric: lining-nums; font-family: "Cormorant Garamond", serif; font-size: 34px; color: var(--gold-dark); line-height: 1.1; }
.parcours small { color: var(--muted); font-size: 14px; }

/* ---------- special days ---------- */
.special { text-align: center; padding: 50px 10px 30px; }
.special .candles { font-size: 64px; }
.special h2 { font-family: "Cormorant Garamond", serif; font-size: 44px; color: var(--gold-dark); margin: 10px 0 4px; line-height: 1.1; }
.special p { font-size: 22px; margin: 0; }

/* ---------- footer ---------- */
.foot { text-align: center; margin-top: 26px; }
.motto { font-family: "Cormorant Garamond", serif; color: var(--gold); font-size: 22px; margin: 0 0 8px; }
#footer-tools { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 15px; color: var(--muted); }
.size button { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; font-weight: 800; }
.install { margin: 14px 0 0; font-size: 15px; color: var(--muted); background: #fffdf8; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }

/* ---------- bravo overlay ---------- */
#overlay {
  position: fixed; inset: 0; background: rgba(251, 246, 234, .97); z-index: 10;
  display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.bravo .star { font-size: 70px; animation: pop .7s ease-out; }
.bravo h2 { font-family: "Cormorant Garamond", serif; font-size: 46px; color: var(--gold-dark); margin: 10px 0; line-height: 1.05; }
.bravo p { font-size: 22px; margin: 0 0 8px; }
.bravo .proud { font-weight: 800; color: var(--gold-dark); font-size: 24px; margin: 12px 0 22px; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0 } 70% { transform: scale(1.15) } 100% { transform: scale(1); opacity: 1 } }
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; z-index: 11; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .bravo .star { animation: none; } }
