@font-face {
  font-family: "Franklin_Gothic_Medium"; 
  src: url("../fonts/Franklin_Gothic_Medium.ttf") format("truetype"); 
  font-style: normal; 
  font-weight: normal; 
} 
.profile-frame {
  position: relative;
  width: 650px;
  height: 140px;
  /* background: url(/img/profilebg.png) no-repeat center / cover;
  background-size: 100%; */
  font-family: 'Franklin_Gothic_Medium', sans-serif;
  color: #fff;
  margin: 20px auto 50px auto;
    background-color: rgba(15, 15, 15, 0.65);
    backdrop-filter: blur(4px);
    margin-top: 0;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
}

.frame-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url(/img/profilebg.png) no-repeat center / cover;
    background-size: 100%;
  pointer-events: none; /* чтобы не мешала кликам */
}



.profile-frame span,
.profile-frame button {
    color: #ebf9ab;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

.top-left {
     position: absolute;
    top: 28px;
    left: 114px;
    max-width: 180px;
}

.nickname {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.bottom-left {
  position: absolute;
    bottom: 42px;
    left: 120px;
}

.top-right {
 position: absolute;
   top: 27px;
    left: 70%;
}
.top-right .balance{
    font-size: 22px;
    color: ebf9ab;
}


.bottom-right {
  position: absolute;
    bottom: 43px;
    right: 86px;
}
.btn-purchases{
    color: #ebf9ab;
}
.btn-purchases,
.btn-topup {
  background: transparent;
  border: none;
  font-size: 21px;
  cursor: pointer;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  transition: color 0.3s ease; /* Добавляем плавный переход */
}

.btn-purchases:hover,
.btn-topup:hover {
  color: red;
}

.center-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: -7px;
    margin-left: -5px;
}
.center-avatar img {
      width: 120px;
    height: 105px;
    border-radius: 38%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}
.header-auth .btnlogout{
    text-align: center;
    padding: 0 !important;
    display: block;
    line-height: 48px;
}
/* ===== Настройки профиля ===== */
.profile-settings {
  --ps-bg: rgba(20, 20, 24, .96);
  --ps-bg-soft: rgba(31, 31, 38, .9);
  --ps-border: rgba(255, 255, 255, .11);
  --ps-border-strong: rgba(255, 198, 7, .42);
  --ps-text: #f4f4f5;
  --ps-muted: #a8a8b2;
  --ps-accent: #ffc607;
  --ps-accent-2: #ff9f1a;
  --ps-danger: #ff6b6b;
  width: 100%;
  max-width: 1180px;
  margin: 28px auto 64px;
  color: var(--ps-text);
  font-family: "Play", Arial, sans-serif;
}

.profile-settings *,
.profile-settings *::before,
.profile-settings *::after {
  box-sizing: border-box;
}

.profile-settings__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}

.profile-settings__heading h2 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  text-transform: none;
}

.profile-settings__heading p {
  margin: 7px 0 0;
  color: var(--ps-muted);
  font-size: 14px;
  line-height: 1.45;
}

.profile-settings__layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-settings-card {
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(35,35,42,.96), rgba(20,20,25,.96));
  border: 1px solid var(--ps-border);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  color: var(--ps-text);
}

.profile-settings-card--avatar {
  padding: 20px;
  position: sticky;
  top: 18px;
}

.profile-settings-card--security {
  padding: 0 24px 24px;
}

.profile-settings-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 18px;
  margin: 0;
  border-bottom: 1px solid var(--ps-border);
}

.profile-settings-card__head--simple {
  padding-top: 0;
}

.profile-settings-card h3,
.profile-settings-card h4 {
  margin: 0;
  color: #fff;
  text-transform: none;
  text-shadow: none;
  font-weight: 700;
}

.profile-settings-card h3 {
  font-size: 20px;
}

.profile-settings-card h4 {
  font-size: 17px;
}

.profile-settings-card p {
  margin: 6px 0 0;
  color: var(--ps-muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-account-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}

.profile-account-badge--local {
  color: #171717;
  background: var(--ps-accent);
  border: 1px solid var(--ps-accent);
}

.profile-account-badge--social {
  color: #d0d0d6;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}

.profile-avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 20px;
}

.profile-avatar-editor__preview-wrap {
  width: 108px;
  height: 108px;
  margin: 0 auto 14px;
  padding: 3px;
  overflow: hidden;
  border: 2px solid rgba(255,198,7,.75);
  border-radius: 50%;
  background: #17171b;
  box-shadow: 0 8px 22px rgba(0,0,0,.32), 0 0 0 4px rgba(255,198,7,.07);
}

.profile-avatar-editor__preview {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  background: #111;
}

.profile-avatar-editor__meta {
  text-align: center;
  margin-bottom: 18px;
}

.profile-avatar-editor__meta strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 14px;
}

