:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #fff;
  background: #06351d;
  --orange: #ff851b;
  --cream: #fff3d9;
  --green: #085f2c;
  --surface: #075b2c;
  --muted: #d0e4c9;
  --gutter: clamp(24px, 6.5vw, 34px);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100svh; display: grid; place-items: center; }
button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid var(--cream); outline-offset: 5px; }
button:disabled { cursor: default; }
button img { object-fit: contain; }
img { -webkit-user-drag: none; }
.app {
  width: min(100%, 520px);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: max(26px, env(safe-area-inset-top)) var(--gutter) max(20px, env(safe-area-inset-bottom));
  background: var(--surface);
  overflow: hidden;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.balance { display: flex; align-items: center; gap: 6px; padding: 9px 0 9px 10px; border: 0; background: none; color: #fff; font-size: 1.25rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.balance img { width: 28px; height: 28px; }
.intro { text-align: center; margin-top: clamp(24px, 4svh, 40px); position: relative; z-index: 2; }
h1, h2 { margin: 0; font-weight: 750; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: clamp(2.125rem, 9.6vw, 2.875rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: clamp(1.875rem, 8vw, 2.5rem); line-height: 1.15; letter-spacing: -.025em; }
.daily { margin: 16px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.4; }
.game { flex: 1; position: relative; min-height: 310px; margin: 12px calc(-1 * var(--gutter)) 20px; isolation: isolate; }
/* Local light intentionally follows the central reward, as in the supplied references. */
.game::before, .reward-art::before {
  content: ""; position: absolute; inset: 4% 2% 6%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, #c3e75765 0%, #9fd04030 29%, #86be2f10 48%, transparent 70%);
}
.reel-window { position: absolute; inset: 0 0 24px; overflow: hidden; mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 100%); }
.reel { position: absolute; top: calc(50% - 110px); left: 0; right: 0; will-change: transform; scale: 1.35; transform-origin: center 110px; }
/* Row height matches the existing 220px animation step; only presentation scales. */
.reel-item { height: 220px; display: flex; align-items: center; justify-content: center; flex-direction: column; position: relative; }
.reel-neighbor { opacity: 0; }
.reel-item img { width: 155px; height: 155px; object-fit: contain; }
.reel-item.gift img { width: 240px; height: 186px; }
.reel-item .prize-label { font-size: .8125rem; font-weight: 600; line-height: 1.3; color: #fff; margin-top: 6px; text-align: center; }
.reel-item .value, .reward-art > span {
  display: block; position: relative; padding: 4px 22px 6px; min-width: 85px; text-align: center;
  color: #fff; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  border: 1px solid #ffdc9b; border-radius: 999px;
  background: linear-gradient(165deg, #ffb64c 0%, #bd4c08 18%, #a33c05 78%, #f99c34 100%);
  box-shadow: inset 0 2px 2px #fff4cd9e, inset 0 -2px 2px #a7420b60, 0 3px 6px #00371d30;
}
.reel-item .value { font-size: 1.875rem; margin-top: -18px; rotate: -5deg; }
.reel-item.points .prize-label, .reel-item.bonus .prize-label { margin-top: 5px; }
.reel-caption { position: absolute; inset: auto var(--gutter) 0; margin: 0; text-align: center; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.reward-sparks { position: absolute; inset: 0; pointer-events: none; z-index: 1; color: #f0ffcd; }
.reward-sparks span { position: absolute; font-size: 21px; line-height: 1; }
.reward-sparks span:nth-child(1) { left: 16%; top: 23%; }
.reward-sparks span:nth-child(2) { right: 13%; top: 55%; font-size: 15px; }
.reward-sparks span:nth-child(3) { left: 25%; bottom: 19%; font-size: 11px; opacity: .65; }
.controls { position: relative; }
.button { width: 100%; min-height: 64px; border: 0; border-radius: 999px; padding: 15px 20px; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 1.125rem; line-height: 1.25; font-weight: 700; transition: background .15s, opacity .15s; overflow-wrap: anywhere; }
.button-primary { background: var(--orange); color: #3b210c; flex-direction: column; gap: 3px; }
.button-primary:hover:not(:disabled) { background: #ff9637; }
.button-hint { font-size: .8125rem; font-weight: 500; }
.button-secondary { margin-top: 13px; background: var(--cream); color: #323323; }
.button-secondary:hover:not(:disabled) { background: #fff; }
.button-secondary img { width: 27px; height: 27px; flex-shrink: 0; }

.demo-note { text-align: center; font-size: .8125rem; line-height: 1.4; color: var(--muted); margin: 17px 0 21px; }
.bottom-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 20px; }
.bottom-bar button { display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; padding: 10px 0; color: #fff; font-size: .875rem; line-height: 1.4; font-weight: 500; }
.bottom-bar button:disabled { opacity: .5; }
.bottom-bar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.footer-divider { width: 1px; height: 18px; background: #ffffff35; }
.count { font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--cream); }
.count::before { content: "· "; }
.count[hidden] { display: none; }
dialog { border: 0; color: #fff; background: var(--surface); width: min(460px, calc(100% - 32px)); max-height: calc(100svh - 32px); border-radius: 20px; padding: 58px 28px 26px; overflow-y: auto; }
dialog::backdrop { background: #001b15bf; }
.close-button { position: absolute; right: 22px; top: 22px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #ffffff17; color: #fff; font-size: 29px; line-height: 1; }
.reward-dialog {
  width: min(520px, 100%); height: 100svh; max-height: none; margin: 0 auto; padding: max(92px, calc(env(safe-area-inset-top) + 72px)) var(--gutter) max(28px, env(safe-area-inset-bottom));
  border-radius: 0; text-align: center; box-shadow: none;
}
.reward-dialog[open] { display: flex; flex-direction: column; align-items: stretch; }
.reward-dialog h2 { flex-shrink: 0; max-width: 430px; width: 100%; margin: 24px auto 0; }
.reward-dialog .close-button { top: max(22px, env(safe-area-inset-top)); right: var(--gutter); }
.reward-art { position: relative; isolation: isolate; flex: 1 0 330px; min-height: 330px; display: flex; align-items: center; justify-content: center; flex-direction: column; margin: 12px calc(-1 * var(--gutter)) 18px; }
.reward-art img { width: min(82%, 370px); height: 290px; object-fit: contain; }
.reward-art > span { z-index: 2; margin-top: -50px; padding: 10px 30px 13px; font-size: clamp(2.5rem, 12vw, 3.75rem); letter-spacing: -.035em; rotate: -6deg; }
.reward-art > span:empty { display: none; }
.reward-dialog > p { font-size: 1rem; line-height: 1.55; color: #fff; margin: 0 auto 12px; max-width: 420px; }
.reward-dialog > .modal-note { font-size: .8125rem; color: var(--muted); margin: 0 0 28px; }
.reward-dialog > .button { margin-top: auto; flex-shrink: 0; }
.info-dialog h2 { padding-right: 20px; margin-bottom: 22px; }
.info-dialog p { font-size: 1rem; line-height: 1.6; color: #e6f0df; margin: 0 0 18px; }
.info-dialog .button { margin-top: 24px; }
.prize-row { display: flex; gap: 13px; align-items: center; padding: 15px 0; border-bottom: 1px solid #ffffff22; }
.prize-row img { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.prize-row .details { flex: 1; min-width: 0; }
.prize-row strong { display: block; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.prize-row small { display: block; font-size: .8125rem; line-height: 1.4; color: var(--muted); margin-top: 4px; }
.prize-row .odds { font-size: .875rem; color: #fff; font-weight: 600; flex-shrink: 0; }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(12px); opacity: 0; pointer-events: none; background: var(--cream); color: #26351e; padding: 14px 20px; max-width: calc(100% - 32px); width: max-content; border-radius: 12px; font-size: .875rem; line-height: 1.4; font-weight: 600; z-index: 10; transition: opacity .15s, transform .15s; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 700px) {
  .app { min-height: max(860px, 100svh); }
  .game { min-height: 350px; }
}
@media (max-height: 740px) {
  .app { padding-top: max(18px, env(safe-area-inset-top)); }
  .intro { margin-top: 22px; }
  h1 { font-size: 2.125rem; }
  .daily { margin-top: 12px; }
  .game { min-height: 290px; margin-top: 8px; margin-bottom: 16px; }
  .reel { scale: 1.17; }
  .button { min-height: 58px; padding-block: 12px; }
  .demo-note { margin-block: 14px; }
  .reward-dialog { padding-top: max(74px, calc(env(safe-area-inset-top) + 60px)); }
  .reward-dialog h2 { margin-top: 14px; }
  .reward-art { flex-basis: 260px; min-height: 260px; margin-top: 6px; }
  .reward-art img { height: 240px; }
  .reward-dialog > .modal-note { margin-bottom: 20px; }
}
@media (max-width: 360px) {
  :root { --gutter: 22px; }
  .brand { font-size: 1.375rem; }
  .balance { font-size: 1.125rem; }
  .daily { font-size: .875rem; }
  .bottom-bar { gap: 16px; }
  .reel-caption { font-size: .8125rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Existing brand: orange actions and green canvas; cream remains the quieter action. */
[hidden] { display: none !important; }
.app { min-height: var(--app-height,100svh); padding-top: max(22px,env(safe-area-inset-top),var(--tg-safe-top,0px)); padding-bottom: max(16px,env(safe-area-inset-bottom),var(--tg-safe-bottom,0px)); padding-left: max(var(--gutter),var(--tg-safe-left,0px)); padding-right: max(var(--gutter),var(--tg-safe-right,0px)); }
.screen { flex: 1; min-width: 0; }
.wheel-screen { display: flex; flex-direction: column; }
.button { transition: background .15s, transform .15s; }
.button-primary { border: 1px solid #ffb56c; box-shadow: inset 0 1px 0 #ffcf9580,0 3px 0 #aa490d; }
.button:active:not(:disabled) { transform: translateY(2px); }
.button:disabled { background: #164c32; color: #d5e5d9; box-shadow: none; border-color: #42785a; }
.is-spinning .button-primary { background: #dbefe1; color: #16472c; }
.button-secondary:disabled { background: #164c32; }
.button[aria-busy="true"] .button-hint { opacity: .8; }
.text-button { border: 0; background: none; color: var(--cream); padding: 9px 12px; font: inherit; text-decoration: underline; text-underline-offset: 4px; }
.demo-note { margin-bottom: 5px; }
.bottom-bar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; margin: auto calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) 0; border-top: 1px solid #ffffff26; }
.bottom-bar button { flex-direction: column; gap: 6px; padding: 10px 0; min-height: 60px; font-size: .75rem; color: #c1dcc9; }
.bottom-bar button[aria-current="page"] { color: var(--cream); font-weight: 750; }
.bottom-bar button[aria-current="page"] svg { stroke: var(--orange); stroke-width: 2; }
.bottom-bar button:focus-visible { outline-offset: -2px; }
.reward-sparks { transition: opacity .18s; }
.reward-sparks span { animation: reward-float 3.8s ease-in-out infinite; }
.reward-sparks span:nth-child(2) { animation-duration: 4.6s; animation-delay: -1.6s; }
.reward-sparks span:nth-child(3) { animation-duration: 5.2s; animation-delay: -3s; }
.is-spinning .game .reward-sparks { opacity: 0; }
.motion-paused .game .reward-sparks span { animation-play-state: paused; }
@keyframes reward-float { 0%,100% { transform: translateY(4px); opacity: .65; } 50% { transform: translateY(-5px); opacity: 1; } }
.reel-item .prize-label { max-width: 82%; overflow-wrap: anywhere; }
.content-screen { padding-bottom: 28px; }
.section-intro { text-align: center; margin: 35px 0 24px; }
.section-intro h1 { font-size: clamp(2rem,9vw,2.75rem); }
.section-intro p { color: var(--muted); font-size: .9375rem; line-height: 1.5; margin: 16px 0 0; }
.section-note { color: var(--muted); font-size: .8125rem; line-height: 1.55; margin: 16px 0 22px; }
.task-row, .friend-row { padding: 23px 0; border-top: 1px solid #ffffff30; }
.row-heading { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.task-row h2 { font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.3; text-wrap: initial; }
.friend-row h3 { margin: 0; font-size: 1.125rem; }
.task-row p,.friend-row p { font-size: .875rem; line-height: 1.55; color: var(--muted); margin: 12px 0; }
.task-row .row-status,.friend-row .row-status { color: #fff; font-weight: 600; }
.point-label { display: inline-flex; align-items: center; gap: 4px; font-size: 1.125rem; font-weight: 750; white-space: nowrap; flex-shrink: 0; }
.point-label img { width: 25px; height: 25px; object-fit: contain; }
.row-action { min-height: 48px; font-size: .875rem; margin-top: 14px; }
.link-label { display: block; color: var(--cream); font-size: .875rem; margin: 24px 0 10px; }
#referral-link { font: inherit; font-size: .875rem; width: 100%; border: 1px solid #70967d; border-radius: 10px; padding: 16px 12px; background: #063e23; color: #fff; margin-bottom: 16px; }
input:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.list-heading { font-size: 1.4rem; margin: 28px 0 14px; }
.ledger-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; border-bottom: 1px solid #ffffff25; }
.ledger-row p { font-size: .875rem; line-height: 1.5; }
#history-list .prize-row { flex-wrap: wrap; }
#history-list .odds { font-size: .75rem; color: var(--muted); margin-left: 65px; }
.reward-dialog { height: var(--app-height,100svh); padding-top: max(86px,calc(var(--tg-safe-top,0px) + 64px),calc(env(safe-area-inset-top) + 64px)); padding-bottom: max(28px,var(--tg-safe-bottom,0px),env(safe-area-inset-bottom)); }
@media (max-height:740px) { .game { min-height: 235px; } .intro { margin-top: 20px; } .bottom-bar { padding-top: 6px; } }
@media (min-width:700px) { .app { min-height: max(860px,var(--app-height,100svh)); } }
@media (prefers-reduced-motion:reduce) { .reward-sparks span { animation: none; } .button { transition: none; } }

body { place-items: start center; }
.game { min-height: 270px; }
.motion-paused .reward-sparks span,.has-dialog .game .reward-sparks span { animation-play-state: paused; }
@media (max-height:740px) { .game { min-height: 235px; } }
@media (min-width:700px) { .game { min-height: 350px; } }
/* Navigation stays reachable while sponsor and history lists scroll. */
.app { padding-bottom: max(96px,calc(90px + env(safe-area-inset-bottom)),calc(90px + var(--tg-safe-bottom,0px))); }
.bottom-bar { position: fixed; z-index: 4; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,520px); margin: 0; background: var(--surface); padding: 8px var(--gutter) max(12px,env(safe-area-inset-bottom),var(--tg-safe-bottom,0px)); }

.reward-dialog { max-width: min(520px,100%); top: 0; }
.reel-item .prize-label { max-width: 65%; flex-shrink: 0; }
body:not(.is-spinning) .reel-window { mask-image: none; }
@media (max-height:899px) { .reel { scale: 1.12; } }
@media (max-height:740px) { .game { min-height: 260px; } .reel { scale: 1.05; } }
/* Three persistent destinations; referrals and rewards belong to Profile. */
.bottom-bar { grid-template-columns: repeat(3,minmax(0,1fr)); padding-top: 6px; }
.bottom-bar button { gap: 1px; min-height: 54px; padding: 4px 0; font-size: .75rem; position: relative; }
.bottom-bar img { width: 32px; height: 32px; object-fit: contain; opacity: .7; transition: opacity .15s,transform .15s; }
.bottom-bar [aria-current="page"] img { opacity: 1; transform: translateY(-2px); }
.bottom-bar [aria-current="page"]::after { content: ''; width: 24px; height: 2px; background: var(--orange); position: absolute; bottom: 1px; }
.app { padding-bottom: max(82px,calc(76px + env(safe-area-inset-bottom)),calc(76px + var(--tg-safe-bottom,0px))); }
.profile-identity { text-align: center; margin: 34px 0 38px; }
.profile-identity > img { width: 92px; height: 92px; object-fit: contain; margin-bottom: 18px; border-radius: 50%; }
.profile-identity h1 { font-size: clamp(1.75rem,8vw,2.5rem); }
.profile-identity p { color: var(--muted); line-height: 1.5; font-size: .9375rem; }
.profile-link { display: flex; width: 100%; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #ffffff25; border-radius: 14px; background: #064824; color: #fff; text-align: left; margin-bottom: 12px; }
.profile-link > img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.profile-link > span:nth-child(2) { flex: 1; min-width: 0; }
.profile-link strong { display: block; font-size: 1.125rem; line-height: 1.3; }
.profile-link small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.profile-link > span:last-child { font-size: 1.375rem; }
.compact-task { display: flex; align-items: center; gap: 12px; padding: 18px 0; border-top: 1px solid #ffffff25; }
.compact-task > img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }
.task-detail { flex: 1; min-width: 0; }
.task-detail strong { display: block; font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.task-detail small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.5; margin-top: 6px; }
.task-detail .point-label { font-size: .8125rem; margin-top: 6px; }
.task-detail .point-label img { width: 18px; height: 18px; }
.compact-task .row-action { width: auto; flex: 0 0 104px; white-space: nowrap; min-height: 42px; padding: 10px 8px; margin: 0; font-size: .8125rem; }
.reward-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 12px; }
.reward-card { display: flex; flex-direction: column; align-items: stretch; text-align: center; min-width: 0; padding: 14px 10px; background: #064824; border: 1px solid #ffffff20; border-radius: 16px; }
.reward-card > img { width: 100%; height: 112px; object-fit: contain; }
.reward-card h3 { font-size: .9375rem; line-height: 1.35; overflow-wrap: anywhere; margin: 10px 0 7px; }
.card-amount { color: var(--cream); font-size: .875rem; font-weight: 700; }
.reward-card p { font-size: .75rem; line-height: 1.5; color: var(--muted); margin: 7px 0; }
.reward-card .claim-button { min-height: 40px; padding: 9px 6px; margin-top: auto; font-size: .8125rem; }
.reward-grid .empty-state { grid-column: 1 / -1; }
.referral-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid #ffffff25; padding: 18px 0; }
.referral-row > img { width: 44px; height: 44px; border-radius: 50%; object-fit: contain; }
.referral-row > div { flex: 1; min-width: 0; }
.referral-row strong { display: block; overflow-wrap: anywhere; font-size: .9375rem; }
.referral-row small { display: block; color: var(--muted); line-height: 1.5; margin-top: 5px; font-size: .8125rem; }
.page-loader { min-height: 12px; text-align: center; }
#copy-referral { display: block; margin: 14px auto 0; }
@media (max-width:360px) { .compact-task { gap: 8px; } .compact-task > img { width: 38px; height: 38px; } .compact-task .row-action { flex-basis: 100px; font-size: .75rem; } .reward-card { padding: 12px 8px; } }
@media (prefers-reduced-motion:reduce) { .bottom-bar img { transition: none; } }

/* Compact navigation and a clear sponsor-task state, using existing artwork. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wheel-screen .intro { margin-top: 18px; }
.wheel-screen .daily { margin: 0; font-size: .875rem; }
.prize-row img { width: 64px; height: 64px; }
#screen-tasks { display: flex; flex-direction: column; padding-bottom: 20px; }
.tasks-header { margin: 28px 0 24px; }
.tasks-header h1 { font-size: 2rem; line-height: 1.15; text-align: left; }
.tasks-header p { margin: 10px 0 0; font-size: .875rem; line-height: 1.5; color: var(--muted); }
#task-list { min-width: 0; }
#task-list.is-task-state { display: flex; flex: 1; align-items: center; justify-content: center; padding-bottom: 24px; }
.task-state { width: 100%; max-width: 350px; text-align: center; padding: 18px 4px; }
.task-state-art { margin: 0 auto 24px; width: 180px; height: 180px; }
.task-state-art img { width: 100%; height: 100%; object-fit: contain; }
.task-state h2 { font-size: 1.625rem; line-height: 1.2; letter-spacing: -.025em; }
.task-state p { margin: 14px auto 0; max-width: 300px; font-size: .9375rem; line-height: 1.6; color: var(--muted); }
.task-state-action { width: auto; min-height: 46px; margin: 26px auto 0; padding: 12px 24px; font-size: .875rem; }
.task-state.loading .task-state-art { opacity: .65; }
.compact-task { border: 1px solid #ffffff25; border-radius: 14px; padding: 16px 12px; margin: 0 0 12px; gap: 10px; background: #064824; }
.compact-task > img { width: 40px; height: 40px; }
.compact-task .row-action { flex-basis: 100px; font-size: .75rem; min-height: 42px; }
.compact-task.task-complete { background: transparent; }
.compact-task.task-complete > img { opacity: .65; }
@media (max-width:360px) { .compact-task { gap: 8px; padding: 14px 10px; } .compact-task > img { width: 32px; height: 32px; } .compact-task .row-action { flex-basis: 92px; padding-inline: 6px; } }
@media (max-height:740px) { .wheel-screen .intro { margin-top: 14px; } .game { min-height: 220px; } .task-state-art { width: 132px; height: 132px; margin-bottom: 18px; } .tasks-header { margin-block: 22px 16px; } .task-state h2 { font-size: 1.5rem; } }
