/* ================= Рейтинговый матч: правила, поиск, заставка, итоги; профиль и жалоба ================= */

/* ---------- Правила при первом входе ---------- */
.rk-rules { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.rk-rules-intro { margin: 0 0 4px; font-size: 13.5px; line-height: 1.5; color: #cfd6e4; text-align: center; }
.rk-rule {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(94,224,255,.06); border: 1px solid rgba(94,224,255,.2); transition: border-color .15s, background .15s;
}
.rk-rule:hover { border-color: rgba(94,224,255,.5); }
.rk-rule:has(input:checked) { background: rgba(125,255,155,.08); border-color: rgba(125,255,155,.5); }
.rk-rule input { width: 20px; height: 20px; margin-top: 2px; accent-color: #7dff9b; flex-shrink: 0; cursor: pointer; }
.rk-rule b { display: block; font-size: 15px; }
.rk-rule small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rk-rules .rk-find { margin-top: 6px; }
.rk-rules .rk-find:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }

/* ---------- Среднее время поиска ---------- */
.rk-avg { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: #cfe9f5; }
.rk-avg-time b { color: #5ee0ff; font-variant-numeric: tabular-nums; }

/* ---------- Заставка первого раунда ---------- */
.rki {
  position: fixed; inset: 0; z-index: 350; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 18%, rgba(70,30,120,.55), rgba(6,6,14,.94) 60%);
  backdrop-filter: blur(2px); animation: rkiIn .4s ease-out;
}
@keyframes rkiIn { from { opacity: 0; } }
.rki-stage { position: relative; flex: 1 1 52%; min-height: 220px; }
.rki-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.rki-cards { position: absolute; left: 0; right: 0; top: 85%; }
.rki-card {
  position: absolute; transform: translate(-50%, 10px); opacity: 0; transition: opacity .35s, transform .35s;
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 120px; text-align: center;
}
.rki-card.show { opacity: 1; transform: translate(-50%, 0); }
.rki-name { font-family: var(--font-display); font-size: 20px; letter-spacing: .5px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.rki-rating { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 17px; color: #ffe08a; }
.rki-bot { font-size: 13px; color: #9aa0b4; }
.rki-rules {
  flex: 0 0 auto; width: min(1100px, 100%); margin: 0 auto; padding: 14px 20px 22px;
  background: rgba(14,16,26,.85); border-top: 1px solid rgba(177,77,255,.35); border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.5);
}
.rki-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rki-title > span { font-family: var(--font-display); font-size: 24px; letter-spacing: 3px; text-transform: uppercase; color: #fff; text-shadow: 0 0 18px rgba(177,77,255,.7); }
.rki-start { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #cfd6e4; text-transform: uppercase; letter-spacing: 1px; }
.rki-start i { display: inline-flex; width: 18px; height: 18px; color: #ffd23f; }
.rki-count { font-family: var(--font-display); font-size: 28px; color: #ffd23f; margin-left: 2px; min-width: 22px; text-align: right; }
.rki-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rki-fact {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; cursor: help;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.12);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  font-size: 13.5px; transition: border-color .15s, background .15s;
}
.rki-fact i { display: inline-flex; width: 18px; height: 18px; color: #c9b8ff; }
.rki-fact i svg, .rki-start i svg { width: 100%; height: 100%; }
.rki-fact:hover { border-color: rgba(201,184,255,.6); background: rgba(177,77,255,.14); }
.rki-cols { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 2.6fr) minmax(0, .9fr); gap: 16px; }
.rki-col h4 {
  display: inline-block; margin: 0 0 8px; font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: #cfd6e4; cursor: help; border-bottom: 1px dashed rgba(255,255,255,.25);
}
.rki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 7px; }
.rki-col:nth-child(2) .rki-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rki-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; cursor: help;
  font-size: 12px; font-weight: 600; color: #e9e3d7; text-align: center;
  background: rgba(177,77,255,.12); border: 1px solid rgba(177,77,255,.5);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: inset 0 0 18px rgba(177,77,255,.18); transition: transform .15s, border-color .15s;
}
.rki-tile:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.55); }
.rki-tile-ico { display: flex; align-items: center; justify-content: center; height: 46px; }
.rki-tile.seasonal { background: rgba(31,209,193,.12); border-color: rgba(31,209,193,.6); box-shadow: inset 0 0 18px rgba(31,209,193,.2); color: #d6fffb; }
.rki-tile.bonus.bad { background: rgba(255,80,80,.1); border-color: rgba(255,90,90,.55); box-shadow: inset 0 0 18px rgba(255,80,80,.18); }
.rki-tile.enemy { background: rgba(255,45,85,.12); border-color: rgba(255,45,85,.6); box-shadow: inset 0 0 18px rgba(255,45,85,.22); color: #ffd6de; }
.rki-pop { position: fixed; z-index: 500; pointer-events: none; }
.rki-pop p { white-space: normal; }
.rki-pop.seasonal { background: radial-gradient(circle at 50% 0%, #10464a, #0e1618 75%); box-shadow: 0 16px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(31,209,193,.4); }
.rki-pop.seasonal .fx-pop-tag { background: rgba(31,209,193,.2); color: #b8fff6; }
.rki-pop.enemy { background: radial-gradient(circle at 50% 0%, #4a1020, #180c10 75%); box-shadow: 0 16px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,45,85,.45); }
.rki-pop.enemy .fx-pop-tag, .rki-pop.bad .fx-pop-tag { background: rgba(255,80,80,.22); color: #ffc2cc; }

/* ---------- Отсчёт перед стартом: «2 — 1 — BOOM!» ---------- */
.cd { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 370; pointer-events: none; }
.cd span { display: block; font-family: var(--font-display); letter-spacing: 4px; line-height: 1; animation: cdPop .9s cubic-bezier(.2,1.4,.4,1) both; }
.cd-n { font-size: 150px; color: #fff; text-shadow: 0 0 30px rgba(94,224,255,.8), 0 8px 0 #12334a, 0 14px 30px rgba(0,0,0,.6); }
.cd-boom {
  font-size: 128px; color: #ffd23f;
  text-shadow: 0 0 40px rgba(255,140,40,.95), 0 8px 0 #7a2a08, 0 14px 30px rgba(0,0,0,.6);
  animation-name: cdBoom !important;
}
@keyframes cdPop { 0% { transform: scale(2.4); opacity: 0; } 25% { transform: scale(.9); opacity: 1; } 40% { transform: scale(1.05); } 80% { opacity: 1; } 100% { transform: scale(.85); opacity: 0; } }
@keyframes cdBoom { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 30% { transform: scale(1.25) rotate(3deg); opacity: 1; } 55% { transform: scale(1) rotate(0); } 85% { opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@media (max-width: 760px), (max-height: 520px) { .cd-n { font-size: 96px; } .cd-boom { font-size: 80px; } }

/* ---------- Баннер «Раунд 2» ---------- */
.rki-banner {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 350; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rkBanner .5s cubic-bezier(.2,.9,.3,1.3);
}
.rki-banner span { font-family: var(--font-display); font-size: 84px; letter-spacing: 6px; color: #fff; text-shadow: 0 0 30px rgba(177,77,255,.9), 0 6px 0 #3a1466; }
@keyframes rkBanner { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }

/* ---------- Итоги раунда и финал ---------- */
.rkr { position: fixed; inset: 0; z-index: 360; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5,6,12,.72); backdrop-filter: blur(3px); animation: rkiIn .3s ease-out; }
.rkr-box {
  width: min(640px, 100%); max-height: 92vh; overflow-y: auto; padding: 20px 22px; border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, #2b1b4a, #12131d 70%); border: 1px solid rgba(177,77,255,.35);
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
}
.rkr-box.final { width: min(860px, 100%); }
.rkr-head { text-align: center; margin-bottom: 14px; }
.rkr-head > span { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #c9b8ff; }
.rkr-head h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: 32px; letter-spacing: 1px; color: #fff; }
.rkr-mydelta { margin-top: 6px; font-size: 15px; }
.rkr-mydelta b { font-family: var(--font-display); font-size: 22px; }
.rkr-mydelta.up b, .rkr-rating b.up { color: #7dff9b; }
.rkr-mydelta.down b, .rkr-rating b.down { color: #ff7b7b; }
.rkr-table { display: flex; flex-direction: column; gap: 6px; }
.rkr-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) 90px 80px; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.04);
}
.rkr-row.final { grid-template-columns: 54px minmax(0, 1.4fr) 100px 60px minmax(150px, 1fr) 34px; }
.rkr-row.me { background: rgba(232,135,30,.16); box-shadow: inset 0 0 0 1px rgba(255,173,66,.5); }
.rkr-th { background: none; padding-top: 0; padding-bottom: 0; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.rkr-place { font-family: var(--font-display); font-size: 24px; text-align: center; color: #cfd6e4; }
.rkr-place.p1 { color: #ffd23f; text-shadow: 0 0 12px rgba(255,210,63,.5); }
.rkr-place.p2 { color: #e3ecf7; }
.rkr-place.p3 { color: #ff9f5a; }
/* кнопки с линейной иконкой (вместо эмодзи) */
.ico-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ico-btn i { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.ico-btn i svg { width: 100%; height: 100%; }
.rkr-name { display: flex; align-items: center; gap: 8px; min-width: 0; background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.rkr-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.rkr-name:hover b { color: #5ee0ff; text-decoration: underline; }
.rkr-ava { flex-shrink: 0; }
.rkr-left { color: #ff7b7b; font-size: 11px; font-weight: 700; }
.rkr-pts { color: #7dff9b; font-weight: 700; }
.rkr-total { font-family: var(--font-display); font-size: 22px; color: #ffd23f; }
.rkr-rounds { font-size: 13px; color: #cfd6e4; }
.rkr-rating { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.rkr-rating b { font-family: var(--font-display); font-size: 16px; }
.rkr-lvl { width: 100%; font-size: 11px; font-weight: 700; }
.rkr-lvl.up { color: #7dff9b; } .rkr-lvl.down { color: #ff7b7b; }
.rkr-report { font-size: 15px; opacity: .7; }
.rkr-report:hover { opacity: 1; color: #ff9a6b; }
.rkr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 14px; color: #cfd6e4; }
.rkr-foot b { font-family: var(--font-display); font-size: 20px; color: #ffd23f; }
.rkr-hint { margin: 12px 0 0; font-size: 12.5px; line-height: 1.45; }
.rkr-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rkr-actions button { padding: 11px 22px; }

/* ---------- Итоги обычного матча: ник — профиль, ⚑ — жалоба (подложка итогов клики пропускает) ---------- */
#overlay .go-kills { display: inline-flex; align-items: center; gap: 3px; color: #aab; font-size: 12px; }
#overlay .go-report { display: inline-flex; color: #c9cfdd; }
#overlay .go-name, #overlay .go-report { pointer-events: auto; background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
#overlay .go-name:hover { color: #5ee0ff; text-decoration: underline; }
#overlay .go-report { margin-left: 4px; font-size: 13px; opacity: .55; }
#overlay .go-report:hover { opacity: 1; color: #ff9a6b; }

/* ---------- Профиль игрока и жалоба ---------- */
/* ник-ссылка на профиль (лобби, таблица рейтинга) */
.name-txt.link, button.tt-name.link { cursor: pointer; }
.name-txt.link:hover, button.tt-name.link:hover { color: #5ee0ff; text-decoration: underline; }
button.tt-name.link { background: none; border: none; padding: 0; color: inherit; font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-box {
  position: relative; width: min(460px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.8);
}
.pp-x { position: absolute; right: 10px; top: 10px; }
.pp-head { display: flex; gap: 16px; align-items: center; }
.pp-ava { width: 80px; height: 80px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #3a2f5e, #1a1530); flex-shrink: 0; }
.pp-name { display: flex; align-items: center; gap: 8px; }
.pp-name b { font-family: var(--font-display); font-size: 26px; letter-spacing: .5px; }
.pp-rank { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.pp-rank b { display: block; font-family: var(--font-display); font-size: 20px; color: #ffe08a; line-height: 1; }
.pp-rank small { font-size: 11px; color: var(--muted); }
.pp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0; }
.pp-stats .st { background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 4px; text-align: center; }
.pp-stats .st b { display: block; font-family: var(--font-display); font-size: 20px; }
.pp-stats .st span { font-size: 10.5px; color: var(--muted); }
.pp-recent h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.pp-match { display: grid; grid-template-columns: 1fr 80px 110px; gap: 8px; padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.pp-match:nth-child(odd) { background: rgba(255,255,255,.03); }
.pp-match.won b { color: #ffd23f; }
.pp-match small { color: var(--muted); text-align: right; }
.pp-report { width: 100%; margin-top: 14px; color: #ffb08a; border-color: rgba(255,140,90,.4); }
.rp-modal h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 22px; letter-spacing: .5px; }
.rp-reasons { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
.rp-reason {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; text-align: left;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: inherit; cursor: pointer;
}
.rp-reason .rp-ico { grid-row: 1 / 3; display: inline-flex; align-self: center; color: #ffb38a; }
.rp-reason.on .rp-ico { color: #ff9a6b; }
.rp-title { display: flex; align-items: center; gap: 8px; }
.rp-title span { display: inline-flex; color: #ff9a6b; }
.rp-reason small { color: var(--muted); font-size: 12px; }
.rp-reason:hover { border-color: rgba(255,255,255,.3); }
.rp-reason.on { border-color: #ff9a6b; background: rgba(255,140,90,.12); }
.rp-comment { width: 100%; min-height: 80px; resize: vertical; box-sizing: border-box; }

@media (max-width: 760px), (max-height: 520px) {
  .rki-cols { grid-template-columns: 1fr; gap: 8px; }
  .rki-grid, .rki-col:nth-child(2) .rki-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }
  .rki-tile { font-size: 10.5px; padding: 6px 2px; }
  .rki-tile-ico { height: 34px; }
  .rki-tile-ico canvas { width: 32px !important; height: 32px !important; }
  .rki-rules { padding: 10px 12px 14px; }
  .rki-title span { font-size: 16px; }
  .rki-name { font-size: 15px; }
  .rki-card { min-width: 90px; }
  .rki-banner span { font-size: 52px; }
  .rkr-row.final { grid-template-columns: 34px minmax(0, 1fr) 54px minmax(90px, auto) 28px; }
  .rkr-row.final .rkr-rounds { display: none; }
  .rkr-row { grid-template-columns: 34px minmax(0, 1fr) 54px 50px; }
  .rkr-head h2 { font-size: 24px; }
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
}
