/* 0.55 «Сезоны» autumn — «Листопад» and «Уютный марафон» (public/autumn-events.js): the leaf falling over the lobby (a
   path and a turn in the plane — never a squash), the herbarium window (a pressed-paper album) and the cozy meter. */

/* --- The falling leaf: a 72-px button (a big tap target round a 56-px leaf) ------------------------------------------ */
#au-sky { position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; }
.au-fall {
  position: absolute; z-index: 6; top: 0; left: var(--x, 50%); width: 72px; height: 72px; margin: 0 0 0 -36px; padding: 0;
  border: 0; background: transparent; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
  animation: au-fall var(--fall, 9000ms) linear forwards;
}
.au-fall-in { display: grid; place-items: center; width: 100%; height: 100%; animation: au-sway 2.4s ease-in-out infinite alternate; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.au-fall:focus-visible { outline: 2px solid var(--accent-2, #ffd27a); outline-offset: 2px; border-radius: 50%; }
.au-fall.caught { pointer-events: none; animation-play-state: paused; }
.au-fall.caught .au-fall-in { animation: au-caught .55s ease-out forwards; }
@keyframes au-fall {
  0% { transform: translate(0, -70px) rotate(0deg); opacity: 0; }
  6% { opacity: 1; }
  25% { transform: translate(var(--sway), 22vh) rotate(calc(var(--spin) * .25)); }
  50% { transform: translate(0, 44vh) rotate(calc(var(--spin) * .5)); }
  75% { transform: translate(calc(var(--sway) * -1), 64vh) rotate(calc(var(--spin) * .75)); }
  94% { opacity: 1; }
  100% { transform: translate(0, 80vh) rotate(var(--spin)); opacity: 0; }
}
@keyframes au-sway { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes au-caught { to { transform: scale(1.5) rotate(20deg); opacity: 0; } }
.au-bit { position: absolute; z-index: 7; width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 2px 6px; pointer-events: none; animation: au-bit .65s ease-out forwards; }
@keyframes au-bit { to { transform: translate(var(--dx), var(--dy)) rotate(160deg); opacity: 0; } }
/* Reduced motion: it rests near the lobby's lower edge, fading in, then out — still there to tap. */
.au-fall.still { top: auto; bottom: 18px; animation: au-rest var(--fall, 9000ms) linear forwards; }
.au-fall.still .au-fall-in { animation: none; transform: rotate(-12deg); }
.au-fall.still.caught .au-fall-in { animation: none; opacity: 0; }
@keyframes au-rest { 0% { opacity: 0; } 8% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .au-fall, .au-fall-in, .au-bit { animation-duration: 1ms; }
  .au-fall.still { animation: au-rest var(--fall, 9000ms) linear forwards; }
}

/* --- The window --------------------------------------------------------------------------------------------------- */
.au-modal.stats-modal { padding: 20px; }
.au-page {
  position: relative; display: flex; flex-direction: column; width: min(860px, 100%); max-height: calc(100dvh - 40px); overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(242, 178, 92, .32); color: #f6ead6; box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  background: radial-gradient(120% 90% at 50% 0%, #3b2414 0%, #2a180d 55%, #1d1008 100%);
}
.au-top { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 18px; }
.au-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.au-tab {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(242, 178, 92, .3); background: transparent; color: #e8cfa6;
  font: 700 15px/1 Georgia, 'Times New Roman', serif; cursor: pointer;
}
.au-tab.on { background: #f2b25c; border-color: #f2b25c; color: #2a160a; }
.au-tab:focus-visible, .au-close:focus-visible, .au-give:focus-visible, .au-person:focus-visible, .au-cancel:focus-visible { outline: 2px solid #ffd27a; outline-offset: 2px; }
.au-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .35);
  color: #f6ead6; font-size: 24px; line-height: 1; cursor: pointer;
}
.au-body { padding: 6px 18px 20px; overflow: auto; min-height: 0; }
.au-note { padding: 50px 10px; text-align: center; color: #d8b98a; }
.au-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 8px; }
.au-count { font: 700 22px/1.2 Georgia, 'Times New Roman', serif; color: #ffd9a0; }
.au-sub, .au-mile { color: #d8b98a; font-size: 13px; }
.au-mile { padding: 3px 10px; border-radius: 12px; background: rgba(242, 178, 92, .16); color: #ffd9a0; font-weight: 700; }
.au-bar { position: relative; flex: 1 1 140px; height: 8px; min-width: 120px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.au-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: linear-gradient(90deg, #d8401f, #f2b632); }
.au-hint { margin: 2px 0 8px; color: #d8b98a; font-size: 13px; line-height: 1.4; }
.au-hint.stars { color: #ffd27a; font-weight: 700; }
.au-hint.pv { color: #9fd6fb; }

/* the album: pressed leaves on paper */
.au-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.au-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 10px 4px 8px; border-radius: 10px;
  background: #efe2c6; color: #3a2614; box-shadow: inset 0 0 0 1px rgba(90, 60, 20, .25), 0 2px 6px rgba(0, 0, 0, .35);
}
.au-cell::before { content: ''; position: absolute; top: 5px; left: 50%; width: 22px; height: 7px; margin-left: -11px; background: rgba(255, 250, 235, .55); transform: rotate(-4deg); box-shadow: 0 0 0 1px rgba(120, 90, 40, .12); } /* a strip of tape */
.au-cell.none { background: #3a2c1e; color: #a99272; box-shadow: inset 0 0 0 1px rgba(242, 178, 92, .15); }
.au-cell.none::before { display: none; }
.au-cell.rare:not(.none) { background: #f6e7b8; box-shadow: inset 0 0 0 2px #e0a418, 0 2px 8px rgba(0, 0, 0, .35); }
.au-art { position: relative; display: grid; place-items: center; height: 56px; }
.au-x { position: absolute; right: -14px; top: -4px; padding: 1px 6px; border-radius: 10px; background: #8e2b17; color: #fff3dc; font-size: 12px; font-weight: 800; }
.au-n { font-size: 12.5px; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.au-k { font-size: 11px; opacity: .8; }
.au-k.r { color: #a86d06; font-weight: 800; opacity: 1; }
.au-give {
  margin-top: 4px; min-height: 36px; padding: 0 10px; border-radius: 18px; border: 1px solid rgba(90, 60, 20, .35); background: #fff8e8; color: #5a3410;
  font-family: inherit; font-weight: 700; font-size: 12.5px; line-height: 1; cursor: pointer;
}
.au-give:hover:not(:disabled) { background: #ffffff; }
.au-giving { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 6px; text-align: center; }
.au-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.au-person, .au-cancel {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(242, 178, 92, .4); background: rgba(242, 178, 92, .12); color: #f6ead6;
  font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1; cursor: pointer;
}
.au-person:hover:not(:disabled) { background: #f2b25c; color: #2a160a; }
.au-cancel { background: transparent; border-color: rgba(255, 255, 255, .2); font-weight: 600; }

/* the cozy meter: a shelf of candles */
.au-candles {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; margin: 10px 0; padding: 16px 14px 10px; list-style: none; border-radius: 12px;
  background: linear-gradient(#24160c, #24160c) padding-box, linear-gradient(180deg, transparent 80%, #5a3a1c 80%);
  box-shadow: inset 0 -10px 0 #6b4424, inset 0 -12px 0 #3d2412;
}
.au-c { display: block; }
.au-c.lit .au-flame { transform-origin: 10px 15px; animation: au-flicker 1.6s ease-in-out infinite alternate; }
.au-c.lit:nth-child(3n) .au-flame { animation-delay: -.5s; } .au-c.lit:nth-child(3n + 1) .au-flame { animation-delay: -1.1s; }
@keyframes au-flicker { 0% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } 100% { transform: rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .au-c.lit .au-flame { animation: none; } }
.au-c.lit svg { filter: drop-shadow(0 -4px 8px rgba(255, 182, 39, .45)); }
.au-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 14px; color: #f0dcbc; }
.au-tonight { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 6px; font-size: 14px; color: #ffd9a0; }

/* the profile's line */
.au-pp { margin: 6px 0 2px; font-size: 13px; color: var(--muted, #b9b2a6); }

@media (max-width: 560px) {
  .au-modal.stats-modal { padding: 8px; }
  .au-page { max-height: calc(100dvh - 16px); border-radius: 14px; }
  .au-top { padding: 10px 10px 4px 12px; }
  .au-tab { padding: 0 12px; font-size: 14px; }
  .au-body { padding: 4px 10px 14px; }
  .au-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .au-count { font-size: 19px; }
}
@media (max-width: 340px) { .au-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
