/* New Year — full checklist atmosphere under Quiet Pulse chrome. */

#wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.wp {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

html[data-wallpaper]:not([data-wallpaper="none"]) .wp {
  opacity: 1;
}

html[data-wallpaper]:not([data-wallpaper="none"]) .page-bg {
  opacity: 0;
}

/* Device used to paint an opaque bg.jpg over #wallpaper — snow lived under it and was invisible */
html[data-wallpaper]:not([data-wallpaper="none"]) .device,
html[data-wallpaper]:not([data-wallpaper="none"]) body:not(.in-tg) .device,
html[data-wallpaper]:not([data-wallpaper="none"]) body.is-public:not(.in-tg) .device {
  background: transparent !important;
  background-image: none !important;
}

html[data-wallpaper]:not([data-wallpaper="none"]) .view {
  padding-bottom: 168px;
}

html[data-wallpaper]:not([data-wallpaper="none"]) .hero-card.glass {
  margin-bottom: 12px;
}

/* Snowflake cursor */
html[data-wallpaper]:not([data-wallpaper="none"]) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg fill='none' stroke='%23eef6ff' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M14 3v22M3 14h22M6.5 6.5l15 15M21.5 6.5l-15 15'/%3E%3Cpath d='M14 7l2 2M14 7l-2 2M14 21l2-2M14 21l-2-2'/%3E%3C/g%3E%3Ccircle cx='14' cy='14' r='1.6' fill='%23fff'/%3E%3C/svg%3E")
      14 14,
    auto;
}

html[data-wallpaper]:not([data-wallpaper="none"]) a,
html[data-wallpaper]:not([data-wallpaper="none"]) button,
html[data-wallpaper]:not([data-wallpaper="none"]) [role="button"] {
  cursor: pointer;
}

.wp__move {
  position: absolute;
  inset: -5%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.wp__move--photo {
  inset: -7%;
  z-index: 0;
}

.wp__move--mid {
  z-index: 1;
}

.wp__move--fore {
  inset: 0;
  z-index: 3;
  overflow: hidden;
}

.wp__layer {
  position: absolute;
  inset: 0;
}

.wp__photo {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.wp__photo--ny {
  filter: saturate(1.05) contrast(1.06) brightness(0.72) blur(2.8px);
  transform: scale(1.06);
}

.wp__photo-dim {
  background:
    linear-gradient(180deg, rgba(6, 12, 28, 0.62) 0%, rgba(8, 14, 32, 0.32) 26%, rgba(10, 16, 34, 0.22) 52%, rgba(8, 10, 22, 0.58) 100%),
    radial-gradient(68% 48% at 50% 40%, transparent 28%, rgba(4, 8, 20, 0.5) 100%);
}

.wp__lights {
  background-position: center 18%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.52;
  mix-blend-mode: screen;
  filter: blur(0.5px);
}

.wp--ny-snow .wp__lights {
  animation: wp-lights-breathe 7s ease-in-out infinite;
}

.wp__bokeh {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.wp__bokeh i {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(30px);
  mix-blend-mode: screen;
}

.wp__ground {
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(200, 215, 235, 0.1) 40%, rgba(180, 195, 220, 0.16));
}

.wp__vignette--ny {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform: none !important;
  background:
    radial-gradient(58% 42% at 50% 48%, rgba(255, 168, 72, 0.11) 0%, transparent 58%),
    radial-gradient(120% 100% at 50% 50%, transparent 40%, rgba(4, 8, 18, 0.58) 100%),
    linear-gradient(180deg, rgba(6, 10, 24, 0.66) 0%, rgba(8, 12, 28, 0.22) 16%, transparent 32%, transparent 62%, rgba(12, 10, 18, 0.4) 88%, rgba(6, 8, 14, 0.66) 100%);
  box-shadow: inset 0 0 90px rgba(180, 210, 255, 0.07);
}

/*
 * Ice rim — above UI so backdrop-filter frosts real content.
 * Glass + noise distort + frost texture + specular highlights + jagged masks.
 */
.wp__ice-rim {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}

.wp__ice-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wp__ice-glass {
  position: absolute;
  pointer-events: none;
  /* Real frost: soft matte glass, smooth fade — no torn scraps */
  backdrop-filter: blur(5px) brightness(1.05) saturate(1.08);
  -webkit-backdrop-filter: blur(5px) brightness(1.05) saturate(1.08);
  box-shadow: inset 0 0 32px rgba(200, 228, 250, 0.1);
}

.wp__ice-glass--top {
  top: 0;
  left: 0;
  right: 0;
  height: min(16vh, 108px);
  background: linear-gradient(
    to bottom,
    rgba(225, 240, 255, 0.3) 0%,
    rgba(200, 228, 250, 0.16) 28%,
    rgba(200, 228, 250, 0.06) 58%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    rgba(0, 0, 0, 0.82) 22%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.12) 78%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    rgba(0, 0, 0, 0.82) 22%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.12) 78%,
    transparent 100%
  );
}

