/* Full viewport shell; reference artwork and type keep their mobile scale. */
:root {
  --reference-unit: min(1vw, 4.4px);
  --page-gutter: clamp(12px, 2.6vw, 32px);
}
.reward-dialog-content { padding: 52px 24px 28px; }
.reward-dialog-content h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.reward-dialog-content p { font-size: 14px; line-height: 1.6; color: var(--ui-muted); margin: 10px 0; }
.reward-dialog-content .primary-btn { width: 100%; min-height: 48px; margin-top: 18px; background: var(--green); color: #fff; border: 0; border-radius: 14px; padding: 12px; font-weight: 700; }
.reward-dialog-content .primary-btn:disabled { opacity: .6; }
.reward-dialog-content label { display: block; margin: 24px 0 8px; font-weight: 600; }
.reward-dialog-content input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--ui-line); border-radius: 14px; font-size: 16px; text-transform: uppercase; }
.reward-dialog-content [hidden] { display: none; }
.reward-wheel { display: grid; place-items: center; width: 152px; height: 152px; margin: 24px auto; border-radius: 50%; border: 9px solid #e4f6ee; background: conic-gradient(#00a587 0deg 90deg,#95e3ce 90deg 180deg,#00a587 180deg 270deg,#95e3ce 270deg); box-shadow: 0 8px 24px #009b7e22; color: #fff; font-size: 48px; font-weight: 800; }
.reward-pending .reward-wheel { animation: reward-wheel-turn 1s linear infinite; }
@keyframes reward-wheel-turn { to { transform: rotate(360deg); } }
#rewardResult { color: #00866e; font-weight: 600; }
@media(prefers-reduced-motion:reduce) { .reward-pending .reward-wheel { animation: none; } }
#root, .app-shell { width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 0; }
.app-shell { container-type: normal; border: 0; box-shadow: none; }
.app-viewport { flex: 1 1 0; min-height: 0; }
.app-screen { padding-bottom: 0; }
.app-screen:not(.active-screen) { transition: none; }
.app-screen:not(.home-screen) { padding-top: env(safe-area-inset-top, 0px); }
/* Header belongs to the Home scroll flow, without a separate surface above it. */
.home-screen > .home-header { position: static; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.screen-content { max-width: 1280px; }
.home-layout, .tasks-layout { padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
.app-header { padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px)); }
.app-viewport, .settings-overlay-layer { border-left: env(safe-area-inset-left, 0px) solid transparent; border-right: env(safe-area-inset-right, 0px) solid transparent; }
.settings-subpage > .screen-content { max-width: 760px; }
/* Settings details fill the available page while keeping safe, responsive gutters. */
.settings-overlay-layer .settings-subpage:not(.task-detail-page):not(.reward-page) > .screen-content {
  width: 100%; max-width: none; min-height: calc(100% - 64px - env(safe-area-inset-top, 0px));
  padding-inline: var(--page-gutter);
}
/* Detail content is the page surface, including forms and help sections. */
.settings-overlay-layer .settings-subpage:not(.task-detail-page):not(.reward-page) { background: #fff; padding-bottom: 0; }
.settings-overlay-layer .settings-subpage:not(.task-detail-page):not(.reward-page) > .screen-content { padding: 0; margin: 0; }
.settings-overlay-layer .settings-subpage:not(.task-detail-page):not(.reward-page) > .screen-content > div { width: 100%; margin-inline: 0; border: 0; border-radius: 0; box-shadow: none; }
.settings-overlay-layer .settings-subpage:not(.task-detail-page):not(.reward-page) > .screen-content > .card {
  width: 100%; min-height: inherit; margin: 0; padding: 24px var(--page-gutter) max(28px,env(safe-area-inset-bottom,0px));
  border: 0; border-radius: 0; box-shadow: none; background: #fff;
}
.settings-overlay-layer .settings-subpage .withdraw-form { width: 100%; margin: 0; padding: 24px var(--page-gutter); border: 0; border-radius: 0; box-shadow: none; }
.settings-overlay-layer #sub-withdraw > .screen-content > div:last-child { padding: 0 var(--page-gutter) 28px; }
.settings-overlay-layer #wHistory { min-height: inherit; border: 0; border-radius: 0; padding: 12px var(--page-gutter); }
.settings-overlay-layer #wWithdrawHistory { border-radius: 0; border-inline: 0; }
.settings-overlay-layer .settings-subpage.reward-page > .reward-page-content { width: 100%; max-width: none; min-height: calc(100% - 64px); padding: 28px var(--page-gutter); }
.reward-page-content .reward-wheel { margin-block: 36px; }
#spinRewardResult, #bonusRewardResult { color: #00866e; font-weight: 600; }
/* Simple monochrome settings icons and consistent circular back controls. */
.settings-screen .settings-row-icon { background: transparent; color: #17191c; border-radius: 0; }
.settings-screen .native-back-btn { border-radius: 50%; background: #fff; color: #17191c; box-shadow: 0 3px 12px #173d4b18; transition: transform 160ms ease, box-shadow 160ms ease; }
.settings-screen .native-back-btn:active { transform: scale(.94); box-shadow: 0 1px 5px #173d4b16; }
@media (prefers-reduced-motion: reduce) { .settings-screen .native-back-btn { transition: none; } .settings-screen .native-back-btn:active { transform: none; } }

/* Floating capsule and independent reward action. Reserve scroll space naturally. */
nav.bottom-nav {
  --nav-motion: 320ms cubic-bezier(.22,.68,0,1);
  position: relative; inset: auto; display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); max-width: 440px;
  height: 64px; min-height: 64px; margin: 10px auto calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 0; border: 0; border-radius: 999px; background: transparent;
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.bottom-nav-items {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  flex: 1; min-width: 0; height: 64px; padding: 6px; border-radius: 999px;
  background: #fff; box-shadow: 0 4px 18px #1423300b, 0 1px 3px #14233006;
  transition: grid-template-columns var(--nav-motion);
}
.nav-active-pill {
  position: absolute; z-index: -1; left: 6px; top: 6px; bottom: 6px;
  width: calc((100% - 12px) * .4); border-radius: 999px; background: var(--green);
  pointer-events: none; transform: translateX(0); transition: transform var(--nav-motion);
}
.bottom-nav-items:has([data-tab=tasks].active) { grid-template-columns: 1fr 2fr 1fr 1fr; }
.bottom-nav-items:has([data-tab=refer].active) { grid-template-columns: 1fr 1fr 2fr 1fr; }
.bottom-nav-items:has([data-tab=wallet].active) { grid-template-columns: 1fr 1fr 1fr 2fr; }
.bottom-nav-items:has([data-tab=tasks].active) .nav-active-pill { transform: translateX(50%); }
.bottom-nav-items:has([data-tab=refer].active) .nav-active-pill { transform: translateX(100%); }
.bottom-nav-items:has([data-tab=wallet].active) .nav-active-pill { transform: translateX(150%); }
nav.bottom-nav button, nav.bottom-nav button.nav-reward {
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  min-width: 0; min-height: 52px; height: 52px; padding: 0; gap: 0;
  border: 0; border-radius: 999px; background: transparent; box-shadow: none;
  color: var(--ui-muted); font-size: 12px; font-weight: 600; line-height: 18px;
  transition: color 180ms ease, gap var(--nav-motion);
}
nav.bottom-nav button .nav-icon, nav.bottom-nav .nav-reward > .nav-icon {
  position: static; inset: auto; display: grid; place-items: center; flex: 0 0 20px;
  width: 20px; height: 20px; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit;
  transition: transform 180ms ease;
}
nav.bottom-nav button svg, nav.bottom-nav .nav-reward svg { width: 20px; height: 20px; fill: none; stroke-width: 1.8; }
nav.bottom-nav button.active[data-tab=home] svg { fill: none; stroke-width: 1.8; }
nav.bottom-nav .nav-label { max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap; transition: max-width var(--nav-motion), opacity 160ms ease; }
nav.bottom-nav button.active { color: #fff; gap: 6px; font-weight: 600; }
nav.bottom-nav button.active .nav-label { max-width: 65px; opacity: 1; }
nav.bottom-nav button.active::after { display: none; }
nav.bottom-nav button.nav-reward {
  flex: 0 0 52px; width: 52px; height: 52px; min-height: 52px;
  color: var(--ui-accent); background: #fff; box-shadow: 0 4px 18px #1423300b, 0 1px 3px #14233006;
}
nav.bottom-nav button:active .nav-icon { transform: scale(.9); }
nav.bottom-nav button:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
@media (hover: hover) {
  nav.bottom-nav button:not(.active):hover { color: var(--ui-accent); }
  nav.bottom-nav button.nav-reward:hover { background: #edf9f4; }
}

@media (min-width: 600px) {
  .home-layout, .tasks-layout { gap: 22px; padding-top: 14px; padding-bottom: 32px; }
  .home-hero { height: 280px; padding: 28px; }
  .home-hero .hero-title { font-size: 34px; }
  .home-hero .hero-sub { margin: 12px 0 18px; font-size: 14px; }
  .home-hero .hero-cta { height: 42px; }
  .home-hero .hero-art { top: auto; bottom: 0; width: 64%; height: auto; aspect-ratio: 416 / 322; }
  .quick-art { max-height: 140px; }
  .quick-card { padding-bottom: 14px; }
  .quick-card h3, .tasks-quick .quick-card h3 { margin-top: 8px; }
  .quick-card > button, .tasks-quick .quick-card > button { min-height: 42px; }
  .home-layout .section-head h2, .tasks-layout .section-head h2 { font-size: 19px; }
  .home-shortcuts .earn-tile { min-height: 108px; max-height: 160px; }
  .home-shortcuts .explore-title { font-size: 17px; }
  .home-featured .featured-game > b { min-height: 42px; font-size: 13px; }
  .tasks-hero { min-height: 200px; max-height: 280px; }
  .tasks-hero h2 { font-size: 28px; }
  .tasks-hero-art { top: auto; bottom: 0; height: auto; aspect-ratio: 348 / 270; }
  .home-hero .hero-art, .tasks-hero-art {
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 98%, transparent), linear-gradient(0deg, transparent, #000 2%, #000 84%, transparent);
    mask-composite: intersect;
  }
  .task-category { max-height: 136px; }
  .category-copy b { font-size: 18px; }
  .screen-content.settings-content { padding: 24px var(--page-gutter) 32px; }
  #tab-games > .screen-content, #tab-offers > .screen-content, #tab-refer > .screen-content { padding: 24px var(--page-gutter) 32px; }
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .home-layout, .tasks-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .home-hero { height: 100%; min-height: 270px; padding: 24px; }
  .home-hero .hero-title { font-size: 30px; }
  .home-hero .hero-sub { font-size: 12px; white-space: normal; }
  .home-shortcuts, .home-featured { align-self: start; }
  .home-featured .featured-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-featured .game-cover { aspect-ratio: 1.85; }
  .tasks-heading, .tasks-categories { grid-column: 1 / -1; }
  .tasks-hero { height: 100%; min-height: 270px; aspect-ratio: auto; padding: 24px; }
  .tasks-hero-art { width: 58%; }
  .tasks-hero h2 { font-size: 26px; }
  .task-category-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .task-category { min-height: 190px; max-height: none; aspect-ratio: auto; align-items: flex-start; padding: 14px; }
  .category-icon { width: 62px; height: 62px; }
  .category-copy, .category-video .category-copy { left: 16px; bottom: 18px; width: calc(100% - 32px); }
  .category-decoration { width: 54%; height: 60%; }
  .settings-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
  .settings-heading, .settings-content > .settings-profile { grid-column: 1 / -1; }
  .settings-screen .settings-heading, .settings-screen .settings-profile, .settings-screen .settings-group { margin: 0; }
  #tab-offers .task-list, #taskList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-detail-page > .screen-content { max-width: 1280px; }
  #tab-refer > .screen-content { max-width: 900px; }
}
@media (min-width: 1100px) {
  .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-header { padding-left: max(var(--page-gutter), calc((100% - 1216px) / 2)); padding-right: max(var(--page-gutter), calc((100% - 1216px) / 2)); }
  .home-hero .hero-title { font-size: 36px; }
  .home-hero .hero-sub { font-size: 14px; }
}
@media (max-height: 500px) and (min-width: 600px) {
  .home-header { height: calc(60px + env(safe-area-inset-top, 0px)); min-height: 60px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  nav.bottom-nav button, nav.bottom-nav button .nav-icon, nav.bottom-nav .nav-label, .bottom-nav-items, .nav-active-pill { transition: none; }
  nav.bottom-nav button:active .nav-icon { transform: none; }
}
