/* =========================================================
   MatchMate — профиль v6. Слой поверх profile_v4 / layout / v5:
   «О себе» под ником, настройки — шестерёнка и меню «⋯» в углу,
   игры и ранги — плитки с иконками.
   ========================================================= */
html body .container.profile-page{
  --pv-panel:rgba(9,13,23,.9);
  --pv-line:rgba(255,255,255,.08);
  --pv-text:#eaf1ff;
  --pv-dim:#93a5be;
  --pv-accent:#48dcf7;
}

/* ------------------------------------------------------------ шапка */
html body .container.profile-page .profile-hero{
  position:relative !important;
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) !important;
  align-items:center !important;
  gap:18px 22px !important;
  margin:18px 0 0 !important;
  padding:24px 26px !important;
  text-align:left !important;
  border-radius:20px !important;
  /* меню «⋯» выходит за край шапки и должно лежать поверх блоков ниже */
  overflow:visible !important;z-index:5 !important;
}
html body .container.profile-page .profile-hero .ph-texts{
  display:flex !important;flex-direction:column !important;align-items:flex-start !important;
  gap:8px !important;min-width:0 !important;margin:0 !important;text-align:left !important;
}
/* ник не залезает под кнопки в углу */
html body .container.profile-page .profile-hero .ph-texts h2{padding-right:170px !important;justify-content:flex-start !important}
html body .container.profile-page .profile-hero .ph-bio{
  max-width:62ch !important;margin:0 !important;
  font-size:15px !important;line-height:1.55 !important;color:#cfdcee !important;
  white-space:pre-line !important;overflow-wrap:anywhere !important;
}
html body .container.profile-page .profile-hero .ph-bio[hidden]{display:none !important}
html body .container.profile-page .profile-hero .profile-facts{
  display:flex !important;flex-wrap:wrap !important;gap:6px !important;margin:2px 0 0 !important;justify-content:flex-start !important;
}
html body .container.profile-page .profile-hero .profile-fact{
  display:inline-flex !important;align-items:center !important;
  height:28px !important;min-height:0 !important;padding:0 11px !important;border-radius:999px !important;
  background:rgba(255,255,255,.05) !important;border:1px solid var(--pv-line) !important;
  color:var(--pv-dim) !important;font-size:12.5px !important;font-weight:700 !important;
}
html body .container.profile-page .profile-hero .profile-fact:empty{display:none !important}
html body .container.profile-page .profile-hero .profile-visibility-status{grid-column:1 / -1 !important;margin:4px 0 0 !important}

/* ------------------------------------- инструменты владельца в углу
   profile-actions-fix.css показывал блок через display:grid !important
   и этим игнорировал style="display:none" у чужих профилей. */
html body .container.profile-page #owner-actions[style*="none"]{display:none !important}
html body .container.profile-page #owner-actions:not([style*="none"]){
  position:absolute !important;top:16px !important;right:16px !important;z-index:20 !important;
  display:flex !important;flex-direction:row !important;align-items:center !important;gap:8px !important;
  width:auto !important;margin:0 !important;padding:0 !important;
  background:none !important;border:0 !important;box-shadow:none !important;
}
html body .container.profile-page #owner-actions .ph-tool,
html body .container.profile-page #owner-actions #open-settings,
html body .container.profile-page #owner-actions #profile-actions-toggle{
  display:inline-flex !important;align-items:center !important;justify-content:center !important;gap:8px !important;
  width:auto !important;min-width:40px !important;height:40px !important;min-height:0 !important;
  margin:0 !important;padding:0 14px !important;border-radius:12px !important;
  background:rgba(255,255,255,.06) !important;border:1px solid rgba(255,255,255,.12) !important;
  color:var(--pv-text) !important;font-size:14px !important;font-weight:700 !important;
  text-decoration:none !important;box-shadow:none !important;cursor:pointer !important;
  transition:background .15s ease,border-color .15s ease !important;
}
html body .container.profile-page #owner-actions #profile-actions-toggle{width:40px !important;padding:0 !important}
html body .container.profile-page #owner-actions .ph-tool:hover{background:rgba(255,255,255,.11) !important;border-color:rgba(72,220,247,.45) !important}
html body .container.profile-page #owner-actions .ph-tool svg{width:18px !important;height:18px !important;flex:none !important}
html body .container.profile-page #owner-actions #open-settings svg{fill:none !important;stroke:currentColor !important;stroke-width:2 !important;stroke-linecap:round !important;stroke-linejoin:round !important}
html body .container.profile-page #owner-actions #profile-actions-toggle svg{fill:currentColor !important;stroke:none !important}
/* старый «гамбургер» и свечение кнопки больше не нужны */
html body .container.profile-page #owner-actions #profile-actions-toggle span,
html body .container.profile-page #owner-actions .btn-glow{display:none !important}
html body .container.profile-page #owner-actions.is-open #profile-actions-toggle{background:rgba(72,220,247,.14) !important;border-color:rgba(72,220,247,.5) !important}

