:root {
  --navy: #57484c;
  --navy-2: #735f64;
  --mantle: #738a82;
  --turquoise: #87a299;
  --cream: #f1eadf;
  --paper: #fffdfa;
  --ink: #3e3733;
  --muted: #766e67;
  --gold: #bea062;
  --rose: #9f6674;
  --green: #627b72;
  --line: #ded5ca;
  --shadow: 0 16px 38px rgba(73, 59, 50, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(87,72,76,.022) 1px, transparent 1px),
    linear-gradient(rgba(87,72,76,.022) 1px, transparent 1px),
    #f6f2eb;
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: .5rem; z-index: 20; transform: translateY(-180%); background: #fff; color: var(--navy); padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { transform: translateY(0); }

.topbar {
  width: min(1180px, calc(100% - 2rem));
  margin: .8rem auto 0;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(87,72,76,.12);
  border-radius: 999px;
  background: rgba(255,253,250,.92);
  box-shadow: 0 8px 24px rgba(73,59,50,.055);
  backdrop-filter: blur(10px);
}
.brand { border: 0; background: transparent; color: var(--navy); display: flex; align-items: center; gap: .65rem; font-weight: 850; cursor: pointer; font-size: 1rem; }
.brand-mark { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50% 50% 45% 45%; color: white; background: var(--rose); border: 3px solid #ead9b4; box-shadow: 0 4px 12px rgba(87,72,76,.14); }
.top-actions { display: flex; align-items: center; gap: .8rem; }
.help-link { border: 0; border-bottom: 1px solid rgba(97,33,58,.35); padding: .25rem 0; background: transparent; color: var(--navy); font-weight: 800; cursor: pointer; }
.help-link:hover { border-bottom-color: var(--rose); color: var(--rose); }
.top-stats { display: flex; align-items: center; gap: .8rem; color: var(--navy); }
.level-chip, .phase-badge, .status { border-radius: 999px; padding: .28rem .65rem; font-size: .78rem; font-weight: 800; }
.level-chip { background: #eee6d6; color: var(--navy); border: 1px solid #d9cbb4; }

main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.view[hidden] { display: none !important; }
.home-view { display: block; padding: 1.4rem 0 4rem; }
.hero-retablo { max-width: 920px; min-height: 0; margin: 0 auto; overflow: hidden; border-radius: 1.8rem; border: 1px solid #d8cdbf; background: var(--paper); box-shadow: var(--shadow); }
.welcome-card, .question-card, .result-card { border-radius: 1.6rem; box-shadow: var(--shadow); }
.hero-retablo .welcome-card { border-radius: 0; box-shadow: none; }
.welcome-card { min-height: 500px; padding: clamp(2.4rem, 7vw, 5.4rem); background: var(--paper); color: var(--ink); display: flex; flex-direction: column; justify-content: center; overflow: hidden; position: relative; }
.welcome-card::before { content: "✿"; position: absolute; right: 2rem; top: 1.5rem; color: rgba(159,102,116,.1); font-size: 4rem; line-height: 1; }
.welcome-card::after { content: ""; position: absolute; left: 0; top: 13%; bottom: 13%; width: .32rem; border-radius: 0 1rem 1rem 0; background: #c8b27f; }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card > .welcome-watermark { position: absolute; z-index: 0; right: clamp(1rem, 4vw, 3.5rem); bottom: clamp(1rem, 3vw, 2.5rem); width: clamp(13rem, 34%, 19rem); height: auto; opacity: .075; mix-blend-mode: multiply; pointer-events: none; user-select: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 850; color: var(--green); margin: 0 0 1rem; }
.welcome-card .eyebrow { color: var(--rose); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.08; letter-spacing: -.02em; }
h1 { font-size: clamp(2.65rem, 6vw, 5.4rem); margin: 0 0 1.3rem; max-width: 10ch; color: var(--navy); }
.welcome-card > p:not(.eyebrow):not(.privacy-note) { font-size: 1.08rem; color: var(--muted); max-width: 50ch; margin: 0 0 1.7rem; }
.primary-button, .secondary-button { min-height: 3.2rem; padding: .75rem 1.25rem; border-radius: .85rem; font-weight: 850; cursor: pointer; border: 1px solid transparent; }
.primary-button { background: var(--rose); color: white; width: fit-content; box-shadow: 0 8px 18px rgba(87,72,76,.14); }
.primary-button:hover { background: #895664; transform: translateY(-1px); }
.secondary-button { background: white; color: var(--navy); border-color: #cbd5df; }
.privacy-note { font-size: .78rem; color: var(--muted); margin: 1rem 0 0; }
.player-field { width: min(100%, 27rem); display: grid; gap: .35rem; margin: 0 0 1rem; color: var(--navy); font-size: .82rem; font-weight: 750; }
.player-field input { width: 100%; min-height: 3.15rem; border: 1px solid #d6c3a5; border-radius: .65rem; padding: .7rem .85rem; background: #fffaf0; color: var(--ink); font: inherit; }
.player-field input::placeholder { color: #9a8b82; }
.player-field input:focus { outline: 3px solid rgba(217,169,52,.45); outline-offset: 2px; border-color: var(--gold); }
.public-name-consent { width: min(100%, 31rem); display: grid; grid-template-columns: 1.2rem 1fr; gap: .65rem; align-items: start; margin: -.15rem 0 1rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.public-name-consent input { width: 1.05rem; height: 1.05rem; margin-top: .15rem; accent-color: var(--gold); }
.public-name-consent strong { color: var(--navy); }
.field-error { margin: -.5rem 0 .8rem; color: var(--rose); font-size: .82rem; font-weight: 750; }

.journey-card { margin-top: 1.25rem; padding: 1.5rem 1.7rem 0; overflow: hidden; border: 1px solid #d8cdbf; border-radius: 1.6rem; background: #fbf8f2; box-shadow: 0 12px 32px rgba(73,59,50,.055); }
.journey-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.journey-heading .eyebrow { margin-bottom: .25rem; color: var(--rose); }
.journey-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.75rem, 4vw, 2.8rem); }
.journey-heading > p { max-width: 28rem; margin: 0 0 .25rem; color: var(--muted); text-align: right; }
.level-route { height: 12.5rem; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: .45rem; list-style: none; margin: 1.3rem 0 0; padding: 0; }
.level-route li { position: relative; isolation: isolate; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .4rem; padding: .75rem .3rem; color: white; background: var(--turquoise); border-radius: .9rem .9rem 0 0; box-shadow: inset 0 .25rem 0 rgba(255,255,255,.12); }
.level-route li:nth-child(1) { height: 4.5rem; background: #a9827c; }
.level-route li:nth-child(2) { height: 6rem; background: #987570; }
.level-route li:nth-child(3) { height: 7.6rem; background: #806b6e; }
.level-route li:nth-child(4) { height: 9.2rem; background: #6f827d; }
.level-route li:nth-child(5) { height: 10.8rem; background: var(--mantle); }
.level-route span { position: absolute; z-index: 0; left: 50%; top: 45%; width: auto; height: auto; transform: translate(-50%, -50%); color: rgba(255,255,255,.31); background: transparent; border: 0; font-family: "Iowan Old Style", Georgia, serif; font-size: clamp(3rem, 6vw, 5.6rem); font-weight: 600; line-height: .82; letter-spacing: -.08em; }
.level-route strong { position: relative; z-index: 1; max-width: 100%; padding: .18rem .35rem; border-radius: .35rem; background: rgba(55,48,47,.16); font-size: clamp(.68rem, 1.4vw, .86rem); color: white; text-align: center; overflow-wrap: anywhere; }

.modes { padding-top: 3.2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); color: var(--navy); }
.section-heading .eyebrow { margin-bottom: .35rem; }
.phase-badge { background: #f6e6bc; color: var(--navy); border: 1px solid rgba(217,169,52,.35); }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.mode-card { text-align: left; min-height: 10.5rem; border-radius: .45rem 1.25rem 1.25rem .45rem; padding: 1.15rem; border: 1px solid #decfb6; border-left: .42rem solid var(--rose); background: var(--paper); display: flex; flex-direction: column; gap: .7rem; color: var(--ink); cursor: pointer; position: relative; overflow: hidden; box-shadow: 0 9px 24px rgba(83,42,33,.06); }
.mode-card:nth-child(2) { border-left-color: var(--gold); }
.mode-card:nth-child(3) { border-left-color: var(--turquoise); }
.mode-card::after { content: "✿"; position: absolute; right: .85rem; top: .65rem; color: rgba(173,54,94,.18); font-size: 1.3rem; }
.mode-card:hover { border-color: #b99f78; border-left-color: var(--rose); transform: translateY(-2px); }
.mode-card.active { background: #fff9ec; border-color: #c95b76; border-left-color: var(--rose); }
.mode-icon { width: 2.55rem; height: 2.55rem; display: grid; place-items: center; border-radius: .7rem; font-size: 1.2rem; color: white; background: var(--navy); }
.mode-card strong { display: block; font-size: 1rem; }
.mode-card small { display: block; color: var(--muted); line-height: 1.4; margin-top: .25rem; }
.status { margin-top: auto; width: fit-content; background: #edf0f3; color: #6b7280; }
.status.available { background: #e6f3ef; color: #176957; }

.how-view { max-width: 980px; margin: 0 auto; padding: 1.5rem 0 4rem; }
.how-card { overflow: hidden; padding: clamp(1.5rem, 5vw, 4rem); border: 1px solid #decaa7; border-radius: 2rem; background: var(--paper); box-shadow: var(--shadow); }
.how-card > .eyebrow { color: var(--rose); }
.how-card > h1 { max-width: 15ch; font-size: clamp(2.5rem, 6vw, 4.8rem); }
.how-intro { max-width: 68ch; margin: 0 0 2rem; color: var(--muted); font-size: 1.08rem; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.rules-grid section { min-height: 14rem; padding: 1.25rem; border: 1px solid #e3d4ba; border-radius: 1.1rem; background: #fff9ed; }
.rule-number { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%; background: var(--rose); color: white; font-weight: 900; }
.rules-grid section:nth-child(2) .rule-number { background: var(--gold); color: var(--navy); }
.rules-grid section:nth-child(3) .rule-number { background: var(--turquoise); }
.rules-grid h2, .level-guide h2, .public-guide h2 { margin: 1rem 0 .5rem; color: var(--navy); font-size: 1.35rem; }
.rules-grid p, .level-guide p, .public-guide p { margin: 0; color: var(--muted); }
.level-guide { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2rem; align-items: center; margin-top: 1rem; padding: 2rem; border: 1px solid #ded5ca; border-radius: 1.2rem; background: #f4f0e9; color: var(--ink); }
.level-guide .eyebrow { color: var(--rose); margin-bottom: .3rem; }
.level-guide h2 { margin-top: 0; color: var(--navy); font-size: clamp(1.7rem, 3vw, 2.35rem); }
.level-guide p { color: var(--muted); }
.level-table { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.level-table li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .8rem; border-radius: .65rem; background: rgba(255,255,255,.72); border: 1px solid #e3dbd0; }
.level-table span { color: var(--muted); font-size: .86rem; }
.level-table strong { color: var(--navy); }
.example-box { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: center; margin-top: 1rem; padding: 1.15rem 1.3rem; border: 1px solid #e2c77e; border-radius: 1rem; background: #fff4d2; color: #5a4023; }
.example-box > span { font-size: 1.8rem; }
.public-guide { margin-top: 1rem; padding: 1.25rem 1.4rem; border-left: .35rem solid var(--turquoise); background: #f1faf7; }
.public-guide h2 { margin-top: 0; }
.how-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }

.game-view { max-width: 780px; margin: 0 auto; padding: .5rem 0 4rem; }
.game-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.text-button { justify-self: start; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .6rem 0; font-weight: 700; }
.question-count { font-weight: 800; color: var(--navy); }
.rose-count { justify-self: end; background: white; padding: .45rem .8rem; border-radius: 999px; box-shadow: 0 5px 18px rgba(15,38,66,.08); }
.game-rewards { justify-self: end; display: flex; align-items: center; gap: .45rem; }
.streak { padding: .35rem .65rem; border-radius: 999px; background: #fff1d5; color: #8a5700; font-size: .82rem; font-weight: 850; animation: pop .25s ease; }
.climb { margin: 0 0 1rem; }
.climb-track { height: .7rem; border-radius: 999px; overflow: hidden; background: #dce5e6; }
.climb-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .45s ease; }
.climb-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: .4rem; }
.climb-labels strong { color: var(--green); }
.question-card { background: linear-gradient(180deg, white, #fffdf8); padding: clamp(1.3rem, 4vw, 2.7rem); border: 1px solid rgba(22,154,139,.2); position: relative; overflow: hidden; }
.question-card::after { content: "✦"; position: absolute; right: 1.2rem; bottom: .8rem; color: rgba(242,199,110,.65); }
.question-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .82rem; font-weight: 700; }
.difficulty { color: var(--green); text-transform: uppercase; letter-spacing: .08em; }
.question-card h2 { font-size: clamp(1.65rem, 4.5vw, 2.45rem); margin: 1rem 0 1.6rem; }
.visual-question { min-height: 150px; margin: 1rem 0; border-radius: 1rem; background: linear-gradient(135deg, var(--navy), #285b82); overflow: hidden; display: grid; place-items: center; }
.visual-question img { width: 100%; max-height: 260px; object-fit: contain; }
.answers { display: grid; gap: .75rem; }
.answer-button { width: 100%; min-height: 3.7rem; padding: .85rem 1rem; border: 1px solid #cad5df; border-radius: .9rem; background: #fff; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; gap: .8rem; font-weight: 700; }
.answer-letter { width: 2rem; height: 2rem; flex: 0 0 2rem; display: grid; place-items: center; border-radius: .55rem; background: #eef3f5; color: var(--navy); }
.answer-button:hover:not(:disabled) { border-color: var(--green); background: #f4fbf8; }
.answer-button.correct { border-color: #23826d; background: #e6f6f1; }
.answer-button.incorrect { border-color: #b93f5a; background: #fff0f3; }
.answer-button:disabled { cursor: default; opacity: .78; }
.feedback { margin-top: 1.2rem; padding: 1.15rem; border-radius: 1rem; background: #f4f7f8; border-left: 4px solid var(--green); }
.feedback.wrong { border-left-color: var(--rose); }
.feedback-title { font-weight: 900; color: var(--navy); }
.feedback p { margin: .45rem 0 .7rem; }
.feedback a { color: var(--navy-2); font-weight: 750; }
.feedback .primary-button { display: block; margin-top: 1rem; width: 100%; }

.result-view { max-width: 680px; margin: 1rem auto 4rem; }
.result-card { position: relative; overflow: hidden; background: radial-gradient(circle at 50% -10%, rgba(242,199,110,.28), transparent 38%), linear-gradient(180deg, #fffdf8, #fff7e7); color: var(--ink); padding: clamp(2rem, 7vw, 4rem); text-align: center; border: 1px solid #decaa7; }
.result-card::before { content: ""; position: absolute; inset: 0 0 auto; height: .45rem; background: linear-gradient(90deg, var(--rose), var(--gold), var(--turquoise)); }
.result-card h1 { margin-left: auto; margin-right: auto; color: var(--navy); }
.result-card .eyebrow { color: var(--rose); }
.result-emblem { width: 4.5rem; height: 4.5rem; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 50%; background: #fff1d5; border: 1px solid #e4bd59; box-shadow: 0 9px 24px rgba(139,92,25,.13); font-size: 2.35rem; }
.result-score { font-size: 1.25rem; color: var(--muted); }
.result-score strong { font-size: 2rem; color: var(--rose); }
#result-message { color: var(--muted); }
.result-level { margin: 1.5rem auto; padding: 1rem; border: 1px solid #b9ded2; border-radius: 1rem; max-width: 340px; background: #f1faf7; }
.result-level span, .result-level strong { display: block; }
.result-level span { color: var(--green); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.result-level strong { font-family: Georgia, serif; font-size: 1.7rem; color: var(--navy); }
.result-actions { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; }
.offering-view { width: min(100%, 1100px); margin: 1rem auto 4rem; }
.offering-layout { display: grid; grid-template-columns: 42% 58%; min-height: 720px; overflow: hidden; border: 1px solid var(--line); border-radius: 1.5rem; background: #fffdf8; box-shadow: var(--shadow); }
.offering-image { position: relative; min-height: 720px; margin: 0; overflow: hidden; background: #233f36; }
.offering-image::after { content: ""; position: absolute; inset: 42% 0 0; background: linear-gradient(transparent, rgba(18,34,28,.86)); }
.offering-image img { display: block; width: 100%; height: 100%; min-height: 720px; object-fit: cover; object-position: center; }
.offering-image figcaption { position: absolute; z-index: 1; right: 2rem; bottom: 2.4rem; left: 2rem; color: #fff; }
.offering-image figcaption small, .offering-image figcaption strong { display: block; }
.offering-image figcaption small { margin-bottom: .65rem; font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.offering-image figcaption strong { max-width: 390px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 500; line-height: 1.05; }
.offering-content { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 5.5rem clamp(2rem,6vw,5.5rem) 3.5rem; }
.offering-logo { position: absolute; top: 2rem; right: 2.4rem; width: 8rem; height: auto; opacity: .13; }
.offering-content h1 { max-width: 600px; color: var(--navy); font-size: clamp(2.4rem,5vw,4rem); }
.offering-flowers { display: grid; grid-template-columns: repeat(10, 1.55rem); gap: .45rem; width: max-content; max-width: 100%; margin: 1.5rem 0; }
.offering-flower { display: grid; width: 1.55rem; height: 1.55rem; place-items: center; border-radius: 50%; color: #aaa39a; background: #ece6dc; font-size: .95rem; }
.offering-flower.earned { color: #9d3f57; background: #f4dfe4; }
.offering-invitation { max-width: 620px; margin: 0 0 1rem; color: var(--ink); font-family: Georgia, serif; font-size: 1.18rem; line-height: 1.5; }
.prayer-label { margin: 0 0 .5rem; color: var(--muted); font-size: .82rem; }
.offering-prayer { margin: 0 0 1.3rem; padding: 1rem 1.2rem; border-left: 3px solid var(--gold); background: #f6efe2; color: #4d443e; line-height: 1.55; }
.offering-prayer p { margin: 0 0 .55rem; }
.offering-prayer p:last-child { margin-bottom: 0; }
.offering-content .primary-button { align-self: flex-start; }
.ranking-view { max-width: 760px; margin: 1rem auto 4rem; }
.ranking-card { background: white; padding: clamp(1.3rem, 5vw, 2.5rem); border-radius: 1.5rem; box-shadow: var(--shadow); }
.ranking-card h1 { color: var(--navy); font-size: clamp(2.4rem, 6vw, 4rem); margin: 0; }
.ranking-empty { text-align: center; padding: 3rem 1rem; border: 1px dashed #b9c7d3; border-radius: 1rem; }
.ranking-empty > span { font-size: 2.5rem; }
.ranking-empty h2 { margin: .4rem 0; color: var(--navy); }
.ranking-empty p { color: var(--muted); }
.ranking-empty .primary-button { margin: .5rem auto 0; }
.ranking-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .65rem; counter-reset: place; }
.ranking-list li { counter-increment: place; display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .9rem; }
.ranking-list li::before { content: counter(place); width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: #eef3f5; color: var(--navy); font-weight: 900; }
.ranking-list li:first-child::before { background: var(--gold); }
.ranking-name { font-weight: 850; color: var(--navy); }
.ranking-meta { display: block; color: var(--muted); font-size: .78rem; }
.ranking-score { font-size: 1.15rem; font-weight: 900; color: var(--rose); }
.ranking-card .privacy-note { color: var(--muted); text-align: center; margin-top: 1rem; }
.rose-burst { position: fixed; z-index: 40; left: 50%; top: 50%; font-size: 2.5rem; pointer-events: none; animation: rose-burst .8s ease-out forwards; }
@keyframes pop { 50% { transform: scale(1.14); } }
@keyframes rose-burst { 0% { opacity: 0; transform: translate(-50%,-30%) scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-150%) scale(1.35) rotate(10deg); } }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 30; background: var(--ink); color: white; padding: .8rem 1rem; border-radius: .7rem; box-shadow: var(--shadow); max-width: min(90vw, 450px); }
.share-panel { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(11,35,29,.68); }
.share-panel[hidden] { display: none; }
.share-sheet { position: relative; width: min(100%, 620px); padding: clamp(1.5rem,5vw,2.5rem); border-top: 5px solid var(--stage); background: var(--paper); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.share-sheet h2 { margin: .25rem 2.5rem 1rem 0; color: var(--green); font-size: clamp(1.8rem,5vw,2.5rem); }
.share-close { position: absolute; top: .8rem; right: .8rem; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); background: #fff; color: var(--green); font-size: 1.6rem; cursor: pointer; }
.share-link-label { display: block; margin: 1.2rem 0 .4rem; color: var(--green); font-weight: 800; }
.share-link { width: 100%; min-height: 3rem; padding: .7rem .8rem; border: 1px solid #b7aa98; background: #fff; color: var(--ink); font-size: 1rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.share-status { min-height: 1.5rem; margin: .8rem 0 0; color: var(--stage-dark); font-weight: 750; }
footer { border-top: 1px solid var(--line); padding: 1.5rem 1rem 2.5rem; color: var(--muted); text-align: center; font-size: .82rem; }
footer p { margin: .25rem; }
footer a { color: var(--navy-2); }

@media (max-width: 900px) {
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-card.active { min-height: 9rem; }
  .rules-grid { grid-template-columns: 1fr; }
  .rules-grid section { min-height: 0; }
  .level-guide { grid-template-columns: 1fr; }
  .offering-layout { grid-template-columns: 1fr; }
  .offering-image, .offering-image img { min-height: 520px; height: 62svh; }
  .offering-content { min-height: 690px; padding: 7rem 1.4rem 3rem; }
  .offering-logo { top: 1.5rem; right: 1.4rem; width: 7rem; }
}
@media (max-width: 560px) {
  .topbar { width: calc(100% - 1rem); margin-top: .5rem; padding: .65rem .75rem; }
  .brand span:last-child { display: none; }
  .top-actions { gap: .55rem; }
  .help-link { font-size: .78rem; }
  .level-chip { display: none; }
  main { width: min(100% - 1rem, 1180px); }
  .home-view { padding-top: .75rem; }
  .hero-retablo { border-radius: 1.3rem; }
  .welcome-card, .question-card, .result-card { border-radius: 1.1rem; }
  .hero-retablo .welcome-card { border-radius: 0; }
  .welcome-card { min-height: 480px; padding: 3rem 1.4rem 1.7rem; }
  .welcome-card::before { right: .7rem; font-size: 3rem; }
  .welcome-card > .welcome-watermark { right: .8rem; bottom: 1rem; width: 12.5rem; opacity: .06; }
  h1 { font-size: clamp(2.6rem, 14vw, 4rem); }
  .welcome-card .primary-button { width: 100%; }
  .journey-card { padding: 1.25rem 1rem 0; border-radius: 1.2rem; }
  .journey-heading { display: block; }
  .journey-heading > p { margin-top: .55rem; text-align: left; font-size: .86rem; }
  .level-route { height: 10.8rem; gap: .18rem; margin-top: 1rem; }
  .level-route li { padding: .55rem .1rem; border-radius: .65rem .65rem 0 0; }
  .level-route li:nth-child(1) { height: 4rem; }
  .level-route li:nth-child(2) { height: 5.4rem; }
  .level-route li:nth-child(3) { height: 6.8rem; }
  .level-route li:nth-child(4) { height: 8.2rem; }
  .level-route li:nth-child(5) { height: 9.7rem; }
  .level-route span { font-size: clamp(2.5rem, 13vw, 4.2rem); }
  .level-route strong { font-size: .61rem; line-height: 1.1; }
  .section-heading { align-items: start; flex-direction: column; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card, .mode-card.active { grid-column: auto; min-height: 8.2rem; }
  .how-view { padding-top: .75rem; }
  .how-card { padding: 1.4rem 1rem; border-radius: 1.25rem; }
  .how-card > h1 { font-size: 2.55rem; }
  .level-guide { padding: 1.25rem; }
  .level-table li { align-items: start; flex-direction: column; gap: .1rem; }
  .how-actions { flex-direction: column; }
  .how-actions button { width: 100%; }
  .game-header { grid-template-columns: 1fr auto 1fr; font-size: .85rem; }
  .question-card { padding: 1.1rem; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
  .offering-layout { border-radius: 1.1rem; }
  .offering-image, .offering-image img { min-height: 440px; }
  .offering-image figcaption { right: 1.35rem; bottom: 1.6rem; left: 1.35rem; }
  .offering-flowers { grid-template-columns: repeat(10, minmax(1.1rem,1.4rem)); gap: .3rem; }
  .offering-content .primary-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Opción elegida: Cuaderno de peregrino */
:root {
  --navy: #174b3d;
  --navy-2: #245f50;
  --mantle: #174b3d;
  --turquoise: #36758c;
  --cream: #f4efe4;
  --paper: #fffdf8;
  --ink: #25342f;
  --muted: #68746f;
  --gold: #c7a45d;
  --rose: #995268;
  --green: #174b3d;
  --line: #dcd6c8;
  --stage: #157167;
  --stage-dark: #0f5b54;
  --stage-soft: #e0f0ed;
  --stage-number: "01";
  --shadow: 0 14px 34px rgba(23,75,61,.09);
}
body[data-stage="0"] { --stage:#157167; --stage-dark:#0f5b54; --stage-soft:#e0f0ed; --stage-number:"01"; }
body[data-stage="1"] { --stage:#ad791f; --stage-dark:#805812; --stage-soft:#f7ead1; --stage-number:"02"; }
body[data-stage="2"] { --stage:#36758c; --stage-dark:#285c70; --stage-soft:#e1edf2; --stage-number:"03"; }
body[data-stage="3"] { --stage:#995268; --stage-dark:#783c50; --stage-soft:#f2e1e6; --stage-number:"04"; }
body[data-stage="4"] { --stage:#725980; --stage-dark:#594363; --stage-soft:#ece4ef; --stage-number:"05"; }

body {
  background:
    linear-gradient(90deg, rgba(23,75,61,.018) 1px, transparent 1px),
    linear-gradient(rgba(23,75,61,.018) 1px, transparent 1px),
    #f7f4ed;
  background-size: 32px 32px;
  color: var(--ink);
}
.topbar {
  margin-top: 0;
  width: 100%;
  padding: 1rem max(1rem, calc((100% - 1180px)/2));
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255,255,255,.96);
  box-shadow: none;
}
.brand { color: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 600; }
.brand-mark { width: 2rem; height: 2rem; border: 1px solid var(--gold); border-radius: 2px; color: var(--green); background: #f7edd5; box-shadow: none; }
.help-link { color: var(--green); border-bottom-color: rgba(23,75,61,.3); }
.level-chip { border: 0; border-radius: 2px; background: var(--stage-soft); color: var(--stage-dark); }
main { width: min(1180px, calc(100% - 2rem)); }

.home-view {
  display: grid;
  grid-template-columns: 180px minmax(0,1fr) 270px;
  gap: 1.4rem;
  align-items: stretch;
  padding: 1.5rem 0 4rem;
}
.hero-retablo {
  grid-column: 2;
  grid-row: 1;
  max-width: none;
  min-width: 0;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.welcome-card, .question-card, .result-card { border-radius: 3px; }
.hero-retablo .welcome-card {
  min-height: 610px;
  border-top: 5px solid var(--stage);
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.welcome-card {
  padding: clamp(2.2rem,5vw,4.2rem);
  background: #fbf7ed;
}
.welcome-card::before {
  content: var(--stage-number);
  right: .5rem;
  top: 1.1rem;
  color: color-mix(in srgb, var(--stage) 11%, transparent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(10rem,18vw,15rem);
  font-weight: 600;
  line-height: .8;
  letter-spacing: -.08em;
}
.welcome-card::after { top: 0; bottom: 0; width: .28rem; border-radius: 0; background: var(--stage); }
.welcome-card > .welcome-watermark { right: 1.5rem; bottom: 1.5rem; width: clamp(12rem,38%,18rem); opacity: .07; }
.welcome-card .eyebrow, .eyebrow { color: var(--stage-dark); }
h1 { color: var(--green); }
.primary-button, .secondary-button { border-radius: 2px; }
.primary-button { background: var(--stage); color: #fff; box-shadow: none; }
.primary-button:hover { background: var(--stage-dark); }
.secondary-button { border-color: var(--stage); color: var(--stage-dark); }
.player-field { color: var(--green); }
.player-field input { border-radius: 2px; border-color: #cfc3aa; background: #fffdf8; }
.player-field input:focus { outline-color: color-mix(in srgb, var(--stage) 34%, transparent); border-color: var(--stage); }
.public-name-consent input { accent-color: var(--stage); }

.journey-card {
  grid-column: 1;
  grid-row: 1;
  min-height: 610px;
  margin: 0;
  padding: 1.25rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.journey-heading { display: block; }
.journey-heading .eyebrow { color: var(--green); }
.journey-heading h2 { font-size: 1.5rem; color: var(--green); }
.journey-heading > p { margin: .55rem 0 1rem; text-align: left; font-size: .86rem; }
.level-route { height: auto; display: grid; grid-template-columns: 1fr; gap: .55rem; margin: 0; }
.level-route li {
  height: 5.35rem !important;
  min-height: 5.35rem;
  padding: .8rem .75rem;
  border-radius: 2px;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  align-items: center;
  justify-items: start;
  gap: .55rem;
  box-shadow: none;
  opacity: .72;
}
.level-route li:nth-child(1) { background:#157167; }
.level-route li:nth-child(2) { background:#ad791f; }
.level-route li:nth-child(3) { background:#36758c; }
.level-route li:nth-child(4) { background:#995268; }
.level-route li:nth-child(5) { background:#725980; }
.level-route li.is-current { opacity: 1; box-shadow: inset 0 0 0 3px rgba(255,255,255,.9), 0 7px 18px rgba(23,75,61,.14); }
.level-route li.is-complete { opacity: .9; }
.level-route li.is-complete strong::after { content: " · completado"; font-size: .64rem; font-weight: 500; }
.level-route span {
  position: static;
  transform: none;
  font-size: 2.1rem;
  color: rgba(255,255,255,.58);
  letter-spacing: -.05em;
}
.level-route strong {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: .8rem;
  text-align: left;
}

.home-offering-preview {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  border-top: 5px solid var(--gold);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.home-offering-preview figure { position: relative; height: 285px; margin: 0; overflow: hidden; background: var(--green); }
.home-offering-preview figure::after { content:""; position:absolute; inset:48% 0 0; background:linear-gradient(transparent,rgba(17,45,37,.82)); }
.home-offering-preview img { display:block; width:100%; height:100%; object-fit:cover; object-position:center 16%; }
.home-offering-preview figcaption { position:absolute; z-index:1; right:1rem; bottom:1rem; left:1rem; color:#fff; font-family:Georgia,serif; font-size:1.35rem; line-height:1.1; }
.home-offering-preview > div { padding: 1.2rem; }
.home-offering-preview .eyebrow { margin-bottom: .4rem; color:#8b681d; }
.home-offering-preview h2 { margin:.2rem 0 .6rem; color:var(--green); font-size:1.65rem; }
.home-offering-preview p:not(.eyebrow) { color:var(--muted); font-size:.9rem; }
.home-offering-preview blockquote { margin:1rem 0 0; padding:.8rem .9rem; border-left:3px solid var(--gold); background:#f6efe2; color:#4d443e; font-family:Georgia,serif; font-size:.9rem; line-height:1.45; }

.modes { grid-column: 1 / -1; padding-top: 1.7rem; border-top: 1px solid var(--line); }
.section-heading h2 { color: var(--green); }
.phase-badge, .status { border-radius: 2px; }
.mode-card, .mode-card.active {
  min-height: 9.25rem;
  border-radius: 2px;
  border-color: var(--line);
  border-left: .32rem solid var(--stage);
  background: var(--paper);
  box-shadow: none;
}
.mode-card.active { border-color: var(--stage); background: var(--stage-soft); }
.mode-icon { border-radius: 2px; background: var(--stage-dark); }
.mode-card::after { color: color-mix(in srgb, var(--stage) 22%, transparent); }

.how-card, .ranking-card {
  position: relative;
  border-radius: 3px;
  border-top: 5px solid var(--stage);
  background-color: var(--paper);
  background-image: url("assets/logo-camino-guadalupe.png");
  background-repeat: no-repeat;
  background-position: calc(100% - 2rem) 2rem;
  background-size: 10rem auto;
  box-shadow: var(--shadow);
}
.how-card::before, .ranking-card::before {
  content: var(--stage-number);
  position: absolute;
  right: 1.3rem;
  top: 1.2rem;
  color: color-mix(in srgb, var(--stage) 9%, transparent);
  font-family: Georgia,serif;
  font-size: 11rem;
  font-weight: 600;
  line-height: .8;
  pointer-events: none;
}
.rules-grid section, .level-guide, .example-box { border-radius: 2px; }
.rules-grid section { background:#fffaf0; }
.rule-number { border-radius: 2px; background:var(--stage); }
.rules-grid section:nth-child(2) .rule-number, .rules-grid section:nth-child(3) .rule-number { background:var(--stage); color:#fff; }
.level-guide { background:var(--stage-soft); }
.level-table li { border-radius:2px; }

.game-view { max-width: 880px; padding-top: 1.25rem; }
.rose-count, .streak { border-radius:2px; }
.climb-track { height:.38rem; border-radius:0; background:#e3ddd2; }
.climb-fill { border-radius:0; background:var(--stage); }
.climb-labels strong, .difficulty { color:var(--stage-dark); }
.question-card {
  min-height: 540px;
  padding: clamp(1.7rem,5vw,3.4rem);
  border: 0;
  border-top: 5px solid var(--stage);
  background-color: #fbf7ed;
  background-image: url("assets/logo-camino-guadalupe.png");
  background-repeat: no-repeat;
  background-position: calc(100% - 2rem) calc(100% - 2rem);
  background-size: clamp(9rem,24%,14rem) auto;
  box-shadow: var(--shadow);
}
.question-card::before {
  content: var(--stage-number);
  position:absolute;
  right:.6rem;
  top:1rem;
  color:color-mix(in srgb,var(--stage) 9%,transparent);
  font-family:Georgia,serif;
  font-size:clamp(9rem,22vw,15rem);
  font-weight:600;
  line-height:.8;
  letter-spacing:-.08em;
}
.question-card::after { content:""; }
.question-card > * { position:relative; z-index:1; }
.answer-button {
  border-radius:2px;
  border-color:#d9d1c4;
  background:rgba(255,255,255,.87);
}
.answer-button:hover:not(:disabled) { border-color:var(--stage); background:var(--stage-soft); }
.answer-letter { border-radius:50%; background:var(--stage-soft); color:var(--stage-dark); }
.feedback { border-radius:2px; border-left-color:var(--stage); background:#fffdf8; }

.result-view { max-width:760px; padding-top:1rem; }
.result-card {
  border:0;
  border-top:5px solid var(--stage);
  background-color:#fbf7ed;
  background-image:url("assets/logo-camino-guadalupe.png");
  background-repeat:no-repeat;
  background-position:calc(100% - 2rem) calc(100% - 2rem);
  background-size:12rem auto;
  text-align:left;
}
.result-card::before { background:var(--stage); height:0; }
.result-card h1 { margin-left:0; margin-right:0; color:var(--green); }
.result-card .eyebrow { color:var(--stage-dark); }
.result-emblem { margin:0 0 1rem; border-radius:2px; background:var(--stage-soft); border-color:var(--stage); box-shadow:none; }
.result-level { margin:1.5rem 0; border-radius:2px; border-color:var(--stage); background:var(--stage-soft); }
.result-level span { color:var(--stage-dark); }
.result-level strong { color:var(--green); }
.result-actions { justify-content:flex-start; }

.offering-layout {
  border-radius:3px;
  border:0;
  border-top:5px solid var(--stage);
  box-shadow:var(--shadow);
}
.offering-logo { opacity:.08; width:10rem; }
.offering-content h1 { color:var(--green); }
.offering-prayer { background:#f6efe2; }
.offering-content .eyebrow { color:var(--stage-dark); }

.ranking-list li { border-radius:2px; }
.ranking-list li::before { border-radius:2px; background:var(--stage-soft); color:var(--stage-dark); }

footer { background:#102f28; color:#dce7e2; padding:1.6rem 1rem; }
footer a { color:#f3ddaa; }

@media (max-width: 980px) {
  .home-view { grid-template-columns: 170px minmax(0,1fr); }
  .journey-card { grid-column:1; grid-row:1; }
  .hero-retablo { grid-column:2; grid-row:1; }
  .home-offering-preview { grid-column:1 / -1; grid-row:2; display:grid; grid-template-columns:38% 62%; }
  .home-offering-preview figure { height:300px; }
  .modes { grid-row:3; }
}
@media (max-width: 700px) {
  .topbar { padding:.7rem .8rem; }
  .top-actions { gap:.45rem; }
  .home-view { display:block; padding-top:.8rem; }
  .hero-retablo .welcome-card { min-height:520px; }
  .journey-card { min-height:0; margin-top:1rem; padding:1rem 0; }
  .level-route { grid-template-columns:repeat(5,1fr); gap:.3rem; }
  .level-route li {
    height:5rem !important;
    min-height:5rem;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:.4rem .15rem;
  }
  .level-route span { font-size:1.7rem; }
  .level-route strong { font-size:.6rem; text-align:center; }
  .level-route li.is-complete strong::after { content:""; }
  .home-offering-preview { display:grid; grid-template-columns:1fr; margin-top:1rem; }
  .home-offering-preview figure { height:360px; }
  .modes { margin-top:1rem; }
  .question-card { min-height:480px; }
  .result-card { text-align:left; }
  .offering-layout { border-radius:3px; }
}