.wp__ice-glass--bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: min(17vh, 116px);
  background: linear-gradient(
    to top,
    rgba(190, 220, 245, 0.32) 0%,
    rgba(205, 230, 250, 0.14) 30%,
    rgba(205, 230, 250, 0.05) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to top,
    black 0%,
    rgba(0, 0, 0, 0.82) 22%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.12) 78%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to top,
    black 0%,
    rgba(0, 0, 0, 0.82) 22%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.12) 78%,
    transparent 100%
  );
}

.wp__ice-glass--left {
  top: 0;
  bottom: 0;
  left: 0;
  width: min(11vw, 52px);
  background: linear-gradient(
    to right,
    rgba(205, 230, 250, 0.26) 0%,
    rgba(205, 230, 250, 0.1) 40%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    black 0%,
    rgba(0, 0, 0, 0.7) 28%,
    rgba(0, 0, 0, 0.28) 62%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    black 0%,
    rgba(0, 0, 0, 0.7) 28%,
    rgba(0, 0, 0, 0.28) 62%,
    transparent 100%
  );
}

.wp__ice-glass--right {
  top: 0;
  bottom: 0;
  right: 0;
  width: min(11vw, 52px);
  background: linear-gradient(
    to left,
    rgba(205, 230, 250, 0.26) 0%,
    rgba(205, 230, 250, 0.1) 40%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to left,
    black 0%,
    rgba(0, 0, 0, 0.7) 28%,
    rgba(0, 0, 0, 0.28) 62%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to left,
    black 0%,
    rgba(0, 0, 0, 0.7) 28%,
    rgba(0, 0, 0, 0.28) 62%,
    transparent 100%
  );
}

/* Quiet frost grain — only at the rim */
.wp__ice-frost-tex {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E")
    center / 200px 200px repeat;
  -webkit-mask-image: radial-gradient(ellipse 86% 78% at 50% 50%, transparent 62%, black 100%);
  mask-image: radial-gradient(ellipse 86% 78% at 50% 50%, transparent 62%, black 100%);
}

/* Soft rim glints */
.wp__ice-highlights {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.45), transparent 18%),
    linear-gradient(to top, rgba(255, 255, 255, 0.28), transparent 16%),
    linear-gradient(to right, rgba(255, 255, 255, 0.22), transparent 10%),
    linear-gradient(to left, rgba(255, 255, 255, 0.22), transparent 10%);
  mix-blend-mode: soft-light;
}