/* выпадающее меню «⋯» */
html body .container.profile-page #owner-actions #profile-actions-extra{
  position:absolute !important;top:calc(100% + 8px) !important;right:0 !important;left:auto !important;
  display:none !important;flex-direction:column !important;gap:2px !important;
  width:250px !important;min-width:0 !important;margin:0 !important;padding:6px !important;
  border-radius:14px !important;background:#131c2a !important;border:1px solid rgba(255,255,255,.1) !important;
  box-shadow:0 20px 44px rgba(0,0,0,.5) !important;
}
html body .container.profile-page #owner-actions.is-open #profile-actions-extra{display:flex !important}
html body .container.profile-page #owner-actions #profile-actions-extra .ph-menu-item{
  display:flex !important;align-items:center !important;gap:10px !important;
  width:100% !important;height:42px !important;min-height:0 !important;margin:0 !important;padding:0 12px !important;
  border:0 !important;border-radius:10px !important;background:none !important;box-shadow:none !important;
  color:var(--pv-text) !important;font-size:14.5px !important;font-weight:700 !important;font-family:inherit !important;
  text-align:left !important;text-decoration:none !important;cursor:pointer !important;white-space:nowrap !important;
}
html body .container.profile-page #owner-actions #profile-actions-extra .ph-menu-item:hover{background:rgba(255,255,255,.07) !important}
html body .container.profile-page #owner-actions #profile-actions-extra .ph-menu-item span{width:20px !important;text-align:center !important;flex:none !important}
html body .container.profile-page #owner-actions #profile-actions-extra .ph-menu-item.is-danger{color:#ff8095 !important}

/* ------------------------------------------------------ блоки ниже */
html body .container.profile-page .profile-content{
  display:grid !important;
  grid-template-columns:minmax(0,2fr) minmax(0,1fr) !important;
  align-items:start !important;gap:14px !important;
  margin:14px 0 24px !important;
}
html body .container.profile-page .profile-content .profile-games-card{order:1 !important}
html body .container.profile-page .profile-content .profile-card,
html body .container.profile-page .profile-content .profile-card h3{text-align:left !important}
html body .container.profile-page .profile-content #contacts{justify-content:flex-start !important}
html body .container.profile-page .profile-content .profile-about-card{order:2 !important}

/* игры и ранги — плитки */
html body .container.profile-page .pg-games{
  display:grid !important;grid-template-columns:repeat(auto-fill,minmax(230px,1fr)) !important;gap:8px !important;
}
html body .container.profile-page .pg-game{
  --pg-accent:rgba(72,220,247,.35);
  display:flex !important;align-items:center !important;gap:12px !important;
  min-width:0 !important;min-height:58px !important;padding:9px 12px 9px 10px !important;
  border-radius:14px !important;
  background:rgba(255,255,255,.035) !important;border:1px solid rgba(255,255,255,.07) !important;
}
html body .container.profile-page .pg-game.has-rank{
  background:linear-gradient(100deg, color-mix(in srgb, var(--pg-accent) 30%, transparent), rgba(255,255,255,.03) 70%) !important;
  border-color:color-mix(in srgb, var(--pg-accent) 80%, transparent) !important;
}
html body .container.profile-page .pg-game.b-valorant{--pg-accent:rgba(255,70,85,.45)}
html body .container.profile-page .pg-game.b-cs2{--pg-accent:rgba(255,170,60,.45)}
html body .container.profile-page .pg-game.b-dota{--pg-accent:rgba(235,70,50,.4)}
html body .container.profile-page .pg-game.b-fortnite{--pg-accent:rgba(160,110,255,.45)}
html body .container.profile-page .pg-game.b-wow{--pg-accent:rgba(245,190,70,.4)}
html body .container.profile-page .pg-game.b-lol{--pg-accent:rgba(200,170,90,.4)}
html body .container.profile-page .pg-game-icon{
  width:38px !important;height:38px !important;flex:none !important;border-radius:10px !important;object-fit:cover !important;
  box-shadow:0 4px 12px rgba(0,0,0,.35) !important;
}
html body .container.profile-page .pg-game-text{display:flex !important;flex-direction:column !important;gap:2px !important;flex:1 1 auto !important;min-width:0 !important}
html body .container.profile-page .pg-game-name,
html body .container.profile-page .pg-game-rank{white-space:nowrap !important;overflow:hidden !important;text-overflow:ellipsis !important}
html body .container.profile-page .pg-game-name{font-size:14.5px !important;font-weight:800 !important;color:var(--pv-text) !important}
html body .container.profile-page .pg-game-rank{font-size:12.5px !important;font-weight:700 !important;color:#aebfd6 !important}
html body .container.profile-page .pg-game:not(.has-rank) .pg-game-rank{color:#6f8098 !important;font-weight:600 !important}
html body .container.profile-page .pg-rank-icon{
  width:40px !important;height:40px !important;flex:none !important;object-fit:contain !important;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.5)) !important;
}
html body .container.profile-page .pg-empty{color:var(--pv-dim) !important;font-size:14px !important}

