/* identity-bar.css — Site-wide soft-signin pill in the top-right.
 * Uses the Gorton Solutions site palette (navy + cyan/violet, beveled corners).
 * On game pages, games-nav provides an identity host so the pill becomes part
 * of the top game bar instead of covering controls. */

.gs-identity-bar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(17, 26, 51, 0.92);
  color: #eaf0ff;
  border: 1px solid rgba(78, 163, 255, 0.35);
  font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(78, 163, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Beveled corners matching the rest of the site */
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px,
                     100% calc(100% - 8px), calc(100% - 8px) 100%,
                     8px 100%, 0 calc(100% - 8px), 0 8px);
  transition: opacity 200ms ease, transform 200ms ease;
  max-width: calc(100vw - 24px);
}

.gs-identity-bar[hidden] { display: none !important; }

.gs-identity-bar.is-collapsed {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.gs-identity-bar__msg {
  color: #a9b6dd;
  margin-right: 4px;
}

/* Stacked layout used by the signed-out memory warning + actions. */
.gs-identity-bar[data-state="signed-out"] {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  max-width: 380px;
}
.gs-identity-bar__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-identity-bar__col .gs-identity-bar__msg {
  font: 500 12px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: #cdd5f0;
  margin: 0;
}
.gs-identity-bar__col .gs-identity-bar__msg strong { color: #eaf0ff; }
.gs-identity-bar__col .gs-identity-bar__msg a {
  color: #4ea3ff;
  text-decoration: none;
}
.gs-identity-bar__col .gs-identity-bar__msg a:hover { text-decoration: underline; }
.gs-identity-bar__row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gs-identity-bar__row .gs-identity-bar__btn {
  flex: 1 1 auto;
  justify-content: center;
  font-size: 11px;
  padding: 7px 10px;
}

.gs-identity-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(78, 163, 255, 0.12);
  color: #eaf0ff;
  border: 1px solid rgba(78, 163, 255, 0.4);
  font: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px,
                     100% calc(100% - 6px), calc(100% - 6px) 100%,
                     6px 100%, 0 calc(100% - 6px), 0 6px);
  transition: background 120ms ease, box-shadow 120ms ease;
}
.gs-identity-bar__btn:hover {
  background: rgba(78, 163, 255, 0.22);
  box-shadow: 0 0 16px rgba(78, 163, 255, 0.35);
}
.gs-identity-bar__btn--primary {
  background: linear-gradient(135deg, rgba(78, 163, 255, 0.28), rgba(124, 92, 255, 0.28));
  border-color: rgba(124, 92, 255, 0.5);
}
.gs-identity-bar__btn--primary:hover {
  background: linear-gradient(135deg, rgba(78, 163, 255, 0.45), rgba(124, 92, 255, 0.45));
}
.gs-identity-bar__btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #a9b6dd;
}
.gs-identity-bar__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #eaf0ff;
}

.gs-identity-bar__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  background: rgba(78, 163, 255, 0.12);
  border: 1px solid rgba(78, 163, 255, 0.4);
  color: #eaf0ff;
  font: inherit;
  letter-spacing: 0.04em;
  text-transform: none;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px,
                     100% calc(100% - 6px), calc(100% - 6px) 100%,
                     6px 100%, 0 calc(100% - 6px), 0 6px);
}
.gs-identity-bar__pill:hover { background: rgba(78, 163, 255, 0.22); }

.gs-identity-bar__avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ea3ff, #7c5cff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0b1020;
  font-size: 12px;
  overflow: hidden;
}
.gs-identity-bar__avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.gs-identity-bar__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #111a33;
  border: 1px solid rgba(78, 163, 255, 0.3);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px,
                     100% calc(100% - 6px), calc(100% - 6px) 100%,
                     6px 100%, 0 calc(100% - 6px), 0 6px);
}
.gs-identity-bar.is-open .gs-identity-bar__menu { display: flex; }

.gs-identity-bar__menu button,
.gs-identity-bar__menu a {
  background: transparent;
  border: none;
  color: #eaf0ff;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gs-identity-bar__menu button:hover,
.gs-identity-bar__menu a:hover {
  background: rgba(78, 163, 255, 0.14);
  color: #4ea3ff;
}

.gs-fixed-site-header body {
  padding-top: var(--gs-site-header-h, 72px);
}

@keyframes gsPageSlideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100vw); opacity: 0; }
}

.gs-fixed-site-header body.page-exit {
  animation: none !important;
  overflow-x: hidden;
}

.gs-fixed-site-header body.page-exit > header:not(.gs-gnav) {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.gs-fixed-site-header body.page-exit .page-slide-in {
  animation: gsPageSlideOutLeft .38s cubic-bezier(.55,0,1,.45) both !important;
}

@media (prefers-reduced-motion: reduce) {
  .gs-fixed-site-header body.page-exit .page-slide-in {
    animation: none !important;
  }
}

.gs-fixed-site-header body > header:not(.gs-gnav) {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: rgba(11, 16, 32, 0.88);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.12));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.gs-fixed-site-header[data-theme="light"] body > header:not(.gs-gnav) {
  background: rgba(238, 242, 255, 0.92);
}

