/* ═══ v4.13 — TIME PORTAL · Bible-time lands ═══ */

/* the warp */
.timewarp { position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 50%, #3a2a8f 0%, #140f3a 60%, #07051c 100%); display: grid; place-items: center; overflow: hidden; animation: twIn .35s ease; }
@keyframes twIn { from { opacity: 0; } to { opacity: 1; } }
/* a CSS swirl keeps turning on the compositor even while the next land is loading */
.tw-spin { position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; border-radius: 50%; opacity: .55;
  background: repeating-conic-gradient(from 0deg, rgba(139,92,255,.0) 0deg 10deg, var(--c) 14deg 18deg, rgba(255,214,92,.0) 22deg 30deg); animation: twSpin 2.4s linear infinite; will-change: transform; }
@keyframes twSpin { to { transform: rotate(-360deg); } }
.timewarp.out { animation: twOut .7s ease forwards; }
@keyframes twOut { 0% { opacity: 1; filter: brightness(1); } 35% { opacity: 1; filter: brightness(3); background: #fff; } 100% { opacity: 0; filter: brightness(2); } }
.timewarp canvas { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
.tw-clock { position: absolute; width: min(36vh, 260px); height: min(36vh, 260px); border-radius: 50%; border: 10px solid rgba(255,230,128,.9); box-shadow: 0 0 60px rgba(255,214,92,.6), inset 0 0 40px rgba(255,214,92,.35);
  display: grid; place-items: center; margin-top: -12vh; animation: twClock 2.6s ease-in-out infinite; }
.tw-clock span { font-size: min(9vh, 64px); filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
.tw-clock i { position: absolute; left: 50%; bottom: 50%; width: 8px; margin-left: -4px; border-radius: 4px; background: #ffe680; transform-origin: 50% 100%; }
.tw-clock i.h { height: 26%; animation: twHand 1.2s linear infinite reverse; }
.tw-clock i.m { height: 40%; width: 5px; margin-left: -2.5px; animation: twHand .35s linear infinite reverse; }
@keyframes twHand { to { transform: rotate(360deg); } }
@keyframes twClock { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.08) rotate(-12deg); } }
.tw-text { position: absolute; bottom: 9vh; left: 16px; right: 16px; text-align: center; color: #fff; font-family: var(--font-display); text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 0 30px rgba(139,92,255,.8); }
.tw-text small { display: block; font-family: var(--font); font-size: 14px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; opacity: .85; }
.tw-year { display: block; font-size: clamp(54px, 11vw, 120px); line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; color: #ffe680; }
.tw-year.pop { animation: twPop .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes twPop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.tw-title { display: block; font-size: clamp(22px, 3.4vw, 36px); }
.tw-text em { display: block; font-style: normal; font-family: var(--font); font-weight: 700; opacity: .85; margin-top: 2px; }

/* the Time Portal panel */
.panel.timeportal { width: min(1040px, calc(100vw - 24px)); background: radial-gradient(circle at 50% 0%, #efe7ff, #fff7e8 60%); }
.tp-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-right: 56px; }
.tp-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 36px; background: linear-gradient(135deg, #8b5cff, #3a93d6); box-shadow: 0 5px 0 #5a30c9; }
.tp-head h2 { margin: 0; } .tp-head .sub { margin: 2px 0 0; }
.tp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tp-card { display: flex; flex-direction: column; text-align: left; border-radius: 26px; background: #fff; overflow: hidden; border: 4px solid var(--c); box-shadow: 0 6px 0 rgba(31,42,92,.12), 0 16px 30px rgba(31,42,92,.14); transition: transform .15s; }
.tp-card:hover { transform: translateY(-4px) rotate(-.5deg); }
.tp-img { position: relative; aspect-ratio: 16 / 9; background: #eee; }
.tp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-year { position: absolute; left: 10px; bottom: 10px; padding: 5px 12px; border-radius: 999px; background: rgba(20,15,58,.82); color: #ffe680; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.tp-done { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: #3fbf7f; color: #fff; font-weight: 800; font-size: 12px; }
.tp-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tp-body b { font-family: var(--font-display); font-size: 20px; color: var(--ink); line-height: 1.1; }
.tp-body small { font-weight: 800; color: var(--ink-2); font-size: 12px; }
.tp-body p { margin: 4px 0 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; flex: 1; }
.tp-go { align-self: flex-start; padding: 8px 16px; border-radius: 999px; background: var(--c); color: #fff; font-family: var(--font-display); font-weight: 700; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.tp-note { margin: 16px 0 0; text-align: center; font-weight: 800; color: var(--ink-2); }

/* in the land: the Discovery Trail */
.era-hud { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 12; width: min(560px, calc(100vw - 420px)); min-width: 300px;
  background: #fff; border-radius: 22px; border: 4px solid var(--c); box-shadow: 0 6px 0 rgba(31,42,92,.12), 0 14px 26px rgba(31,42,92,.2); padding: 8px 10px 10px; font-family: var(--font-display); color: var(--ink); animation: promptIn .3s; }
.eh-top { display: flex; align-items: center; gap: 10px; }
.eh-ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--c); font-size: 22px; flex: none; }
.eh-t { flex: 1; min-width: 0; line-height: 1.05; }
.eh-t b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-t small { font-family: var(--font); font-size: 11px; font-weight: 800; color: var(--ink-2); letter-spacing: .4px; }
.eh-home { padding: 8px 12px; border-radius: 999px; background: #efe7ff; color: #5a30c9; font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 #d6c8ff; pointer-events: auto; }
.eh-steps { display: flex; gap: 6px; margin: 8px 2px 6px; }
.eh-steps i { flex: 1; height: 8px; border-radius: 999px; background: #e6e9f3; }
.eh-steps i.done { background: var(--c); }
.eh-steps i.now { background: linear-gradient(90deg, var(--c), #ffe680); animation: ehNow 1.2s ease-in-out infinite; }
@keyframes ehNow { 50% { opacity: .55; } }
.eh-hint { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.eh-arrow { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #ffc526; color: #fff; font-size: 16px; box-shadow: 0 3px 0 #d98a00; transition: transform .15s; }
.eh-text { flex: 1; line-height: 1.15; }
.eh-count { padding: 3px 10px; border-radius: 999px; background: var(--c); color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
body[data-scene="era"] .h-dock, body[data-scene="era"] .h-map, body[data-scene="era"] .h-crest { display: none !important; }
body[data-scene="era"] .toasts { top: calc(132px + var(--safe-t)); }
body[data-scene="era"] #hudCoinChip, body[data-scene="era"] #hudRewards, body[data-scene="era"] .place-pill, body[data-scene="era"] .tt-chip { display: none !important; }
@media (max-width: 640px) { body[data-scene="era"] .toasts { top: calc(186px + var(--safe-t)); } }
.tag.era-name { font-size: 14px; }
.era-flash { position: fixed; inset: 0; z-index: 55; background: #fff; pointer-events: none; animation: eraFlash .45s ease-out forwards; }
@keyframes eraFlash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* story cards */
.panel.eracard { width: min(860px, calc(100vw - 24px)); padding: 0; overflow: hidden; background: #fff; }
.era-card { display: grid; grid-template-columns: 1fr 1fr; }
.era-card.storm, .era-card.finale { grid-template-columns: 1fr; }
.ec-img { position: relative; background: #1d1640; min-height: 100%; }
.ec-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ec-body { padding: 26px 60px 22px 26px; display: flex; flex-direction: column; gap: 10px; border-left: 6px solid var(--c); }
.era-card.storm .ec-body, .era-card.finale .ec-body { border-left: 0; border-top: 8px solid var(--c); text-align: center; align-items: center; }
.ec-step { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.finale .ec-step { align-self: center; }
.ec-body h2 { margin: 0; font-size: 30px; }
.ec-say { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.35; color: var(--ink); }
.ec-verse { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #fff7e0; border: 2px dashed #ffc93c; }
.ec-verse span { font-size: 24px; }
.ec-verse p { margin: 0; font-weight: 700; color: #6a4a00; font-style: italic; }
.ec-verse b { display: block; font-style: normal; margin-top: 4px; font-size: 13px; letter-spacing: .5px; }
.ec-body .row { margin-top: 6px; gap: 10px; }
.ec-badge { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 60px; background: radial-gradient(circle at 50% 35%, #fff, var(--c)); box-shadow: 0 0 0 8px #ffe680, 0 12px 30px rgba(31,42,92,.25); animation: twPop .6s cubic-bezier(.2,1.8,.4,1); }
.ec-learned { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--font-display); font-size: 18px; color: var(--ink); text-align: left; }
.ec-reward { margin: 0; font-weight: 800; color: #b47a00; }

@media (max-width: 900px) { .tp-grid { grid-template-columns: 1fr; } .tp-card { flex-direction: row; } .tp-img { width: 42%; aspect-ratio: auto; flex: none; } .era-hud { width: calc(100vw - 260px); } }
@media (max-width: 760px) { .era-card { grid-template-columns: 1fr; } .ec-img { aspect-ratio: 16 / 9; min-height: 0; } .ec-body { border-left: 0; border-top: 6px solid var(--c); padding: 18px; } .ec-body h2 { font-size: 24px; } .ec-say { font-size: 17px; } }
@media (max-width: 640px) { .era-hud { top: calc(64px + var(--safe-t)); width: calc(100vw - 24px); min-width: 0; } .tp-card { flex-direction: column; } .tp-img { width: 100%; aspect-ratio: 16 / 9; } }
@media (max-height: 460px) {
  .era-hud { width: min(400px, calc(100vw - 440px)); padding: 6px 8px; } body[data-scene="era"] #hudStars { display: none !important; } .eh-t small { display: none; } .eh-ic { width: 30px; height: 30px; font-size: 17px; } .eh-hint { font-size: 13px; } .eh-steps { margin: 5px 2px 4px; }
  .era-card { grid-template-columns: 0.8fr 1fr; } .ec-body { padding: 14px 16px; gap: 6px; } .ec-body h2 { font-size: 22px; } .ec-say { font-size: 15px; } .ec-verse { padding: 8px 10px; } .ec-verse p { font-size: 13px; }
  .panel.eracard { max-height: calc(100vh - 16px); overflow: auto; }
}

/* v4.14 — quiz, inside the big fish, passport */
.era-card.quiz { grid-template-columns: 1fr; }
.era-card.quiz .ec-body { border-left: 0; border-top: 8px solid var(--c); text-align: center; align-items: center; padding: 26px; }
.era-card.quiz .ec-step { align-self: center; }
.qz-answers { display: grid; gap: 10px; width: min(460px, 100%); margin-top: 6px; }
.qz-a { padding: 14px 18px; border-radius: 18px; background: #f3f5fb; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); box-shadow: 0 4px 0 #dfe3ee; text-align: center; transition: transform .1s; }
.qz-a:active { transform: translateY(3px); box-shadow: none; }
.qz-a.right { background: #3fbf7f; color: #fff; box-shadow: 0 4px 0 #2a8f5c; animation: twPop .4s; }
.qz-a.wrong { background: #ffe1e5; color: #c0392b; box-shadow: 0 4px 0 #f7b8c0; animation: qzShake .35s; }
@keyframes qzShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.qz-msg { margin: 4px 0 0; font-weight: 800; color: var(--ink-2); min-height: 1.3em; }
.era-inside { position: fixed; inset: 0; z-index: 54; display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, #7a2a45 0%, #3b1530 55%, #160a1c 100%); animation: twIn .5s; overflow: hidden; }
.era-inside.dawn { background: radial-gradient(circle at 50% 75%, #ffd59a 0%, #d07a72 42%, #3d2c58 100%); }
.era-inside.out { animation: twOut .6s forwards; }
.ei-text { position: relative; text-align: center; color: #fff; font-family: var(--font-display); text-shadow: 0 3px 0 rgba(0,0,0,.3); padding: 0 16px; }
.ei-day { display: block; font-size: 72px; animation: twPop .5s; }
.ei-text b { display: block; font-size: clamp(28px, 5vw, 48px); }
.ei-text p { margin: 8px 0; font-size: clamp(18px, 2.6vw, 26px); opacity: .92; }
.ei-count { display: inline-block; margin-top: 6px; padding: 6px 16px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 16px; font-family: var(--font); font-weight: 800; letter-spacing: 1px; }
.ei-bubbles { position: absolute; inset: 0; pointer-events: none; }
.ei-bubbles i { position: absolute; bottom: -40px; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.45); animation: eiUp 3.2s linear infinite; }
.ei-bubbles i:nth-child(odd) { width: 14px; height: 14px; animation-duration: 2.6s; }
.ei-bubbles i:nth-child(1) { left: 6%; } .ei-bubbles i:nth-child(2) { left: 14%; animation-delay: .4s; } .ei-bubbles i:nth-child(3) { left: 22%; animation-delay: 1.1s; } .ei-bubbles i:nth-child(4) { left: 30%; animation-delay: .2s; }
.ei-bubbles i:nth-child(5) { left: 38%; animation-delay: 1.6s; } .ei-bubbles i:nth-child(6) { left: 46%; animation-delay: .8s; } .ei-bubbles i:nth-child(7) { left: 54%; animation-delay: 2s; } .ei-bubbles i:nth-child(8) { left: 62%; animation-delay: .5s; }
.ei-bubbles i:nth-child(9) { left: 70%; animation-delay: 1.3s; } .ei-bubbles i:nth-child(10) { left: 78%; animation-delay: .1s; } .ei-bubbles i:nth-child(11) { left: 86%; animation-delay: 1.8s; } .ei-bubbles i:nth-child(12) { left: 92%; animation-delay: .9s; }
.ei-bubbles i:nth-child(13) { left: 10%; animation-delay: 2.3s; } .ei-bubbles i:nth-child(14) { left: 50%; animation-delay: 2.7s; }
@keyframes eiUp { to { transform: translateY(-110vh); } }

.panel.passport { width: min(820px, calc(100vw - 24px)); }
.panel.passport h2 { color: #5a30c9; }
.pp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 6px; }
.pp-stamp { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 22px; background: #fff; border: 2px solid #efe7ff; box-shadow: 0 4px 0 rgba(31,42,92,.06); color: var(--ink); text-align: center; transform: rotate(var(--r, 0deg)); }
.pp-stamp .pp-ic { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; border: 5px dashed var(--c); background: #fff; }
.pp-stamp.got .pp-ic { background: radial-gradient(circle at 50% 35%, #fff, var(--c)); border-style: solid; box-shadow: 0 0 0 4px #ffe680; }
.pp-stamp:not(.got) { opacity: .55; filter: grayscale(.8); }
.pp-stamp b { font-family: var(--font-display); font-size: 16px; line-height: 1.1; }
.pp-stamp small { font-weight: 800; color: var(--ink-2); font-size: 12px; }
.tp-pass { margin-left: 10px; padding: 6px 14px; border-radius: 999px; background: #24306b; color: #ffe680; font-weight: 800; }
@media (max-width: 640px) { .pp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 901px) { .tp-grid { gap: 12px; } .tp-img { aspect-ratio: 2.3 / 1; } .tp-body { padding: 10px 12px 12px; } .tp-grid .tp-body p { font-size: 13px; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .tp-body b { font-size: 17px; } .tp-go { padding: 6px 14px; } .tp-head { margin-bottom: 10px; } }

/* v4.17 seasonal specials */
.tp-sec, .pp-sec { margin: 12px 2px 8px; font-size: 16px; font-weight: 900; color: #1f2a5c; letter-spacing: .2px; }
.tp-special { grid-template-columns: repeat(2, 1fr); }
.tp-card.featured { box-shadow: 0 0 0 4px #ffd84d, 0 6px 0 rgba(31,42,92,.12), 0 16px 30px rgba(216,50,74,.25); }
.tp-now { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: #ffd84d; color: #5a3200; font-weight: 900; font-size: 12px; animation: tpNow 1.6s ease-in-out infinite; }
@keyframes tpNow { 50% { transform: scale(1.07); } }
@media (max-width: 900px) { .tp-special { grid-template-columns: 1fr; } }
@media (min-width: 901px) { .tp-special .tp-img { aspect-ratio: 3.4 / 1; } }

/* v4.37 — the 3D time tunnel */
.timewarp.v2 { background: radial-gradient(circle at 50% 50%, #fff4c8 0%, #6a4bd8 12%, #1d1452 55%, #07051c 100%); }
.timewarp.v2 .tw-spin { opacity: .35; }
.timewarp.v2 canvas.tw-3d { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: normal; }
.timewarp.v2.no3d .tw-spin { opacity: .6; }
.tw-cover { position: absolute; left: 50%; top: 42%; width: min(46vmin, 380px); aspect-ratio: 1; margin: calc(min(46vmin, 380px) / -2) 0 0 calc(min(46vmin, 380px) / -2);
  border-radius: 50%; overflow: hidden; opacity: 0; transform: scale(.15); transition: opacity .5s ease, transform .9s cubic-bezier(.2,1.4,.4,1);
  box-shadow: 0 0 0 8px rgba(255,230,128,.9), 0 0 80px 30px rgba(255,240,200,.8); }
.tw-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-cover.on { opacity: 1; transform: scale(1); }
.timewarp.v2 .tw-text { text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 30px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: reduce) { .timewarp.v2 canvas.tw-3d { display: none; } }

/* v4.39 — journey fun: hidden stars chip + the sing-along rhythm game */
.era-hud .eh-stars { margin-left: auto; margin-right: 8px; padding: 4px 10px; border-radius: 999px; background: #fff4c4; color: #7a5a00; font-family: var(--font-display); font-size: 14px; white-space: nowrap; }
.era-hud .eh-stars.all { background: #ffd23f; color: #3b2a00; box-shadow: 0 0 0 2px #ffb800; }
.panel.songpanel { width: min(460px, calc(100vw - 24px)); }
.jf-song { text-align: center; }
.jf-stage { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; height: min(46vh, 340px); border-radius: 22px; padding: 6px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, #1d1452), #1d1452); }
.jf-lane { position: relative; border-radius: 16px; background: rgba(255,255,255,.07); }
.jf-line { position: absolute; left: 6px; right: 6px; top: 82%; height: 6px; margin-top: 14px; border-radius: 4px; background: #ffe680; box-shadow: 0 0 18px #ffe680; pointer-events: none; }
.jf-n { position: absolute; left: 50%; top: -10%; width: 46px; height: 46px; margin-left: -23px; display: grid; place-items: center; font-style: normal; font-size: 28px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.jf-n.hit { transform: scale(1.6); opacity: 0 !important; transition: transform .25s, opacity .25s; }
.jf-n.miss { filter: grayscale(1); opacity: .35 !important; }
.jf-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.jf-b { height: 64px; border: 0; border-radius: 18px; font-size: 30px; background: linear-gradient(180deg, #fff, #ffe9a6); box-shadow: 0 5px 0 #e0b23c; touch-action: none; }
.jf-b.flash { animation: jfFlash .25s; }
@keyframes jfFlash { 50% { transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 #e0b23c; background: #ffd23f; } }
.jf-score { margin: 8px 0 0; font-family: var(--font-display); font-size: 20px; color: #1f2a5c; }
.jf-end { grid-column: 1 / -1; display: grid; place-items: center; align-content: center; gap: 6px; color: #fff; padding: 10px; }
.jf-end .say { color: #fff; font-size: 18px; }
.jf-btns [data-ok] { grid-column: 1 / -1; justify-self: center; }
