/* RateMyFather: demo look. Warm parchment, burgundy + gold, Georgia serif headings,
   leaded stained-glass frames. Ported from the demo's design system: a narrow 768px
   centered column, 16px universal radius, soft two-layer shadows, arched hero,
   leaded-glass divider strips, lead score boxes, gold stars and category bars. */
:root {
  --bg:#fbf7ef; --surface:#fffdf8; --surface-alt:#efe6d8; --text:#2b2118; --dim:#7a6a58;
  --border:#ddd0ba; --accent:#7a1f2b; --accent-soft:#f3e3e0; --accent-hover:#571420;
  --gold:#c49a3c; --glass-lead:#38291a; --glass-ruby:#7a1f2b; --glass-amber:#c49a3c;
  --radius:16px;
  --shadow-card:0 1px 2px rgb(43 33 24 / 0.05), 0 8px 24px -12px rgb(43 33 24 / 0.18);
  --shadow-lift:0 2px 4px rgb(43 33 24 / 0.06), 0 16px 32px -16px rgb(43 33 24 / 0.28);
  /* legacy names, kept so existing server-rendered pages keep working */
  --burgundy:#7a1f2b; --burgundy-dark:#571420; --gold-soft:#e8d9a0;
  --cream:#fbf7ef; --paper:#fffdf8; --ink:#2b2118; --muted:#7a6a58; --line:#ddd0ba;
  --green:#2e5e4e; --red:#b8452a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#171008; --surface:#221809; --surface-alt:#2c2010; --text:#f2e9d8; --dim:#b3a189;
    --border:#443620; --accent:#d98a94; --accent-soft:#3a1e22; --accent-hover:#e8a3ac;
    --gold:#d4af5e; --glass-lead:#0d0805; --glass-ruby:#8a2a35; --glass-amber:#d4af5e;
    --burgundy:#d98a94; --burgundy-dark:#8a2a35; --gold-soft:#d4af5e;
    --cream:#171008; --paper:#221809; --ink:#f2e9d8; --muted:#b3a189; --line:#443620;
  }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text);
  font-family:"Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size:16px; line-height:1.5; }
h1, h2, h3, .brand, .font-display { font-family:Georgia, "Times New Roman", Times, serif;
  letter-spacing:-0.01em; color:var(--text); }
h1 { font-size:30px; line-height:36px; font-weight:700; margin:0 0 8px; }
h2 { font-size:24px; line-height:32px; font-weight:700; margin:40px 0 0; }
h3 { font-size:20px; line-height:28px; font-weight:700; margin:0 0 4px; }
p { margin:12px 0 0; }
p:first-child { margin-top:0; }
a { color:var(--accent); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }

/* ---------- Layout: one narrow centered column ---------- */
.wrap { max-width:768px; margin:0 auto; padding:0 16px; }
@media (min-width:640px) { .wrap { padding:0 20px; } }
main { padding:40px 0 64px; }
.home-section { margin-top:40px; }
.home-section h2 { margin-top:0; }
.explainer { font-size:14px; color:var(--dim); margin-top:4px; }

