/* 0.57 «Сезоны» H — Halloween's events (public/halloween-events.js): the window «Сладость или гадость» / «Тыквенная грядка»
   (a night-violet page, pumpkin-orange accents), the tricks worn on a friend's picture in the participants strip, the
   friend's pill, the profile's line. Phones first; reduced motion keeps the tricks still. */

/* --- The window --------------------------------------------------------------------------------------------------- */
.hwe-modal.stats-modal { padding: 20px; }
.hwe-page {
  position: relative; display: flex; flex-direction: column; width: min(820px, 100%); max-height: calc(100dvh - 40px); overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(255, 150, 60, .3); color: #f3ead9; box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  background: radial-gradient(120% 90% at 50% 0%, #34224f 0%, #21152f 55%, #150d1f 100%);
}
.hwe-top { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 18px; }
.hwe-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.hwe-tab {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(255, 150, 60, .32); background: transparent; color: #f2c991;
  font: 700 15px/1 inherit; cursor: pointer;
}
.hwe-tab[hidden] { display: none; }
.hwe-tab.on { background: #f28a24; border-color: #f28a24; color: #2a1206; }
.hwe-tab:focus-visible, .hwe-close:focus-visible, .hwe-door:focus-visible, .hwe-go:focus-visible, .hwe-face:focus-visible { outline: 2px solid #ffd27a; outline-offset: 2px; }
.hwe-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: #f3ead9; font-size: 24px; line-height: 1; cursor: pointer;
}
.hwe-body { padding: 6px 18px 20px; overflow: auto; min-height: 0; }
.hwe-note { padding: 50px 10px; text-align: center; color: #cdb7e6; }
.hwe-preview { margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; background: rgba(160, 120, 255, .16); color: #d9c8ff; font-size: 13px; }
.hwe-how { margin: 4px 0 12px; color: #d6c8e8; font-size: 14px; line-height: 1.45; }
.hwe-how.small { font-size: 13px; margin-top: 10px; }
.hwe-h { display: block; margin: 10px 0 8px; font-size: 14px; color: #ffcf8a; }
.hwe-none { margin: 10px 0; color: #bfaed6; }
.hwe-warn { margin: 10px 0 0; color: #ffb27a; font-size: 13px; }

/* the doors: one per friend, the picked one lit */
.hwe-doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.hwe-door {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 104px; padding: 12px 6px 8px;
  border-radius: 12px 12px 6px 6px; border: 2px solid #5a3a22; color: #f3ead9; font: inherit; cursor: pointer;
  background: linear-gradient(90deg, rgba(0, 0, 0, .18) 0 4%, transparent 4% 96%, rgba(0, 0, 0, .18) 96%), repeating-linear-gradient(90deg, #6b4428 0 22px, #5c3a22 22px 24px);
}
.hwe-door::after { content: ''; position: absolute; right: 10px; top: 52%; width: 7px; height: 7px; border-radius: 50%; background: #e8b94a; box-shadow: 0 0 0 1.5px #3a2412; }
.hwe-door.on { border-color: #f28a24; box-shadow: 0 0 0 2px rgba(242, 138, 36, .35), 0 0 16px rgba(255, 170, 60, .3); }
.hwe-dface { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #3b2a55; box-shadow: 0 0 0 2px #1a0f08; }
.hwe-dface img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hwe-dface i { font-style: normal; font-weight: 700; }
.hwe-dname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.hwe-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hwe-go {
  flex: 1 1 auto; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: #f28a24; color: #2a1206;
  font: 800 16px/1 inherit; cursor: pointer;
}
.hwe-go:disabled { opacity: .5; cursor: default; }
.hwe-go.alt { background: transparent; color: #f3ead9; border: 1px solid rgba(255, 255, 255, .22); font-weight: 700; }
.hwe-bag { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); }
.hwe-bag .hwe-h { margin-top: 0; }
.hwe-sweets { display: flex; flex-wrap: wrap; gap: 10px; }
.hwe-sweet { position: relative; display: inline-flex; align-items: center; gap: 3px; }
.hwe-sweet svg { width: 34px; height: 34px; }
.hwe-sweet b { font-size: 14px; min-width: 1ch; }
.hwe-sweet.none { opacity: .38; filter: grayscale(.7); }
.hwe-bagline { margin-top: 8px; font-size: 13px; color: #d6c8e8; }
.hwe-off { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); cursor: pointer; }
.hwe-off input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: #f28a24; flex: none; }
.hwe-off span { display: flex; flex-direction: column; gap: 2px; }
.hwe-off small { color: #bfaed6; font-size: 12.5px; }

/* the patch: a night field under the moon, the pumpkins in rows */
.hwe-night {
  position: relative; padding: 18px 12px 12px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(#1b1236 0, #2a1b47 58px, #3a2412 59px, #2c1a0c 100%); /* a band of night sky over the field */
}
.hwe-moon { position: absolute; right: 9%; top: 8px; width: 34px; height: 34px; border-radius: 50%; box-shadow: 9px 5px 0 0 #fff2c4; filter: drop-shadow(0 0 10px rgba(255, 240, 190, .45)); }
.hwe-patch { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 10px 10px; min-height: 120px; padding-top: 24px; }
.hwe-pk { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hwe-pk .hwp-svg { display: block; overflow: visible; }
.hwe-pkd { font-size: 11px; color: #e8d6b8; }
.hwe-pkb, .hwe-pkm { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.hwe-pkb { background: #f28a24; color: #2a1206; }
.hwe-pkm { background: rgba(255, 255, 255, .14); color: #f3ead9; }
.hwe-pk.big .hwp-svg { filter: drop-shadow(0 0 10px rgba(255, 176, 46, .35)); }
.hwe-tonight { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 14px; color: #f2d7ad; }
.hwe-tonight.done { color: #ffd27a; font-weight: 700; }
.hwe-bar { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.hwe-bar b { display: block; height: 100%; background: linear-gradient(90deg, #f28a24, #ffcf3a); }
.hwe-carve { margin-top: 12px; }
.hwe-faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hwe-face {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; padding: 8px 4px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .22); color: #f3ead9; font: inherit; cursor: pointer;
}
.hwe-face.on { border-color: #f28a24; background: rgba(242, 138, 36, .18); }
.hwe-face span { font-size: 13px; font-weight: 700; text-align: center; }
.hwe-face small { font-size: 11.5px; color: #d6c8e8; }
.hwe-lead { margin-top: 8px; font-size: 14px; color: #ffd27a; }
.hwe-lead.final { font-weight: 700; }
.hwe-pp { margin: 6px 0 2px; font-size: 13px; color: var(--muted, #b9b2a6); }
.hwe-pp-off { margin: 0 0 10px; }

@media (max-width: 560px) {
  .hwe-modal.stats-modal { padding: 8px; }
  .hwe-page { max-height: calc(100dvh - 16px); border-radius: 14px; }
  .hwe-top { padding: 10px 10px 4px 12px; }
  .hwe-tab { padding: 0 12px; font-size: 14px; }
  .hwe-body { padding: 4px 10px 14px; }
  .hwe-faces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hwe-doors { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* --- The tricks on a friend's picture (the participants strip: the face is 22 px at the chip's left) ----------------- */
.hwt-ov { position: absolute; left: 3px; top: calc(50% - 11px); width: 22px; height: 22px; z-index: 2; pointer-events: none; }
.hwt-ov i { position: absolute; display: block; }
.hwt-ov svg { display: block; width: 100%; height: 100%; }
.hwt-web i { inset: -3px -3px 3px 3px; }
.hwt-web i svg { animation: hwt-sway 2.4s ease-in-out infinite; transform-origin: 100% 0; }
.hwt-bat i { left: 3px; top: 4px; width: 16px; height: 10px; animation: hwt-orbit 2.2s linear infinite; }
.hwt-ghost i { right: -9px; bottom: -2px; width: 14px; height: 16px; animation: hwt-peek 2.6s ease-in-out infinite; }
.hwt-ghost b { position: absolute; right: -24px; top: -9px; padding: 0 4px; border-radius: 6px; background: #f6f7fb; color: #1a1a24; font-size: 9px; line-height: 13px; font-weight: 800; animation: hwt-boo 2.6s ease-in-out infinite; }
@keyframes hwt-sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
@keyframes hwt-orbit {
  0% { transform: translate(0, -11px) scale(1); } 25% { transform: translate(12px, -2px) scale(.9); } 50% { transform: translate(0, 7px) scale(.8); }
  75% { transform: translate(-12px, -2px) scale(.9); } 100% { transform: translate(0, -11px) scale(1); }
}
@keyframes hwt-peek { 0%, 100% { transform: translateX(-6px); opacity: .2; } 35%, 70% { transform: translateX(0); opacity: 1; } }
@keyframes hwt-boo { 0%, 30%, 100% { opacity: 0; transform: scale(.6); } 40%, 70% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .hwt-web i svg, .hwt-bat i, .hwt-ghost i, .hwt-ghost b { animation: none; }
  .hwt-bat i { transform: translate(0, -11px); }
  .hwt-ghost b { opacity: 1; transform: none; }
}

/* --- The friend's pill: the candy's card, or the trick with «😂 Посмеяться» ----------------------------------------- */
.hwe-pill {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1750; display: flex;
  align-items: center; gap: 10px; max-width: calc(100vw - 20px); padding: 8px 10px 8px 12px; border-radius: 16px; border: 1px solid rgba(255, 150, 60, .4);
  background: #21152f; color: #f3ead9; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font-size: 14px;
}
.hwe-pi { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.hwe-pi svg { width: 100%; height: 100%; }
.hwe-star { color: #ffd27a; }
.hwe-laugh { flex: none; min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: #f28a24; color: #2a1206; font: 800 14px/1 inherit; cursor: pointer; }
