/* Advent Calendar — стили модального окна и кнопки в сайдбаре.
   Изолированы — никаких реcетов, только префикс .advent / .sidebar-advent. */

/* === Sidebar button ====================================== */
.sidebar-advent-btn {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  margin: 6px 8px 8px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #d63131 0%, #b1102f 100%);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(214, 49, 49, .55), inset 0 1px 0 rgba(255,255,255,.18);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sidebar-advent-btn.has-bg { background-size: cover; background-position: center; }
.sidebar-advent-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -6px rgba(214, 49, 49, .8); }
.sidebar-advent-btn:active { transform: translateY(0); }
.sidebar-advent-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.sidebar-advent-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sidebar-advent-title { font-size: 0.95rem; }
.sidebar-advent-sub { font-size: 0.72rem; opacity: .85; font-weight: 500; }
.sidebar-advent-badge {
  margin-left: auto;
  background: #fff;
  color: #b1102f;
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .sidebar-advent-btn { padding: 8px 10px; margin: 4px 6px; }
}

/* === Modal === */
.advent-no-scroll { overflow: hidden; }

.advent-modal { position: fixed; inset: 0; z-index: 1500; display: none; }
.advent-modal.is-open, .advent-modal:not([hidden]) { display: block; }
.advent-modal__backdrop { position: absolute; inset: 0; background: rgba(6,7,11,.82); backdrop-filter: blur(8px); }

/* === Battle-pass shell === */
.advent-bp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(1180px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 28px));
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(245,158,11,.10), transparent 55%),
    linear-gradient(160deg, #15171d 0%, #1b1f27 55%, #14161c 100%);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
  overflow: hidden;
  color: #f3f4f6;
}
.advent-bp__close {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  width: 38px; height: 38px; border-radius: 12px; border: 0;
  background: rgba(0,0,0,.35); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: background .15s, transform .15s;
}
.advent-bp__close:hover { background: rgba(0,0,0,.6); transform: rotate(90deg); }