/* ---------- Header: sticky, blurred, glass strip below ---------- */
.topnav { position:sticky; top:0; z-index:40;
  background:var(--bg); background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
  border-bottom:1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.nav-inner { display:flex; align-items:center; gap:8px 16px; flex-wrap:wrap; padding:8px 0; }
.brand { color:var(--text); text-decoration:none; font-size:16px; font-weight:600; }
.brand .accent { color:var(--accent); }
.topnav nav { display:flex; gap:4px; flex-wrap:wrap; margin-left:auto; }
@media (max-width:639px) { .topnav nav { margin-left:0; width:100%; } }
.topnav nav a { color:var(--dim); text-decoration:none; font-size:13px; padding:8px 6px; }
.topnav nav a:hover { color:var(--accent); }

/* ---------- Leaded-glass divider strips ---------- */
.glass-strip { display:flex; gap:1px; padding:1px; background:var(--glass-lead);
  border-radius:3px; height:8px; margin:32px 0; }
.glass-strip.thin { height:6px; }
.glass-strip.gs-7 { height:7px; }
.glass-strip span { flex:1; border-radius:2px; opacity:0.92; }
.glass-strip span.w3 { flex:3; }
.glass-strip span:nth-child(odd) { background:var(--glass-ruby); }
.glass-strip span:nth-child(even) { background:var(--glass-amber); }
.topnav .glass-strip { margin:0; }

/* ---------- Hero: arched stained-glass frame, big serif headline ---------- */
.sg-frame { border:3px solid var(--glass-lead); overflow:hidden; background:var(--surface);
  border-radius:110px 110px var(--radius) var(--radius); box-shadow:var(--shadow-card);
  height:176px; }
@media (min-width:640px) { .sg-frame { height:240px; } }
.sg-frame svg { display:block; width:100%; height:100%; }
.hero h1 { font-size:48px; line-height:1.05; margin:32px 0 0; }
@media (min-width:640px) { .hero h1 { font-size:60px; } }
.hero h1 .accent { color:var(--accent); }
.hero .tagline { font-size:18px; line-height:28px; color:var(--dim); margin:12px 0 0; max-width:36rem; }
.hero .stats { font-size:14px; color:var(--dim); margin-top:8px; }

/* ---------- Search ---------- */
.search { display:flex; gap:8px; flex-wrap:wrap; margin:24px 0 0; }
.search-field { position:relative; flex:1; min-width:220px; }
.search-field svg { position:absolute; left:16px; top:50%; transform:translateY(-50%);
  width:20px; height:20px; stroke:var(--dim); fill:none; stroke-width:2; pointer-events:none; }
.search-field input { width:100%; padding-left:48px !important; }
.search input, .search select { padding:16px; font-size:18px; border-radius:var(--radius);
  box-shadow:var(--shadow-card); }
.search input, .search select, form input[type="text"], form input:not([type]), form select,
form textarea, #chat-input {
  padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius);
  font-size:16px; background:var(--surface); color:var(--text); }
.search input, .search select { padding:16px; font-size:18px; box-shadow:var(--shadow-card); }
.search-field input { padding-left:48px; }

/* ---------- Buttons and chips ---------- */
button, .btn { background:var(--accent); color:#fff; border:0; border-radius:var(--radius);
  padding:12px 16px; font-size:16px; font-weight:600; cursor:pointer; text-decoration:none;
  display:inline-block; }
button:hover, .btn:hover { background:var(--accent-hover); }
.btn-secondary { background:var(--surface); color:var(--text); border:1px solid var(--border);
  font-weight:500; }
.btn-secondary:hover { background:var(--surface-alt); }
.btn-pill { border-radius:999px; padding:10px 20px; }
.chip-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.chip { display:inline-block; border:1px solid var(--border); background:var(--surface);
  color:var(--text); border-radius:999px; padding:10px 16px; font-size:16px; font-weight:600;
  text-decoration:none; box-shadow:var(--shadow-card); }
.chip:hover { border-color:var(--accent); color:var(--accent); }
.press { transition:transform 150ms ease-out, background-color 150ms ease-out, box-shadow 200ms ease-out; }
.press:active { transform:translateY(1px); }
.card-lift { transition:transform 180ms ease, box-shadow 200ms ease; }
@media (hover:hover) {
  .card-lift:hover { transform:translateY(-2px); box-shadow:var(--shadow-lift); }
}

/* ---------- Cards and priest cards ---------- */
.cards { display:flex; flex-direction:column; gap:16px; margin-top:12px; }
.card, .review { background:var(--surface); border:1px solid var(--border);
  padding:20px; border-radius:var(--radius); box-shadow:var(--shadow-card); }
