/* v0.2 game layer: coins, chest, dream home + shop, quests, Play hub,
   Lightning Round, Money Moves, league. Uses the tokens from styles.css. */

.hello-r { display: flex; align-items: center; gap: 10px; }
.coin-pill { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 99px; background: #fff3d6; border: 1.5px solid #f3d892; font-family: var(--head); font-weight: 700; font-size: 15px; color: #6b4a00; }
.wiggle { display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-12deg) scale(1.1); } 85% { transform: rotate(12deg) scale(1.1); } 92% { transform: rotate(-6deg); } }
.chest-banner { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 14px; padding: 12px 16px; border-radius: 18px; background: linear-gradient(135deg, #f2b53a, #ef7b5a); color: #fff; box-shadow: 0 4px 0 #c9603f; }
.chest-banner > span:first-child { font-size: 30px; }
.chest-banner b { font-family: var(--head); display: block; }
.chest-banner small { opacity: .9; }
.chest-banner div { flex: 1; }
.chest-banner .go { font-size: 22px; font-weight: 700; }
.chest-big { font-size: 96px; line-height: 1.1; margin: 6px 0 4px; }
.chest-big.reveal { animation: reveal .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes reveal { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }

/* dream home */
.house { display: block; width: 100%; height: auto; }
.house-mini { display: block; margin-top: 14px; border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.hm-meta { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.hm-meta b { display: block; font-family: var(--head); font-size: 16px; }
.hm-go { color: var(--green); font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.house-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; margin-top: 14px; }
.house-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.house-meta b { display: block; font-family: var(--head); font-size: 18px; }
.house-card > .bar { margin: 0 16px; height: 8px; }
.house-next { padding: 10px 16px 14px; color: var(--muted); font-size: 14.5px; }
.top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.back-link .ico { width: 18px; height: 18px; }
.top-row .back-link { margin: 0; }

/* shop */
.seg.four button { font-size: 13px; }
.shop-note { background: var(--blue-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #3c4a60; margin-bottom: 12px; }
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 6px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shop-item b { font-size: 14px; line-height: 1.2; }
.shop-item small { font-size: 12px; color: var(--muted); font-weight: 600; }
.shop-item.on { border-color: var(--green); background: var(--green-soft); }
.shop-item.on small { color: var(--green-dark); }
.shop-item.short { opacity: .6; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.s-emoji { font-size: 36px; line-height: 44px; }

/* weekly quests */
.quests { margin-top: 14px; }
.q-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.q-head h2 { font-size: 17px; }
.q-head small { color: var(--muted); font-weight: 600; }
.quest { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quest:last-of-type { border-bottom: 0; }
.q-emo { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.q-body { flex: 1; }
.q-body b { display: block; font-size: 15px; margin-bottom: 6px; }
.q-body .bar { height: 7px; }
.q-count { color: var(--muted); font-weight: 700; min-width: 34px; text-align: right; }
.q-done { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; }
.quest.claimed b { color: var(--muted); }
.quest .btn.small { height: 36px; padding: 0 12px; font-size: 14px; animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.06); } }
.q-bonus { margin-top: 8px; font-size: 13.5px; color: #9a7a3a; font-weight: 600; }
.tile .t-ico { font-size: 24px; }

/* quiz extras */
.q-row { display: flex; justify-content: space-between; align-items: center; }
.combo-chip { background: #fff3d6; color: #8a5a00; font-weight: 800; font-size: 13px; border-radius: 99px; padding: 4px 10px; animation: reveal .35s ease; }
.house-gain .house { width: 84px; flex: none; border-radius: 10px; }

.pop { position: absolute; z-index: 45; transform: translate(-50%, 0); pointer-events: none; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--green); text-shadow: 0 2px 0 #fff, 0 0 12px #fff; animation: popUp .95s ease-out forwards; white-space: nowrap; }
@keyframes popUp { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -12px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -60px) scale(1); opacity: 0; } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* play hub */
.games { display: grid; gap: 12px; margin-top: 18px; }
.game { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 24px; color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .18); transition: transform .08s; }
.game:active { transform: translateY(3px); }
.game h3 { font-size: 19px; }
.game p { opacity: .9; font-size: 14.5px; margin: 2px 0 6px; }
.game small { display: inline-block; background: rgba(255, 255, 255, .2); border-radius: 99px; padding: 3px 10px; font-weight: 700; font-size: 12.5px; }
.g-emoji { font-size: 40px; width: 64px; height: 64px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border-radius: 18px; flex: none; }
.g-lr { background: linear-gradient(135deg, #3a2a8c, #7b3fd1); }
.g-mm { background: linear-gradient(135deg, #e0603f, #f2a33a); }
.g-sim { background: linear-gradient(135deg, #16233f, #2f6b52); }
.g-lg { background: linear-gradient(135deg, #b07b0f, #e8b53a); }

/* lightning round */
.lr { display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 20px 24px; background: radial-gradient(circle at 50% 0%, #5b3bc4 0%, #1d1650 60%, #120e33 100%); color: #fff; }
.lr-top { display: flex; align-items: center; gap: 12px; }
.x { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); }
.x.light { color: #c9c3f0; }
.lr-time { flex: 1; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.lr-time i { display: block; height: 100%; background: linear-gradient(90deg, #f2b53a, #ffd66b); border-radius: 99px; transition: width .1s linear; }
.lr-time i.low { background: linear-gradient(90deg, #ef4b4b, #ff8a5c); }
.lr-t { font-family: var(--head); font-size: 20px; min-width: 28px; text-align: right; }
.lr-score { text-align: center; margin-top: 22px; }
.lr-score span { font-family: var(--head); font-weight: 800; font-size: 54px; line-height: 1; }
.lr-score small { display: block; color: #b8b0ea; font-weight: 600; }
.lr-combo { align-self: center; margin: 12px 0 18px; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 14px; color: #d8d2ff; }
.lr-combo.hot { background: linear-gradient(90deg, #ef7b5a, #f2b53a); color: #fff; animation: glow 1s ease-in-out infinite; }
.lr-question { font-size: 22px; line-height: 1.3; text-align: center; margin-bottom: 18px; min-height: 58px; }
.lr-opts { display: grid; gap: 10px; }
.lr-opt { background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .16); color: #fff; border-radius: 16px; padding: 15px; font-weight: 700; font-size: 16px; text-align: left; transition: background .12s, transform .08s; }
.lr-opt:active { transform: scale(.98); }
.lr-opt.right { background: #3aa66a; border-color: #6fe0a0; }
.lr-opt.wrong { background: #c8443b; border-color: #ff8a80; }
.lr-intro, .lr-end { align-items: center; text-align: center; }
.lr-intro .lr-top { align-self: stretch; }
.lr-big { font-size: 88px; margin: 24px 0 6px; }
.lr-big.bolt { animation: wiggle 2s ease-in-out infinite; }
.lr h1 { font-size: 32px; font-weight: 800; }
.lr-rules { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 10px; text-align: left; width: 100%; }
.lr-rules li { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 12px 14px; font-weight: 600; }
.lr-best { color: #c9c3f0; margin-bottom: 18px; }
.lr-intro > .btn { margin-top: auto; }
.lr-label { margin-top: 4px; font-family: var(--head); font-weight: 700; color: #ffd66b; font-size: 18px; }
.lr-final { font-family: var(--head); font-weight: 800; font-size: 80px; line-height: 1.1; }
.lr-sub { color: #c9c3f0; }
.lr-gains { display: flex; gap: 10px; margin: 20px 0 10px; }
.lr-gains span { background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 8px 14px; font-weight: 700; }
.lr-badge { color: #ffd66b; font-weight: 700; margin-top: 6px; }
.lr-actions { margin-top: auto; width: 100%; display: grid; gap: 12px; padding-top: 24px; }
.btn.ghost-dark { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }

/* money moves */
.mm { display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 20px 24px; background: linear-gradient(180deg, #fff6ea 0%, var(--bg) 40%); }
.mm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mm-top .dots { flex: 1; display: flex; gap: 5px; }
.mm-top .dots i { flex: 1; height: 8px; border-radius: 99px; background: #e8dfd2; }
.mm-top .dots i.ok { background: var(--coral); }
.mm-top .dots i.now { background: #f6b9a6; }
.meters { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.meter { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; text-align: left; }
.meter small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.meter b { font-family: var(--head); font-size: 17px; }
.meter .bar { height: 5px; margin-top: 4px; }
.bar.happy > i { background: linear-gradient(90deg, #f2b53a, #ef7b5a); }
.mm-card { margin: 16px 0; background: #fff; border-radius: 26px; padding: 22px 18px; text-align: center; box-shadow: 0 10px 30px rgba(22, 35, 63, .1); animation: cardIn .35s ease; }
@keyframes cardIn { from { transform: translateY(16px) rotate(-2deg); opacity: 0; } }
.mm-emoji { font-size: 62px; margin: 6px 0; }
.mm-card h2 { font-size: 21px; line-height: 1.25; }
.mm-card p { color: var(--muted); margin-top: 6px; font-size: 16px; }
.mm-choices { display: grid; gap: 10px; margin-top: auto; }
.mm-choice { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 16px; font-weight: 700; font-size: 16px; box-shadow: 0 4px 0 var(--line); text-align: left; }
.mm-choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.mm-out { margin-top: auto; animation: reveal .3s ease; }
.mm-out p { font-size: 17px; font-weight: 600; text-align: center; line-height: 1.4; }
.deltas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.delta { border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: 14.5px; }
.delta.up { background: var(--green-soft); color: var(--green-dark); }
.delta.down { background: var(--red-soft); color: var(--red); }
.mm-intro, .mm-end { text-align: center; }
.mm .big { font-size: 74px; margin-top: 10px; }
.mm h1 { font-size: 30px; font-weight: 800; margin: 8px 0 6px; }
.mm .score { color: var(--muted); font-size: 16.5px; margin-bottom: 18px; line-height: 1.45; }
.mm-goal { margin: 18px 0; background: var(--green-soft); border-radius: 14px; padding: 12px; font-size: 15px; }
.mm-intro > .btn { margin-top: auto; }
.mm-tip { margin-top: 12px; background: #fff3d6; border-radius: 14px; padding: 10px 12px; font-size: 14.5px; }
.mm-end .gains { margin: 16px 0; }
.mm-end .actions { margin-top: auto; display: grid; gap: 12px; }

/* league */
.league { display: grid; gap: 8px; margin-top: 18px; }
.lrow { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; }
.lrow.you { border: 2px solid var(--green); background: var(--green-soft); }
.rank { width: 28px; text-align: center; font-family: var(--head); font-weight: 700; color: var(--muted); font-size: 16px; }
.l-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.lrow b { flex: 1; font-weight: 600; }
.lrow small { font-family: var(--head); font-weight: 700; color: var(--ink); }
.promo-line { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--green); margin: 6px 0 2px; border-top: 2px dashed #b9dcc2; }
.promo-line span { position: relative; top: -10px; background: var(--bg); padding: 0 8px; }

/* Drawn coin: the coin emoji is missing on many Windows PCs. */
.coin { display: inline-block; width: .95em; height: .95em; border-radius: 50%; vertical-align: -.14em; background: radial-gradient(circle at 35% 30%, #fff1b8, #f2b53a 55%, #c98a12); box-shadow: inset 0 0 0 1.5px #c98a12; }
.pill { white-space: nowrap; }

/* Demo-only restart bar (DEMO_BAR in app.js). It takes the top safe area,
   so screens under it drop their own safe-area padding. */
.demo-bar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(6px + env(safe-area-inset-top)) 14px 6px; background: #0e1830; color: #b6c3d8; font-size: 12.5px; font-weight: 600; }
.demo-bar button { color: #fff; background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; }
.app.has-demo main { padding-top: 18px; }
.app.has-demo.full main { padding-top: 0; }
.app.has-demo .welcome, .app.has-demo .quiz, .app.has-demo .lr, .app.has-demo .mm, .app.has-demo .media { padding-top: 16px; }
.app.has-demo .result { padding-top: 36px; }
.app.has-demo .toasts { top: 52px; }
