@media screen and (pointer: coarse) and (orientation: portrait) {
  #main-menu,
  #stage,
  canvas,
  .menu-shield,
  .menu-content,
  .menu-main,
  .menu-help,
  #sound-btn,
  #mobile-controls {
    display: none !important;
  }

  #portrait-mode {
    display: flex !important;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 28px;
    color: white;
    padding: 40px;
  }
}

@media screen and (orientation: landscape) and (max-width: 1200px) {
  .main-menu {
    padding-top: 12px;
  }

  .menu-shield {
    max-width: 1000px;
  }

  .menu-content {
    inset: 28% 10% 16% 10%;
    gap: 32px;
  }

  .menu-main-title {
    font-size: 48px;
  }

  .button-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }

  .button-container .game-btn {
    font-size: 18px;
    padding: 10px 22px;
    min-width: 170px;
  }
}

@media screen and (orientation: landscape) and (max-width: 920px) {
  #title {
    padding-bottom: 5px;
  }

  .menu-shield {
    max-width: 900px;
  }

  .menu-help,
  .menu-settings,
  .menu-story {
    width: min(100%, 460px);
    padding: 16px 18px;
    max-height: 70vh;
    overflow-y: auto;
  }

  .menu-content {
    inset: 26% 8% 10% 8%;
    gap: 26px;
  }

  .menu-main {
    max-width: 460px;
    width: 100%;
  }

  .button-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 10px;
  }

  .button-container .game-btn {
    font-size: 16px;
    padding: 8px 18px;
    min-width: 140px;
  }

  .sound-btn {
    font-size: 20px;
    padding: 6px 10px;
  }
}

@media screen and (orientation: landscape) and (max-width: 700px) {
  .menu-shield {
    max-width: 650px;
  }

  .menu-content {
    inset: 26% 6% 10% 6%;
    gap: 22px;
  }

  .menu-main-title {
    font-size: 30px;
  }

  .menu-main {
    max-width: 400px;
    width: 100%;
  }
  
  .button-container {
    padding: 8px;
    gap: 8px;
    justify-content: center;
  }

  .button-container .game-btn {
    font-size: 14px;
    padding: 6px 14px;
    min-width: 120px;
  }

  .sound-btn {
    font-size: 18px;
    padding: 4px 8px;
  }

  .controls-grid .control-item {
    padding: 10px 14px;
  }

  .controls-grid .key,
  .controls-grid .action {
    font-size: 15px;
  }
}

@media (pointer: coarse) {
  #mobile-controls {
    display: flex !important;
  }
}

@media (pointer: fine) {
  #mobile-controls {
    display: none !important;
  }
}

@media screen and (pointer: coarse) and (min-width: 768px) and (orientation: landscape) {
  .mobile-controls {
    position: fixed;        
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    display: flex !important;
    justify-content: space-between;  
    align-items: center;             
    padding: 0 32px;

    pointer-events: none;            
    z-index: 20;
  }

  .mobile-controls-left,
  .mobile-controls-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;            
  }

  .ctrl-btn {
    min-width: 72px;
    min-height: 72px;
  }

  .ctrl-icon {
    width: 56px;
    height: 56px;
  }
}