/**
 * Header único del sitio.
 * Medidas en px lógicos del lienzo 1920×1080.
 */

.site-header {
  position: relative;
}

.sh-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.sh-nav[hidden],
.sh-actions [hidden] {
  display: none !important;
}

.sh-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: 600 20px var(--font-body, inherit);
  text-decoration: none;
  cursor: pointer;
}

.sh-link:hover,
.sh-link:focus-visible {
  border-color: var(--line-strong);
  background: rgba(0, 240, 255, 0.06);
}

.sh-link:focus-visible,
.sh-user:focus-visible,
.sh-menu-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.sh-link[aria-current="page"] {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35) inset;
}

.sh-logout {
  color: var(--text-muted);
}

.sh-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sh-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 22, 44, 0.7);
  color: inherit;
  text-decoration: none;
}

.sh-user-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: 18px;
}

.sh-medal img {
  display: block;
  width: 24px;
  height: 24px;
}

.sh-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sh-skel-avatar {
  background: rgba(123, 92, 255, 0.35);
}

.sh-skel-name {
  width: 140px;
  height: 18px;
  border-radius: 9px;
  background: rgba(0, 240, 255, 0.15);
}

@media (prefers-reduced-motion: no-preference) {
  .sh-skel-avatar,
  .sh-skel-name {
    animation: sh-pulse 1.2s ease-in-out infinite;
  }

  @keyframes sh-pulse {
    50% {
      opacity: 0.45;
    }
  }
}

.sh-menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(8, 6, 24, 0.85);
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.sh-bar {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform 0.2s, opacity 0.2s;
}

.is-menu-open .sh-bar:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg);
}

.is-menu-open .sh-bar:nth-child(2) {
  opacity: 0;
}

.is-menu-open .sh-bar:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg);
}

/* Celu */
.game-shell[data-layout="mobile"] .sh-menu-btn {
  display: flex;
}

.game-shell[data-layout="mobile"] .sh-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  padding: 12px 16px;
  background: rgba(5, 6, 15, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.game-shell[data-layout="mobile"] .site-header.is-menu-open .sh-nav:not([hidden]) {
  display: flex;
}

.game-shell[data-layout="mobile"] .sh-link {
  justify-content: flex-start;
  font-size: 18px;
}

.game-shell[data-layout="mobile"] .sh-user {
  padding: 4px;
}

.game-shell[data-layout="mobile"] .sh-user-name,
.game-shell[data-layout="mobile"] .sh-medal,
.game-shell[data-layout="mobile"] .sh-skel-name {
  display: none;
}

.game-shell[data-layout="mobile"] .sh-actions {
  margin-left: auto;
  gap: 8px;
}

.game-shell[data-layout="mobile"] .sh-create {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 16px;
  white-space: nowrap;
}

/* Una sola fila: la marca cede ancho, el menú no baja. */
.game-shell[data-layout="mobile"] #site-header {
  height: 56px;
  min-height: 56px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  box-sizing: border-box;
}

.game-shell[data-layout="mobile"] #site-header .brand {
  min-width: 0;
  flex: 1 1 auto;
}

.game-shell[data-layout="mobile"] #site-header .brand img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.game-shell[data-layout="mobile"] #site-header .brand-copy {
  min-width: 0;
}

.game-shell[data-layout="mobile"] #site-header .brand-copy strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shell[data-layout="mobile"] #site-header .sh-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.game-shell[data-layout="mobile"] #site-header .sh-create {
  padding: 4px 12px;
  font-size: 15px;
}

.game-shell[data-layout="mobile"] #site-header .sh-music {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.game-shell[data-layout="mobile"] #site-header .sh-menu-btn {
  width: 40px;
  height: 40px;
  padding: 10px;
  flex-shrink: 0;
}

.game-shell[data-layout="mobile"][data-orient="landscape"] #site-header {
  height: 48px;
  min-height: 48px;
  padding: 4px 12px;
}

.sh-music {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.sh-music[aria-pressed="false"] {
  color: var(--cyan);
}

.sh-music svg {
  width: 22px;
  height: 22px;
}

.sh-music:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}