/* ================================================================ ПК */
@media (min-width:821px){
  html body .container.profile-page .profile-hero .avatar{width:112px !important;height:112px !important;min-width:112px !important;min-height:112px !important}
}

/* ============================================================ телефон */
@media (max-width:760px){
  html body .container.profile-page .profile-hero{
    grid-template-columns:1fr !important;justify-items:center !important;text-align:center !important;
    gap:12px !important;padding:22px 16px 18px !important;margin-top:12px !important;
  }
  html body .container.profile-page .profile-hero .avatar{width:96px !important;height:96px !important;min-width:96px !important;min-height:96px !important}
  html body .container.profile-page .profile-hero .ph-texts{align-items:center !important;text-align:center !important}
  html body .container.profile-page .profile-hero .ph-texts h2{padding-right:0 !important;justify-content:center !important}
  html body .container.profile-page .profile-hero .ph-bio{font-size:14.5px !important}
  html body .container.profile-page .profile-hero .profile-facts{justify-content:center !important}
  /* в углу только иконки */
  html body .container.profile-page #owner-actions:not([style*="none"]){top:12px !important;right:12px !important;gap:6px !important}
  html body .container.profile-page #owner-actions #open-settings{width:40px !important;padding:0 !important}
  html body .container.profile-page #owner-actions #open-settings span{display:none !important}
  html body .container.profile-page #owner-actions #profile-actions-extra{width:min(260px, calc(100vw - 40px)) !important}

  html body .container.profile-page .profile-content{grid-template-columns:1fr !important;gap:12px !important}
  html body .container.profile-page .pg-games{grid-template-columns:1fr !important}
}
@media (min-width:481px) and (max-width:760px){
  html body .container.profile-page .pg-games{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
}

/* Телефон: пункты «⋯» (Valorant, инвентарь, поинты, рефералка, выход) есть в меню сайта — кнопку убираем */
@media (max-width:860px){
  html body .container.profile-page #owner-actions #profile-actions-toggle,
  html body .container.profile-page #owner-actions #profile-actions-extra{display:none !important}
}

/* подсказка владельцу: выбрать ник вместо логина */
.mm-name-hint{grid-column:1 / -1 !important;width:100%;min-width:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0 0;padding:12px 14px;border-radius:14px;background:rgba(79,214,247,.08);border:1px solid rgba(79,214,247,.28);color:#dfe7f3;font-size:14px;line-height:1.4}
.mm-name-hint span{flex:1 1 220px}
.mm-name-hint b{color:#fff}
.mm-name-hint a{flex:none;display:inline-flex;align-items:center;height:36px;padding:0 14px;border-radius:10px;background:linear-gradient(135deg,#4fd6f7,#8f7bff);color:#05070f;font-weight:800;text-decoration:none}
.mm-name-hint button{flex:none;width:32px;height:32px;border:0;border-radius:9px;background:rgba(255,255,255,.08);color:#aebbd0;font-size:20px;line-height:1;cursor:pointer}