.profile-avatar-editor__meta span {
  display: block;
  margin-top: 5px;
  color: var(--ps-muted);
  font-size: 11px;
  line-height: 1.35;
}

.profile-settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.profile-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.profile-file-picker {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  width: 100%;
  padding: 9px 12px;
  color: #efefef;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.profile-file-picker:hover {
  border-color: var(--ps-border-strong);
  background: rgba(255,198,7,.07);
  transform: translateY(-1px);
}

.profile-file-picker__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #171717;
  background: var(--ps-accent);
  font-size: 17px;
  line-height: 20px;
  font-weight: 700;
}

.profile-file-picker__text {
  color: #f2f2f2;
  font-size: 12px;
  font-weight: 700;
}

.profile-file-name {
  min-height: 16px;
  margin-top: -5px;
  overflow: hidden;
  color: #898993;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-reset-avatar-form {
  margin-top: 8px;
}

.profile-security-section {
  padding: 24px 0 0;
}

.profile-security-section + .profile-security-section {
  margin-top: 24px;
  border-top: 1px solid var(--ps-border);
}

.profile-security-section__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.profile-settings-form--security {
  max-width: 680px;
}

.profile-settings-label {
  display: flex !important;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  margin: 0;
  color: #d2d2d7;
  font-size: 12px;
  line-height: 1.2;
}

.profile-settings-label > span {
  color: #d0d0d5;
  font-size: 12px;
  font-weight: 600;
}

.profile-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  background: rgba(10,10,13,.58);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.profile-input-wrap:focus-within {
  border-color: rgba(255,198,7,.72);
  background: rgba(16,16,19,.86);
  box-shadow: 0 0 0 3px rgba(255,198,7,.09);
}

.profile-input-wrap--disabled {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.08);
}

.profile-settings-label input {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 13px !important;
  line-height: 42px !important;
  text-align: left !important;
  -webkit-appearance: none;
}

.profile-settings-label input::placeholder {
  color: #6f6f79 !important;
  opacity: 1;
}

.profile-settings-label input:disabled {
  color: #96969e !important;
  -webkit-text-fill-color: #96969e;
  opacity: 1;
  cursor: not-allowed;
}

.profile-input-wrap--password input {
  padding-right: 82px !important;
}

.profile-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  min-width: 65px;
  height: 30px;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: rgba(255,255,255,.07) !important;
  color: #bdbdc5 !important;
  font-size: 10px !important;
  line-height: 30px !important;
  text-transform: none !important;
  text-shadow: none !important;
  cursor: pointer;
}

.profile-password-toggle:hover {
  background: rgba(255,198,7,.13) !important;
  color: var(--ps-accent) !important;
}

.profile-settings-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 2px;
}

.profile-settings-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 148px;
  min-height: 42px;
  margin: 0 !important;
  padding: 10px 16px !important;
  border-radius: 9px !important;
  border: 1px solid transparent !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  text-transform: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, border-color .16s ease;
}

.profile-settings-btn--primary {
  color: #171717 !important;
  background: linear-gradient(180deg, #ffd32a 0%, var(--ps-accent) 48%, #f0a900 100%) !important;
  border-color: #ffd640 !important;
  box-shadow: 0 5px 14px rgba(255,166,0,.16);
}

.profile-settings-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(255,166,0,.24);
}

.profile-settings-btn--secondary {
  width: 100% !important;
  color: #c7c7cc !important;
  background: rgba(255,255,255,.035) !important;
  border-color: rgba(255,255,255,.11) !important;
}

.profile-settings-btn--secondary:hover {
  color: #fff !important;
  border-color: rgba(255,255,255,.22) !important;
  background: rgba(255,255,255,.06) !important;
}

.profile-avatar-form .profile-settings-btn--primary {
  width: 100% !important;
}

.profile-settings-help {
  max-width: 680px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  color: #9c9ca5;
  font-size: 12px;
  line-height: 1.45;
}

.profile-settings-locked {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}

.profile-settings-locked__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,107,107,.1);
  color: var(--ps-danger);
  font-size: 18px;
  line-height: 28px;
}