/* Left banner */
.advent-bp__aside {
  position: relative;
  padding: 30px 24px;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, rgba(120,53,15,.55) 0%, rgba(20,22,28,.2) 45%),
    linear-gradient(160deg, #3a2a12 0%, #1a1206 60%, #141014 100%);
  border-right: 1px solid rgba(245,158,11,.18);
  overflow: hidden;
}
.advent-bp__aside-glow {
  position: absolute; inset: -40% -60% auto -40%; height: 70%;
  background: radial-gradient(closest-side, rgba(245,158,11,.45), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.advent-bp__aside-kicker {
  position: relative;
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: #fbbf24; font-weight: 700; margin-bottom: 10px;
}
.advent-bp__aside-title {
  position: relative;
  margin: 0; font-size: 2.1rem; line-height: 1.05; font-weight: 900;
  letter-spacing: -.01em;
  background: linear-gradient(180deg, #fff 0%, #fcd34d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 18px rgba(245,158,11,.25);
}
.advent-bp__aside-desc {
  position: relative;
  margin: 14px 0 0; font-size: .9rem; line-height: 1.5; color: rgba(255,255,255,.78);
}
.advent-bp__aside-spacer { flex: 1; min-height: 18px; }
.advent-bp__aside-progress { position: relative; margin-bottom: 16px; }
.advent-bp__pcap { display: flex; justify-content: space-between; font-size: .76rem; color: rgba(255,255,255,.7); margin-bottom: 6px; font-weight: 600; }
.advent-bp__pbar { height: 8px; border-radius: 99px; background: rgba(0,0,0,.4); overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.advent-bp__pbar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #fcd34d); transition: width .4s ease; }
.advent-bp__aside-timer {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245,158,11,.16), rgba(245,158,11,0) 70%),
    linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.25));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px -16px rgba(0,0,0,.8);
}
.advent-bp__timer-lbl {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.55); font-weight: 600;
}
.advent-bp__timer-val {
  font-size: 1.35rem; font-weight: 900; letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #fcd34d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.advent-bp__timer-val--ready {
  background: linear-gradient(180deg, #d1fae5, #34d399);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Right main */
.advent-bp__main { display: flex; flex-direction: column; min-width: 0; padding: 20px 20px 18px; }
.advent-bp__toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 44px 16px 6px;
}
.advent-bp__lanes-legend { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.75); }
.advent-bp__legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-left: 10px; }
.advent-bp__legend-dot--all { background: #60a5fa; }
.advent-bp__legend-dot--vip { background: #fcd34d; }
.advent-bp__vipbadge { font-size: .76rem; font-weight: 700; padding: 7px 14px; border-radius: 99px; }
.advent-bp__vipbadge.is-on { color: #1c1208; background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.advent-bp__vipbadge.is-off { color: rgba(255,255,255,.7); background: linear-gradient(90deg, rgba(255,255,255,.1), rgba(255,255,255,.04)); }

.advent-bp__viewport { position: relative; flex: 1; min-height: 0; display: flex; align-items: stretch; }

.advent-bp__scroll {
  flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
  padding: 2px 4px 14px;
  scrollbar-width: thin; scrollbar-color: rgba(245,158,11,.5) rgba(255,255,255,.05);
}
.advent-bp__scroll::-webkit-scrollbar { height: 8px; }
.advent-bp__scroll::-webkit-scrollbar-thumb { background: rgba(245,158,11,.45); border-radius: 99px; }
.advent-bp__scroll::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 99px; }

.advent-bp__grid { display: flex; gap: 14px; height: 100%; min-height: 0; }
.advent-bp__lanecol {
  position: sticky; left: 0; z-index: 5;
  display: grid; grid-template-rows: 1fr 1fr; gap: 12px;
  width: 30px; flex-shrink: 0;
}
.advent-bp__lanecol-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800; letter-spacing: .14em;
  border-radius: 12px; color: rgba(147,197,253,.92);
  background: linear-gradient(180deg, rgba(96,165,250,.28) 0%, rgba(37,99,235,.06) 55%, rgba(15,18,24,0) 100%);
}
.advent-bp__lanecol-label--vip {
  color: #fcd34d;
  background: linear-gradient(180deg, rgba(245,158,11,.34) 0%, rgba(180,120,30,.08) 55%, rgba(15,18,24,0) 100%);
}
.advent-bp__cols { display: flex; gap: 12px; height: 100%; }

.advent-bp__col {
  width: 168px; flex-shrink: 0;
  display: grid; grid-template-rows: 1fr 1fr; gap: 12px;
}
.advent-bp__head {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding-left: 42px; /* 30px lane + 12px gap */
}
.advent-bp__dayhead {
  width: 168px; flex-shrink: 0;
  text-align: center;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(255,255,255,.08);
}
.advent-bp__dayhead.is-current {
  color: #34d399;
  border-bottom-color: #34d399;
}

/* Cell */
.advent-bp__cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,0) 38%),
    linear-gradient(170deg, rgba(46,53,66,.8) 0%, rgba(24,28,36,.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 28px -20px rgba(0,0,0,.9);
  text-align: center; min-height: 0;
  transition: box-shadow .25s, transform .2s;
  border: none;
}
.advent-bp__cell--vip {
  background:
    linear-gradient(180deg, rgba(245,158,11,.08) 0%, rgba(245,158,11,0) 40%),
    linear-gradient(170deg, rgba(78,58,26,.85) 0%, rgba(33,25,12,.95) 100%);
  box-shadow: inset 0 1px 0 rgba(245,158,11,.15), 0 12px 28px -20px rgba(0,0,0,.9);
  border: none;
}
.advent-bp__cell.is-ready {
  box-shadow:
    inset 0 0 0 1px rgba(245,158,11,.5),
    0 0 36px -10px rgba(245,158,11,.7),
    0 14px 30px -16px rgba(245,158,11,.5);
  transform: translateY(-1px);
}
.advent-bp__cell.is-claimed { opacity: .72; }
.advent-bp__cell.is-viplock { filter: saturate(.55); }
.advent-bp__cell-reward {
  font-size: .82rem; font-weight: 800; color: #fcd34d;
  min-height: 18px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.advent-bp__cell--all .advent-bp__cell-reward { color: #93c5fd; }
.advent-bp__cell-chest { width: 100%; flex: 1; min-height: 64px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.advent-bp__cell-cond { font-size: .68rem; color: rgba(255,255,255,.6); line-height: 1.3; min-height: 26px; margin-bottom: 8px; }
.advent-bp__cell-lock { font-size: .68rem; color: #fcd34d; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; min-height: 26px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.advent-bp__btn {
  width: 100%; border: 0; border-radius: 10px; cursor: pointer;
  padding: 8px 0; font-size: .78rem; font-weight: 700; font-family: inherit;
  transition: filter .15s, transform .15s;
}
.advent-bp__btn--primary { background: linear-gradient(90deg, #2563eb, #3b82f6); color: #fff; }
.advent-bp__btn--gold { background: linear-gradient(90deg, #f59e0b, #fcd34d); color: #1c1208; }
.advent-bp__btn--done { background: rgba(52,211,153,.18); color: #34d399; cursor: default; }
.advent-bp__btn--muted { background: rgba(255,255,255,.06); color: rgba(255,255,255,.45); cursor: not-allowed; }
.advent-bp__btn--primary:hover, .advent-bp__btn--gold:hover { filter: brightness(1.1); transform: translateY(-1px); }

.advent-bp__access {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(127,29,29,.5), rgba(127,29,29,.2));
  color: #fecaca; font-size: .78rem;
}
.advent-skeleton, .advent-empty, .advent-error {
  text-align: center; padding: 60px 20px; font-size: 1rem; opacity: .7;
}
.advent-error { color: #fca5a5; }

.advent-bp__cell.is-claimed .advent-chest3d { filter: saturate(.55) brightness(.86); }
.advent-bp__cell--locked .advent-chest3d,
.advent-bp__cell--missed .advent-chest3d,
.advent-bp__cell--cooldown .advent-chest3d { filter: saturate(.35) brightness(.7); }

/* === Chest Image === */
.advent-chest-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.2 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: adventChestFloat 4s ease-in-out infinite;
}
.advent-bp__cell.is-ready .advent-chest-img-wrap {
  animation: adventChestShake 2.2s ease-in-out infinite;
}
.advent-chest-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 12px rgba(0,0,0,.46));
  transition: transform .4s cubic-bezier(0.34, 1.56, 0.64, 1), filter .4s ease;
}
.advent-chest-img-wrap.is-opening .advent-chest-img {
  transform: scale(1.15) translateY(-5%);
  filter: drop-shadow(0 20px 20px rgba(0,0,0,.6)) brightness(1.2);
}
.advent-chest-glow {
  position: absolute;
  width: 60%; height: 40%;
  background: var(--cg, #f59e0b);
  filter: blur(15px);
  top: 40%; left: 20%;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: -1;
}
.advent-chest-img-wrap.is-opening .advent-chest-glow { opacity: 1; }

/* Tiers */
.advent-chest-img-wrap[data-tier="1"], .advent-chest-img-wrap[data-tier="2"], .advent-chest-img-wrap[data-tier="3"] { --cg: #fcd34d; }
.advent-chest-img-wrap[data-tier="4"], .advent-chest-img-wrap[data-tier="5"] { --cg: #f97316; }
.advent-chest-img-wrap[data-tier="6"], .advent-chest-img-wrap[data-tier="7"] { --cg: #e2e8f0; }
.advent-chest-img-wrap[data-tier="8"], .advent-chest-img-wrap[data-tier="9"] { --cg: #6ee7b7; }
.advent-chest-img-wrap[data-tier="10"], .advent-chest-img-wrap[data-tier="11"] { --cg: #93c5fd; }
.advent-chest-img-wrap[data-tier="12"], .advent-chest-img-wrap[data-tier="13"] { --cg: #c084fc; }
.advent-chest-img-wrap[data-tier="14"] { --cg: #fef08a; }
.advent-chest-img-wrap[data-tier="10"] .advent-chest-img, .advent-chest-img-wrap[data-tier="11"] .advent-chest-img, .advent-chest-img-wrap[data-tier="12"] .advent-chest-img {
  filter: drop-shadow(0 12px 14px rgba(0,0,0,.52)) drop-shadow(0 0 8px var(--cg));
}
.advent-chest-img-wrap[data-tier="13"] .advent-chest-img, .advent-chest-img-wrap[data-tier="14"] .advent-chest-img {
  filter: drop-shadow(0 14px 16px rgba(0,0,0,.56)) drop-shadow(0 0 12px var(--cg));
}
@keyframes adventChestFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }
@keyframes adventChestShake {
  0%, 100% { transform: rotate(0) translateY(0); }
  20% { transform: rotate(-3deg) translateY(-2px); }
  40% { transform: rotate(3deg) translateY(-2px); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(2deg); }
}
/* === FS choice overlay === */
.advent-fs {
  position: absolute; inset: 0;
  background: rgba(8,10,14,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.advent-fs__shell {
  width: min(420px, calc(100% - 24px));
  background: #1d2229;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
}
.advent-fs__title { font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; }
.advent-fs__list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.advent-fs__opt {
  background: linear-gradient(135deg, #2a313b, #1a1e25);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  color: #f3f4f6;
  font: inherit; text-align: left;
  transition: border-color .15s, transform .15s;
}
.advent-fs__opt:hover { border-color: rgba(245,158,11,.5); transform: translateY(-1px); }
.advent-fs__name { font-weight: 700; flex: 1; }
.advent-fs__prov { font-size: 0.76rem; opacity: .65; }
.advent-fs__count { font-size: 0.8rem; font-weight: 700; color: #fbbf24; }
.advent-fs__cancel {
  width: 100%;
  background: transparent;
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer; font: inherit;
}

/* === Reward splash === */
.advent-splash {
  position: absolute; inset: 0;
  background: rgba(8,10,14,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 11;
}
.advent-splash__shell {
  width: min(440px, calc(100% - 24px));
  background: linear-gradient(160deg, #2a1b08 0%, #1d2229 100%);
  border-radius: 22px;
  border: 1px solid rgba(245,158,11,.4);
  padding: 24px;
  text-align: center;
}
.advent-splash__title { font-size: 1.4rem; font-weight: 800; color: #fbbf24; margin-bottom: 8px; }
.advent-splash__chest { width: 160px; margin: 0 auto 8px; }
.advent-splash__chest .advent-chest3d { animation: adventChestGlow 1.2s ease-out 1; }
@keyframes adventChestGlow {
  0% { transform: scale(.4); filter: brightness(2) drop-shadow(0 0 24px #fbbf24); }
  60% { transform: scale(1.08); filter: brightness(1.4) drop-shadow(0 0 16px #fbbf24); }
  100% { transform: scale(1); }
}
.advent-splash__reward { font-size: 1.2rem; font-weight: 800; margin: 4px 0 12px; }
.advent-splash__hint { font-size: 0.85rem; opacity: .75; margin-bottom: 16px; line-height: 1.4; }
.advent-splash__ok {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #1c1208; border: 0;
  padding: 10px 28px; border-radius: 12px;
  font-weight: 800; cursor: pointer;
}

/* === Toast === */
.advent-toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  background: #1d2229;
  color: #f3f4f6;
  padding: 10px 18px; border-radius: 12px;
  z-index: 2000;
  box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.advent-toast--err { background: #7f1d1d; color: #fff; }

/* Tablet/mobile tuning */
@media (max-width: 860px) {
  .advent-bp {
    grid-template-columns: 1fr;
    height: min(92vh, calc(100vh - 16px));
    width: calc(100vw - 16px);
  }
  .advent-bp__aside {
    padding: 20px 18px 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(245,158,11,.18);
  }
  .advent-bp__aside-spacer { display: none; }
  .advent-bp__aside-title { font-size: 1.5rem; }
  .advent-bp__aside-desc { margin-top: 8px; font-size: .82rem; }
  .advent-bp__aside-progress { margin-top: 14px; }
  .advent-bp__main { padding: 14px 12px 12px; }
}
@media (max-width: 600px) {
  .advent-bp__toolbar { padding: 0 38px 12px 4px; flex-wrap: wrap; gap: 8px; }
  .advent-bp__col { width: 142px; }
  .advent-bp__cell-reward { font-size: .76rem; }
}
