.game-header {
  flex: 0 0 auto;
  padding:
    max(10px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    8px
    max(10px, env(safe-area-inset-left));
  position: relative;
  z-index: 150;
}

.header-inner {
  width: 100%;
  display: grid;
  grid-template-columns: var(--touch) minmax(0, 1fr) var(--touch);
  align-items: center;
  gap: clamp(6px, 2vw, 12px);
}

.header-spacer {
  width: var(--touch);
  height: var(--touch);
}

.header-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-lockup {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 2vw, 10px);
}

.brand-mark {
  width: clamp(32px, 9vw, 46px);
  height: clamp(32px, 9vw, 46px);
  flex: 0 0 auto;
  position: relative;
  display: grid;
  place-items: center;
}

.brand-mark img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
}

.train-mark {
  position: absolute;
  right: -5px;
  bottom: -4px;
  font-size: clamp(1rem, 4vw, 1.35rem);
  line-height: 1;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.main-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: clamp(1.02rem, 5vw, 2rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(42,26,18,.7), 0 0 18px rgba(242,193,78,.22);
}

.subtitle {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: clamp(.58rem, 2.5vw, .72rem);
  font-weight: 800;
  letter-spacing: .08em;
}

.header-stripe {
  width: min(260px, 60vw);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.menu-btn {
  width: var(--touch);
  height: var(--touch);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 1px solid rgba(242,193,78,.32);
  border-radius: 8px;
  background: rgba(246,239,223,.06);
  color: var(--gold);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}

.menu-btn span {
  width: 21px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  transition: transform .22s ease, opacity .22s ease;
}

.menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(.3);
}

.menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (hover: hover) {
  .menu-btn:hover {
    background: rgba(242,193,78,.14);
    border-color: rgba(242,193,78,.54);
  }
}

@media (max-width: 360px) {
  .brand-lockup {
    gap: 5px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .subtitle {
    letter-spacing: .05em;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .game-header {
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: 3px;
  }

  .brand-mark,
  .subtitle,
  .header-stripe {
    display: none;
  }
}
