.game-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2.5vw, 42px);
}
.game-nav .sessionbar { gap: clamp(10px, 2vw, 32px); padding: 0 }
.mast .wordmark { width: clamp(148px, 20vw, 282px) }
.mast .utility { white-space: nowrap }
#game-menu-toggle, .mast .menu-label { display: none }

#game-menu {
  width: min(380px, calc(100% - 20px));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #aa75ae; border-radius: 18px; color: var(--cream);
  background: linear-gradient(125deg, #40204c, #241331 64%, #24203b);
  box-shadow: 0 18px 64px #100719bd;
}
#game-menu::backdrop { background: #10051dc4; backdrop-filter: blur(4px) }
body:has(#game-menu[open]) { overflow: hidden }
.menu-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 15px 8px; background: var(--pride) top / 100% 3px no-repeat;
}
.menu-heading .wordmark { width: min(66%, 218px) }
#close-game-menu {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: #422349; color: var(--cream); border: 1px solid #a876a9;
  font-size: 27px; line-height: 1;
}
#game-menu .game-nav { display: grid; gap: 14px; padding: 2px 15px 17px }
#game-menu .sessionbar { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 12px }
#game-menu .wallet { justify-content: flex-start; font-size: 14px }
#game-menu .wallet .tips-unit { display: inline }
#game-menu .switch { display: grid; grid-template-columns: 1fr 1fr; padding: 2px }
#game-menu .switch button { padding-inline: 4px; font-size: 14px }
#game-menu .mast-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px }
.utility.league-link { padding-inline: 11px; gap: 5px; color: var(--gold); border-color: #9d7294 }
#game-menu .utility { width: auto; height: auto; min-height: 63px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; font-size: 13px }
#game-menu .utility span { display: inline }
.wallet-link {
  border: 1px solid transparent; border-radius: 9px; padding: 4px; min-height: 44px;
  background: transparent; color: var(--gold); font-family: inherit;
}
.wallet-link:hover { border-color: #a376b1; background: #402348 }
.duel-reward { min-height: 44px; margin-top: 6px; grid-column: 1/-1; grid-row: 4 }
.duel-reward[hidden] { display: none }
#game-menu .wallet-link { border-color: #85508a; padding: 7px 10px }
.wallet-destination { display: none }
#game-menu .wallet-destination { display: inline; margin-left: auto; color: var(--cream); font-weight: 700 }

@media (min-width: 741px) and (max-width: 1000px) {
  .mast .game-nav { gap: 10px }
  .mast .sessionbar { gap: 8px }
  .mast .switch button { padding-inline: 9px; font-size: 13px }
  .mast .mast-actions { gap: 4px }
  .mast .utility.outfit { padding: 0; width: 44px }
  .mast .utility.outfit span { display: none }
  .mast .utility.league-link { padding: 0; width: 44px }
  .mast .utility.league-link span { display: none }
}
@media (max-width: 740px), (min-width: 741px) and (max-width: 900px) and (orientation: portrait), (orientation: landscape) and (min-width: 520px) and (max-height: 540px) {
  .mast, .mast-inner { display: contents }
  .mast .game-nav { display: none }
  /* Keep the document title available while the original controls are in the drawer. */
  .mast h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
  #game-menu-toggle {
    display: grid; place-items: center; align-self: stretch; justify-self: stretch;
    min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line);
    color: #ffd6f2; background: linear-gradient(140deg, #593063, #311e43);
  }
  #game-menu-toggle svg { width: 21px; height: 21px; stroke-width: 2.3 }
}

.house-policies, .menu-privacy { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px }
.house-policies { padding: 2px var(--gutter) 18px; justify-content: center }
.house-policies a, .house-policies button, .menu-privacy button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; border: 0;
  background: transparent; color: var(--muted); font: inherit; font-size: .875rem;
  text-decoration: underline; text-underline-offset: .22em;
}
.menu-privacy { padding: 0 17px 6px; border-top: 1px solid var(--line) }
.menu-privacy a { display: inline-flex; min-height: 44px; align-items:center; color: var(--muted); font-size:.875rem; text-underline-offset:.22em }

/* The lane animates behind open sheets. A solid scrim avoids a live blur pass on touch screens. */
@media (hover: none) and (pointer: coarse) {
  body #game-menu::backdrop, body .club-dialog::backdrop, body .league-dialog::backdrop, body .reward-dialog::backdrop {
    backdrop-filter: none; background: #170b22eb;
  }
}
