/* Final desktop menu contract. Keep this file last so historical menu CSS cannot add layers. */
@media (min-width: 900px) and (orientation: landscape) {
  html,
  body,
  body:not(.game-active) main.start-menu {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
  }

  body:not(.game-active) main.start-menu {
    min-height: 640px !important;
    padding: clamp(14px, 1.25vw, 24px) !important;
    overflow: hidden !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .start-menu-stage {
    position: relative !important;
    display: block !important;
    width: min(100%, 1720px) !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .start-menu-stage::before,
  html body:not(.game-active) #startMenu.start-menu .start-menu-stage::after {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  body:not(.game-active) main.start-menu .brand-showcase {
    position: absolute !important;
    inset: clamp(16px, 2vh, 30px) auto clamp(16px, 2vh, 30px) clamp(16px, 2vw, 36px) !important;
    display: block !important;
    width: min(52%, 860px) !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    transform: none !important;
    pointer-events: none !important;
  }

  body:not(.game-active) main.start-menu .brand-showcase > img {
    content: url("./assets/desktop-menu/logo-browser.png?v=transparent-v2") !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  body:not(.game-active) main.start-menu .brand-showcase > p,
  body:not(.game-active) main.start-menu .start-heading,
  body:not(.game-active) main.start-menu .home-player-section,
  body:not(.game-active) main.start-menu .menu-error {
    display: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .start-menu-panel {
    position: absolute !important;
    inset: clamp(16px, 2vh, 30px) clamp(16px, 2vw, 36px) clamp(16px, 2vh, 30px) auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows:
      minmax(150px, 1.08fr)
      minmax(150px, 1fr)
      minmax(104px, 0.7fr)
      minmax(188px, 1.25fr)
      clamp(62px, 8vh, 78px) !important;
    grid-template-areas:
      "variant"
      "level"
      "options"
      "competition"
      "start" !important;
    gap: clamp(10px, 1.25vh, 16px) !important;
    width: min(43%, 700px) !important;
    min-width: 500px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  body:not(.game-active) main.start-menu .start-menu-panel > .variant-group { grid-area: variant !important; }
  body:not(.game-active) main.start-menu .start-menu-panel > .level-group { grid-area: level !important; }
  body:not(.game-active) main.start-menu .start-menu-panel > .home-options-section { grid-area: options !important; }
  body:not(.game-active) main.start-menu .start-menu-panel > .competition-entry { grid-area: competition !important; }
  body:not(.game-active) main.start-menu .start-menu-panel > #startGameButton { grid-area: start !important; }

  /* Keep the three main section names visible above their controls. */
  html body:not(.game-active) #startMenu.start-menu .variant-group > legend,
  html body:not(.game-active) #startMenu.start-menu .level-group > legend,
  html body:not(.game-active) #startMenu.start-menu .competition-entry > .competition-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 4 !important;
    width: auto !important;
    margin: 0 auto !important;
    padding: 0 14px !important;
    color: #dcae49 !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(15px, 1.2vw, 19px) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-group .menu-choice {
    display: grid !important;
    grid-template-rows: clamp(50px, 4.2vw, 66px) auto !important;
    place-items: center !important;
    align-content: center !important;
    gap: 5px !important;
    min-width: 0 !important;
    padding: 10px 8px !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-group .menu-choice::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-choice-icon {
    display: block !important;
    width: clamp(50px, 4.2vw, 66px) !important;
    height: clamp(50px, 4.2vw, 66px) !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    background-repeat: no-repeat !important;
    background-position: center top !important;
    background-size: 100% auto !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-choice-icon-beginner {
    background-image: url("./assets/level-beginner-landscape.png?v=2") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-choice-icon-normal {
    background-image: url("./assets/level-normal-landscape.png?v=2") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-choice-icon-expert {
    background-image: url("./assets/level-expert-landscape.png?v=2") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .level-group .menu-choice > span:last-child {
    display: block !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  /* One icon source per control: retain the real HTML icon and disable legacy CSS layers. */
  body:not(.game-active) main.start-menu .variant-group .menu-choice::before,
  body:not(.game-active) main.start-menu .level-group .menu-choice::before,
  body:not(.game-active) main.start-menu .home-action-card::before,
  body:not(.game-active) main.start-menu .home-action-card::after,
  body:not(.game-active) main.start-menu .premium-action::before,
  body:not(.game-active) main.start-menu .premium-action::after,
  body:not(.game-active) main.start-menu .premium-action-icon::before,
  body:not(.game-active) main.start-menu .premium-action-icon::after,
  body:not(.game-active) main.start-menu .premium-action-text::before,
  body:not(.game-active) main.start-menu .premium-action-text::after,
  body:not(.game-active) main.start-menu .home-action-card span:last-child::before,
  body:not(.game-active) main.start-menu .home-action-card span:last-child::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-icon {
    background: none !important;
    box-shadow: none !important;
  }

  body:not(.game-active) main.start-menu .home-action-icon > svg,
  body:not(.game-active) main.start-menu .premium-action-icon > svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body:not(.game-active) #startMenu.start-menu #startGameButton {
    position: relative !important;
    place-self: stretch !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 clamp(18px, 2vw, 32px) !important;
    font-size: clamp(24px, 2vw, 34px) !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    transform: none !important;
    overflow: hidden !important;
  }

  html body:not(.game-active) #startMenu.start-menu #startGameButton::after {
    content: none !important;
    display: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu #startGameButton::before {
    width: clamp(30px, 2.5vw, 44px) !important;
    height: clamp(30px, 2.5vw, 44px) !important;
    background-size: contain !important;
  }

  /* Remove every historical generated icon; the inline SVG is the sole icon source. */
  html body:not(.game-active) #startMenu.start-menu .home-action-card::before,
  html body:not(.game-active) #startMenu.start-menu .home-action-card::after,
  html body:not(.game-active) #startMenu.start-menu .home-action-icon::before,
  html body:not(.game-active) #startMenu.start-menu .home-action-icon::after,
  html body:not(.game-active) #startMenu.start-menu .premium-action::before,
  html body:not(.game-active) #startMenu.start-menu .premium-action::after,
  html body:not(.game-active) #startMenu.start-menu .premium-action-icon::before,
  html body:not(.game-active) #startMenu.start-menu .premium-action-icon::after,
  html body:not(.game-active) #startMenu.start-menu .premium-action-text::before,
  html body:not(.game-active) #startMenu.start-menu .premium-action-text::after,
  html body:not(.game-active) #startMenu.start-menu .home-action-card > span:last-child::before,
  html body:not(.game-active) #startMenu.start-menu .home-action-card > span:last-child::after,
  html body:not(.game-active) #startMenu.start-menu .home-action-card strong::before,
  html body:not(.game-active) #startMenu.start-menu .home-action-card strong::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action-icon {
    display: grid !important;
    place-items: center !important;
    background: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action-icon > svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-card strong,
  html body:not(.game-active) #startMenu.start-menu .premium-action-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #f4e4b7 !important;
    font-size: clamp(13px, 1.15vw, 16px) !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: normal !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-card small {
    display: none !important;
  }

  /* Supplied premium menu artwork. Show the round symbol and keep live HTML labels. */
  html body:not(.game-active) #startMenu.start-menu .home-action-icon,
  html body:not(.game-active) #startMenu.start-menu .premium-action-icon {
    width: clamp(48px, 4vw, 62px) !important;
    height: clamp(48px, 4vw, 62px) !important;
    flex: 0 0 auto !important;
    overflow: hidden !important;
    background-repeat: no-repeat !important;
    background-position: center top !important;
    background-size: 100% auto !important;
    border-radius: 50% !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-card:nth-child(1) .home-action-icon {
    background-image: url("./assets/desktop-menu/icon_regels.png?v=1") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-card:nth-child(2) .home-action-icon {
    background-image: url("./assets/desktop-menu/icon_demo.png?v=1") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-card:nth-child(3) .home-action-icon {
    background-image: url("./assets/desktop-menu/icon_setup.png?v=1") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action:nth-child(1) .premium-action-icon {
    background-image: url("./assets/desktop-menu/icon_online.png?v=1") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action:nth-child(2) .premium-action-icon {
    background-image: url("./assets/desktop-menu/icon_dagspel.png?v=1") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action:nth-child(3) .premium-action-icon {
    background-image: url("./assets/desktop-menu/icon_standen.png?v=1") !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: clamp(48px, 4vw, 62px) auto !important;
    align-content: center !important;
    justify-items: center !important;
    gap: 5px !important;
    padding: 8px 6px !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  html body:not(.game-active) #startMenu.start-menu .premium-action-text {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: start !important;
    width: 100% !important;
    min-height: 17px !important;
    margin: 0 !important;
    text-align: center !important;
  }

  html body:not(.game-active) #startMenu.start-menu .home-action-icon > svg,
  html body:not(.game-active) #startMenu.start-menu .premium-action-icon > svg {
    display: none !important;
  }

  html body:not(.game-active) #startMenu.start-menu #startGameButton {
    color: #201406 !important;
    text-shadow: 0 1px 0 rgba(255, 231, 149, 0.45) !important;
  }
}

/* Final menu typography: readable labels in every orientation. */
html body:not(.game-active) #startMenu,
html body:not(.game-active) #startMenu button,
html body:not(.game-active) #startMenu input,
html body:not(.game-active) #startMenu legend,
html body:not(.game-active) #startMenu h1,
html body:not(.game-active) #startMenu h2,
html body:not(.game-active) #startMenu strong,
html body:not(.game-active) #startMenu small {
  font-family: Arial, Helvetica, sans-serif !important;
}

html body:not(.game-active) #startMenu .variant-group > legend,
html body:not(.game-active) #startMenu .level-group > legend {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #e0b75b !important;
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

html body:not(.game-active) #startMenu.start-menu .variant-group > legend,
html body:not(.game-active) #startMenu.start-menu .level-group > legend {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* One real heading per mobile menu container; suppress legacy generated copies. */
html body:not(.game-active) #startMenu.start-menu .variant-group::before,
html body:not(.game-active) #startMenu.start-menu .variant-group::after,
html body:not(.game-active) #startMenu.start-menu .level-group::before,
html body:not(.game-active) #startMenu.start-menu .level-group::after,
html body:not(.game-active) #startMenu.start-menu .home-options-section::before,
html body:not(.game-active) #startMenu.start-menu .home-options-section::after,
html body:not(.game-active) #startMenu.start-menu .variant-group > legend::before,
html body:not(.game-active) #startMenu.start-menu .variant-group > legend::after,
html body:not(.game-active) #startMenu.start-menu .level-group > legend::before,
html body:not(.game-active) #startMenu.start-menu .level-group > legend::after,
html body:not(.game-active) #startMenu.start-menu .home-options-section > h2::before,
html body:not(.game-active) #startMenu.start-menu .home-options-section > h2::after {
  content: none !important;
  display: none !important;
}

html body:not(.game-active) #startMenu.start-menu .variant-group,
html body:not(.game-active) #startMenu.start-menu .level-group,
html body:not(.game-active) #startMenu.start-menu .home-options-section {
  position: relative !important;
}

html body:not(.game-active) #startMenu.start-menu .variant-group > legend,
html body:not(.game-active) #startMenu.start-menu .level-group > legend,
html body:not(.game-active) #startMenu.start-menu .home-options-section > h2 {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10 !important;
  color: #e0b75b !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  white-space: nowrap !important;
}
