#roda-touch[hidden], #roda-touch-toggle[hidden] { display: none; }

#roda-touch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  touch-action: none;
  user-select: none;
}

#roda-touch button {
  padding: 2px;
  min-width: 44px;
  min-height: 44px;
  font-size: .8rem;
  touch-action: none;
}

#roda-touch button.held { background: #efcf78; color: #1a1c12; }
#roda-touch-move { display: grid; grid-template-areas: ". up ." "left down right"; grid-template-columns: repeat(3,44px); gap: 3px; }
#roda-touch-move [data-roda-control="12"] { grid-area: up; }
#roda-touch-move [data-roda-control="14"] { grid-area: left; }
#roda-touch-move [data-roda-control="13"] { grid-area: down; }
#roda-touch-move [data-roda-control="15"] { grid-area: right; }
#roda-touch-actions { display: grid; grid-template-columns: repeat(4,44px); gap: 3px; }
#roda-touch-menu { display: flex; flex-direction: column; gap: 3px; }
#roda-touch:not([data-scene="fight"]) .roda-fight-only { visibility: hidden; }

@media (max-width: 560px) {
  body > main { padding-inline: 6px !important; }
  #roda-touch { flex-wrap: wrap; justify-content: space-between; gap: 5px; }
  #roda-touch-menu { flex-direction: row; width: 100%; justify-content: center; }
}

@media (max-width: 355px) {
  #roda-touch { gap: 3px; }
  #roda-touch-move, #roda-touch-actions { gap: 1px; }
}

@media (orientation: landscape) and (max-height: 520px) and (any-pointer: coarse) {
  #roda-touch-menu { flex-direction: row; width: auto; }
  #cabinet:has(#roda-touch:not([hidden])) .screen {
    width: min(100%, calc((100dvh - 112px) * 1.94));
    aspect-ratio: 1280 / 660;
    margin-inline: auto;
  }
}

@media (orientation: landscape) and (max-width: 505px) and (any-pointer: coarse) {
  #cabinet:has(#roda-touch:not([hidden])) .screen { width: min(100%, calc((100dvh - 160px) * 1.94)); }
}