/* Footprint tracks */
.wp__tracks {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.wp__print {
  position: absolute;
  width: 7px;
  height: 9px;
  margin: -4px 0 0 -3px;
  border-radius: 50% 50% 45% 45%;
  background: rgba(210, 225, 245, 0.55);
  box-shadow: 0 0 4px rgba(160, 190, 230, 0.35);
  animation: wp-print-fade 1.5s ease forwards;
  pointer-events: none;
}

@keyframes wp-print-fade {
  0% {
    opacity: 0.7;
    transform: scale(0.7);
  }
  30% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

/* Garland */
.wp__garland {
  position: absolute;
  top: 0;
  left: 2%;
  right: 2%;
  height: 38px;
  z-index: 5;
}

.wp__wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wp__bulb {
  position: absolute;
  top: 9px;
  width: 9px;
  height: 11px;
  margin-left: -4.5px;
  border-radius: 50% 50% 45% 45%;
  background: var(--c, #ffd27a);
  box-shadow:
    0 0 8px var(--c, #ffd27a),
    0 0 18px color-mix(in srgb, var(--c, #ffd27a) 50%, transparent);
  animation: wp-bulb 2.8s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0.85;
}

.wp__bulb::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  background: rgba(60, 70, 85, 0.7);
  border-radius: 1px;
}

@keyframes wp-bulb {
  0%,
  100% {
    opacity: 0.42;
    filter: brightness(0.85);
  }
  50% {
    opacity: 1;
    filter: brightness(1.3);
  }
}

.wp__snow {
  overflow: hidden;
  z-index: 2;
}

.wp__snow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Phone snowfall: CSS flakes in #wallpaper (behind cards) — no canvas WebView bugs */
.wp__snow--css {
  z-index: 2;
}

.wp__snow--css i {
  position: absolute;
  left: var(--x);
  top: -12px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgba(255, 252, 250, var(--o));
  box-shadow: 0 0 6px rgba(210, 230, 255, 0.45);
  animation: wp-snow-fall var(--d) linear infinite;
  animation-delay: var(--delay);
  pointer-events: none;
  will-change: transform;
}

@keyframes wp-snow-fall {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(var(--drift, 16px), 110vh, 0);
  }
}

.is-scrolling .wp__snow--css i,
.bg-paused .wp__snow--css i {
  animation-play-state: paused;
}

@keyframes wp-lights-breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.6;
  }
}


/* —— Glass + material textures (wood / knit) —— */
html[data-wallpaper="ny"] .glass {
  border-color: rgba(255, 205, 150, 0.12);
  background:
    linear-gradient(168deg, rgba(34, 30, 40, 0.88) 0%, rgba(18, 16, 26, 0.92) 100%),
    repeating-linear-gradient(
      92deg,
      rgba(120, 78, 42, 0.07) 0 2px,
      rgba(90, 55, 30, 0.03) 2px 5px,
      rgba(150, 100, 55, 0.05) 5px 7px
    );
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 230, 190, 0.1);
}

/* Soft knit overlay on hero */
html[data-wallpaper] .hero-card.glass {
  background:
    linear-gradient(168deg, rgba(36, 32, 44, 0.9) 0%, rgba(20, 18, 30, 0.93) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0 1px,
      transparent 1px 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0 1px,
      transparent 1px 4px
    );
}

html[data-wallpaper] .hero-card.glass,
html[data-wallpaper] .list-card.glass,
html[data-wallpaper] .feed-card.glass,
html[data-wallpaper] .section__head .chip-btn,
html[data-wallpaper] .sched-tools .chip-btn,
html[data-wallpaper] .tabbar button {
  position: relative;
  overflow: visible !important;
}

/* backdrop-filter clips overflow in Chromium — drop it so rim snow can sit ON the card */
html[data-wallpaper] .hero-card.glass,
html[data-wallpaper] .list-card.glass,
html[data-wallpaper] .feed-card.glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background:
    linear-gradient(168deg, rgba(36, 32, 44, 0.88) 0%, rgba(16, 20, 32, 0.9) 100%),
    rgba(12, 16, 26, 0.72);
}

html[data-wallpaper] .tabbar {
  overflow: visible;
  z-index: 5;
}

/* Frost overlay — keep card overflow visible so top snow sits on the rim */
html[data-wallpaper] .wp-frost-host.feed-card.glass {
  overflow: visible;
}

/* Soft corner frost — no hard “cut-out” panel (that left a step on the card) */
html[data-wallpaper] .wp-frost-host.feed-card.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(232, 251, 255, 0.22) 0%, rgba(160, 210, 235, 0.1) 34%, transparent 62%),
    linear-gradient(135deg, transparent 48%, rgba(255, 255, 255, 0.08) 72%, rgba(200, 230, 245, 0.12) 100%);
  -webkit-mask-image: linear-gradient(135deg, transparent 40%, rgba(0, 0, 0, 0.35) 58%, black 82%);
  mask-image: linear-gradient(135deg, transparent 40%, rgba(0, 0, 0, 0.35) 58%, black 82%);
  mix-blend-mode: soft-light;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/*
 * Top snow sits on the flat rim between rounded corners (inset ≈ radius),
 * soft tapered ends — no hard stubs, no overhang past the curve.
 */
