/* Tester ("player") app: game-style, mobile-first. Active when <body class="player">. */

body.player {
  --o1: #8a6bff; --o2: #6c45ff; --o3: #4a2bc2; --deep1: #2a1f5c; --deep2: #17122c; --gold1: #ffe27a; --gold2: #f5b400;
  --pbg: #eef1f7; --pcard: #ffffff; --pink: #1d1f29; --pmuted: #6b7182; --pline: #e2e6ee;
  background: var(--pbg);
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--pink);
}
body.player .app { max-width: 560px; padding-bottom: 92px; }
body.player .top { background: var(--pbg); border: 0; min-height: 76px; padding: 0 16px; flex-wrap: nowrap; }
body.player .nav, body.player .footer { display: none; }
body.player .logo { font-family: Fredoka, Poppins, sans-serif; font-size: 22px; }
body.player .logo span { color: var(--o2); }
body.player main { padding: 4px 16px 24px; }
body.player .who { gap: 10px; }

.balance-pill {
  display: grid; justify-items: center; text-decoration: none; color: #fff; line-height: 1.05;
  padding: 7px 18px 8px; border-radius: 12px;
  background: linear-gradient(180deg, var(--o1), var(--o2));
  box-shadow: 0 3px 0 var(--o3), 0 8px 18px #6c45ff40;
}
.balance-pill span { font-size: 11px; font-weight: 600; opacity: .95; }
.balance-pill b { font-family: Fredoka, Poppins, sans-serif; font-size: 22px; font-weight: 700; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: #7b4fd6; color: #fff;
  font-family: Fredoka, Poppins, sans-serif; font-weight: 700; font-size: 19px; box-shadow: 0 2px 8px #0002;
}
.avatar.big { width: 72px; height: 72px; font-size: 32px; display: grid; place-items: center; margin: 0 auto 8px; }