.profile-settings-locked strong {
  color: #fff;
  font-size: 13px;
}

.profile-settings-locked p {
  margin-top: 4px;
  max-width: 660px;
}

.profile-settings-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 18px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
}

.profile-settings-notice__mark {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.profile-settings-notice--success {
  color: #c9f6d2;
  background: rgba(72,181,98,.09);
  border-color: rgba(84,204,112,.24);
}
.profile-settings-notice--success .profile-settings-notice__mark { background: #58d477; }

.profile-settings-notice--error {
  color: #ffd0d0;
  background: rgba(210,64,64,.09);
  border-color: rgba(255,91,91,.24);
}
.profile-settings-notice--error .profile-settings-notice__mark { background: #ff6b6b; }

@media (max-width: 980px) {
  .profile-settings {
    max-width: 760px;
  }
  .profile-settings__layout {
    grid-template-columns: 1fr;
  }
  .profile-settings-card--avatar {
    position: static;
  }
  .profile-avatar-editor {
    max-width: 360px;
    margin: 0 auto;
  }
  .profile-settings-form--security {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .profile-settings {
    margin-top: 20px;
  }
  .profile-settings__heading h2 {
    font-size: 23px;
  }
  .profile-settings-card--avatar,
  .profile-settings-card--security {
    padding-left: 16px;
    padding-right: 16px;
  }
  .profile-settings-card__head {
    flex-direction: column;
    gap: 10px;
  }
  .profile-account-badge {
    align-self: flex-start;
  }
  .profile-settings-actions,
  .profile-settings-actions .profile-settings-btn {
    width: 100% !important;
  }
  .profile-settings-btn {
    width: 100% !important;
  }
}

/* ===== Единый кабинет /profile ===== */
.profile-page .noob-profile {
  margin-bottom: 22px;
}

.noob-profile__photo-link {
  display: block;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.noob-profile__photo-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(255,198,7,.08), 0 8px 24px rgba(0,0,0,.28);
}

.noob-profile__settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 32px;
  margin-top: -13px;
  padding: 0 13px;
  border: 1px solid rgba(239,164,6,.76);
  border-radius: 5px;
  color: #ffc607;
  background: rgba(255,140,0,.08);
  box-shadow: inset 0 0 14px rgba(255,85,0,.08);
  font-size: 11px;
  line-height: 30px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.noob-profile__settings-btn:hover {
  color: #ffd746;
  border-color: #f5a810;
  background: rgba(255,140,0,.14);
  box-shadow: inset 0 0 20px rgba(255,85,0,.14), 0 0 12px rgba(255,85,0,.12);
  transform: translateY(-1px);
}

.noob-profile__stats .noob-profile__stats-item {
  width: 50%;
}

.profile-promo-form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-frame__settings-link,
.profile-frame .center-avatar {
  cursor: pointer;
  text-decoration: none;
}

.profile-frame__settings-link {
  z-index: 2;
  border-radius: 8px;
}

.profile-frame .center-avatar {
  z-index: 2;
}

.profile-frame__settings-link:hover .nickname,
.profile-frame .center-avatar:hover img {
  filter: brightness(1.08);
}

.profile-dashboard-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0 0 18px;
}

.profile-dashboard-nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  background: rgba(41,41,49,.88);
  color: #bdbdc3;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.profile-dashboard-nav__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  background: rgba(255,198,7,.1);
  color: #ffc607;
  font-size: 12px;
}

.profile-dashboard-nav__item:hover,
.profile-dashboard-nav__item.is-active {
  color: #ffc607;
  border-color: rgba(239,164,6,.5);
  background: linear-gradient(180deg, rgba(49,49,58,.96), rgba(39,39,47,.96));
  box-shadow: inset 0 0 22px rgba(255,85,0,.07), 0 6px 18px rgba(0,0,0,.16);
  transform: translateY(-1px);
}

.profile-dashboard {
  width: 100%;
}

.profile-dashboard-section {
  width: 100%;
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(37,37,45,.84) url(../img/textures/topcase.png) 0 0 no-repeat;
  box-shadow: 0 7px 22px rgba(0,0,0,.18);
  scroll-margin-top: 18px;
}

.profile-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 19px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(42,42,49,.76);
}

.profile-section-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.18;
  font-weight: 700;
  text-transform: none;
}

