/* Fe en Juego — estilos. Mobile-first (360px), letra grande, alto contraste, modo oscuro. */
:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-2: #f2ebdf;
  --text: #1d1a16;
  --muted: #5c554b;
  --line: #d9cfbf;
  --primary: #1e4fa8;        /* azul talavera */
  --primary-text: #ffffff;
  --accent: #b5462a;         /* terracota */
  --ok: #1e4fa8;             /* letra en su lugar */
  --near: #7b3fa0;           /* letra en otro lugar */
  --off: #cfc6b8;            /* letra que no está */
  --off-text: #3b352d;
  --good: #1d6b46;
  --bad: #a3271f;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(40, 30, 10, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f; --surface: #221f1a; --surface-2: #2c2821; --text: #f3eee6; --muted: #bdb3a4;
    --line: #3d382f; --primary: #5b8ff0; --primary-text: #0d1424; --accent: #e07a58;
    --ok: #4f86e8; --near: #b27ae0; --off: #4a443b; --off-text: #efe8dc; --good: #5fc596; --bad: #ff8a80;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f; --surface: #221f1a; --surface-2: #2c2821; --text: #f3eee6; --muted: #bdb3a4;
  --line: #3d382f; --primary: #5b8ff0; --primary-text: #0d1424; --accent: #e07a58;
  --ok: #4f86e8; --near: #b27ae0; --off: #4a443b; --off-text: #efe8dc; --good: #5fc596; --bad: #ff8a80;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; }
a { color: var(--primary); }

.app { max-width: 520px; margin: 0 auto; padding: 0 16px 32px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 0 8px; position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  min-width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
}
.steps { display: flex; gap: 6px; margin: 4px 0 14px; }
.steps span { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.steps span.done { background: var(--primary); }
.steps span.now { background: var(--accent); }

.banner {
  background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 12px;
  padding: 10px 12px; font-size: 16px; margin-bottom: 12px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
h1 { font-size: 28px; line-height: 1.2; margin: 6px 0 8px; }
h2 { font-size: 22px; line-height: 1.25; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }

.btn {
  display: block; width: 100%; min-height: 54px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: 19px; padding: 12px 16px;
}
.btn + .btn { margin-top: 10px; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.whats { background: #1f7a4d; color: #fff; }
.btn:focus-visible, .opt:focus-visible, .key:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.ritual-list { list-style: none; padding: 0; margin: 12px 0 18px; }
.ritual-list li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ritual-list li:last-child { border-bottom: 0; }
.ritual-list .n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); font-weight: 800; color: var(--accent);
}

/* ---- Palabra escondida: casillas redondas ("piedritas") ---- */
.board { display: grid; gap: 7px; margin: 6px auto 12px; justify-content: center; }
.row { display: grid; gap: 6px; }
.row.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.tile {
  width: var(--tile); height: var(--tile); border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 800; font-size: calc(var(--tile) * .48); text-transform: uppercase;
  background: var(--surface);
}
.tile.filled { border-color: var(--muted); }
.tile.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.tile.near { background: var(--near); border-color: var(--near); color: #fff; border-style: dashed; }
.tile.off { background: var(--off); border-color: var(--off); color: var(--off-text); }
.tile.pop { animation: pop .25s; }
@keyframes pop { 50% { transform: scale(1.12); } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -2px; margin-right: 5px; }
.legend .ok { background: var(--ok); } .legend .near { background: var(--near); } .legend .off { background: var(--off); }
.hint { text-align: center; font-weight: 700; color: var(--accent); min-height: 0; font-size: 16px; }
.msg { text-align: center; min-height: 24px; font-weight: 600; font-size: 16px; }
.card.juego { padding: 12px 14px; }

.keyboard { display: grid; gap: 7px; margin-top: 8px; user-select: none; }
.krow { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1 1 0; min-width: 0; height: 54px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--text); font-weight: 800; font-size: 19px; padding: 0;
  touch-action: manipulation;
}
.key.wide { flex: 1.6 1 0; font-size: 15px; }
.key.ok { background: var(--ok); color: #fff; }
.key.near { background: var(--near); color: #fff; }
.key.off { background: var(--off); color: var(--off-text); opacity: .75; }

/* ---- Trivia y acertijo ---- */
.qnum { font-size: 15px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.question { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 6px 0 14px; }
.opts { display: grid; gap: 10px; }
.opt {
  min-height: 56px; text-align: left; padding: 12px 16px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); font-size: 19px; font-weight: 600;
}
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.opt[disabled] { cursor: default; }
.verdict { font-weight: 800; margin: 12px 0 6px; }
.verdict.good { color: var(--good); } .verdict.bad { color: var(--bad); }
.quote {
  border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0;
  padding: 10px 14px; margin: 10px 0 14px; font-size: 17px;
}
.quote cite { display: block; font-style: normal; font-weight: 800; margin-top: 6px; font-size: 15px; color: var(--muted); }
.emojis { font-size: 46px; text-align: center; line-height: 1.3; margin: 8px 0 14px; word-break: break-word; }
.levels { display: grid; gap: 12px; }
.level {
  text-align: left; border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface); cursor: pointer;
}
.level b { display: block; font-size: 21px; }
.level.sel { border-color: var(--primary); }

/* ---- Versículo ---- */
.verse { font-size: 24px; line-height: 1.45; font-family: Georgia, "Times New Roman", serif; margin: 6px 0 10px; }
.verse-ref { font-weight: 800; color: var(--accent); }

/* ---- Resultado ---- */
.share-box {
  white-space: pre-wrap; font-size: 17px; background: var(--surface-2); border-radius: 12px; padding: 12px;
  border: 1px solid var(--line); margin: 10px 0 12px; line-height: 1.4; user-select: all;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 14px; color: var(--muted); }
.promo { position: relative; border: 2px solid var(--primary); }
.promo.alt { border-color: var(--accent); }
.promo .close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: transparent;
  font-size: 24px; cursor: pointer; color: var(--muted);
}
.promo h2 { padding-right: 40px; }
.promo ul { margin: 6px 0 12px; padding-left: 22px; }
.thanks { font-weight: 700; color: var(--good); margin-top: 10px; }
.foot { font-size: 14px; color: var(--muted); text-align: center; margin-top: 18px; }
.foot p { margin: 6px 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 420px) { .key { height: 58px; } }
