/* Who Am I? — the Bible guessing game in the family tree's kids mode (tree/guess.js) */
.gw { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 16, 12, 0.5); opacity: 0; transition: opacity 0.22s ease; }
.gw.open { opacity: 1; }
.gw[hidden] { display: none; }
html.gw-open, html.gw-open body { overflow: hidden; }
.gw-box { position: relative; display: flex; flex-direction: column; width: min(860px, 100%); height: min(960px, 100%); overflow: hidden; border-radius: 24px; background: #FFF8EC; color: #2E2B27; box-shadow: 0 40px 80px -30px rgba(20, 16, 12, 0.6); transform: translateY(20px) scale(0.98); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); font-family: var(--sans, system-ui, sans-serif);
  background-image: radial-gradient(circle at 12% 8%, rgba(224, 137, 47, 0.12), transparent 40%), radial-gradient(circle at 90% 95%, rgba(214, 69, 127, 0.1), transparent 45%); }
.gw.open .gw-box { transform: none; }
@media (max-width: 560px) { .gw { padding: 0; } .gw-box { width: 100%; height: 100%; border-radius: 0; } }
body.site-dark .gw-box { background-color: #2A241C; color: #F3EAD8; }

.gw-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; padding-top: max(14px, env(safe-area-inset-top)); }
.gw-titles { flex: 1; min-width: 0; }
.gw-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #D0702A; }
.gw-title { margin-top: 2px; font-family: var(--serif, Georgia, serif); font-size: clamp(20px, 5.4vw, 26px); font-weight: 700; line-height: 1.15; }
.gw-sub { margin-top: 3px; font-size: 13.5px; line-height: 1.4; opacity: 0.75; }
.gw-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 14px 16px; }

