/* A viewport-fixed landscape, independent of the document's scroll height.
   Restore the original cool-blue wash shared by the older app pages. */
:root{--clearspk-page-landscape:linear-gradient(to bottom,rgba(255,255,255,.60) 0%,rgba(79,195,247,.60) 30%,rgba(3,155,229,.60) 100%),url('../bg6_clearspk.png');background-color:#dff7fa;overscroll-behavior:none}
/* Form pages use native vertical scrolling, including the platform's edge feedback. */
html:root:has(form:not(dialog form)) { overscroll-behavior-y: auto; }
html:root:has(form:not(dialog form)):not(.clearspk-page-loading, .swal2-shown) { overflow-y: auto; }
/* Keep the same landscape underneath the fixed layer when a block/flex route
   transition causes the browser to repaint its composited pseudo-element. */
html:root body{isolation:isolate!important;background-color:#dff7fa!important;background-image:var(--clearspk-page-landscape)!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important;background-attachment:fixed!important;overscroll-behavior-x:none;overscroll-behavior-y:auto}
/* A fixed painted layer also works on iOS, where background-attachment:fixed
   can move or resize with the document. Large viewport units avoid URL-bar jumps. */
html:root body::before{content:""!important;display:block!important;position:fixed!important;inset:0 auto auto 0!important;width:100%!important;height:100vh!important;height:100lvh!important;z-index:-2!important;margin:0!important;border:0!important;border-radius:0!important;background:var(--clearspk-page-landscape) center/cover no-repeat!important;pointer-events:none!important;filter:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;transform:none!important;animation:none!important;will-change:auto!important}
/* Stagger the three passes within one cycle so the clouds periodically share the sky. */
html:root body::after,html:root body>.clearspk-cloud-companion{--cloud-width:var(--clearspk-cloud-width,clamp(240px,32vw,480px));content:""!important;display:block!important;position:fixed!important;inset:var(--clearspk-cloud-top,52vh) auto auto calc(-1 * var(--cloud-width))!important;inset:var(--clearspk-cloud-top,52lvh) auto auto calc(-1 * var(--cloud-width))!important;width:var(--cloud-width)!important;height:calc(var(--cloud-width) * .42)!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;z-index:-1!important;pointer-events:none!important;contain:strict;filter:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important;background:url('../assets/background/cloud-soft.svg') center/contain no-repeat!important;opacity:0;transform:translate3d(0,0,0);animation:clearspk-cloud-pass 84s linear -17s infinite!important;will-change:auto!important}
html:root body>.clearspk-cloud-companion{animation-delay:-7s!important}
@keyframes clearspk-cloud-pass{0%,8%{opacity:0;transform:translate3d(0,0,0)}14%{opacity:var(--clearspk-cloud-opacity,.30)}52%{opacity:var(--clearspk-cloud-opacity,.30)}62%,100%{opacity:0;transform:translate3d(calc(100vw + var(--cloud-width)), -18px,0)}}
html.wallet-page-hidden body::after,html.clearspk-cloud-paused body::after,html.wallet-page-hidden body>.clearspk-cloud-companion,html.clearspk-cloud-paused body>.clearspk-cloud-companion{animation-play-state:paused!important}
@media(prefers-reduced-motion:reduce){html:root body::after,html:root body>.clearspk-cloud-companion{animation:none!important;opacity:0}}
@media print{html:root body{background:#fff!important}html:root body::before,html:root body::after,html:root body>.clearspk-cloud-companion{display:none!important}}

/* The sky sits behind the clouds and the page controls. */
.clearspk-sky-light {
  --sky-size: clamp(50px, 6vw, 82px);
  position: fixed;
  /* Use the same patch of sky on the home screen and both practice screens. */
  top: max(env(safe-area-inset-top, 0px), clamp(52px, 19vh, 165px));
  top: max(env(safe-area-inset-top, 0px), clamp(52px, 19svh, 165px));
  left: max(calc(env(safe-area-inset-left, 0px) + 8px),
            calc(50% - clamp(96px, 25vw, 158px) - var(--sky-size) / 2));
  width: var(--sky-size);
  height: var(--sky-size);
  z-index: -1;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  html:root body > .clearspk-cloud-companion.clearspk-cloud-distant {
    animation-delay: 4s !important;
  }
}
.clearspk-sky-light::before, .clearspk-sky-light::after {
  content: "";
  position: absolute;
}
.clearspk-sky-light[data-phase="day"]::before {
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from -4deg, #ffe6a0 0 8deg, transparent 8deg 45deg);
  -webkit-mask-image: radial-gradient(circle closest-side, transparent 75%, #000 78%);
  mask-image: radial-gradient(circle closest-side, transparent 75%, #000 78%);
}
.clearspk-sky-light[data-phase="day"]::after {
  inset: 18%;
  border-radius: 50%;
  background: linear-gradient(150deg, #fff5b5, #ffcf66 85%);
  box-shadow: 0 0 16px 5px #ffe3a766;
}
.clearspk-sky-light[data-phase="night"] {
  filter: drop-shadow(0 0 6px #9b96d880);
}
.clearspk-sky-light[data-phase="night"]::before {
  inset: 9%;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffed 30%, #e4e8ff 90%);
  -webkit-mask-image: radial-gradient(circle at 72% 24%, transparent 0 48%, #000 50%);
  mask-image: radial-gradient(circle at 72% 24%, transparent 0 48%, #000 50%);
}
.clearspk-sky-light[data-phase="night"]::after {
  top: 12%;
  right: 12%;
  width: 17%;
  height: 22%;
  background: #fff6d9;
  clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 60%, 50% 100%, 38% 60%, 0 50%, 38% 37%);
}
@media (prefers-reduced-motion: no-preference) {
  .clearspk-sky-light { animation: clearspk-sky-drift 16s ease-in-out infinite alternate; }
  .clearspk-sky-light[data-phase="day"]::before { animation: clearspk-sun-turn 72s linear infinite; }
  .clearspk-sky-light[data-phase="night"]::after { animation: clearspk-star-glow 4s ease-in-out infinite alternate; }
  html.clearspk-cloud-paused .clearspk-sky-light,
  html.clearspk-cloud-paused .clearspk-sky-light::before,
  html.clearspk-cloud-paused .clearspk-sky-light::after { animation-play-state: paused; }
}
@keyframes clearspk-sky-drift { to { transform: translate(3px, -3px); } }
@keyframes clearspk-sun-turn { to { transform: rotate(1turn); } }
@keyframes clearspk-star-glow { to { opacity: .45; } }
@media print { .clearspk-sky-light { display: none; } }