.profile-section-heading p {
  margin: 6px 0 0;
  color: #a8a8b0;
  font-size: 14px;
  line-height: 1.45;
}

.profile-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(239,164,6,.56);
  border-radius: 20px;
  color: #ffc607;
  background: rgba(255,140,0,.08);
  box-shadow: inset 0 0 14px rgba(255,85,0,.08);
  font-size: 17px;
  font-weight: 700;
}

.profile-section-body {
  padding: 20px 20px 6px;
}

.profile-section-body .profile-games {
  margin: 0;
}

.profile-section-body .alert {
  margin-bottom: 14px;
}

/* Настройки теперь являются частью общей страницы и равны ширине noob-profile */
.profile-settings.profile-settings--embedded {
  width: 100%;
  max-width: none;
  margin: 0;
  color: #f4f4f5;
}

.profile-settings--embedded .profile-section-heading--settings {
  margin: 0;
}

.profile-settings--embedded .profile-settings-notice {
  margin: 16px 20px 0;
}

.profile-settings--embedded .profile-settings__layout {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  align-items: stretch;
}

.profile-settings--embedded .profile-settings-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(34,34,41,.72);
}

.profile-settings--embedded .profile-settings-card--avatar {
  position: static;
  padding: 22px;
  border-right: 1px solid rgba(255,255,255,.08);
}

.profile-settings--embedded .profile-settings-card--security {
  padding: 0 24px 24px;
  background: rgba(38,38,46,.62);
}

.profile-settings--embedded .profile-settings-card__head {
  padding: 22px 0 17px;
}

.profile-settings--embedded .profile-settings-card__head--simple {
  padding-top: 0;
}

.profile-settings--embedded .profile-settings-card h3 {
  font-size: 19px;
}

.profile-settings--embedded .profile-settings-card h4 {
  font-size: 16px;
}

.profile-settings--embedded .profile-settings-card p,
.profile-settings--embedded .profile-security-section__title p {
  font-size: 13px;
  line-height: 1.5;
}

.profile-settings--embedded .profile-avatar-editor__preview-wrap {
  width: 104px;
  height: 104px;
  margin-bottom: 14px;
}

.profile-settings--embedded .profile-avatar-editor__meta strong {
  font-size: 15px;
}

.profile-settings--embedded .profile-avatar-editor__meta span {
  font-size: 12px;
}

