@import url("./rating-palette.css?v=20260722ratings1");

@layer components {
  .top-nav-actions {
    align-items: center;
    gap: 8px;
  }

  .auth-header {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 52px;
    z-index: 8;
  }

  .auth-header-login,
  .auth-header-loading {
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(19, 25, 34, 0.94);
    color: var(--text, #fff);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  }

  .auth-header-login {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
  }

  .auth-header-login:hover {
    border-color: rgba(102, 192, 244, 0.55);
    background: rgba(25, 32, 43, 0.98);
  }

  .auth-header-account {
    position: relative;
    width: clamp(220px, 16vw, 260px);
    min-width: 220px;
    max-width: 260px;
    height: 52px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 9px;
    padding: 7px 12px 7px 8px;
    border: 1px solid rgba(var(--elo-color-rgb, 255, 255, 255), 0.6);
    border-radius: 14px;
    background: rgba(19, 25, 34, 0.94);
    color: var(--text, #fff);
    box-shadow:
      0 0 0 1px rgba(var(--elo-color-rgb, 255, 255, 255), 0.18),
      0 0 10px rgba(var(--elo-color-rgb, 255, 255, 255), 0.28);
    backdrop-filter: blur(10px);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }

  .auth-header-account:hover {
    border-color: rgba(var(--elo-color-rgb, 255, 255, 255), 0.85);
    background: rgba(25, 32, 43, 0.98);
    box-shadow:
      0 0 0 1px rgba(var(--elo-color-rgb, 255, 255, 255), 0.24),
      0 0 12px rgba(var(--elo-color-rgb, 255, 255, 255), 0.34);
  }

  .auth-header-account:focus-visible {
    outline: 2px solid var(--elo-color, #9ca8b7);
    outline-offset: 2px;
  }

  .auth-header-steam-icon,
  .auth-header-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background: #1b8bc3;
    font-size: 0.78rem;
    font-weight: 900;
    overflow: hidden;
  }

  .auth-header-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .auth-header-login-label {
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .auth-header-account-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: left;
  }

  .auth-header-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--text, #fff);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-header-metrics {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
  }

  .pilot-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    box-sizing: border-box;
    padding: 0 4px;
    border: 0;
    border-radius: 7px;
    font-size: 8.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  .pilot-rating-badge-text {
    display: block;
    transform: translateY(1px);
  }

  .pilot-rating-badge--rank {
    background: #566274;
    color: #fff;
  }

  .pilot-rating-badge--elo {
    background: var(--elo-color, #687486);
    color: var(--elo-text-color, #fff);
  }

  .pilot-rating-badge--sr {
    background: var(--sr-color, #687486);
    color: var(--sr-text-color, #fff);
  }

  .pilot-rating-badge--number {
    background: #f4b740;
    color: #1b1405;
  }

  .auth-header-caret {
    justify-self: end;
    width: 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    transition: transform 160ms ease;
  }

  .auth-header-account[aria-expanded="true"] .auth-header-caret {
    transform: rotate(180deg);
  }

  .auth-header-invitation-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    box-sizing: border-box;
    padding: 0 5px;
    gap: 2px;
    border: 2px solid #131922;
    border-radius: 999px;
    background: #ff5b2e;
    color: #fff;
    box-shadow: 0 3px 12px rgba(255, 91, 46, 0.5);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
  }

  .auth-header-invitation-icon {
    font-size: 11px;
    line-height: 1;
  }

  .auth-header-invitation-count {
    min-width: 6px;
    text-align: center;
  }

  .auth-header-loading {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted, #9ca8b7);
    font-size: 0.72rem;
  }

  .auth-header-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    width: 100%;
    min-width: 220px;
    box-sizing: border-box;
    padding: 7px;
    border: 1px solid rgba(var(--elo-color-rgb, 255, 255, 255), 0.28);
    border-radius: 14px;
    background: rgba(10, 16, 24, 0.98);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(14px);
  }

  .auth-header-menu[hidden] {
    display: none !important;
  }

  .auth-header-menu-item,
  .auth-header-unlinked {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    color: var(--text, #fff);
    background: transparent;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 750;
    text-align: left;
    text-decoration: none;
  }

  .auth-header-discord {
    margin: 4px 0;
    padding: 7px 0 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .auth-header-discord-heading,
  .auth-header-discord-status {
    padding: 3px 11px;
  }

  .auth-header-discord-heading {
    color: #b9a7ff;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .auth-header-discord-status {
    color: var(--muted, #9ca8b7);
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1.35;
  }

  .auth-header-discord-status--synced {
    color: #72e6a5;
  }

  .auth-header-discord-status--error {
    color: #ffd166;
  }

  .auth-header-discord-status--unlink_pending {
    color: #ffcfbf;
  }

  .auth-header-discord-link {
    color: #c9beff;
  }

  .auth-header-discord-sync {
    color: #72e6a5;
  }

  .auth-header-discord-unlink {
    color: #ffcfbf;
  }

  .auth-header-menu-item:disabled {
    cursor: wait;
    opacity: 0.55;
  }

  .auth-header-menu-item {
    cursor: pointer;
  }

  .auth-header-menu-item:hover,
  .auth-header-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.07);
  }

  .auth-header-unlinked {
    color: var(--muted, #9ca8b7);
    line-height: 1.35;
  }

  .auth-header-logout {
    color: #ff9e87;
  }

  .auth-header-retry {
    color: #ffd166;
  }

  @media (min-width: 721px) and (max-width: 1180px) {
    .auth-header-account { width:clamp(190px,19vw,210px); min-width:190px; max-width:210px; height:70px; }
    .auth-header-name { font-size:11px; }
    .auth-header-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .auth-header-metric { width:100%; }
    .auth-header-menu { min-width:190px; }
  }

  @media (max-width: 720px) {
    .auth-header-account {
      width: auto;
      min-width: 68px;
      grid-template-columns: 34px 14px;
      gap: 5px;
      padding: 6px 8px;
    }

    .auth-header-account-copy {
      display: none;
    }

    .auth-header-avatar {
      width: 32px;
      height: 32px;
    }

    .auth-header-menu {
      width: min(220px, calc(100vw - 20px));
      min-width: 0;
    }
  }

  @media (max-width: 520px) {
    .top-nav-actions {
      gap: 4px;
    }

    .auth-header-login {
      min-height: 34px;
      padding: 3px 7px;
    }

    .auth-header-login-label {
      display: none;
    }

    .auth-header-steam-icon {
      width: 28px;
      height: 28px;
    }

    .auth-header-account {
      min-width: 44px;
      height: 44px;
      grid-template-columns: 32px;
      padding: 5px;
    }

    .auth-header-caret {
      display: none;
    }

    .auth-header-loading {
      width: 34px;
      min-height: 34px;
      padding: 0;
      overflow: hidden;
      color: transparent;
    }

    .auth-header-loading::after {
      content: "…";
      width: 100%;
      color: var(--muted, #9ca8b7);
      text-align: center;
    }
  }
}
