/* Thanksgiving's visual layer, copied from themes/halloween/halloween.css and
   scoped to this collection. Original geometry, typography and red app icons
   are inherited unchanged. No prop ever handles pointer events. */
:root[data-theme-collection="thanksgiving"] .apps-body { background:transparent; }
:root[data-theme-collection="thanksgiving"] .apps-body::before { content:none; }
/* The grid remains structurally unchanged. The leaf layer itself rises as the
   pile builds, and remains click-through while it covers the tiles. */
:root[data-theme-collection="thanksgiving"] .apps-inner { position:relative; z-index:2; }
:root[data-theme-collection="thanksgiving"] .app-tile { position:relative; z-index:2; }
:root[data-theme-collection="thanksgiving"] .app-tile {
  /* Do not redefine the Original tile's geometry or interaction treatment.
     Theme palette tokens recolor the native component without resizing it. */
  isolation:isolate;
  transform-style:flat;
  overflow:hidden;
  overflow:clip;
}
:root[data-theme-collection="thanksgiving"] .app-tile::before { content:none; }
#thanksgiving-drift {
  position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden;
  contain:strict;
}
#thanksgiving-leaves {
  /* A viewport layer above the apps: leaves collect from the bottom into a
     visible tower, while pointer-events keeps every application usable. */
  position:fixed; inset:0; z-index:3; pointer-events:none; overflow:hidden;
  contain:strict; background:none;
}
.thanksgiving-drifter {
  position:absolute; top:0; left:0; display:block; pointer-events:none;
  perspective:600px; will-change:transform;
}
.thanksgiving-drifter img {
  display:block; width:100%; height:100%; object-fit:contain; opacity:.78;
  filter:drop-shadow(0 3px 4px color-mix(in srgb, var(--shadow-color) 22%, transparent));
  transform-origin:center;
  animation:thanksgiving-small-orbit 11s ease-in-out var(--phase) infinite;
}
.thanksgiving-falling-leaf,.thanksgiving-settled-leaf {
  position:absolute; top:0; left:0; display:block; pointer-events:none;
  will-change:transform;
}
.thanksgiving-falling-leaf {
  transform-origin:48% 56%;
  transform-style:preserve-3d;
}
.thanksgiving-falling-leaf img,.thanksgiving-settled-leaf img {
  display:block; width:100%; height:100%; object-fit:contain;
  filter:drop-shadow(0 2px 2px color-mix(in srgb, var(--shadow-color) 22%, transparent));
}
.thanksgiving-falling-leaf img { transform-origin:center; backface-visibility:visible; }
.thanksgiving-settled-leaf { opacity:var(--leaf-opacity,.62); }
#thanksgiving-turkey-layer { position:fixed; inset:0; z-index:4; pointer-events:none; }
@keyframes thanksgiving-small-orbit {
  0%,100% { transform:translate3d(var(--pointer-x,0px),var(--pointer-y,0px),0) rotateY(0deg) rotateZ(-4deg); }
  50% { transform:translate3d(var(--pointer-x,0px),calc(var(--pointer-y,0px) - 3px),8px) rotateY(var(--yaw)) rotateZ(4deg); }
}
.thanksgiving-turkey {
  /* scene.js writes the transform every frame: it walks the tile's edge,
     hops, and flips in 3D. Perspective here is what gives the flip depth. */
  position:absolute; z-index:1; display:block; pointer-events:none;
  transform-style:preserve-3d; perspective:520px; will-change:transform;
  filter:drop-shadow(0 3px 3px color-mix(in srgb, var(--shadow-color) 28%, transparent));
}
.thanksgiving-turkey img {
  display:block; width:100%; height:100%; object-fit:contain;
}
.thanksgiving-turkey.is-flapping img {
  animation:thanksgiving-wing-flap .18s ease-in-out infinite alternate;
  transform-origin:50% 70%;
}
@keyframes thanksgiving-wing-flap {
  from { transform:rotateZ(-9deg) scaleX(.96); }
  to { transform:rotateZ(9deg) scaleX(1.06); }
}
/* Measured CSS variables make the live turkey travel exactly from one native
   tile edge to the other, then return. No transform can escape the card. */
/* A flight is calculated against the actual Original app icon: bottom of the
   tile → perch above the icon → bottom of the same tile. */
/* Turkeys live in their own fixed overlay, measured against each native tile.
   They can therefore never participate in the card/grid layout calculation. */
@media (prefers-reduced-motion:reduce) {
  .thanksgiving-drifter img { animation:none; }
  .thanksgiving-falling-leaf { display:none; }
  }
@media (prefers-reduced-motion:reduce) {
  .thanksgiving-drifter { will-change:auto; }
}
