/* ================= Аккуратные полосы прокрутки (страницы, окна, списки) ================= */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,173,66,.5); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ================= Новичок: сначала обучение ================= */
.tt-welcome { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; color: #c96a12; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(18deg); } 30% { transform: rotate(-10deg); } }
/* пока обучение не пройдено — остальные плитки приглушены, обучение в фокусе */
body:not(.tutorial-done) #menu .tile:not([data-nav="tutorial"]) { filter: brightness(.6) saturate(.7); }
body:not(.tutorial-done) #menu .tile[data-nav="tutorial"] { z-index: 2; transform: scale(1.02); }
.tile-pointer {
  position: absolute; right: 14px; bottom: 12px; z-index: 5; font-size: 34px;
  animation: pointBounce 1s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5));
}
@keyframes pointBounce { 50% { transform: translateY(-8px); } }

/* ================= Игра: «В лобби» ================= */
.to-lobby-btn {
  flex-shrink: 0; margin-bottom: 6px; padding: 7px 10px; border-radius: 8px;
  background: rgba(231,76,60,.14); border: 1px solid rgba(231,76,60,.45); color: #ffb0a8; font-weight: 700; font-size: 13px;
}
.to-lobby-btn:hover { background: rgba(231,76,60,.28); color: #fff; }
body.touch .to-lobby-btn { display: none; }

/* ================= Кара с того света ================= */
#cursePanel {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 16;
  width: min(560px, 94%); padding: 8px 10px 10px; border-radius: 14px;
  background: rgba(22,14,36,.94); border: 1px solid rgba(196,123,255,.55);
  box-shadow: 0 0 30px rgba(196,123,255,.3), 0 10px 30px rgba(0,0,0,.5);
  animation: curseIn .35s ease-out;
}
@keyframes curseIn { from { opacity: 0; transform: translate(-50%, 12px); } }
.cp-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none; color: #e3d4ff; padding: 2px 4px 6px; }
.cp-head span { font-family: var(--font-display); font-size: 17px; letter-spacing: .8px; text-transform: uppercase; }
.cp-head small { color: #b8a6d8; font-size: 12px; }
.cp-hint { font-size: 12.5px; color: #cdbfe6; margin: 0 4px 6px; display: flex; align-items: center; gap: 6px; }
.cp-back { background: rgba(255,255,255,.1); border: none; color: #fff; border-radius: 6px; padding: 2px 8px; }
.cp-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.cp-kind {
  display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; text-align: left; align-items: center;
  background: rgba(196,123,255,.1); border: 1px solid rgba(196,123,255,.3); border-radius: 10px; padding: 7px 9px; color: #fff;
}
.cp-kind:hover { background: rgba(196,123,255,.25); }
.ck-ico { grid-row: 1 / 3; font-size: 24px; }
.cp-kind b { font-size: 13px; }
.cp-kind small { font-size: 11px; color: #c9bce0; line-height: 1.3; }
.cp-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-target { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 4px 12px 4px 4px; color: #fff; font-weight: 700; }
.cp-target:hover { background: rgba(231,76,60,.3); border-color: rgba(231,76,60,.7); }
body.touch #cursePanel { bottom: 4px; width: min(520px, 96%); max-height: 70%; overflow-y: auto; }
body.touch .cp-kind small { display: none; }

/* ================= Повтор гибелей после матча ================= */
#replayBox { position: absolute; inset: 0; z-index: 18; border-radius: 8px; overflow: hidden; background: #0d0f16; }
#replayCv { position: absolute; inset: 0; width: 100%; height: 100%; }
#replayBox.flip { animation: replayFlip .25s ease-out; }
@keyframes replayFlip { from { opacity: .3; } }
.rp-tag { position: absolute; left: 12px; top: 10px; z-index: 2; background: rgba(231,76,60,.9); color: #fff; font-family: var(--font-display); letter-spacing: 2px; padding: 3px 10px; border-radius: 6px; font-size: 14px; }
.rp-tag span { margin-left: 6px; opacity: .85; }
.rp-cap {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; max-width: 92%;
  background: rgba(0,0,0,.72); color: #fff; padding: 7px 16px; border-radius: 10px; font-weight: 700; font-size: 16px; text-align: center;
}
/* победитель на итогах */
/* ---------- Баннер мутации перед матчем (наискосок, как «BOSS!») ---------- */
.mut-banner { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: flex; align-items: center; justify-content: center; overflow: hidden; background: rgba(8,4,16,.35); }
.mb-band {
  /* шире поля и без сжатия: после наклона края полосы уходят за рамку, пустых углов нет */
  position: relative; width: 140%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 16px 0; transform: rotate(-6deg);
  background: linear-gradient(90deg, #4a1a8a, #8a2fe0 30%, #c24dff 55%, #8a2fe0 80%, #4a1a8a);
  box-shadow: 0 14px 40px rgba(0,0,0,.55), inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.25);
  animation: mbIn .28s cubic-bezier(.2,1.3,.4,1) both;
}

.mut-banner.out .mb-band { animation: mbOut .28s cubic-bezier(.6,0,.8,.4) forwards; }
@keyframes mbIn { from { transform: rotate(-6deg) translateX(-110%); } }
@keyframes mbOut { to { transform: rotate(-6deg) translateX(110%); } }
.mb-emblems { display: flex; gap: 6px; transform: rotate(6deg); animation: mbPop .45s .12s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes mbPop { from { transform: rotate(6deg) scale(.2) rotate(-90deg); } }
.mb-emblem { width: 140px; height: 140px; margin: -40px 0; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.mb-text { display: flex; flex-direction: column; color: #fff; text-align: left; }
.mb-kicker, .mb-name {
  font-family: 'Lilita One', var(--font-display), sans-serif; text-transform: uppercase; line-height: 1;
  -webkit-text-stroke: 7px #2a0f4d; paint-order: stroke fill; text-shadow: 0 5px 0 #1a0833;
}
.mb-kicker { font-size: 22px; letter-spacing: 2px; color: #ffd23f; }
.mb-name { font-size: 52px; letter-spacing: 1px; }
.mb-desc { margin-top: 4px; font-size: 15px; font-weight: 700; color: #f3eaff; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
@media (max-height: 520px) and (orientation: landscape), (max-width: 700px) and (orientation: portrait) {
  .mb-emblem { width: 76px; height: 76px; margin: -14px 0; }
  .mb-name { font-size: 32px; -webkit-text-stroke-width: 5px; }
  .mb-kicker { font-size: 15px; } .mb-desc { font-size: 12px; }
  .mb-band { padding: 10px 0; gap: 10px; }
}
/* ---------- Пьедестал после матча: 2 · 1 · 3 ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.pd-col { position: relative; display: flex; flex-direction: column; align-items: center; width: 150px; animation: pdIn .55s cubic-bezier(.2,1.4,.4,1) both; }
.pd-1 { width: 170px; animation-delay: .25s; }
.pd-3 { animation-delay: .1s; }
@keyframes pdIn { from { transform: translateY(40px); opacity: 0; } }
.pd-col canvas { position: relative; z-index: 2; margin-bottom: -10px; }
.pd-rays {
  position: absolute; z-index: 0; left: 50%; top: 30px; width: 260px; height: 260px; margin-left: -130px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,214,90,.35) 0 10deg, rgba(255,214,90,0) 10deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%);
  animation: pdRays 9s linear infinite;
}
@keyframes pdRays { to { transform: rotate(360deg); } }
.pd-block {
  position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; padding-top: 8px; border-radius: 6px 6px 2px 2px;
  box-shadow: inset 0 6px 0 rgba(255,255,255,.35), inset 0 -6px 0 rgba(0,0,0,.18), 0 8px 18px rgba(0,0,0,.45);
}
#overlay .rank-table { position: relative; z-index: 2; background: rgba(20,22,32,.92); }
.pd-1 .pd-block { height: 100px; background: linear-gradient(#ffd56a, #f0a630); color: #5a3a00; }
.pd-2 .pd-block { height: 80px; background: linear-gradient(#e8edf3, #aeb8c6); color: #2f3a48; }
.pd-3 .pd-block { height: 66px; background: linear-gradient(#f0b07a, #c27440); color: #4a2410; }
.pd-num {
  font-family: var(--font-display); font-size: 22px; line-height: 1; min-width: 34px; padding: 3px 8px; border-radius: 6px;
  background: rgba(255,255,255,.45); box-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.pd-name { margin-top: 6px; font-family: var(--font-display); font-size: 18px; letter-spacing: .5px; max-width: 94%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-col.empty .pd-block { opacity: .35; }
#overlay .rank-row .place-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px;
  font-family: var(--font-display); font-size: 14px; background: rgba(255,255,255,.12); color: #fff;
}
#overlay .rank-row.top1 .place-badge { background: linear-gradient(#ffd56a, #f0a630); color: #5a3a00; }
#overlay .rank-row.top2 .place-badge { background: linear-gradient(#e8edf3, #aeb8c6); color: #2f3a48; }
#overlay .rank-row.top3 .place-badge { background: linear-gradient(#f0b07a, #c27440); color: #4a2410; }

/* ================= Лучшие моменты в истории ================= */
.hl-btn { padding: 8px 16px; font-size: 15px; }
.hl-modal { z-index: 650; }
.hl-box { width: min(860px, 96vw); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.hl-head { display: flex; align-items: center; gap: 10px; }
.hl-head b { font-family: var(--font-display); font-size: 20px; letter-spacing: 1px; text-transform: uppercase; }
.hl-count { color: var(--muted); font-size: 13px; margin-right: auto; }
.hl-cv { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #0d0f16; display: block; }
.hl-cap { text-align: center; font-weight: 700; font-size: 16px; min-height: 22px; }
.hl-nav { display: flex; gap: 8px; justify-content: center; }
.hl-nav button { padding: 8px 14px; font-size: 14px; }

@media (max-height: 520px) and (orientation: landscape) {
  .community { gap: 6px; }
  .feedback-big { padding: 3px 10px 3px 6px; gap: 6px; box-shadow: 0 3px 0 #146b37; }
  .fb-env { font-size: 18px; }
  .fb-txt b { font-size: 12px; }
  .fb-txt small { display: none; }
  .social-btn { width: 28px; height: 28px; border-radius: 8px; box-shadow: none !important; }
  .social-btn svg { width: 16px; height: 16px; }
  .rp-cap { font-size: 13px; padding: 4px 10px; }
  /* пьедестал на низком экране: компактнее */
  .podium { margin: 0 0 6px; }
  .pd-col { width: 96px; } .pd-1 { width: 110px; }
  .pd-col canvas { width: 66px !important; height: 66px !important; margin-bottom: -6px; }
  .pd-1 canvas { width: 80px !important; height: 80px !important; }
  .pd-rays { width: 150px; height: 150px; margin-left: -75px; top: 10px; }
  .pd-1 .pd-block { height: 50px; } .pd-2 .pd-block { height: 38px; } .pd-3 .pd-block { height: 30px; }
  .pd-num { font-size: 14px; padding: 1px 5px; min-width: 22px; }
  .pd-name { font-size: 12px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .community { flex-wrap: wrap; justify-content: center; }
  .feedback-big { width: 100%; }
}

/* ================= Главное меню: раскладка плиток ================= */
/* [Классик][Рейтинг] во всю высоту; справа столбиком: обучение (новичку) или сезон →
   [Персонаж][Магазин] → серые «Скоро» */
#menu .tiles {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}
#menu .tile-classic { grid-column: 1; grid-row: 1 / 4; }
#menu .tile-ranked { grid-column: 2; grid-row: 1 / 3; }
#menu .tile-weekly { grid-column: 2; grid-row: 3; }

/* еженедельный турнир: тёмно-красный с золотом, кубок справа, таймер под заголовком */
.tile-weekly { color: #fff1d6; background: radial-gradient(ellipse at 75% 60%, #5a1a1a, #1c0a0c 75%); }
.tile-weekly .tile-art { left: 0; width: 100%; height: 100%; }
.tile-weekly .tile-text { max-width: 62%; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.tile-weekly h3 { font-size: 22px; line-height: 1.05; }
.tw-kicker { display: block; font-family: var(--font-display); font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #ffc85a; margin-bottom: 4px; }
/* статус: подпись мелко, таймер крупно цифрами в ряд */
.tw-status { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; white-space: nowrap; color: #fff; }
.tw-status small { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; opacity: .75; }
.tw-status b { font-family: var(--font-display); font-size: 22px; letter-spacing: .5px; font-variant-numeric: tabular-nums; color: #ffe08a; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.tw-status.reg b { color: #ffd23f; }
.tw-status.live b { color: #7dff9b; }
.tile-weekly .tw-soon { background: linear-gradient(180deg, #ffd864, #e8a21c); color: #3a2008; }
.tile-weekly:not(:disabled):hover { box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 3px #ffc85a, 0 0 26px rgba(255,180,60,.4); }
#menu .tile-band { grid-column: 3; grid-row: 1; }
#menu .tile-duo { grid-column: 3; grid-row: 2; }
#menu .tile-soon { grid-column: 3; grid-row: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
#menu .tile-duo > .tile { grid-column: auto; grid-row: auto; min-width: 0; }
.tile-character .tile-art { width: 60%; }
.tile-character .tile-text { max-width: 48%; }
/* в паре с магазином: греческий зал на весь блок, персонаж справа, текст слева поверх затемнения */
.tile-duo .tile-character { background: #2c2825; }
.tile-duo .tile-character .tile-art { left: 0; right: 0; width: 100%; }
.tile-duo .tile-character .tile-text { max-width: 58%; }
.tile-duo .ct-line:not(:first-child), .tile-duo .ct-cta { display: none; }

/* магазин: лавка торговца на весь блок, текст слева поверх затемнения */
.tile-shop { color: #fff3dc; background: #2a170c; }
.tile-shop .tile-art { left: 0; width: 100%; height: 100%; }
.tile-shop .tile-text { max-width: 52%; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.tile-shop p { opacity: .95; }
.tile-shop:not(:disabled):hover { box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 3px #ffd23f, 0 0 30px rgba(255,200,80,.45); }
.tile-shop-soon {
  position: absolute; left: 16px; bottom: 12px; z-index: 3;
  background: linear-gradient(180deg, #ffd864, #e8a21c); color: #3a2008;
  font-family: var(--font-display); font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px; box-shadow: 0 0 14px rgba(255,200,80,.5);
}

.tile-band { flex-direction: row; align-items: center; }
.tile-band .tile-text { max-width: 55%; padding: 14px 22px; }
.tile-band .tile-art { left: auto; right: 0; width: 45%; height: 100%; }
.tile-tutorial { background: var(--cream); }

.tile-season { color: #fff; background: #2a1030; }
.tile-season .tile-art { left: 0; width: 100%; }
.tile-season .tile-text { z-index: 2; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.ts-kicker { font-family: var(--font-display); letter-spacing: 3px; text-transform: uppercase; color: #ffcf8a; font-size: 14px; }
.tile-season h2 { font-size: 32px; }
.tile-season p { opacity: .95; }
.ts-days {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%); z-index: 3;
  font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; color: #fff;
  background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 4px;
}
.tile-season:not(:disabled):hover { box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 3px #ffad42; }

/* ================= Сообщество: плоские плитки в стиле меню ================= */
.community { display: flex; align-items: stretch; gap: 10px; }
.ctile {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff;
  border: none; border-radius: 4px; padding: 10px 16px; text-align: left; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .18s cubic-bezier(.2,.9,.3,1.2), box-shadow .18s;
}
.ctile:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.55), 0 0 0 3px #fff; }
.ctile:active { transform: translateY(-1px); }
.ctile-feedback { background: #27ae60; }
.ct-ico { font-size: 26px; line-height: 1; display: flex; }
.ct-ico svg { width: 28px; height: 28px; flex-shrink: 0; }
.ct-txt { display: flex; flex-direction: column; }
.ct-txt b { font-family: var(--font-display); font-size: 17px; letter-spacing: .5px; text-transform: uppercase; font-weight: 600; }
.ct-txt small { font-size: 11.5px; opacity: .9; }
/* соцсети — только значок, название в подсказке (title) */
.ctile-social { padding: 10px 14px; justify-content: center; }
.ctile-social svg { width: 26px; height: 26px; flex-shrink: 0; }
.ctile-social.discord { background: #5865f2; }
.ctile-social.telegram { background: #2aa3df; }
.menu-footer { align-items: center; }

@media (max-width: 900px) {
  #menu .tiles { grid-template-columns: 1fr 1fr; grid-template-rows: 280px 130px 150px 190px 120px; max-height: none; }
  #menu .tile-classic { grid-column: 1; grid-row: 1; }
  #menu .tile-ranked { grid-column: 2; grid-row: 1; }
  #menu .tile-weekly { grid-column: 1 / 3; grid-row: 2; }
  #menu .tile-band { grid-column: 1 / 3; grid-row: 3; }
  #menu .tile-duo { grid-column: 1 / 3; grid-row: 4; }
  #menu .tile-soon { grid-column: 1 / 3; grid-row: 5; }
}
/* телефон: лента / список — обучение или сезон сразу после «Рейтинга», серые в конце */
@media (max-height: 520px) and (orientation: landscape), (max-width: 700px) and (orientation: portrait) {
  #menu .tile-soon { display: contents; }
  #menu .tile-band { order: 2; }
  body:not(.tutorial-done) #menu .tile-tutorial { order: -1; }
  #menu .tile-soon .tile { flex-direction: column; align-items: stretch; }
  #menu .tile-soon .tile-ribbon { right: auto; left: 12px; top: auto; bottom: 10px; transform: none; }
  .tile-season h2 { font-size: 30px; }
  .ts-days { top: 12px; transform: none; font-size: 14px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #menu .tile-band { width: clamp(220px, 34vw, 290px); flex-direction: column; align-items: stretch; }
  #menu .tile-band .tile-text { max-width: none; padding: 12px 14px 4px; }
  #menu .tile-tutorial .tile-art { width: 100%; height: 56%; top: auto; }
  .community { gap: 6px; }
  .ctile { padding: 3px 10px; box-shadow: none; }
  .ct-ico { font-size: 16px; }
  .ct-ico svg { width: 16px; height: 16px; }
  .ct-txt b { font-size: 12px; }
  .ct-txt small { display: none; }
  .ctile-social svg { width: 16px; height: 16px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .community { flex-wrap: wrap; justify-content: center; }
  .ctile-feedback { width: 100%; }
  .ctile-social { flex: 1; justify-content: center; }
}

/* ================= Геймастер ================= */
.pcard .gm-acts { position: absolute; right: 4px; top: 4px; display: none; gap: 2px; z-index: 2; }
.pcard:hover .gm-acts { display: flex; }
.gm-acts button { width: 22px; height: 22px; padding: 0; border: none; border-radius: 5px; background: rgba(0,0,0,.6); font-size: 12px; cursor: pointer; }
.gm-acts button:hover { background: rgba(231,76,60,.8); }
.gm-mini { background: #ffd23f; color: #2a1800 !important; border-radius: 3px; padding: 0 3px; font-weight: 800; }
#sidebar { pointer-events: auto; }
.msg { position: relative; }
.msg .msg-del { display: none; margin-left: 6px; border: none; background: rgba(231,76,60,.75); color: #fff; border-radius: 4px; font-size: 10px; padding: 0 5px; cursor: pointer; }
.msg:hover .msg-del { display: inline-block; }
#chatLog .msg { pointer-events: auto; }

/* повтор: кнопка «Пропустить» */
.rp-skip { position: absolute; right: 12px; top: 10px; z-index: 3; border: none; border-radius: 6px; padding: 5px 12px; background: rgba(0,0,0,.65); color: #fff; font-weight: 700; cursor: pointer; }
.rp-skip:hover { background: rgba(232,135,30,.9); }