/* Build the Ark (typing trivia). Uses the Keep It Lit card, typing tiles, and menu from lit.css. */
.ark { max-width: 560px; margin: 0 auto; }
.ak-home h2 { margin: 8px 0 10px; font-size: 1.6rem; color: var(--ink); letter-spacing: -0.01em; }
.ak-lbl { margin: 16px 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ak-diff { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
.ak-diff button { font-size: .88rem; padding: 10px 0; }
.ak-stats { margin-top: 12px; }

/* The ark scene */
.ak-stage { position: relative; margin: 0 auto; max-width: 360px; overflow: hidden; border-radius: 18px; background: linear-gradient(180deg, #EAF2F8, #FBF8F1 75%); }
.ak-svg { display: block; width: 100%; height: auto; }
.ak-play .ak-stage { max-width: 300px; margin-top: 30px; }
.ak-plank.drop { animation: ak-drop .5s cubic-bezier(.3,1.5,.5,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.ak-plank.drop + .ak-plank.drop { animation-delay: .12s; }
@keyframes ak-drop { from { transform: translateY(-70px) rotate(-8deg); opacity: 0; } 70% { opacity: 1; } }
.ak-plank.fall { animation: ak-fall .9s ease-in both; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes ak-fall { 0% { transform: none; } 20% { transform: translate(4px, -6px) rotate(10deg); } 100% { transform: translate(40px, 90px) rotate(70deg); opacity: 0; } }
.ak-stage.shake .ak-boat { animation: lt-shake .3s; }
.ak-rainbow, .ak-rain, .ak-sea { opacity: 0; }
.ak-sea { transform: translateY(40px); }
.ak-cabin.on { animation: lt-pop .5s cubic-bezier(.3,1.6,.5,1) both; transform-box: fill-box; transform-origin: 50% 100%; }

/* Ark finished: rain, the water rises, the ark floats, then a rainbow */
.ak-stage.flood .ak-rain { opacity: 1; animation: ak-rainfade 3.2s ease forwards; }
.ak-stage.flood .ak-rain path { animation: ak-rain .55s linear infinite; }
@keyframes ak-rain { to { transform: translate(-14px, 230px); } }
@keyframes ak-rainfade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.ak-stage.flood .ak-sea { opacity: 1; animation: ak-rise 2.4s ease .3s both; }
@keyframes ak-rise { from { transform: translateY(40px); } to { transform: translateY(-22px); } }
.ak-stage.flood .ak-ground { animation: ak-sink 2.4s ease .3s both; }
@keyframes ak-sink { to { opacity: 0; } }
.ak-stage.flood .ak-boat { animation: ak-float 2.4s ease .3s both, ak-bob 2.4s ease-in-out 2.7s infinite; }
@keyframes ak-float { to { transform: translateY(-18px); } }
@keyframes ak-bob { 0%, 100% { transform: translateY(-18px) rotate(0); } 50% { transform: translateY(-22px) rotate(-1.5deg); } }
.ak-stage.flood .ak-rainbow { animation: ak-bow 1.2s ease 2.8s both; }
@keyframes ak-bow { from { opacity: 0; transform: translateY(16px); } to { opacity: .85; transform: none; } }

/* Ark progress bar */
.ak-bar { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 10px auto 0; font-size: .85rem; font-weight: 800; color: var(--muted); }
.ak-bar b { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.ak-meter { flex: 1; height: 10px; border-radius: 5px; background: #ECE6D9; overflow: hidden; }
.ak-meter i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #C98B4E, #9A5F2E); transition: width .45s cubic-bezier(.3,1.4,.5,1); }

/* Animals: 10 pairs per ark, grey until they climb aboard */
.ak-pairbox { margin-top: 12px; }
.ak-pairs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.ak-pair { padding: 2px 6px; border-radius: 999px; font-size: 1rem; line-height: 1.4; letter-spacing: -2px; filter: grayscale(1); opacity: .28; background: #F3EFE6; }
.ak-pair.on { filter: none; opacity: 1; background: var(--green-bg); }
.ak-pair.walk { animation: ak-walk .8s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes ak-walk { 0% { transform: translateX(-30px) scale(.6); opacity: 0; } 60% { transform: translateY(-6px) scale(1.25); opacity: 1; } 100% { transform: none; } }
.ak-next { margin: 6px 0 0; font-size: .82rem; font-weight: 700; color: var(--muted); }
.ak-next b { letter-spacing: -2px; font-size: 1rem; }
.ak-next.pop { animation: lt-pop .4s ease both; }

/* Play */
.ak-top { display: flex; justify-content: space-between; align-items: center; min-height: 30px; padding-left: 84px; }
.ak-streak { font-size: .9rem; font-weight: 700; color: var(--muted); }
.ak-streak b { color: #C2561C; font-size: 1.1rem; }
.ak-streak.hot { animation: lt-pop .4s ease both; }
.ak-lvl { padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); color: #7A5B1E; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.ak-play .ak-stage { margin-top: 8px; }
.ak-qbox { margin: 14px 0 6px; min-height: 3.2em; }
.ak-q { margin: 0; font-size: 1.22rem; font-weight: 700; line-height: 1.35; color: var(--ink); opacity: 0; transform: translateY(-6px); transition: opacity .3s .15s, transform .3s .15s; }
.ak-q.in { opacity: 1; transform: none; }
.ak-time { height: 8px; margin: 10px auto 0; width: 80%; border-radius: 4px; background: #ECE6D9; overflow: hidden; opacity: 0; transition: opacity .2s; }
.ak-time.on { opacity: 1; }
.ak-time i { display: block; height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, #E3C88E, #C9A45C); }
.ak-time.low i { background: linear-gradient(90deg, #E5531A, #F08A3E); }
.ak-typed { min-height: 52px; }
.ak-sp { width: 14px; }
.ak-typed.good .lt-tl { background: var(--green-bg); border-color: var(--green); color: var(--green-deep); }
.ak-typed.bad .lt-tl { background: #FBE9E6; border-color: #C2412D; color: #B3261E; text-decoration: line-through; }
.ak-typed.shake { animation: lt-shake .16s; }

/* The big question: slams in over the card, holds, then shrinks up into its place (Kahoot style) */
.ak-big { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 24px; border-radius: 22px; pointer-events: none; opacity: 0; }
.ak-big span { display: block; font-size: clamp(1.7rem, 7.2vw, 2.4rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; color: var(--paper); text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.ak-big.show { opacity: 1; background: radial-gradient(120% 90% at 50% 30%, #2B5287, var(--blue) 60%, var(--blue-deep)); }
.ak-big.show span { animation: ak-slam .5s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes ak-slam { from { transform: scale(2.2); opacity: 0; } to { transform: none; opacity: 1; } }
.ak-big.away { opacity: 0; transition: opacity .45s ease .1s; background: radial-gradient(120% 90% at 50% 30%, #2B5287, var(--blue) 60%, var(--blue-deep)); }
.ak-big.away span { animation: ak-shrink .5s cubic-bezier(.5,0,.6,1) both; }
@keyframes ak-shrink { to { transform: translateY(-34%) scale(.45); opacity: 0; } }
.ak-play.intro .lt-quit { visibility: hidden; }

/* Result */
.ak-result { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 1.5em; margin: 6px 0 0; font-weight: 600; color: var(--muted); }
.ak-result:empty { display: block; }
.ak-result strong { font-size: 1.1rem; }
.ak-result.yes strong { color: var(--green-deep); animation: lt-pop .35s cubic-bezier(.3,1.6,.5,1) both; }
.ak-result.no strong { color: #B3261E; }
.ak-result.warn { color: #8A6A12; font-weight: 700; }
.ak-result.done strong { font-size: 1.35rem; color: var(--ink); animation: lt-pop .5s cubic-bezier(.3,1.6,.5,1) 2.6s both; }
.ak-result.done span { animation: rise .4s ease 2.8s both; }
.ak-result.done .ak-nextbtn { animation: rise .4s ease 3s both, ctapulse 2s 3.4s infinite; }
.ak-result span { font-size: .95rem; color: var(--ink); }
.ak-result .ak-xp { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--green); color: #fff; font-size: .8rem; font-weight: 800; vertical-align: 2px; }
.ak-ref { color: var(--blue); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--gold); }
.ak-rep { margin-top: 2px; padding: 4px 10px; border: 0; background: none; font-family: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.ak-nextbtn { width: 100%; min-height: 52px; margin-top: 8px; font-size: 1.05rem; letter-spacing: .08em; }

@media (prefers-reduced-motion: reduce) {
  .ak-plank.drop, .ak-plank.fall, .ak-pair.walk, .ak-big span, .ak-stage.flood .ak-rain path, .ak-stage.flood .ak-boat { animation: none !important; }
}
.ak-play.answered .lt-deskhint { visibility: hidden; }
/* Report this question: always under the question, plain so it never competes with the answer */
.ak-qrep { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 5px 12px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-family: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.ak-qrep:hover { border-color: var(--line-dark); color: var(--ink); }
.ak-play.intro .ak-qrep { visibility: hidden; }
/* The blue question screen can be tapped to skip (quick readers) */
.ak-big { flex-direction: column; gap: 18px; }
.ak-big.show { pointer-events: auto; cursor: pointer; }
.ak-skip { font-size: .85rem; font-weight: 700; letter-spacing: .04em; color: var(--gold-light); opacity: 0; animation: rise .4s ease .9s both, breathe 1.8s ease-in-out 1.3s infinite; }
.ak-big.away .ak-skip { animation: none; opacity: 0; }
/* Phones: keyboard tab. Gold when the keyboard is up. While it is up, the ark shrinks so the question and your letters sit above the keys. */
.ak-kbt { display: inline-flex; align-items: center; gap: 6px; margin: 6px auto 0; padding: 8px 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 999px; background: #fff; font-family: inherit; font-size: .92rem; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ak-kbt i { font-style: normal; font-weight: 800; font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: #ECE6D9; color: var(--muted); }
.ak-kbt[aria-pressed="true"] { border-color: var(--gold); background: #FFF8E6; }
.ak-kbt[aria-pressed="true"] i { background: var(--gold); color: var(--blue-deep); }
.ak-kbt[aria-pressed="false"] { animation: ctapulse 2s infinite; }
.ak-play.kb .ak-stage { max-width: 180px; margin-top: 4px; }
.ak-play.kb .ak-bar { margin-top: 4px; }
.ak-play.kb .ak-qbox { margin-top: 8px; }

/* ===== Play layout (Ethan 2026-11-05): top row, ark with tags, bold question card ===== */
.ak-play .ak-top { display: flex; align-items: center; gap: 10px; min-height: 36px; padding-left: 84px; }
.ak-play .ak-top .xp-mini { flex: 1; min-width: 0; margin: 0; }
.ak-scene { position: relative; width: fit-content; max-width: 100%; margin: 10px auto 0; }
.ak-play .ak-scene .ak-stage, .ak-play.kb .ak-scene .ak-stage { margin: 0; }
.ak-tag { position: absolute; top: 7px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--muted); font-size: .74rem; font-weight: 800; line-height: 1.5; box-shadow: 0 1px 0 rgba(0,0,0,.06); white-space: nowrap; }
.ak-tag.ak-lvl { left: 7px; background: var(--gold-soft); color: #7A5B1E; letter-spacing: .04em; }
.ak-tag.ak-count { right: 7px; }
.ak-tag.ak-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ak-tag.ak-streak { top: auto; bottom: 7px; left: 0; right: 0; width: max-content; margin: 0 auto; display: none; color: #C2561C; }
.ak-tag.ak-streak.on { display: block; }
.ak-tag.ak-streak b { font-size: .9rem; }
/* The question: its own card, big and bold. The timer drains along the bottom edge. */
.ak-play .ak-qbox, .ak-play.kb .ak-qbox { position: relative; margin: 10px 0 8px; padding: 14px 14px 18px; min-height: 0; background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 18px; overflow: hidden; }
.ak-play .ak-q { font-size: 1.3rem; font-weight: 800; line-height: 1.28; letter-spacing: -.005em; color: var(--ink); }
.ak-play .ak-qbox .ak-time { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 6px; margin: 0; border-radius: 0; background: #F1ECE1; }
.ak-play .ak-qbox .ak-time i { border-radius: 0; }
.ak-play .ak-qrep { margin: 8px auto 0; }
/* The blue question screen slides up from the bottom, then slides back down when the typing starts (Ethan 2026-11-05) */
.ak-big { opacity: 1; visibility: hidden; transform: translateY(105%); background: radial-gradient(120% 90% at 50% 30%, #2B5287, var(--blue) 60%, var(--blue-deep)); }
.ak-big.show { visibility: visible; transform: none; transition: transform .55s cubic-bezier(.2,.9,.3,1); }
.ak-big.show span { animation: ak-textup .5s ease .25s both; }
@keyframes ak-textup { from { opacity: 0; transform: translateY(18px); } }
.ak-big.away { opacity: 1; visibility: hidden; transform: translateY(105%); transition: transform .5s cubic-bezier(.55,0,.75,.3), visibility 0s linear .5s; }
.ak-big.away span { animation: none; }
@media (prefers-reduced-motion: reduce) { .ak-big.show, .ak-big.away { transition: none; } .ak-big.show span { animation: none; } }
/* The level tag on the ark: Easy green, Medium gold, Hard red, for the question on screen (Ethan 2026-11-05) */
.ak-tag.ak-lvl.d1 { background: var(--green-bg); color: var(--green-deep); }
.ak-tag.ak-lvl.d2 { background: var(--gold-soft); color: #7A5B1E; }
.ak-tag.ak-lvl.d3 { background: var(--red-bg, #FBE9E6); color: var(--red-deep, #9B2C1F); }
