.menu-toggle {
  display: none;
  position: relative;
  right: 5px;
  top: 5px;
  appearance: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 3px solid var(--line, #1a1208);
  border-radius: 6px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--line, #1a1208);
  color: var(--line, #1a1208);
  cursor: pointer;
  z-index: 42;
}

.menu-toggle-bars {
  display: grid;
  gap: 5px;
  width: 22px;
}

.menu-toggle-bars span {
  display: block;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 720px) {
  body.is-menu-open {
    overflow: hidden;
  }

  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 13px 22px;
    background: linear-gradient(180deg, var(--bg, #f6c70c) 0%, var(--bg, #f6c70c) 82%, rgba(246, 199, 12, 0) 100%);
  }

  .menu-toggle {
    display: inline-flex !important;
    flex: 0 0 42px;
    margin-left: auto;
  }

  .header > .site-brand {
    min-width: 0;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 41;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 18px;
    padding: 84px 28px 34px;
    background: rgba(246, 199, 12, 0.96);
    border-left: 0;
    font-size: clamp(18px, 5vw, 26px);
    line-height: 1.25;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(16px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }

  body.is-menu-open .nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .nav a,
  .nav .sound-toggle {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    padding: 10px 4px;
  }

  .nav .sep {
    display: none;
  }

  .sound-toggle {
    font-size: inherit;
  }

  .brand-controls,
  .controls-hint,
  .rpg-hint {
    display: none !important;
  }

  .page {
    padding-top: 86px;
  }

  .site-brand-logo {
    max-width: min(58vw, 220px);
  }

  .score {
    right: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle-bars span,
  .nav {
    transition: none;
  }
}