html[data-wallpaper] .hero-card.glass::before,
html[data-wallpaper] .list-card.glass::before,
html[data-wallpaper] .feed-card.glass::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 16px;
  right: 16px;
  height: 14px;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(180deg, #f7fbff 0%, #c8dced 58%, #8eacc8 100%);
  box-shadow:
    inset 0 -7px 10px rgba(100, 140, 185, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 4px rgba(30, 42, 64, 0.16);
  border-radius: 0;
  /* Soft lips at ends (no stubs), wavy crest — strip inset already clears corner radius */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 16C6 16 10 7 22 7c14-5 28 1 42-1 14-4 28 2 42-1 14-4 28 1 42 0 12-3 22 1 30 5 6 2 12 4 22 6H0z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 16C6 16 10 7 22 7c14-5 28 1 42-1 14-4 28 2 42-1 14-4 28 1 42 0 12-3 22 1 30 5 6 2 12 4 22 6H0z'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  filter: blur(0.25px);
  transform: none !important;
}

html[data-wallpaper] .list-card.glass::before {
  left: 14px;
  right: 14px;
  height: 12px;
  top: -10px;
  opacity: 0.94;
}

html[data-wallpaper] .feed-card.glass::before {
  left: 14px;
  right: 14px;
  height: 11px;
  top: -9px;
  opacity: 0.9;
}

/* Icy progress bar — readable, no warm gold */
html[data-wallpaper] .progress {
  display: block;
  position: relative;
  z-index: 2;
  background: rgba(160, 200, 230, 0.16);
}

html[data-wallpaper] .progress i {
  background: linear-gradient(90deg, #6aa9cb 0%, #b7dcef 55%, #e8f5fc 100%);
  box-shadow: 0 0 6px rgba(140, 200, 230, 0.35);
}

html[data-wallpaper] .progress i::after {
  background: #eaf6ff;
  box-shadow: none;
}

/* Pulse crystal facets → icy under NY wallpaper */
html[data-wallpaper] .subj-bar {
  background: linear-gradient(180deg, #fff 0%, #b8e0f5 22%, #5a9ec4 100%);
}

html[data-wallpaper] .now-tag i {
  background: linear-gradient(135deg, #f4fbff, #7ec4e4);
  box-shadow: 0 0 6px rgba(160, 220, 255, 0.55);
}

html[data-wallpaper] .tabbar button.is-on::before {
  background: radial-gradient(circle, #fff 0 1px, transparent 2px),
    conic-gradient(
      from 45deg,
      transparent 0 22%,
      rgba(210, 240, 255, 0.95) 25%,
      transparent 28% 47%,
      rgba(150, 210, 240, 0.95) 50%,
      transparent 53% 72%,
      rgba(210, 240, 255, 0.95) 75%,
      transparent 78% 97%,
      rgba(150, 210, 240, 0.95) 100%
    );
  filter: drop-shadow(0 0 5px rgba(160, 220, 255, 0.65));
}

html[data-wallpaper] .sheet__card.glass::before,
html[data-wallpaper] .gate__card.glass::before,
html[data-wallpaper] .toast.glass::before,
html[data-wallpaper] .lesson-list.glass::before {
  content: none !important;
  display: none !important;
}

html[data-wp-scene="desk"] .hero-card.glass::before,
html[data-wp-scene="desk"] .list-card.glass::before,
html[data-wp-scene="desk"] .feed-card.glass::before,
html[data-wp-scene="desk"] .feed-card.glass::after {
  display: none;
}

/* Santa hat on logo */
.wp-logo-host {
  position: relative;
}

.wp-santa {
  position: absolute;
  top: -14px;
  left: -8px;
  width: 40px;
  height: 30px;
  pointer-events: none;
  z-index: 8;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
  transform: rotate(-22deg);
}

.wp-santa svg {
  width: 40px;
  height: 30px;
  display: block;
}

html[data-wallpaper] .logo {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 18px rgba(8, 6, 24, 0.26),
    0 -2px 0 rgba(255, 255, 255, 0.2);
}

html[data-wallpaper] .wordmark {
  animation: none !important;
  background-size: auto !important;
  filter: none;
}

html[data-wallpaper] .top::after {
  opacity: 0.16;
  filter: saturate(0.5) brightness(1.05);
}

/* Countdown */
html[data-wallpaper] .app,
html[data-wallpaper] #phone {
  position: relative;
}

/* Keep header above wallpaper chrome; do NOT make .top__actions relative —
   that re-anchors the burger dropdown and pushes it off-screen. */
html[data-wallpaper] .top {
  z-index: 14;
}

html[data-wallpaper] .top__actions.is-fold .top__menu {
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  width: min(260px, calc(100% - 24px));
  max-width: calc(100vw - 24px);
  z-index: 50;
}

.wp-countdown {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-left: auto;
  margin-right: 8px;
  padding: 5px 9px;
  border-radius: 10px;
  background: rgba(12, 16, 28, 0.55);
  border: 1px solid rgba(255, 220, 170, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
  max-width: 42vw;
}

.wp-countdown__lab {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 220, 180, 0.7);
}

.wp-countdown__val {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 245, 230, 0.95);
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

/* brand | countdown | actions — countdown keeps a free lane even with desk gear */
html[data-wallpaper] .top .top__actions {
  margin-left: 0;
}

@media (max-width: 759px), (pointer: coarse) {
  .wp-countdown {
    padding: 4px 8px;
  }
  .wp-countdown__val {
    font-size: 11px;
  }
}

/* Text stays readable — content above craft, room at the bottom for drifts */
html[data-wallpaper] .hero-card.glass,
html[data-wallpaper] .list-card.glass,
html[data-wallpaper] .feed-card.glass {
  isolation: isolate;
}

html[data-wallpaper] .hero-card.glass {
  padding-bottom: 48px;
}

html[data-wallpaper] .list-card.glass,
html[data-wallpaper] .feed-card.glass {
  padding-bottom: 28px;
}

html[data-wallpaper] .hero-card.glass > :not(.wp-orn-slot),
html[data-wallpaper] .list-card.glass > :not(.wp-orn-slot),
html[data-wallpaper] .feed-card.glass > :not(.wp-orn-slot):not(.wp-orn) {
  position: relative;
  z-index: 3;
}

html[data-wallpaper] .feed-card.glass .type,
html[data-wallpaper] .feed-card.glass h3,
html[data-wallpaper] .feed-card.glass p {
  position: relative;
  z-index: 3;
  max-width: calc(100% - 72px);
}

/* —— Ornament slots —— */
.wp-orn-slot {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.wp-orn {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

/* CSS drifts — upright, flat base, 3 layers, blue volume */
.wp-orn--drift {
  position: relative;
  display: block;
  pointer-events: auto;
  cursor: inherit;
  transform: none !important;
  filter: drop-shadow(0 6px 10px rgba(40, 55, 80, 0.28));
}

.wp-orn--drift-lg {
  width: 168px;
  height: 46px;
}
.wp-orn--drift-md {
  width: 96px;
  height: 30px;
}
.wp-orn--drift-sm {
  width: 56px;
  height: 18px;
}

.wp-drift__back,
.wp-drift__mid,
.wp-drift__front {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  /* scalloped crest via mask; flat baseline */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 28' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 28 C2 20 8 14 18 12 C28 4 40 5 50 11 C60 4 72 5 82 12 C90 16 96 20 100 28 Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 28' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 28 C2 20 8 14 18 12 C28 4 40 5 50 11 C60 4 72 5 82 12 C90 16 96 20 100 28 Z'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.wp-drift__back {
  height: 100%;
  width: 108%;
  left: -4%;
  background: linear-gradient(to bottom, #dce8f6 8%, #7f9fbf 100%);
  filter: blur(2.2px);
  opacity: 0.8;
  box-shadow: inset 0 -14px 20px rgba(90, 130, 175, 0.55);
}

.wp-drift__mid {
  height: 90%;
  width: 96%;
  left: 2%;
  background: linear-gradient(to bottom, #eef5fc 12%, #a9c8e8 70%, #7a9cbc 100%);
  box-shadow: inset 0 -12px 18px rgba(110, 150, 195, 0.55);
  opacity: 0.96;
}

.wp-drift__front {
  height: 74%;
  width: 76%;
  left: 10%;
  background: linear-gradient(to bottom, #fbfcff 8%, #cfe0f2 65%, #9db8d4 100%);
  box-shadow:
    inset 0 -10px 16px rgba(130, 170, 210, 0.48),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  filter: drop-shadow(0 -1px 3px rgba(255, 255, 255, 0.5));
}

.wp-drift__spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  animation: wp-crystal-twinkle 2.6s ease-in-out infinite;
  animation-delay: var(--sp, 0s);
  pointer-events: none;
}

.wp-orn--cane {
  margin-left: -12px;
  margin-bottom: -2px;
  z-index: 2;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35));
  transform: none;
  transform-origin: 50% 100%;
  align-self: flex-end;
}

.wp-orn--crystal {
  margin-left: -4px;
  margin-bottom: 10px;
  z-index: 3;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.75)) drop-shadow(0 2px 4px rgba(60, 120, 180, 0.4));
  animation: wp-crystal-twinkle 2.8s ease-in-out infinite;
  animation-delay: var(--tw, 0s);
}

.wp-orn--crystal-sm {
  margin-bottom: 14px;
  margin-left: -2px;
}

.wp-orn--crystal-lg {
  margin-bottom: 6px;
}

@keyframes wp-crystal-twinkle {
  0%,
  100% {
    opacity: 0.62;
  }
  45% {
    opacity: 1;
  }
  70% {
    opacity: 0.78;
  }
}

.wp-orn--snowman {
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}

.wp-orn--ice {
  filter: drop-shadow(0 2px 10px rgba(70, 160, 200, 0.32));
  z-index: 3;
}

.wp-orn--bauble {
  position: relative;
  margin-left: 2px;
  margin-bottom: 6px;
  z-index: 4;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: 50% 0;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35));
  align-self: flex-end;
}

/* Silent tap hint: soft glow ring + tiny bob — no text, no arrow */
.wp-orn--bauble-hint {
  animation: wp-bauble-invite 2.4s ease-in-out infinite;
}

.wp-bauble-hint {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 1.5px solid rgba(180, 220, 255, 0.55);
  box-shadow:
    0 0 10px rgba(140, 200, 255, 0.45),
    inset 0 0 8px rgba(200, 230, 255, 0.25);
  pointer-events: none;
  animation: wp-bauble-ring 2.4s ease-out infinite;
}

@keyframes wp-bauble-invite {
  0%,
  100% {
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 0 transparent);
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 10px rgba(140, 200, 255, 0.55));
    transform: translateY(-2px);
  }
}