.profile-settings--embedded .profile-settings-form--security {
  max-width: none;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-settings--embedded .profile-settings-label,
.profile-settings--embedded .profile-settings-label > span {
  font-size: 13px;
}

.profile-settings--embedded .profile-input-wrap {
  min-height: 46px;
}

.profile-settings--embedded .profile-settings-label input {
  height: 44px !important;
  min-height: 44px !important;
  line-height: 44px !important;
  font-size: 14px !important;
}

.profile-settings--embedded .profile-settings-btn {
  min-height: 43px;
  font-size: 13px !important;
}

.profile-settings-locked--compact {
  margin-top: 0;
}

.profile-social-email {
  margin-top: 9px;
  color: #8f8f98;
  font-size: 12px;
  line-height: 1.4;
}

.profile-social-email span {
  color: #c6c6cc;
}

@media (max-width: 1100px) {
  .profile-settings--embedded .profile-settings__layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .profile-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .profile-dashboard-nav {
    grid-template-columns: 1fr;
  }

  .profile-dashboard-nav__item {
    min-height: 44px;
  }

  .profile-settings--embedded .profile-settings__layout {
    grid-template-columns: 1fr;
  }

  .profile-settings--embedded .profile-settings-card--avatar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .profile-settings--embedded .profile-avatar-editor {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  .profile-section-heading {
    min-height: 0;
    padding: 16px;
    align-items: flex-start;
  }

  .profile-section-heading h2 {
    font-size: 19px;
  }

  .profile-section-heading p {
    font-size: 13px;
  }

  .profile-section-count {
    min-width: 34px;
    height: 34px;
    border-radius: 17px;
    font-size: 15px;
  }

  .profile-section-body {
    padding: 14px 12px 2px;
  }

  .profile-settings--embedded .profile-settings-card--avatar,
  .profile-settings--embedded .profile-settings-card--security {
    padding-left: 16px;
    padding-right: 16px;
  }

  .profile-settings--embedded .profile-settings-notice {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ===== Profile toolbar / logout — unified controls ===== */
.profile-dashboard-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

button.profile-dashboard-nav__item {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}

.profile-dashboard-nav__item--topup {
  color: #ffc607;
  border-color: rgba(239,164,6,.34);
  background: rgba(255,140,0,.065);
}

.profile-dashboard-nav__item--topup:hover {
  color: #ffe178;
  border-color: rgba(239,164,6,.58);
  background: linear-gradient(180deg, rgba(61,52,33,.92), rgba(42,39,34,.94));
}

.profile-logout-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 24px 24px;
  background: rgba(38,38,46,.62);
}

.profile-logout-btn {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 10px 18px;
  border: 1px solid rgba(255,107,107,.24);
  border-radius: 8px;
  color: #ff9a9a;
  background: rgba(255,76,76,.055);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.profile-logout-btn:hover {
  color: #ffc0c0;
  border-color: rgba(255,107,107,.44);
  background: rgba(255,76,76,.10);
  transform: translateY(-1px);
}

@media (max-width: 820px) {
  .profile-dashboard-nav {
    grid-template-columns: 1fr;
  }

  .profile-logout-row {
    padding: 0 16px 16px;
  }

  .profile-logout-btn {
    width: 100%;
  }
}

/* ===== Profile header actions v6 ===== */
@media (min-width: 1101px) {
  .profile-page .noob-profile__main {
    width: 430px;
  }

  .profile-page .noob-profile__info {
    width: 125px;
  }

  .profile-page .noob-profile__info-wrapper {
    align-items: center;
    padding: 0 18px 16px;
    gap: 8px;
  }

  .profile-page .noob-profile__info-right {
    min-width: 0;
    padding-right: 4px;
    text-align: left;
  }

  .profile-page .noob-profile__name {
    width: 100%;
    margin-bottom: 10px;
    padding: 0;
    font-size: 22px;
  }

  .profile-page .noob-profile__balance-val {
    margin-bottom: 13px;
  }
}

.noob-profile__quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  max-width: 290px;
}

.noob-profile__quick-action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid rgba(239,164,6,.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(58,52,40,.76), rgba(40,38,38,.82));
  color: #ffc607;
  box-shadow: inset 0 1px rgba(255,255,255,.035);
  font: inherit;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.noob-profile__quick-action:hover {
  color: #ffe17a;
  border-color: rgba(255,198,7,.7);
  background: linear-gradient(180deg, rgba(74,62,38,.9), rgba(48,43,36,.92));
  box-shadow: inset 0 0 18px rgba(255,151,0,.08), 0 4px 12px rgba(0,0,0,.18);
  transform: translateY(-1px);
}

.noob-profile__quick-action--topup {
  color: #fff4c8;
  border-color: rgba(80,191,100,.55);
  background: linear-gradient(180deg, rgba(55,151,75,.88), rgba(43,123,59,.9));
  text-shadow: 0 1px rgba(0,0,0,.18);
}

.noob-profile__quick-action--topup:hover {
  color: #fff;
  border-color: rgba(97,211,117,.8);
  background: linear-gradient(180deg, rgba(66,177,88,.95), rgba(48,139,66,.95));
}

.noob-profile__quick-action--logout {
  color: #ffaaaa;
  border-color: rgba(255,107,107,.28);
  background: rgba(255,76,76,.055);
}

.noob-profile__quick-action--logout:hover {
  color: #ffc4c4;
  border-color: rgba(255,107,107,.5);
  background: rgba(255,76,76,.1);
}

/* Нижняя навигация кабинета теперь отвечает только за разделы статистики. */
.profile-dashboard-nav {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .noob-profile__info-wrapper {
    align-items: center !important;
  }

  .noob-profile__info-right {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .noob-profile__quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    max-width: none;
  }

  .noob-profile__quick-action {
    min-height: 36px;
    padding: 7px 5px;
    border-radius: 9px;
    font-size: 9.5px;
    letter-spacing: -.1px;
  }

  .profile-dashboard-nav {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 0 3px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow: visible !important;
  }

  .profile-dashboard-nav__item {
    min-width: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 380px) {
  .noob-profile__quick-action {
    min-height: 34px;
    padding-left: 3px;
    padding-right: 3px;
    font-size: 8.7px;
  }
}


/* Mobile-only shortcuts for purchases/wins live inside the profile header. */
.noob-profile__mobile-section-actions {
  display: none;
}

/* ===== FINAL v15: avatar sits BEHIND the wooden profile frame =====
   The uploaded/user photo must be masked by profilebg.png instead of
   covering the decorative wooden rim. Applies to desktop + mobile. */
.profile-frame {
  isolation: isolate;
}

.profile-frame .center-avatar {
  z-index: 1 !important;
}

.profile-frame .frame-overlay {
  z-index: 2;
}

.profile-frame .top-left,
.profile-frame .bottom-left,
.profile-frame .top-right,
.profile-frame .bottom-right {
  z-index: 3;
}

/* Keep the photo itself inside its own layer; the PNG frame above masks
   any part of the rectangular image that extends beyond the centre opening. */
.profile-frame .center-avatar img {
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
}

/* Desktop wood backing v4: same translucent surface as the upper search block. */
@media (min-width: 1101px) {
  body .profile-frame {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0;
    box-shadow: none !important;
    overflow: visible;
  }
  body .profile-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 20px);
    z-index: 0;
    pointer-events: none;
    /* Same paint and backdrop blur as .header__second in app.css. */
    background: rgba(15, 15, 15, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-mask: url(/img/profile-outline.svg?v=3) no-repeat center top / 100% auto;
    mask: url(/img/profile-outline.svg?v=3) no-repeat center top / 100% auto;
    filter: none;
    box-shadow: none;
    opacity: 1;
  }
  body .profile-frame .frame-overlay {
    /* Match the clipping coordinates to the actual background image box. */
    top: 50%;
    height: auto;
    aspect-ratio: 908 / 194;
    transform: translateY(-50%);
    background-size: 100% 100%;
    clip-path: polygon(4.9559% 16.4948%, 7.4890% 5.6701%, 42.0705% 6.7010%, 44.4934% 0.0000%, 54.4053% 0.0000%, 56.6079% 7.2165%, 90.4185% 6.7010%, 92.6211% 15.9794%, 93.0617% 22.1649%, 93.0617% 44.8454%, 92.5110% 73.7113%, 90.1982% 85.0515%, 58.7004% 85.0515%, 57.0485% 94.8454%, 51.5419% 94.8454%, 50.7709% 89.1753%, 43.2819% 98.4536%, 40.7489% 84.5361%, 8.1498% 84.5361%, 6.9383% 80.9278%, 5.5066% 72.1649%, 4.9559% 34.0206%);
    filter: none;
    box-shadow: none;
  }
  body .profile-frame .center-avatar,
  body .profile-frame .center-avatar img {
    box-shadow: none !important;
    filter: none !important;
  }
}

/* Desktop interactions v6: stable hit areas and lightweight motion. */
@media (min-width: 1101px) {
  body .profile-frame :is(.nickname, .btn-purchases, .btn-topup) {
    display: inline-block;
    color: #ebf9ab;
    filter: none;
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center;
    will-change: transform;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
    transition: transform 220ms cubic-bezier(.16, 1, .3, 1), color 140ms ease-out;
  }

  body .profile-frame .profile-frame__settings-link:focus-visible .nickname,
  body .profile-frame .btn-purchases:focus-visible,
  body .profile-frame .btn-topup:focus-visible {
    color: #fff0bb;
    transform: translate3d(0, -1.5px, 0) scale(1.025);
    text-shadow: 0 2px 3px rgba(0, 0, 0, .65), 0 4px 7px rgba(0, 0, 0, .25);
  }
}

@media (min-width: 1101px) and (hover: hover) and (pointer: fine) {
  /* Hover belongs to stationary wrappers, so moving text cannot toggle it. */
  body .profile-frame .profile-frame__settings-link:hover .nickname,
  body .profile-frame .bottom-left:hover .btn-purchases,
  body .profile-frame .bottom-right:hover .btn-topup {
    color: #fff0bb;
    filter: none;
    transform: translate3d(0, -1.5px, 0) scale(1.025);
    text-shadow: 0 2px 3px rgba(0, 0, 0, .65), 0 4px 7px rgba(0, 0, 0, .25);
  }
}

@media (min-width: 1101px) {
  body .profile-frame .profile-frame__settings-link:active .nickname,
  body .profile-frame .btn-purchases:active,
  body .profile-frame .bottom-right:active .btn-topup {
    color: #ffe6a0;
    transform: translate3d(0, 0, 0) scale(.985);
    transition-duration: 80ms;
  }
}

@media (min-width: 1101px) and (prefers-reduced-motion: reduce) {
  body .profile-frame :is(.nickname, .btn-purchases, .btn-topup) {
    transition: none;
    transform: none !important;
    will-change: auto;
  }
}