/* the menu */
.gw-menu { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; text-align: center; }
.gw-faces { display: flex; justify-content: center; margin: 4px 0 2px; }
.gw-face { width: 78px; height: 88px; margin: 0 -8px; border-radius: 50%; overflow: hidden; background: #FDEBD0; border: 3px solid #fff; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.4); cursor: pointer; }
.gw-face:nth-child(odd) { transform: translateY(8px); }
.gw-face svg { width: 100%; height: 100%; display: block; }
.gw-lead { max-width: 440px; margin: 0; font-size: 15.5px; line-height: 1.5; }
.gw-big { display: flex; align-items: center; gap: 14px; width: min(400px, 100%); padding: 14px 16px; border: none; border-radius: 18px; background: linear-gradient(135deg, #E0892F, #D6457F); color: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 10px 20px -12px rgba(214, 69, 127, 0.9); -webkit-tap-highlight-color: transparent; transition: transform 0.12s; }
.gw-big.is-alt { background: linear-gradient(135deg, #3A86D0, #5B4BB5); box-shadow: 0 10px 20px -12px rgba(58, 134, 208, 0.9); }
.gw-big:active { transform: scale(0.97); }
.gw-big b { display: block; font-size: 17px; }
.gw-big small { display: block; font-size: 13px; opacity: 0.9; }
.gw-big-ic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.22); }
.gw-big-ic svg { width: 28px; height: 28px; }
.gw-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; opacity: 0.85; cursor: pointer; }
.gw-check input { width: 18px; height: 18px; accent-color: #E0892F; }
.gw-or { font-size: 13px; opacity: 0.7; }
.gw-join { display: flex; gap: 8px; }
.gw-join input { width: 150px; padding: 10px 12px; border: 2px solid #E6D6BC; border-radius: 14px; background: #fff; color: #2E2B27; font: 800 22px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.2em; text-align: center; text-transform: uppercase; }
.gw-link { border: none; background: none; color: inherit; font: inherit; font-size: 14px; font-weight: 700; opacity: 0.7; cursor: pointer; padding: 8px; }
.gw-code { font: 800 44px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.18em; color: #D6457F; }
.gw-qr { padding: 10px; border-radius: 16px; background: #FFFDF7; box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.4); }
.gw-qr img, .gw-qr canvas { display: block; }
.gw-wait { display: inline-flex; gap: 6px; padding: 8px; }
.gw-wait i { width: 9px; height: 9px; border-radius: 50%; background: #E0892F; animation: gw-dot 1s ease-in-out infinite; }
.gw-wait i:nth-child(2) { animation-delay: 0.15s; } .gw-wait i:nth-child(3) { animation-delay: 0.3s; }
@keyframes gw-dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-6px); opacity: 1; } }

/* the board */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .gw-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; } }
.gw-card { position: relative; padding: 0; border: none; background: none; font: inherit; color: inherit; cursor: pointer; perspective: 600px; -webkit-tap-highlight-color: transparent; }
.gw-card-in { position: relative; display: block; aspect-ratio: 3 / 4.1; transform-style: preserve-3d; transform-origin: 50% 50%; transition: transform 0.45s cubic-bezier(0.3, 1.3, 0.5, 1); }
.gw-front, .gw-back { position: absolute; inset: 0; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.gw-front { background: #fff; border: 2.5px solid #E6D6BC; border-top: 5px solid var(--gw-c, #3A86D0); box-shadow: 0 5px 12px -8px rgba(0, 0, 0, 0.45); }
.gw-card.is-f { --gw-c: #D6457F; }
.gw-card.is-m { --gw-c: #3A86D0; }
.gw-pic { flex: 1; min-height: 0; display: block; background: color-mix(in srgb, var(--gw-c) 12%, #FFF8EC); }
.gw-pic svg { width: 100%; height: 100%; display: block; }
.gw-front b { display: block; padding: 3px 2px 4px; font-size: 12.5px; font-weight: 800; line-height: 1.1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #2E2B27; }
.gw-back { transform: rotateX(180deg); background: #B5652A; border: 2.5px solid #8A4A1E; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0 8px, transparent 8px 16px), radial-gradient(circle at 50% 45%, #E0B84A 0 16%, transparent 17%); }
.gw-card.is-down .gw-card-in { transform: rotateX(180deg); }
.gw-card.is-down { opacity: 0.85; }
.gw-grid.is-pick .gw-card.is-mine .gw-front { border-color: #E0892F; box-shadow: 0 0 0 4px rgba(224, 137, 47, 0.45), 0 10px 20px -10px rgba(0, 0, 0, 0.5); }
.gw-grid.is-pick .gw-card.is-mine { transform: translateY(-4px); }
.gw-grid.is-guessing .gw-card:not(.is-down) .gw-front { animation: gw-pulse 1.2s ease-in-out infinite; border-color: #D6457F; }
@keyframes gw-pulse { 50% { box-shadow: 0 0 0 4px rgba(214, 69, 127, 0.35); } }

.gw-bar { flex: none; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(0, 0, 0, 0.08); background: rgba(255, 255, 255, 0.6); }
body.site-dark .gw-bar { background: rgba(0, 0, 0, 0.2); }
.gw-btn { min-height: 46px; padding: 0 20px; border: none; border-radius: 999px; background: #E0892F; color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 16px -10px rgba(224, 137, 47, 0.9); -webkit-tap-highlight-color: transparent; transition: transform 0.12s; }
.gw-btn:active { transform: scale(0.96); }
.gw-btn[disabled] { opacity: 0.5; cursor: default; }
.gw-btn.soft { background: #fff; color: #2E2B27; border: 2px solid #E6D6BC; box-shadow: none; }
.gw-btn.is-guess { background: #D6457F; box-shadow: 0 8px 16px -10px rgba(214, 69, 127, 0.9); }

.gw-score { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px 8px; }
.gw-mine { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.gw-mine > svg { flex: none; width: 46px; height: 52px; border-radius: 12px; background: #FDEBD0; border: 2px solid #E0892F; cursor: pointer; }
.gw-mine span { min-width: 0; }
.gw-mine small, .gw-left small { display: block; font-size: 11px; font-weight: 700; opacity: 0.7; line-height: 1.15; }
.gw-mine b { display: block; font-size: 16px; }
.gw-left { flex: none; width: 76px; text-align: center; padding: 5px 4px; border-radius: 12px; background: #fff; border: 2px solid #E6D6BC; }
.gw-left b { display: block; font-size: 20px; line-height: 1; color: #E0892F; }
.gw-left.is-them b { color: #3A86D0; }
body.site-dark .gw-left, body.site-dark .gw-btn.soft { background: #3A3228; color: #F3EAD8; border-color: #5A4E3E; }

.gw-ans { flex: none; margin: 0 14px 10px; padding: 10px 14px; border-radius: 16px; background: #EAF6EC; border: 2px solid #8CC79A; animation: gw-in 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.gw-ans.is-no { background: #FDECEC; border-color: #E8A1A1; }
.gw-ans.is-theirs { background: #EAF1FB; border-color: #9BBDE6; }
.gw-ans-q { display: block; font-size: 13.5px; line-height: 1.35; opacity: 0.85; }
.gw-ans b { display: block; font-size: 20px; }
.gw-ans small { display: block; margin-top: 2px; font-size: 12.5px; opacity: 0.8; }
body.site-dark .gw-ans { color: #2E2B27; }
@keyframes gw-in { from { transform: scale(0.9); opacity: 0; } }

/* the question sheet */
.gw-qsheet { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; background: rgba(20, 16, 12, 0.35); opacity: 0; transition: opacity 0.2s; }
.gw-qsheet.open { opacity: 1; }
.gw-qsheet[hidden] { display: none; }
.gw-qbox { width: 100%; max-height: 82%; display: flex; flex-direction: column; border-radius: 22px 22px 0 0; background: #FFF8EC; box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, 0.4); transform: translateY(40px); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
body.site-dark .gw-qbox { background: #2A241C; }
.gw-qsheet.open .gw-qbox { transform: none; }
.gw-qhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; font-size: 18px; }
.gw-qbody { overflow-y: auto; padding: 0 14px calc(16px + env(safe-area-inset-bottom)); }
.gw-qgroup { margin-bottom: 12px; }
.gw-qgroup small { display: block; margin: 0 2px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.65; }
.gw-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 7px; }
.gw-q { position: relative; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 10px; border: 2px solid #E6D6BC; border-radius: 14px; background: #fff; color: #2E2B27; font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gw-q:active { transform: scale(0.97); }
.gw-q[disabled] { opacity: 0.35; cursor: default; text-decoration: line-through; }
.gw-q-ic { position: relative; flex: none; width: 26px; height: 26px; display: grid; place-items: center; color: #D0702A; }
.gw-q-ic svg { width: 24px; height: 24px; }
.gw-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.15); }
.gw-swatch.is-colors { background: conic-gradient(#C0392B, #E67E22, #F1C40F, #27AE60, #2980B9, #8E44AD, #C0392B); }
.gw-eye { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; }

/* the end */
.gw-over { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 16, 12, 0.45); animation: gw-fade 0.3s ease; overflow: hidden; }
@keyframes gw-fade { from { opacity: 0; } }
.gw-over-card { position: relative; z-index: 1; width: min(380px, 100%); padding: 18px 18px 16px; border-radius: 24px; background: #FFF8EC; color: #2E2B27; text-align: center; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6); animation: gw-in 0.45s cubic-bezier(0.3, 1.4, 0.5, 1); }
.gw-over-pic { display: block; width: 150px; height: 170px; margin: -4px auto 4px; cursor: pointer; }
.gw-over-pic svg { width: 100%; height: 100%; display: block; }
.gw-over-card h2 { margin: 0 0 6px; font-family: var(--serif, Georgia, serif); font-size: 24px; line-height: 1.2; }
.gw-over-card p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.gw-over-them { opacity: 0.8; }
.gw-over-acts { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.gw-confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 14px; border-radius: 3px; background: var(--c); animation: gw-conf 2.4s var(--d) ease-in forwards; }
@keyframes gw-conf { to { transform: translateY(110vh) rotate(720deg); } }

.gw-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 95; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: #2E2B27; color: #fff; font-family: var(--sans, system-ui, sans-serif); font-size: 14.5px; font-weight: 600; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: transform 0.25s, opacity 0.25s; }
.gw-toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .gw, .gw-box, .gw-card-in, .gw-qbox, .gw-qsheet { transition: none; }
  .gw-confetti { display: none; }
  .gw-ans, .gw-over-card, .gw-grid.is-guessing .gw-card .gw-front { animation: none; }
}