/* Cash-out goal card */
.goal { display: block; text-decoration: none; color: inherit; background: #e6eaf2; border: 1px solid var(--pline); border-radius: 20px; padding: 16px 18px; margin-top: 6px; }
.goal-head { display: flex; justify-content: space-between; align-items: center; }
.goal-amt { font-family: Fredoka, Poppins, sans-serif; font-size: 26px; }
.goal-head .muted { color: var(--pmuted); font-size: 14px; }
.trophy svg { width: 24px; height: 24px; fill: #f5b400; stroke: #c98a00; stroke-width: 1.2; }
.goal-track { position: relative; height: 16px; border-radius: 99px; background: #f6f7fb; border: 1px solid #d9dee8; margin: 16px 0 14px; }
.goal-track > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--o1), var(--o2)); min-width: 16px; }
.marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: linear-gradient(180deg, #c7ccd6, #9aa1ae); border: 3px solid #fff; box-shadow: 0 2px 6px #0002;
}
.marker.hit { background: linear-gradient(180deg, var(--o1), var(--o2)); }
.marker svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; }
.goal-msg { font-size: 14px; }
.goal-msg b { color: #e09a00; }

.nudge { display: block; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #f3efff; color: #3d2a9e; text-decoration: none; font-size: 14px; border: 1px solid #ddd2ff; }
.offers-count { text-align: center; color: var(--pmuted); font-size: 17px; margin: 20px 0 14px; }
.offers-count span { color: #9aa1ae; margin: 0 4px; }

/* Themes for generated banner art */
.theme-0 { --t1: #4fd1ff; --t2: #1e7bff; --ts: #1c3fa8; }
.theme-1 { --t1: #ffb35c; --t2: #ff4f7b; --ts: #a3123f; }
.theme-2 { --t1: #7be495; --t2: #1aa37a; --ts: #0b6b4c; }
.theme-3 { --t1: #c58bff; --t2: #6a3df0; --ts: #3b1a9e; }
.theme-4 { --t1: #ffe066; --t2: #ff8f1f; --ts: #b54708; }
.theme-5 { --t1: #5ee7df; --t2: #2b6cb0; --ts: #1a4f8a; }

.banner {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 22px;
  background: radial-gradient(120% 90% at 30% 10%, #ffffff55, transparent 55%), linear-gradient(160deg, var(--t1), var(--t2));
  display: grid; place-items: center;
}
.orb { position: absolute; border-radius: 50%; background: #ffffff26; }
.orb.o1 { width: 60%; aspect-ratio: 1; left: -18%; bottom: -30%; }
.orb.o2 { width: 38%; aspect-ratio: 1; right: -8%; top: -14%; background: #ffffff1f; }
.coin {
  position: absolute; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-weight: 800;
  font-family: Fredoka, Poppins, sans-serif; color: #b7791f;
  background: radial-gradient(circle at 35% 30%, #fff6c4, var(--gold1) 40%, var(--gold2) 75%);
  border: 3px solid #e2a300; box-shadow: inset 0 -3px 0 #d18f00, 0 6px 14px #0003;
  animation: bob 3.2s ease-in-out infinite;
}
.coin.c1 { width: 46px; height: 46px; font-size: 22px; left: 8%; top: 58%; }
.coin.c2 { width: 34px; height: 34px; font-size: 16px; right: 12%; top: 16%; animation-delay: -1s; }
.coin.c3 { width: 40px; height: 40px; font-size: 19px; right: 9%; bottom: 10%; animation-delay: -2s; }
.coin.mini { position: static; width: 26px; height: 26px; font-size: 13px; border-width: 2px; animation: none; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .coin { animation: none; } }

.game-title {
  position: relative; max-width: 86%; text-align: center; transform: rotate(-4deg);
  font-family: Fredoka, Poppins, sans-serif; font-weight: 700; font-size: clamp(30px, 10vw, 52px); line-height: .95;
  color: #fff; -webkit-text-stroke: 3px var(--ts); paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ts), 0 10px 18px #0004; overflow-wrap: anywhere;
}
.store-chip, .spots {
  position: absolute; top: 12px; padding: 5px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
  background: #00000055; color: #fff; backdrop-filter: blur(4px);
}
.store-chip { left: 12px; }
.spots { right: 12px; background: #ffffffe6; color: #b42318; }
.x-btn { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #000a; color: #fff; font-size: 15px; }

/* Offer cards */
.offers { display: grid; gap: 22px; }
.offer {
  position: relative; border-radius: 28px; padding: 7px; border: 3px solid var(--o1);
  background: linear-gradient(180deg, var(--deep1), var(--deep2)); box-shadow: 0 10px 24px #17122c33;
}
.offer-hit { position: absolute; inset: 0; border: 0; background: none; border-radius: 28px; z-index: 1; }
.offer-body { padding: 12px 12px 10px; color: #fff; }
.offer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.offer h3, .detail h2 { margin: 0; font-family: Fredoka, Poppins, sans-serif; font-size: 26px; font-weight: 600; }
.offer-meta { font-size: 13px; opacity: .8; margin: 2px 0 12px; }
.verified { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(180deg, var(--o1), var(--o2)); border: 2px solid #d9ccff; }

.play-btn {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 15px 18px; border: 0; border-radius: 18px; color: #fff; text-decoration: none; font-weight: 600; font-size: 17px;
  background: linear-gradient(180deg, var(--o1), var(--o2)); box-shadow: 0 4px 0 var(--o3), 0 10px 20px #6c45ff44;
  transition: transform .08s;
}
.play-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--o3); }
.play-btn svg { width: 20px; height: 20px; fill: #fff; flex: none; }
.play-btn b { font-family: Fredoka, Poppins, sans-serif; font-size: 25px; font-weight: 700; }
.play-btn.sm { width: auto; padding: 11px 18px; font-size: 15px; border-radius: 14px; }
.ghost-btn { border: 2px dashed #ffffff88; background: none; color: #fff; border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: 13px; }
.link-btn { border: 0; background: none; color: inherit; opacity: .75; text-decoration: underline; padding: 0; font-size: 13px; }
.center-block { display: block; margin: 14px auto 0; color: var(--pmuted); }

/* Task cards */
.p-h2 { font-family: Fredoka, Poppins, sans-serif; font-size: 22px; margin: 26px 0 12px; }
.task { border-radius: 24px; padding: 16px; color: #fff; background: linear-gradient(170deg, var(--t2), var(--deep1) 58%, var(--deep2)); margin-bottom: 18px; box-shadow: 0 10px 24px #0002; }
.task.done { filter: saturate(.35); opacity: .85; }
.task-head { display: flex; gap: 12px; align-items: center; }
.task-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-family: Fredoka, Poppins, sans-serif; font-size: 26px; font-weight: 700; background: linear-gradient(160deg, var(--t1), var(--t2)); border: 3px solid #ffffffb0; }
.task-title h3 { margin: 0; font-family: Fredoka, Poppins, sans-serif; font-size: 21px; }
.task-title span { font-size: 13px; opacity: .85; }
.today { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: #ffffff1c; font-size: 14px; }
.today.good { background: #2bd47a33; border: 1px solid #5cf0a066; }
.today.warn { background: #ff4d4d33; border: 1px solid #ff8a8a66; }
.today-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.today .small.muted { color: #ffffffb3; margin-top: 8px; }
.meter { height: 10px; border-radius: 99px; background: #00000040; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold1), var(--gold2)); }

.track { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.tile {
  flex: none; width: 64px; padding: 8px 4px; border-radius: 14px; display: grid; justify-items: center; gap: 4px;
  background: #ffffff1f; border: 2px solid #ffffff26; color: #fff;
}
.tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.tile-day { font-size: 11px; font-weight: 600; opacity: .85; }
.tile-amt { font-family: Fredoka, Poppins, sans-serif; font-size: 13px; font-weight: 600; }
.tile.claimed { background: #2bd47a; border-color: #8ff5bd; }
.tile.today { background: linear-gradient(180deg, var(--o1), var(--o2)); border-color: #d9ccff; animation: glow 1.8s ease-in-out infinite; }
.tile.locked { opacity: .6; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px #8a6bff66; } }
.detail .tile { background: #f1f3f8; border-color: #e3e7ef; color: var(--pink); }
.detail .tile.today { color: #fff; }

.task-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.task-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12px; opacity: .85; flex-wrap: wrap; }
.task-foot .code { background: #ffffff24; color: #fff; }

/* Detail sheet */
.modal .detail { margin: -23px; }
.detail .banner { border-radius: 19px 19px 0 0; }
.detail-body { padding: 18px 20px 22px; }
.detail-body h3 { font-family: Fredoka, Poppins, sans-serif; margin: 18px 0 0; }
.how { display: grid; gap: 10px; margin: 14px 0; }
.how div { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.how b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, var(--o1), var(--o2)); }
.sheet { text-align: center; }
.sheet h2 { font-family: Fredoka, Poppins, sans-serif; margin: 6px 0; }
.burst { font-size: 54px; }
.steps { text-align: left; line-height: 1.55; padding-left: 20px; margin: 14px 0 18px; }
.sheet-link { display: block; width: 100%; padding: 14px; margin-top: 8px; border-radius: 14px; border: 1px solid var(--pline); background: #f7f8fb; color: inherit; text-decoration: none; font-weight: 600; font-size: 15px; }

/* Wallet */
.wallet-hero { margin-top: 6px; border-radius: 24px; padding: 22px; color: #fff; text-align: center; background: radial-gradient(120% 100% at 20% 0%, #8a6bff, transparent 60%), linear-gradient(135deg, var(--deep2), #5134ca); box-shadow: 0 12px 26px #6c45ff40; }
.wallet-hero > span { font-weight: 600; opacity: .9; }
.wallet-hero > b { display: block; font-family: Fredoka, Poppins, sans-serif; font-size: 48px; line-height: 1.1; }
.wallet-hero .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.wallet-hero .split div { background: #ffffff26; border-radius: 14px; padding: 10px; }
.wallet-hero small { display: block; font-size: 12px; opacity: .9; }
.wallet-hero strong { font-family: Fredoka, Poppins, sans-serif; font-size: 20px; }
.wallet-hero p { font-size: 12px; opacity: .85; margin: 12px 0 0; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tier { background: var(--pcard); border: 2px solid var(--pline); border-radius: 18px; padding: 14px 10px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.tier > b { font-family: Fredoka, Poppins, sans-serif; font-size: 24px; }
.tier .meter { width: 100%; background: #edf0f5; }
.tier span { font-size: 12px; color: var(--pmuted); }
.tier.ready { border-color: var(--o1); background: #f6f3ff; }
.tier .play-btn.sm { padding: 9px 12px; font-size: 13px; }
.history { list-style: none; margin: 0; padding: 0; background: var(--pcard); border-radius: 18px; border: 1px solid var(--pline); }
.history li { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--pline); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history small { display: block; color: var(--pmuted); font-size: 12px; }
.history .plus { color: #079455; }
.history .minus { color: var(--pink); }
.center { text-align: center; }

.empty-state { text-align: center; background: var(--pcard); border-radius: 22px; padding: 30px 20px; font-size: 40px; border: 1px solid var(--pline); }
.empty-state h3 { font-family: Fredoka, Poppins, sans-serif; font-size: 20px; margin: 8px 0 4px; }
.empty-state p { font-size: 14px; color: var(--pmuted); margin: 0 0 14px; }
.empty-state.small { font-size: 14px; color: var(--pmuted); padding: 18px; }
.empty-state .play-btn { display: inline-flex; }

/* Bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 0;
  background: #f4f6fa; border-top: 1px solid var(--pline); padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; max-width: 180px; display: grid; justify-items: center; gap: 3px; text-decoration: none; color: #4b5161; font-weight: 600; font-size: 14px; padding: 4px; }
.tabbar svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--o2); }

body.player .modalbox { border-radius: 24px; }
body.player .card { border-radius: 20px; }
@media (max-width: 380px) { .tiers { grid-template-columns: 1fr; } .play-btn b { font-size: 21px; } }
.detail .tile.today { background: linear-gradient(180deg, var(--o1), var(--o2)); border-color: #d9ccff; }
body.player .toast { bottom: calc(96px + env(safe-area-inset-bottom)); border-radius: 16px; font-weight: 600; }
.payout-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--pcard); border: 1px solid var(--pline); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; font-size: 14px; }
.payout-card .link-btn { color: var(--o2); opacity: 1; font-weight: 600; }
.sheet form.left { text-align: left; }
.chat-btn { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 11px 14px; border-radius: 14px; border: 1px solid #ffffff40; background: #ffffff1a; color: #fff; font-weight: 600; font-size: 14px; }
.chat-btn .badge { margin-left: auto; background: #ff4d6d; color: #fff; border-radius: 99px; padding: 2px 9px; font-size: 12px; }
.chat-btn .count { margin-left: auto; opacity: .7; font-size: 12px; }
.tabbar a { position: relative; }
.tabbar .dot { position: absolute; top: 0; left: 55%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ff4d6d; color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
body.player .msg.mine { background: var(--o2); }
.today.wait { background: #ffffff1f; border: 1px dashed #ffffff66; }
.today .link-btn { color: #fff; opacity: .9; margin-left: 4px; }
.fix-btn { margin-top: 10px; }
.early-card { display: grid; gap: 12px; margin-top: 12px; background: var(--pcard); border: 1px dashed #c9bdff; border-radius: 18px; padding: 14px 16px; }
.early-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.early-input { display: flex; align-items: center; gap: 4px; border: 1px solid #d0d5dd; border-radius: 12px; padding: 0 10px; background: #fff; }
.early-input input { width: 92px; border: 0; padding: 10px 0; font: inherit; font-weight: 600; outline: none; }
.early-quote { width: 100%; }