.gs-fixed-site-header body > header:not(.gs-gnav) .nav {
  width: 100%;
  max-width: 1120px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: 0 1 auto;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .brand small {
  display: block;
  color: var(--muted, #a9b6dd);
  font-size: 12px;
  white-space: nowrap;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .links {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .links > a {
  white-space: nowrap;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .links > a[aria-current="page"] {
  color: var(--text, #eaf0ff);
  border-color: var(--border, rgba(255,255,255,.12));
  background: rgba(255,255,255,.04);
}

.gs-fixed-site-header body > header:not(.gs-gnav) .links > .theme-switcher {
  display: none;
}

.gs-fixed-site-header body > header:not(.gs-gnav) .links > a[href="consult.html"],
.gs-fixed-site-header body > header:not(.gs-gnav) .links > a[href="mods.html"],
.gs-fixed-site-header body > header:not(.gs-gnav) .links > a[href="partners.html"],
.gs-fixed-site-header body > header:not(.gs-gnav) .links > a[href="about.html"] {
  display: none;
}

.gs-site-controls {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin-left: 8px;
  flex: 0 0 auto;
}

.gs-site-controls .theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transform: scale(0.9);
  transform-origin: right center;
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px,
                     100% calc(100% - 5px), calc(100% - 5px) 100%,
                     5px 100%, 0 calc(100% - 5px), 0 5px);
}

.gs-site-controls .theme-switcher button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
  min-width: 28px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  color: var(--muted, #a9b6dd);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px,
                     100% calc(100% - 4px), calc(100% - 4px) 100%,
                     4px 100%, 0 calc(100% - 4px), 0 4px);
}

.gs-site-controls .theme-switcher button:hover,
.gs-site-controls .theme-switcher button:focus-visible {
  color: var(--text, #eaf0ff);
  background: rgba(78, 163, 255, 0.12);
  border-color: rgba(78, 163, 255, 0.36);
  outline: none;
}

.gs-site-controls .theme-switcher button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(78, 163, 255, 0.52), rgba(124, 92, 255, 0.48));
  border-color: rgba(140, 205, 255, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.theme-switcher .gs-theme-icon {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gs-fixed-site-header[data-theme="light"] .gs-site-controls .theme-switcher {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.12);
}

.gs-fixed-site-header[data-theme="light"] .gs-site-controls .theme-switcher button {
  color: #4a5a88;
}

.gs-fixed-site-header[data-theme="light"] .gs-site-controls .theme-switcher button:hover,
.gs-fixed-site-header[data-theme="light"] .gs-site-controls .theme-switcher button:focus-visible {
  color: #0b1020;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
}

.gs-fixed-site-header[data-theme="light"] .gs-site-controls .theme-switcher button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.86), rgba(79, 70, 229, 0.82));
  border-color: rgba(37, 99, 235, 0.35);
}

.gs-fixed-site-header body > header:not(.gs-gnav) .menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--text, #eaf0ff);
  cursor: pointer;
  flex-shrink: 0;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}

.gs-fixed-site-header body > header:not(.gs-gnav) .menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text, #eaf0ff);
  transition: transform .2s, opacity .2s;
}

.sidebar-active .gs-fixed-site-header body > header:not(.gs-gnav) .menu-toggle span:nth-child(1),
.gs-fixed-site-header.sidebar-active body > header:not(.gs-gnav) .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar-active .gs-fixed-site-header body > header:not(.gs-gnav) .menu-toggle span:nth-child(2),
.gs-fixed-site-header.sidebar-active body > header:not(.gs-gnav) .menu-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.sidebar-active .gs-fixed-site-header body > header:not(.gs-gnav) .menu-toggle span:nth-child(3),
.gs-fixed-site-header.sidebar-active body > header:not(.gs-gnav) .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.gs-fixed-site-header body > .sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 8990;
}

.gs-fixed-site-header.sidebar-active body > .sidebar-overlay {
  display: block;
}

.gs-fixed-site-header body > .sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 85vw);
  height: 100dvh;
  background: rgba(11,16,32,.97);
  border-left: 1px solid var(--border, rgba(255,255,255,.12));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  z-index: 9010;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.gs-fixed-site-header[data-theme="light"] body > .sidebar {
  background: rgba(238,242,255,.99);
}

.gs-fixed-site-header.sidebar-active body > .sidebar {
  transform: translateX(0) !important;
}

.gs-fixed-site-header.sidebar-active .sidebar {
  transform: translateX(0) !important;
}

.gs-fixed-site-header body > .sidebar .sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.12));
}

.gs-fixed-site-header body > .sidebar .sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--text, #eaf0ff);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.gs-fixed-site-header body > .sidebar .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  overflow-y: auto;
  flex: 1;
}