@keyframes wp-bauble-ring {
  0% {
    opacity: 0.7;
    transform: scale(0.85);
  }
  70% {
    opacity: 0;
    transform: scale(1.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

.wp-orn--bauble.is-swing {
  animation: wp-bauble-swing 0.85s ease-in-out;
}

.wp-orn--bauble:not(.wp-orn--bauble-hint) .wp-bauble-hint {
  display: none;
}

@keyframes wp-bauble-swing {
  0% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(18deg);
  }
  45% {
    transform: rotate(-14deg);
  }
  70% {
    transform: rotate(8deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* Drift ON the card — base on the bottom edge, crest climbs onto the block */
.wp-orn-slot--hero {
  left: 4%;
  right: auto;
  bottom: 2px;
  width: min(210px, 58%);
  max-width: 58%;
  height: 40px;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  overflow: visible;
}

.wp-orn-slot--hero .wp-orn--drift-lg {
  z-index: 1;
  flex-shrink: 0;
  /* tuck base into the card edge */
  margin-bottom: -2px;
}

.wp-orn-slot--hero-day {
  left: 8%;
  right: 34%;
  bottom: 0;
  height: 28px;
  align-items: flex-end;
}

.wp-orn-slot--chip {
  right: 0;
  bottom: 0;
  height: 28px;
  max-width: 96px;
  align-items: flex-end;
}

.wp-orn-slot--chip .wp-orn--cane {
  width: 14px;
  height: 24px;
  margin-bottom: 2px;
}

.wp-orn-slot--chip .wp-orn--cane svg {
  width: 14px;
  height: 24px;
}

.wp-orn-slot--chip .wp-orn--crystal {
  margin-bottom: 4px;
}

.wp-orn-slot--tab {
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  height: 44px;
  justify-content: center;
}

.wp-orn-slot--feed {
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  z-index: 2;
}

.wp-orn-slot--feed .wp-orn--ice {
  position: absolute;
  top: 0;
  right: 0;
}

.wp-orn-slot--feed .wp-orn--crystal {
  position: absolute;
  margin: 0;
}

.wp-orn-slot--feed .wp-orn--crystal-md {
  top: 28px;
  right: 36px;
}

.wp-orn-slot--feed .wp-orn--crystal-sm {
  top: 46px;
  right: 10px;
}

.wp-orn-slot--feed-drift {
  left: 6%;
  right: 38%;
  bottom: 0;
  height: 24px;
  align-items: flex-end;
  z-index: 4;
}

.wp-orn-slot--list {
  left: 4%;
  right: 36%;
  bottom: 0;
  height: 26px;
  align-items: flex-end;
}

html[data-wallpaper] .section__head {
  position: relative;
  overflow: visible;
}

html[data-wallpaper] .section__head .chip-btn.wp-orn-host,
html[data-wallpaper] .sched-tools .chip-btn.wp-orn-host {
  padding-right: 40px;
}

html[data-wallpaper][data-style="pinkme"] .glass {
  border-color: rgba(255, 170, 200, 0.14);
}

html[data-wallpaper][data-style="terminal"] .wp__lights {
  opacity: 0.28;
  filter: saturate(0.5);
}

html[data-wallpaper][data-style="terminal"] .wp__garland,
html[data-wallpaper][data-style="terminal"] .wp__bokeh,
html[data-wallpaper][data-style="terminal"] .wp-santa,
html[data-wallpaper][data-style="terminal"] .wp-countdown {
  opacity: 0.4;
}

@media (prefers-reduced-motion: reduce) {
  .wp__bulb,
  .wp-drift__spark,
  .wp-orn--crystal,
  .wp-orn--bauble.is-swing,
  .wp-orn--bauble-hint,
  .wp-bauble-hint,
  .wp--ny-snow .wp__lights {
    animation: none !important;
  }
  .wp-orn--crystal {
    opacity: 0.85;
  }
  .wp__ice-glass {
    filter: none;
  }
}

/* Phones: keep the same frost look via gradients, drop live backdrop-filter (re-paints every scroll frame). */
@media (max-width: 759px), (pointer: coarse) {
  .wp__ice-glass,
  .wp-countdown,
  html[data-wallpaper] .wp-frost-host.feed-card.glass::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .wp__ice-glass {
    /* without live blur the hard mask edge looked cut — keep a soft veil */
    box-shadow: none;
  }
  .wp__ice-glass--top {
    height: min(18vh, 120px);
  }
  .wp__ice-glass--bottom {
    height: min(19vh, 128px);
  }
  .wp__ice-frost-tex {
    opacity: 0.1;
    mix-blend-mode: soft-light;
  }
  .wp__ice-highlights {
    opacity: 0.18;
  }
  .wp__photo--ny {
    /* static photo: avoid animated blur+scale recomposite under scrolling UI */
    filter: saturate(1.05) contrast(1.06) brightness(0.72);
    transform: scale(1.04);
  }
  .wp__lights {
    /* screen blend over a full-bleed photo is a steady compositor tax on mobile */
    mix-blend-mode: normal;
    opacity: 0.62;
    filter: none;
    animation: none !important;
  }
  .wp__bulb,
  .wp-orn--crystal,
  .wp-orn--bauble-hint,
  .wp-bauble-hint,
  .wp-drift__spark {
    animation: none !important;
  }
  .bg-paused .wp__garland,
  .bg-paused .wp__bokeh {
    opacity: 0.85;
  }
  .is-scrolling .wp__bulb,
  .is-scrolling .wp-orn--crystal,
  .is-scrolling .wp-orn--bauble-hint,
  .is-scrolling .wp-bauble-hint,
  .is-scrolling .wp--ny-snow .wp__lights,
  .is-scrolling .wp-drift__spark {
    animation-play-state: paused !important;
  }
}