.card h2 { margin-top:0; }
.card h3 { margin:0 0 4px; }
.card h3 a { color:var(--text); text-decoration:none; }
.priest-card { display:flex; gap:16px; align-items:flex-start; text-decoration:none; color:inherit; }
.priest-card:hover .priest-name { color:var(--accent); }
.priest-main { flex:1; min-width:0; }
.priest-name { font-family:Georgia, "Times New Roman", Times, serif; font-size:18px; font-weight:700;
  color:var(--text); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.assign { font-size:14px; color:var(--dim); margin:2px 0 0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stars { color:var(--gold); font-size:16px; letter-spacing:2px; line-height:1; margin-top:4px; display:block; }
.stars .empty { color:var(--border); }
.priest-card .scores { display:block; font-size:12px; color:var(--dim); margin-top:4px; font-weight:400; }
.priest-card .caveat { display:block; font-size:12px; color:var(--dim); margin-top:2px; }
.priest-card .badge { margin-top:6px; }
.chevron { flex:none; font-size:24px; color:var(--dim); line-height:1; align-self:center; }

/* Lead score boxes: rated (lead bg, white text) or unrated (alt bg, border). */
.score-box { flex:none; width:56px; height:64px; border-radius:10px; background:var(--glass-lead);
  color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; }
.score-box .num { font-family:Georgia, "Times New Roman", Times, serif; font-size:20px;
  font-weight:700; line-height:1; }
.score-box .lbl { font-size:9px; font-weight:600; text-transform:uppercase;
  letter-spacing:0.06em; opacity:0.8; margin-top:3px; }
.score-box.unrated { background:var(--surface-alt); color:var(--dim); border:1px solid var(--border);
  font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; padding:4px; }
.score-box-lg { flex:none; width:72px; height:80px; border-radius:10px; background:var(--glass-lead);
  color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; }
.score-box-lg .num { font-family:Georgia, "Times New Roman", Times, serif; font-size:30px;
  font-weight:700; line-height:1; }
.score-box-lg .lbl { font-size:9px; font-weight:600; text-transform:uppercase;
  letter-spacing:0.08em; opacity:0.8; margin-top:4px; }
.score-box-lg.unrated { background:var(--surface-alt); color:var(--dim); border:1px solid var(--border);
  font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; padding:6px; }

.unrated { font-style:italic; color:var(--dim); }
.count { color:var(--dim); font-weight:400; }
.caveat { color:var(--dim); font-size:14px; }
.badge { display:inline-block; background:var(--accent-soft); color:var(--accent);
  padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.small, .discreet { color:var(--dim); font-size:14px; }
.match-count { font-size:14px; color:var(--dim); margin-top:16px; }
.notice { background:var(--accent-soft); border:1px solid var(--border);
  padding:8px 12px; border-radius:var(--radius); font-size:14px; }

/* ---------- Regions and Find by place ---------- */
.regions { list-style:none; padding:0; margin:12px 0 0; display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:10px; }
.regions li { background:var(--surface); border:1px solid var(--border); padding:12px 14px;
  border-radius:var(--radius); box-shadow:var(--shadow-card); transition:transform 180ms ease, box-shadow 200ms ease; }
@media (hover:hover) {
  .regions li:hover { transform:translateY(-2px); box-shadow:var(--shadow-lift); }
}
.regions li a { font-weight:600; text-decoration:none; color:var(--text); }
.regions li a:hover { color:var(--accent); }
.place-section { margin-top:24px; }
.place-section h2 { margin-top:0; }
.place-filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:12px 0 0; }
.place-filters select { min-width:150px; }
.place-filters.stacked { display:grid; gap:8px; }
.place-filters.stacked select { width:100%; }

/* ---------- Breather panel ---------- */
.breather { margin-top:48px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px; box-shadow:var(--shadow-card); }
.breather h2 { margin-top:0; }
.breather .btn { margin-top:12px; }

/* ---------- Footer ---------- */
footer.site-footer { margin-top:64px; padding-bottom:32px; }
.site-footer .glass-strip { margin:0 0 20px; }
.footer-nav { display:flex; flex-wrap:wrap; gap:8px 16px; }
.footer-nav a { font-size:14px; font-weight:500; color:var(--dim); text-decoration:underline; }
.footer-nav a:hover { color:var(--accent); }
.site-footer p { font-size:14px; color:var(--dim); margin:8px 0 0; }

/* ---------- Forms ---------- */
form p { margin:12px 0 0; }
.rate-form label, form label { display:block; margin:12px 0 0; font-size:14px; font-weight:500; }
.rate-form textarea { width:100%; }
form input[type="checkbox"] { width:16px; height:16px; margin:0 6px 0 0;
  vertical-align:middle; accent-color:var(--accent); }
form .guidance { background:var(--surface-alt); border-radius:var(--radius);
  padding:10px 12px; font-size:14px; }

/* ---------- Profile page ---------- */
.profile-card { overflow:hidden; border-radius:var(--radius); border:1px solid var(--border);
  background:var(--surface); box-shadow:var(--shadow-card); }
.profile-banner { height:128px; overflow:hidden; background:var(--surface-alt); }
@media (min-width:640px) { .profile-banner { height:160px; } }
.profile-banner svg { display:block; width:100%; height:100%; }
.profile-body { padding:24px; }
@media (min-width:640px) { .profile-body { padding:32px; } }
.profile-name { font-size:30px; line-height:36px; font-weight:700; margin:0; }
.profile-meta { font-size:16px; color:var(--dim); margin-top:4px; }
.profile-sub { font-size:14px; color:var(--dim); margin-top:4px; }
.profile-body .badge { margin-top:8px; }
.score-row { display:flex; gap:16px; align-items:flex-start; margin-top:20px; flex-wrap:wrap; }
.bars { flex:1; min-width:220px; display:flex; flex-direction:column; gap:10px; }
.bar-row { display:flex; align-items:center; gap:12px; }
.bar-label { width:144px; flex:none; font-size:14px; }
.bar-track { flex:1; height:10px; border-radius:999px; background:var(--surface-alt); overflow:hidden; }
.bar-fill { display:block; height:100%; background:var(--gold); border-radius:999px; }
.bar-value { width:32px; flex:none; text-align:right; font-size:14px; font-weight:600; }
.profile-note { font-size:14px; color:var(--dim); margin-top:20px; }
.profile-card + h2 { margin-top:48px; }

/* ---------- Review cards ---------- */
.review { margin-top:16px; }
.review:first-of-type { margin-top:12px; }
.review-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.review-score { font-family:Georgia, "Times New Roman", Times, serif; font-size:16px; font-weight:700; }
.review-head .stars { margin-top:0; font-size:15px; }
.review-date { margin-left:auto; font-size:12px; color:var(--dim); }
.review-cats { font-size:14px; color:var(--dim); margin:8px 0 0; }
.review-cats strong { color:var(--text); }
.review-attendance { font-size:14px; color:var(--dim); margin:8px 0 0; }
.review-attendance strong { color:var(--text); }
.review-body { font-size:16px; margin:12px 0 0; }
.review-actions { display:flex; justify-content:flex-end; gap:16px; margin-top:12px; }
.review-actions a { font-size:14px; color:var(--dim); text-decoration:underline; }
.review-actions a:hover { color:var(--accent); }

/* Skeleton shimmer for loading states. */
.skeleton { position:relative; overflow:hidden; background:var(--border); border-radius:8px; min-height:1em; }
.skeleton::after { content:""; position:absolute; inset:0; transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation:shimmer 1.4s infinite; }
@keyframes shimmer { to { transform:translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
  .skeleton::after { animation:none; }
}
/* ---------- Arcade ---------- */
.arcade-head { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.arcade-tools { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; align-items:center; }
.arcade-tools .chip { border:1px solid var(--border); background:var(--surface); color:var(--text);
  border-radius:999px; padding:6px 12px; font-size:0.92rem; cursor:pointer; }
.arcade-tools .chip[aria-pressed="true"] { background:var(--accent); color:#fff; border-color:var(--accent); }
.arcade-shelf { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:14px; }
/* Compact cards: title, one-line blurb, verdict + best, Play button. No long
   paragraphs above Play, so Play is reachable on a phone without scrolling. */
.game-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:12px 14px; display:flex; flex-direction:column; gap:6px; box-shadow:var(--shadow-card); }
.game-card h3 { margin:0; font-size:1.12rem; }
.game-card .blurb { margin:0; color:var(--dim); font-size:0.92rem; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.game-card .meta { margin:0; font-size:0.88rem; color:var(--dim);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.game-card .meta strong { color:var(--text); }
.game-card .play-row { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:2px; }
.game-card .best { font-size:0.88rem; color:var(--dim); }
.game-card .trophy { color:var(--gold); }
.game-stage { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:12px; margin:12px 0; box-shadow:var(--shadow-card); }
.game-stage .stage-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.game-stage .stage-head h2 { margin:0; flex:1; font-size:1.35rem; }
.game-canvas-wrap { position:relative; width:100%; max-width:480px; margin:0 auto; }
.game-canvas-wrap canvas { display:block; width:100%; height:auto; border-radius:12px;
  border:2px solid var(--glass-lead); background:#1d1712; touch-action:none; }
.game-overlay { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center;
  justify-content:safe center; gap:10px; text-align:center; padding:14px; color:#fff;
  background:rgba(20,12,8,0.72); border-radius:12px; overflow-y:auto; max-height:100dvh; }
.game-overlay h3 { color:#fff; margin:0; font-size:1.4rem; }
.game-overlay p { margin:0; max-width:34ch; font-size:0.95rem; }
.game-overlay .big-btn { width:100%; max-width:340px; padding:13px 18px; font-size:1.1rem; font-weight:700;
  background:var(--gold); color:#3a2c00; }
.game-overlay .big-btn:hover { background:#d9b45a; }
.game-overlay .linklike { background:none; border:0; color:var(--gold-soft); text-decoration:underline;
  font-size:0.92rem; padding:4px; cursor:pointer; }
.game-overlay label { display:block; text-align:left; width:100%; max-width:340px; font-size:0.9rem; }
.game-overlay input { width:100%; margin-top:4px; padding:9px 11px; border-radius:8px;
  border:1px solid var(--border); font-size:1rem; }
.game-hud { display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:space-between;
  max-width:480px; margin:8px auto 0; font-size:0.95rem; }
.game-hud .score { font-weight:700; }
.game-banner { position:absolute; left:50%; top:18%; transform:translateX(-50%);
  background:var(--gold); color:#3a2c00; font-weight:800; padding:8px 16px; border-radius:999px;
  font-size:1.05rem; box-shadow:0 4px 16px rgba(0,0,0,0.35); white-space:nowrap; pointer-events:none; }
.dpad { display:grid; grid-template-columns:repeat(3, 56px); grid-template-rows:repeat(2, 48px);
  gap:6px; justify-content:center; margin:10px auto 0; }
.dpad button { padding:0; font-size:1.2rem; border-radius:10px; }
.game-actions { display:flex; gap:8px; justify-content:center; margin-top:10px; flex-wrap:wrap; }
.game-actions button { padding:8px 14px; }
.game-note { font-size:0.9rem; color:var(--dim); text-align:center; margin:8px 0 0; }
/* Pastor ledger */
.pastor-ledger { width:100%; max-width:480px; margin:10px auto 0; border-collapse:collapse; font-size:0.92rem; }
.pastor-ledger td, .pastor-ledger th { border-bottom:1px solid var(--border); padding:5px 8px; text-align:left; }
.pastor-ledger td.num, .pastor-ledger th.num { text-align:right; }
.pastor-stats { display:flex; gap:14px; flex-wrap:wrap; justify-content:center; margin:8px 0; font-size:0.95rem; }
.pastor-stats b { font-size:1.05rem; }
.pastor-choices { display:flex; flex-direction:column; gap:8px; max-width:480px; margin:10px auto 0; }
.pastor-choices button { text-align:left; padding:10px 14px; line-height:1.4; }
/* ---------- Chat widget ---------- */
#chat-widget { position:fixed; right:16px; bottom:16px; z-index:50;
  display:flex; flex-direction:column-reverse; align-items:flex-end; gap:12px; }
#chat-toggle { background:var(--accent); color:#fff; font-weight:600; border-radius:999px;
  padding:12px 16px; font-size:16px; box-shadow:var(--shadow-lift); }
#chat-toggle:hover { background:var(--accent-hover); }
#chat-panel { width:384px; max-width:calc(100vw - 32px); max-height:72vh; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lift);
  display:flex; flex-direction:column; overflow:hidden; }
#chat-panel[hidden] { display:none; }
#chat-log { flex:1; overflow:auto; padding:12px 16px; display:flex; flex-direction:column; gap:12px; }
#chat-log .msg { margin:0; background:var(--surface-alt); border-radius:var(--radius);
  border-bottom-left-radius:4px; padding:10px 12px; font-size:14px; max-width:92%; }
#chat-log .chat-card { border:1px solid var(--border); border-radius:12px; padding:10px 12px;
  margin:0; font-size:14px; }
#chat-log .chat-card a { color:var(--accent); font-weight:700; }
#chat-form { display:flex; gap:8px; padding:12px; border-top:1px solid var(--border); margin:0; }
#chat-input { flex:1; min-width:0; }
#chat-panel .small { padding:0 16px 12px; margin:0; }