.gs-fixed-site-header body > .sidebar .sidebar-nav a {
  display: block;
  text-decoration: none;
  color: var(--muted, #a9b6dd);
  padding: 12px 14px;
  border: 1px solid transparent;
  font-size: 15px;
  transition: color .15s, border-color .15s, background .15s;
}

.gs-fixed-site-header body > .sidebar .sidebar-nav a:hover,
.gs-fixed-site-header body > .sidebar .sidebar-nav a[aria-current="page"] {
  color: var(--text, #eaf0ff);
  border-color: var(--border, rgba(255,255,255,.12));
  background: rgba(255,255,255,.04);
}

.gs-fixed-site-header body > .sidebar .sidebar-nav .btn.primary {
  margin-top: 6px;
  justify-content: center;
}

.gs-fixed-site-header body > .sidebar .sidebar-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,.12));
  flex-shrink: 0;
}

.gs-fixed-site-header body > .sidebar .sidebar-theme-label {
  font-size: 11px;
  color: var(--muted, #a9b6dd);
  letter-spacing: .03em;
}

.gs-site-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: 0;
  flex: 0 0 auto;
}

.gs-site-identity .gs-identity-bar {
  position: relative;
  inset: auto;
  z-index: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(360px, 34vw);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  clip-path: none;
}

.gs-site-identity .gs-identity-bar[data-state="signed-out"] {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  max-width: min(360px, 34vw);
}

.gs-site-identity .gs-identity-bar__col {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.gs-site-identity .gs-identity-bar__col .gs-identity-bar__msg {
  display: none;
}

.gs-site-identity .gs-identity-bar__row {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px;
}

.gs-site-identity .gs-identity-bar__row .gs-identity-bar__btn,
.gs-site-identity .gs-identity-bar__btn,
.gs-site-identity .gs-identity-bar__pill {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}

.gs-site-identity .gs-identity-bar__btn[data-action="allow"] {
  display: none;
}

.gs-site-identity .gs-identity-bar__menu {
  top: calc(100% + 8px);
  right: 0;
  z-index: 9100;
}

.gs-gnav .gs-identity-bar {
  position: relative;
  inset: auto;
  z-index: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(390px, 42vw);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  clip-path: none;
}

.gs-gnav .gs-identity-bar[data-state="signed-out"] {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  max-width: min(390px, 42vw);
}

.gs-gnav .gs-identity-bar__col {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.gs-gnav .gs-identity-bar__col .gs-identity-bar__msg {
  display: none;
}

.gs-gnav .gs-identity-bar__row {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px;
}

.gs-gnav .gs-identity-bar__row .gs-identity-bar__btn,
.gs-gnav .gs-identity-bar__btn,
.gs-gnav .gs-identity-bar__pill {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 10px;
}

.gs-gnav .gs-identity-bar__btn[data-action="allow"] {
  display: none;
}

.gs-gnav .gs-identity-bar__menu {
  top: calc(100% + 8px);
}

.gs-gnav-identity {
  min-width: 0;
  display: flex;
  align-items: center;
}

@media (max-width: 600px) {
  .gs-fixed-site-header body {
    padding-top: var(--gs-site-header-h, 64px);
  }

  .gs-site-identity {
    margin-left: auto;
  }

  .gs-site-controls {
    margin-left: auto;
    gap: 3px;
  }

  .gs-site-controls .theme-switcher {
    transform: scale(0.82);
  }

  .gs-site-identity .gs-identity-bar {
    max-width: none;
  }

  .gs-site-identity .gs-identity-bar[data-state="signed-out"] {
    max-width: none;
  }

  .gs-site-identity .gs-identity-bar__row .gs-identity-bar__btn,
  .gs-site-identity .gs-identity-bar__btn,
  .gs-site-identity .gs-identity-bar__pill {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .gs-site-identity .gs-identity-bar__btn--ghost {
    display: none;
  }

  .gs-identity-bar {
    top: 8px;
    right: 8px;
    padding: 6px 8px;
    font-size: 12px;
  }
  .gs-identity-bar[data-state="signed-out"] {
    left: 8px;       /* span full width on small screens so message stays readable */
    right: 8px;
    max-width: none;
  }
  .gs-identity-bar[data-state="signed-in"] .gs-identity-bar__msg { display: none; }
}

@media (max-width: 900px) {
  .gs-fixed-site-header body > header:not(.gs-gnav) .nav {
    min-height: 72px;
  }

  .gs-fixed-site-header body > header:not(.gs-gnav) .links {
    display: none;
  }

  .gs-fixed-site-header body > header:not(.gs-gnav) .menu-toggle {
    display: flex;
  }
}

@media (max-width: 520px) {
  .gs-fixed-site-header body > header:not(.gs-gnav) .brand small {
    display: none;
  }
}

@media (max-width: 860px) {
  .gs-gnav .gs-identity-bar__col .gs-identity-bar__msg { display: none; }
  .gs-gnav .gs-identity-bar { max-width: none; }
}

@media (max-width: 520px) {
  .gs-gnav .gs-identity-bar__btn--ghost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gs-identity-bar { transition: none; }
}
