/* Shared identity bar and navigation. The header yields to the mobile dock. */
.apple-style-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-color);
  transition: opacity 180ms ease, transform 180ms ease;
  transform: translateY(0);
}
.apple-style-header.fade-out { opacity: 0; transform: translateY(-20px); }
.apple-style-header.hidden { opacity: 0; transform: translateY(-100%); }
.apple-style-header:not(.hidden):not(.fade-out),
.apple-style-header:focus-within { opacity: 1; transform: translateY(0); }
.apple-style-header:focus-within { display: block; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  min-width: 0;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 24px;
}
.logo-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: .6rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.logo { width: 40px; height: 40px; cursor: pointer; border-radius: var(--radius-sm); }
.logo-wordmark { font-size: 1rem; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; }
.header-inner .universal-search-menu { flex-shrink: 0; }
.header-inner .news-ticker-container { min-width: 0; }
.desktop-tabs { display: flex; align-items: center; gap: 1.5rem; }
.desktop-tabs a,
.mobile-tabs a { color: var(--text-color); text-decoration: none; font-weight: 500; }
.desktop-tabs a:hover,
.mobile-tabs a:hover,
#current-mobile-tab { color: var(--accent-color); }
.mobile-tabs { display: none; width: 100%; text-align: center; padding: .5rem 0; }
.mobile-tabs a { display: inline-block; padding: .5rem 1rem; }
.mobile-dropdown {
  display: none;
  width: 100%;
  margin-top: .5rem;
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.mobile-dropdown a { display: block; padding: 1rem; color: var(--text-color); text-decoration: none; border-bottom: 1px solid var(--border-color); }
.mobile-dropdown a:hover { background: var(--surface-2); }
.nav-menu { position: relative; display: inline-block; z-index: 10000; }
.nav-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .7rem 1.2rem;
  color: var(--text-color);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-button:hover { background: var(--surface-2); }
.nav-button span { transition: transform 160ms ease; }
.nav-menu.active .nav-button span { transform: rotate(180deg); }
.nav-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  min-width: 220px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.nav-menu.active .nav-panel { display: block; }
.nav-panel a { display: flex; padding: .9rem 1.2rem; color: var(--text-color); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border-color); }
.nav-panel a:last-child { border-bottom: none; }
.nav-panel a:hover { background: var(--surface-2); color: var(--accent-color); }
#user-profile,
.user-profile { align-items: center; padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
#user-profile { display: flex; margin-left: 15px; }
.user-profile { display: none; gap: 10px; margin-left: 10px; }
#user-profile:hover { background: var(--surface-3); }
#user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; margin-right: 10px; font-size: .9rem; color: var(--text-color); }
.user-profile #user-email { font-weight: 500; }
.btn-small { padding: 4px 8px; font-size: .8rem; background: var(--surface-1); color: var(--text-color); border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; }
.btn-small:hover { background: var(--surface-3); }
#login-button-container { margin-left: 10px; }
.menu-section a.disabled-link { opacity: .65; color: var(--text-secondary) !important; cursor: pointer; }
.menu-section a.disabled-link:hover { background-color: transparent !important; }
.secret-game-container { position: absolute; bottom: 10px; left: 10px; z-index: 999; opacity: .01; transition: opacity 160ms ease; }
.secret-game-container:hover,
.secret-game-container:focus-within { opacity: .7; }
.secret-game-trigger { width: 40px; height: 40px; background: transparent; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.game-icon { font-size: 20px; }
@media (max-width: 900px) { .logo-wordmark { font-size: .95rem; } }
@media (max-width: 768px) {
  #user-profile { padding: 4px 8px; margin-left: 5px; }
  #user-email, .user-profile #user-email { max-width: 100px; }
  .header-inner { flex-wrap: nowrap; gap: .5rem; }
  .logo { width: auto; margin-right: .25rem; flex-shrink: 0; }
  .universal-search-menu { margin-left: .25rem; }
  .secret-game-container { display: none; }
}
@media (max-width: 600px) {
  .desktop-tabs { display: none; }
  .mobile-tabs { display: block; }
  .nav-menu { position: static; }
  .nav-panel { position: fixed; top: 64px; left: 0; right: 0; width: 100%; max-height: 75vh; overflow-y: auto; z-index: 10001; border-radius: 0 0 var(--radius-md) var(--radius-md); }
  .nav-button { padding: .5rem .8rem; font-size: .9rem; margin-left: auto; }
  .nav-panel a { padding: 1rem 1.5rem; font-size: 1.1rem; }
  .nav-menu.active::before { content: ''; position: fixed; inset: 0; background: rgba(13, 24, 39, .48); z-index: 10000; }
}
