/* «Ёлка клуба» (0.53, public/season-tree.js): the window with the tree, the picker, a toy's bubble, the 31 December
   ceremony (the lobby's entry is a button in the season's banner). Night blue, frost, warm lights. */

.tree-modal.stats-modal { padding: 20px; }
.tree-page {
  position: relative; display: flex; flex-direction: column; width: min(1040px, 100%); max-height: calc(100dvh - 40px); overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(200, 225, 255, .22); color: #eef4fb; box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  background: radial-gradient(120% 80% at 50% 0%, #1d3557 0%, #10213a 45%, #0a1426 100%);
}
.tree-page::before { /* a frosty sky: still snow dots */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(1.6px 1.6px at 12% 18%, #fff 60%, transparent), radial-gradient(1.2px 1.2px at 31% 42%, #fff 60%, transparent),
    radial-gradient(2px 2px at 72% 12%, #fff 60%, transparent), radial-gradient(1.4px 1.4px at 86% 36%, #fff 60%, transparent),
    radial-gradient(1.2px 1.2px at 55% 26%, #fff 60%, transparent), radial-gradient(1.8px 1.8px at 8% 70%, #fff 60%, transparent),
    radial-gradient(1.3px 1.3px at 93% 78%, #fff 60%, transparent), radial-gradient(1.5px 1.5px at 44% 8%, #fff 60%, transparent);
}
.tree-top { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 6px 22px; }
.tree-head { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tree-title { font: 700 24px/1.15 Georgia, 'Times New Roman', serif; letter-spacing: .02em; color: #ffe2a0; text-shadow: 0 1px 0 rgba(0, 0, 0, .8); }
.tree-sub { margin-top: 3px; font-size: 13px; color: #a9c0da; }
.tree-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: #eef4fb; font-size: 24px; line-height: 1; cursor: pointer;
}
.tree-close:hover { border-color: rgba(255, 226, 160, .6); }
.tree-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 8px 18px; padding: 4px 22px 22px; min-height: 0; overflow: auto; }
.tree-note { grid-column: 1 / -1; padding: 60px 10px; text-align: center; color: #a9c0da; }
.tree-stage { position: relative; aspect-ratio: 1 / 1; width: 100%; max-height: calc(100dvh - 150px); margin: 0 auto; cursor: crosshair; touch-action: manipulation; }
.tree-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tree-toy { cursor: pointer; }
.tree-toy.tree-mine > * { filter: drop-shadow(0 0 5px rgba(255, 226, 150, .9)); }
.tree-ghost { opacity: .78; pointer-events: none; animation: treeGhost 1.2s ease-in-out infinite alternate; }
@keyframes treeGhost { from { opacity: .55; } to { opacity: .9; } }
.tree-new { animation: treeDrop .9s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes treeDrop { from { translate: 0 -60px; opacity: 0; } 60% { opacity: 1; } to { translate: 0 0; } }
.tree-bulb { animation: treeTwinkle 2.8s ease-in-out infinite alternate; animation-delay: calc(var(--tb, 0s) * -1); }
.tree-bulb .tree-bulb-halo { animation: treeHalo 2.8s ease-in-out infinite alternate; animation-delay: calc(var(--tb, 0s) * -1); }
@keyframes treeTwinkle { from { opacity: .82; } to { opacity: 1; } }
@keyframes treeHalo { from { opacity: .45; } to { opacity: 1; } }
.tree-topstar-lit .tree-star-rays { transform-origin: 500px 92px; animation: treeRays 14s linear infinite; }
.tree-topstar-lit .tree-star-halo { animation: treeHalo 2.4s ease-in-out infinite alternate; }
@keyframes treeRays { to { rotate: 360deg; } }
.tree-still .tree-bulb, .tree-still .tree-bulb-halo, .tree-still .tree-star-rays, .tree-still .tree-star-halo, .tree-still .tree-ghost { animation: none; }

.tree-tip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 26px)); max-width: min(260px, 80%); padding: 9px 12px; border-radius: 12px;
  background: #fbf6ea; color: #1d2433; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; gap: 4px;
  pointer-events: auto; cursor: default;
}
.tree-tip.below { transform: translate(-50%, 22px); }
.tree-tip[hidden] { display: none; }
.tree-tip b { font-size: 13px; }
.tree-tip-w { font-style: italic; overflow-wrap: anywhere; }
.tree-tip-off { color: #7a7f8c; font-size: 12px; }
.tree-tip-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tree-tip-acts button { min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid #c9c2b2; background: #fff; color: #7a2a22; font: 600 12px/1 inherit; cursor: pointer; }

.tree-side { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; min-width: 0; }
.tree-how, .tree-done, .tree-hint { margin: 0; font-size: 14px; line-height: 1.45; color: #d2e0ee; }
.tree-done { padding: 10px 12px; border-radius: 12px; background: rgba(255, 226, 160, .1); border: 1px solid rgba(255, 226, 160, .28); color: #ffe2a0; }
.tree-hint { font-size: 13px; color: #a9c0da; min-height: 18px; }
.tree-flag { margin: 0; padding: 8px 11px; border-radius: 10px; background: rgba(120, 170, 255, .14); border: 1px dashed rgba(160, 200, 255, .5); color: #cfe0ff; font-size: 13px; }
.tree-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8fb0d2; margin-top: 4px; }
.tree-kinds { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tree-pick {
  display: grid; place-items: center; aspect-ratio: 1 / 1; min-height: 44px; padding: 0; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(200, 225, 255, .18); background: rgba(255, 255, 255, .05);
}
.tree-pick svg { width: 80%; height: 80%; }
.tree-pick.on { border-color: #ffe2a0; background: rgba(255, 226, 160, .14); box-shadow: inset 0 0 0 1px #ffe2a0; }
.tree-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.tree-col {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(0, 0, 0, .35); background: var(--tc);
  box-shadow: inset -5px -6px 0 rgba(0, 0, 0, .18), inset 4px 4px 0 rgba(255, 255, 255, .25);
}
.tree-col.on { outline: 3px solid #ffe2a0; outline-offset: 2px; }
.tree-wishbox { position: relative; }
.tree-wish {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 56px 0 12px; border-radius: 12px; border: 1px solid rgba(200, 225, 255, .25);
  background: rgba(0, 0, 0, .28); color: #eef4fb; font: 15px/1.2 inherit;
}
.tree-wish:focus { outline: none; border-color: #ffe2a0; }
.tree-count { position: absolute; right: 12px; top: 50%; translate: 0 -50%; font-size: 12px; color: #8fb0d2; }
.tree-count.over { color: #ff9a8a; }
.tree-acts { display: flex; gap: 8px; margin-top: 4px; }
.tree-free, .tree-hang, .tree-fw, .tree-cer-ok {
  min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer; font: 600 15px/1 inherit;
}
.tree-free, .tree-fw { border: 1px solid rgba(200, 225, 255, .3); background: rgba(255, 255, 255, .06); color: #eef4fb; }
.tree-hang { flex: 1; border: 0; background: var(--accent, #e5a00d); color: #1b1406; font-size: 16px; }
.tree-hang[disabled] { opacity: .45; cursor: default; }
.tree-starline { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); color: #ffe2a0; font-size: 13px; line-height: 1.4; display: flex; flex-direction: column; gap: 8px; }
.tree-starline-lit { background: rgba(255, 210, 90, .14); }
.tree-who b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #8fb0d2; margin: 6px 0 2px; }
.tree-who p { margin: 0; font-size: 13px; line-height: 1.5; color: #d2e0ee; }

/* The ceremony: over the page (never over a playing film — the server and this page hold it) */
.tree-cer { position: fixed; inset: 0; z-index: 2800; display: grid; place-items: center; padding: 16px; background: rgba(5, 10, 22, .78); animation: dpwFade .3s ease both; }
.tree-cer-out { opacity: 0; transition: opacity .35s ease; }
.tree-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tree-cer-card {
  position: relative; display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 360px); align-items: center; gap: 10px 22px; max-width: 760px; width: 100%;
  padding: 18px 22px; border-radius: 20px; background: radial-gradient(120% 90% at 30% 0%, #1d3557, #0c1830); border: 1px solid rgba(255, 226, 160, .35);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7); color: #eef4fb;
}
.tree-cer-tree { aspect-ratio: 1 / 1; }
.tree-cer-tree .tree-svg { transition: transform .8s cubic-bezier(.2, .9, .3, 1.2); }
.tree-cer-lit .tree-cer-tree .tree-svg { transform: scale(1.03); }
.tree-cer-x { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tree-cer-t { font: 700 34px/1.1 Georgia, 'Times New Roman', serif; color: #ffe2a0; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.tree-cer-s { font-size: 16px; color: #d2e0ee; }
.tree-cer-n { font-size: 14px; color: #a9c0da; }
.tree-cer-who { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; padding: 0; list-style: none; max-height: 132px; overflow: auto; }
.tree-cer-who li { padding: 4px 10px; border-radius: 999px; background: rgba(255, 226, 160, .13); color: #ffe9bd; font-size: 13px; }
.tree-cer-who .tree-cer-more { background: transparent; color: #a9c0da; }
.tree-cer-ok { align-self: flex-start; border: 0; background: var(--accent, #e5a00d); color: #1b1406; font-size: 16px; padding: 0 26px; }
.tree-cer-x > * { opacity: 0; translate: 0 8px; transition: opacity .5s ease, translate .5s ease; }
.tree-cer-lit .tree-cer-x > * { opacity: 1; translate: 0 0; }
.tree-cer-lit .tree-cer-x > :nth-child(2) { transition-delay: .15s; } .tree-cer-lit .tree-cer-x > :nth-child(3) { transition-delay: .3s; }
.tree-cer-lit .tree-cer-x > :nth-child(4) { transition-delay: .45s; } .tree-cer-lit .tree-cer-x > :nth-child(5) { transition-delay: .6s; }
.tree-cer.tree-still .tree-cer-x > * { opacity: 1; translate: 0 0; transition: none; }

@media (max-width: 760px) {
  .tree-modal.stats-modal { padding: 0; align-items: stretch; }
  .tree-page { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .tree-top { padding: 10px 10px 4px 16px; }
  .tree-title { font-size: 21px; }
  .tree-body { grid-template-columns: 1fr; padding: 0 12px 16px; }
  .tree-stage { max-height: none; width: min(100%, 62dvh); }
  .tree-kinds { grid-template-columns: repeat(6, 1fr); }
  .tree-cer-card { grid-template-columns: 1fr; text-align: center; padding: 16px; }
  .tree-cer-tree { width: min(220px, 60vw); margin: 0 auto; }
  .tree-cer-t { font-size: 28px; }
  .tree-cer-who { justify-content: center; }
  .tree-cer-ok { align-self: center; }
}
@media (max-width: 360px) { .tree-kinds { grid-template-columns: repeat(4, 1fr); } .tree-col { width: 32px; height: 32px; } }
@media (prefers-reduced-motion: reduce) {
  .tree-bulb, .tree-bulb-halo, .tree-star-rays, .tree-star-halo, .tree-ghost, .tree-new { animation: none !important; }
  .tree-cer, .tree-cer-x > * { animation: none; transition: none; }
}
